Modified how template list is generated to be a function to allow checking whether the templates can be printed.

This commit is contained in:
Patrick Fic
2020-09-11 14:43:04 -07:00
parent 984c001bd8
commit f7e74c5043
20 changed files with 167 additions and 207 deletions

View File

@@ -130,10 +130,10 @@ export default function ShopInfoIntakeChecklistComponent({ form }) {
<Select mode="multiple">
{Object.keys(TemplateList).map((i) => (
<Select.Option
key={TemplateList[i].key}
value={TemplateList[i].key}
key={TemplateList()[i].key}
value={TemplateList()[i].key}
>
{TemplateList[i].title}
{TemplateList()[i].title}
</Select.Option>
))}
</Select>
@@ -252,10 +252,10 @@ export default function ShopInfoIntakeChecklistComponent({ form }) {
<Select mode="multiple">
{Object.keys(TemplateList).map((i) => (
<Select.Option
key={TemplateList[i].key}
value={TemplateList[i].key}
key={TemplateList()[i].key}
value={TemplateList()[i].key}
>
{TemplateList[i].title}
{TemplateList()[i].title}
</Select.Option>
))}
</Select>

View File

@@ -60,8 +60,8 @@ export default function ShopInfoSpeedPrint({ bodyshop, form }) {
]}
>
<Select mode="multiple">
{Object.keys(TemplateList)
.map((key) => TemplateList[key])
{Object.keys(TemplateList())
.map((key) => TemplateList()[key])
.filter((template) => template.drivingId === "job")
.map((template, idx) => (
<Select.Option key={idx} value={template.key}>