Updated Print Center & TemplateList Object IO-587

This commit is contained in:
Patrick Fic
2021-01-19 16:30:46 -08:00
parent 4c5f9a5522
commit a29c305427
19 changed files with 152 additions and 150 deletions

View File

@@ -16,6 +16,7 @@ const SelectorDiv = styled.div`
export default function ShopInfoIntakeChecklistComponent({ form }) {
const { t } = useTranslation();
const TemplateListGenerated = TemplateList();
return (
<div>
<Form.List name={["intakechecklist", "form"]}>
@@ -128,12 +129,12 @@ export default function ShopInfoIntakeChecklistComponent({ form }) {
]}
>
<Select mode="multiple">
{Object.keys(TemplateList()).map((i) => (
{Object.keys(TemplateListGenerated).map((i) => (
<Select.Option
key={TemplateList()[i].key}
value={TemplateList()[i].key}
key={TemplateListGenerated[i].key}
value={TemplateListGenerated[i].key}
>
{TemplateList()[i].title}
{TemplateListGenerated[i].title}
</Select.Option>
))}
</Select>
@@ -250,12 +251,12 @@ export default function ShopInfoIntakeChecklistComponent({ form }) {
]}
>
<Select mode="multiple">
{Object.keys(TemplateList()).map((i) => (
{Object.keys(TemplateListGenerated).map((i) => (
<Select.Option
key={TemplateList()[i].key}
value={TemplateList()[i].key}
key={TemplateListGenerated[i].key}
value={TemplateListGenerated[i].key}
>
{TemplateList()[i].title}
{TemplateListGenerated[i].title}
</Select.Option>
))}
</Select>

View File

@@ -4,10 +4,12 @@ import React from "react";
import { useTranslation } from "react-i18next";
import { TemplateList } from "../../utils/TemplateConstants";
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
export default function ShopInfoSpeedPrint({ bodyshop, form }) {
const { t } = useTranslation();
const TemplateListGenerated = TemplateList();
console.log("TemplateListGenerated", TemplateListGenerated);
return (
<div>
<Form.List name={["speedprint"]}>
@@ -16,7 +18,7 @@ export default function ShopInfoSpeedPrint({ bodyshop, form }) {
<div>
{fields.map((field, index) => (
<Form.Item key={field.key} style={{ padding: 0, margin: 2 }}>
<div className="imex-flex-row">
<LayoutFormRow grow>
<Form.Item
className="imex-flex-row__margin"
label={t("bodyshop.fields.speedprint.id")}
@@ -59,14 +61,14 @@ export default function ShopInfoSpeedPrint({ bodyshop, form }) {
]}
>
<Select mode="multiple">
{Object.keys(TemplateList())
.map((key) => TemplateList()[key])
.filter((template) => template.drivingId === "job")
.map((template, idx) => (
<Select.Option key={idx} value={template.key}>
{template.title}
</Select.Option>
))}
{Object.keys(TemplateListGenerated).map((key, idx) => (
<Select.Option
key={idx}
value={TemplateListGenerated[key].key}
>
{TemplateListGenerated[key].title}
</Select.Option>
))}
</Select>
</Form.Item>
@@ -81,7 +83,7 @@ export default function ShopInfoSpeedPrint({ bodyshop, form }) {
index={index}
total={fields.length}
/>
</div>
</LayoutFormRow>
</Form.Item>
))}
<Form.Item>