Accomodate updated RPS targets in V2 ruleset.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { DeleteFilled } from "@ant-design/icons";
|
||||
import {
|
||||
Button,
|
||||
Form,
|
||||
@@ -6,10 +5,9 @@ import {
|
||||
InputNumber,
|
||||
Popconfirm,
|
||||
Select,
|
||||
Typography,
|
||||
Typography
|
||||
} from "antd";
|
||||
import React, { useState } from "react";
|
||||
import FormListMoveArrows from "../../atoms/form-list-move-arrows/form-list-move-arrows.atom";
|
||||
import LayoutFormRow from "../../atoms/layout-form-row/layout-form-row.atom";
|
||||
|
||||
export default function ShopSettingsFormMolecule({ form, saveLoading }) {
|
||||
@@ -57,19 +55,6 @@ export default function ShopSettingsFormMolecule({ form, saveLoading }) {
|
||||
>
|
||||
<Select mode="tags" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="groups"
|
||||
label="Available Groupings (Must match below)"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
|
||||
type: "array",
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Select mode="tags" onBlur={handleBlur} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="Alert when Parts Price Difference Less Than"
|
||||
@@ -83,96 +68,7 @@ export default function ShopSettingsFormMolecule({ form, saveLoading }) {
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
</LayoutFormRow>
|
||||
<Typography.Title level={4}>Group Definitions</Typography.Title>
|
||||
<Form.List name={["targets"]}>
|
||||
{(fields, { add, remove, move }) => {
|
||||
return (
|
||||
<div>
|
||||
{fields.map((field, index) => (
|
||||
<Form.Item key={field.key} style={{ padding: 0, margin: 2 }}>
|
||||
<LayoutFormRow>
|
||||
<Form.Item
|
||||
label="Group"
|
||||
key={`${index}group`}
|
||||
name={[field.name, "group"]}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Select>
|
||||
{groupOptions.map((item, idx) => (
|
||||
<Select.Option key={idx} value={item}>
|
||||
{item}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="Age >="
|
||||
key={`${index}ageGte`}
|
||||
name={[field.name, "ageGte"]}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="Age <"
|
||||
key={`${index}ageLt`}
|
||||
name={[field.name, "ageLt"]}
|
||||
>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="Target (as decimal)"
|
||||
key={`${index}target`}
|
||||
name={[field.name, "target"]}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
<div>
|
||||
<DeleteFilled
|
||||
onClick={() => {
|
||||
remove(field.name);
|
||||
}}
|
||||
/>
|
||||
<FormListMoveArrows
|
||||
move={move}
|
||||
index={index}
|
||||
total={fields.length}
|
||||
/>
|
||||
</div>
|
||||
</LayoutFormRow>
|
||||
</Form.Item>
|
||||
))}
|
||||
<Form.Item>
|
||||
<Button
|
||||
type="dashed"
|
||||
onClick={() => {
|
||||
add();
|
||||
}}
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
Add
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
</Form.List>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ export function JobsDetailOrganism({ selectedJobId, setSelectedJobTargetPc }) {
|
||||
setSelectedJobTargetPc({
|
||||
group: data.jobs_by_pk && data.jobs_by_pk.group,
|
||||
v_age: data.jobs_by_pk && data.jobs_by_pk.v_age,
|
||||
close_date: data.jobs_by_pk && data.jobs_by_pk.close_date,
|
||||
});
|
||||
}, [data, setSelectedJobTargetPc]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user