Finished speed print setup + addition to print center modal. BOD-229
This commit is contained in:
@@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next";
|
||||
import styled from "styled-components";
|
||||
import { TemplateList } from "../../utils/TemplateConstants";
|
||||
import ConfigFormTypes from "../config-form-components/config-form-types";
|
||||
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
|
||||
|
||||
const SelectorDiv = styled.div`
|
||||
.ant-form-item .ant-select {
|
||||
@@ -18,14 +19,14 @@ export default function ShopInfoIntakeChecklistComponent({ form }) {
|
||||
return (
|
||||
<div>
|
||||
<Form.List name={["intakechecklist", "form"]}>
|
||||
{(fields, { add, remove }) => {
|
||||
{(fields, { add, remove, move }) => {
|
||||
return (
|
||||
<div>
|
||||
{fields.map((field, index) => (
|
||||
<Form.Item key={field.key} style={{ padding: 0, margin: 2 }}>
|
||||
<div className='imex-flex-row'>
|
||||
<div className="imex-flex-row">
|
||||
<Form.Item
|
||||
className='imex-flex-row__margin'
|
||||
className="imex-flex-row__margin"
|
||||
label={t("jobs.fields.intake.name")}
|
||||
key={`${index}name`}
|
||||
name={[field.name, "name"]}
|
||||
@@ -34,12 +35,13 @@ export default function ShopInfoIntakeChecklistComponent({ form }) {
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}>
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
className='imex-flex-row__margin'
|
||||
className="imex-flex-row__margin"
|
||||
label={t("jobs.fields.intake.type")}
|
||||
key={`${index}type`}
|
||||
name={[field.name, "type"]}
|
||||
@@ -48,7 +50,8 @@ export default function ShopInfoIntakeChecklistComponent({ form }) {
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}>
|
||||
]}
|
||||
>
|
||||
<Select>
|
||||
{Object.keys(ConfigFormTypes).map((i, idx) => (
|
||||
<Select.Option key={i} value={i}>
|
||||
@@ -59,7 +62,7 @@ export default function ShopInfoIntakeChecklistComponent({ form }) {
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
className='imex-flex-row__margin'
|
||||
className="imex-flex-row__margin"
|
||||
label={t("jobs.fields.intake.label")}
|
||||
key={`${index}label`}
|
||||
name={[field.name, "label"]}
|
||||
@@ -68,16 +71,18 @@ export default function ShopInfoIntakeChecklistComponent({ form }) {
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}>
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
className='imex-flex-row__margin'
|
||||
label={t("general.fields.required")}
|
||||
className="imex-flex-row__margin"
|
||||
label={t("jobs.fields.intake.required")}
|
||||
key={`${index}required`}
|
||||
name={[field.name, "required"]}
|
||||
valuePropName='checked'>
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
|
||||
@@ -86,16 +91,22 @@ export default function ShopInfoIntakeChecklistComponent({ form }) {
|
||||
remove(field.name);
|
||||
}}
|
||||
/>
|
||||
<FormListMoveArrows
|
||||
move={move}
|
||||
index={index}
|
||||
total={fields.length}
|
||||
/>
|
||||
</div>
|
||||
</Form.Item>
|
||||
))}
|
||||
<Form.Item>
|
||||
<Button
|
||||
type='dashed'
|
||||
type="dashed"
|
||||
onClick={() => {
|
||||
add();
|
||||
}}
|
||||
style={{ width: "100%" }}>
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
{t("general.actions.add")}
|
||||
</Button>
|
||||
</Form.Item>
|
||||
@@ -114,12 +125,14 @@ export default function ShopInfoIntakeChecklistComponent({ form }) {
|
||||
message: t("general.validation.required"),
|
||||
type: "array",
|
||||
},
|
||||
]}>
|
||||
<Select mode='multiple'>
|
||||
]}
|
||||
>
|
||||
<Select mode="multiple">
|
||||
{Object.keys(TemplateList).map((i) => (
|
||||
<Select.Option
|
||||
key={TemplateList[i].key}
|
||||
value={TemplateList[i].key}>
|
||||
value={TemplateList[i].key}
|
||||
>
|
||||
{TemplateList[i].title}
|
||||
</Select.Option>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user