Added notes presets BOD-227

This commit is contained in:
Patrick Fic
2020-08-04 10:28:46 -07:00
parent 470f69b11c
commit 0a7305ff8e
16 changed files with 407 additions and 4 deletions

View File

@@ -275,6 +275,68 @@ export default function ShopInfoComponent({ form, saveLoading }) {
}}
</Form.List>
<Form.List name={["md_notes_presets"]}>
{(fields, { add, remove }) => {
return (
<div>
{fields.map((field, index) => (
<Form.Item
key={field.key}
style={{ padding: 0, margin: 2 }}
>
<div style={{ display: "flex" }}>
<Form.Item
style={{ padding: 0, margin: 2 }}
label={t("bodyshop.fields.noteslabel")}
key={`${index}label`}
name={[field.name, "label"]}
rules={[
{
required: true,
message: t("general.validation.required"),
},
]}
>
<Input />
</Form.Item>
<Form.Item
style={{ padding: 0, margin: 2 }}
label={t("bodyshop.fields.notestext")}
key={`${index}text`}
name={[field.name, "text"]}
rules={[
{
required: true,
message: t("general.validation.required"),
},
]}
>
<Input />
</Form.Item>
<DeleteFilled
onClick={() => {
remove(field.name);
}}
/>
</div>
</Form.Item>
))}
<Form.Item>
<Button
type="dashed"
onClick={() => {
add();
}}
style={{ width: "100%" }}
>
{t("general.actions.add")}
</Button>
</Form.Item>
</div>
);
}}
</Form.List>
<Form.List name={["md_parts_locations"]}>
{(fields, { add, remove, move }) => {
return (