Added bucket config to shop screen BOD-174

This commit is contained in:
Patrick Fic
2020-06-24 11:39:46 -07:00
parent 997ea6cbcf
commit dab34aef49
9 changed files with 396 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
import ShopInfoROStatusComponent from "./shop-info.rostatus.component";
import ShopInfoOrderStatusComponent from "./shop-info.orderstatus.component";
import ShopInfoResponsibilityCenterComponent from "./shop-info.responsibilitycenters.component";
import ShopInfoSchedulingComponent from "./shop-info.scheduling.component";
export default function ShopInfoComponent({ form }) {
const { t } = useTranslation();
@@ -146,6 +147,12 @@ export default function ShopInfoComponent({ form }) {
>
<ShopInfoROStatusComponent form={form} />
</Collapse.Panel>
<Collapse.Panel
key="scheduling"
header={t("bodyshop.labels.scheduling")}
>
<ShopInfoSchedulingComponent form={form} />
</Collapse.Panel>
<Collapse.Panel
key="orderStatus"
header={t("bodyshop.labels.orderstatuses")}

View File

@@ -0,0 +1,113 @@
import { DeleteFilled } from "@ant-design/icons";
import { Button, Form, Input, InputNumber, Select, Row, Col } from "antd";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
//TODO Fix up styles.
export default function ShopInfoSchedulingComponent({ form }) {
const { t } = useTranslation();
return (
<div>
<strong>{t("bodyshop.labels.orderstatuses")}</strong>
<Row>
<Col span={24}>
<Form.List name={["ssbuckets"]}>
{(fields, { add, remove }) => {
return (
<div>
{fields.map((field, index) => (
<Form.Item
key={field.key}
style={{ padding: 0, margin: 2 }}
>
<div className="imex-flex-row">
<Form.Item
label={t("bodyshop.fields.ssbuckets.id")}
key={`${index}id`}
name={[field.name, "id"]}
rules={[
{
required: true,
message: t("general.validation.required"),
},
]}
>
<Input />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.ssbuckets.label")}
key={`${index}label`}
name={[field.name, "label"]}
rules={[
{
required: true,
message: t("general.validation.required"),
},
]}
>
<Input />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.ssbuckets.gte")}
key={`${index}gte`}
name={[field.name, "gte"]}
rules={[
{
required: true,
message: t("general.validation.required"),
},
]}
>
<InputNumber />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.ssbuckets.lt")}
key={`${index}lt`}
name={[field.name, "lt"]}
>
<InputNumber />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.ssbuckets.target")}
key={`${index}target`}
name={[field.name, "target"]}
rules={[
{
required: true,
message: t("general.validation.required"),
},
]}
>
<InputNumber />
</Form.Item>
<DeleteFilled
onClick={() => {
remove(field.name);
}}
/>
</div>
</Form.Item>
))}
<Form.Item>
<Button
type="dashed"
onClick={() => {
add();
}}
style={{ width: "100%" }}
>
{t("bodyshop.actions.addbucket")}
</Button>
</Form.Item>
</div>
);
}}
</Form.List>
</Col>
</Row>
</div>
);
}

View File

@@ -69,6 +69,7 @@
},
"bodyshop": {
"actions": {
"addbucket": "Add Bucket",
"addtemplate": "Add Template",
"newstatus": "Add Status"
},
@@ -125,6 +126,13 @@
"tow": "Towing"
},
"shopname": "Shop Name",
"ssbuckets": {
"gte": "Greater Than/Equal to (hrs)",
"id": "ID",
"label": "Label",
"lt": "Less than (hrs)",
"target": "Target (count)"
},
"state": "State/Province",
"state_tax_id": "State Tax ID (PST, QST)",
"status": "Status Label",
@@ -161,6 +169,7 @@
"profits": "Profit Centers",
"title": "Responsibility Centers"
},
"scheduling": "SMART Scheduling",
"shopinfo": "Shop Information"
},
"successes": {

View File

@@ -69,6 +69,7 @@
},
"bodyshop": {
"actions": {
"addbucket": "",
"addtemplate": "",
"newstatus": ""
},
@@ -125,6 +126,13 @@
"tow": ""
},
"shopname": "",
"ssbuckets": {
"gte": "",
"id": "",
"label": "",
"lt": "",
"target": ""
},
"state": "",
"state_tax_id": "",
"status": "",
@@ -161,6 +169,7 @@
"profits": "",
"title": ""
},
"scheduling": "",
"shopinfo": ""
},
"successes": {

View File

@@ -69,6 +69,7 @@
},
"bodyshop": {
"actions": {
"addbucket": "",
"addtemplate": "",
"newstatus": ""
},
@@ -125,6 +126,13 @@
"tow": ""
},
"shopname": "",
"ssbuckets": {
"gte": "",
"id": "",
"label": "",
"lt": "",
"target": ""
},
"state": "",
"state_tax_id": "",
"status": "",
@@ -161,6 +169,7 @@
"profits": "",
"title": ""
},
"scheduling": "",
"shopinfo": ""
},
"successes": {