Refactor task claiming and implement basic claim functionality.
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
Input,
|
||||
InputNumber,
|
||||
Row,
|
||||
Select,
|
||||
Space,
|
||||
Switch,
|
||||
} from "antd";
|
||||
@@ -15,7 +16,21 @@ import { useTranslation } from "react-i18next";
|
||||
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
|
||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||
|
||||
export default function ShopInfoTaskPresets({ form }) {
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ShopInfoTaskPresets);
|
||||
|
||||
export function ShopInfoTaskPresets({ bodyshop, form }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
@@ -59,6 +74,7 @@ export default function ShopInfoTaskPresets({ form }) {
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
span={12}
|
||||
label={t("bodyshop.fields.md_tasks_presets.hourstype")}
|
||||
key={`${index}hourstype`}
|
||||
name={[field.name, "hourstype"]}
|
||||
@@ -71,7 +87,15 @@ export default function ShopInfoTaskPresets({ form }) {
|
||||
>
|
||||
<Checkbox.Group>
|
||||
<Row>
|
||||
<Col span={8}>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LAA"
|
||||
style={{ lineHeight: "32px" }}
|
||||
>
|
||||
{t("joblines.fields.lbr_types.LAA")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LAB"
|
||||
style={{ lineHeight: "32px" }}
|
||||
@@ -79,23 +103,23 @@ export default function ShopInfoTaskPresets({ form }) {
|
||||
{t("joblines.fields.lbr_types.LAB")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LAR"
|
||||
value="LAD"
|
||||
style={{ lineHeight: "32px" }}
|
||||
>
|
||||
{t("joblines.fields.lbr_types.LAR")}
|
||||
{t("joblines.fields.lbr_types.LAD")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LAM"
|
||||
value="LAE"
|
||||
style={{ lineHeight: "32px" }}
|
||||
>
|
||||
{t("joblines.fields.lbr_types.LAM")}
|
||||
{t("joblines.fields.lbr_types.LAE")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LAF"
|
||||
style={{ lineHeight: "32px" }}
|
||||
@@ -103,7 +127,7 @@ export default function ShopInfoTaskPresets({ form }) {
|
||||
{t("joblines.fields.lbr_types.LAF")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LAG"
|
||||
style={{ lineHeight: "32px" }}
|
||||
@@ -111,12 +135,90 @@ export default function ShopInfoTaskPresets({ form }) {
|
||||
{t("joblines.fields.lbr_types.LAG")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LAM"
|
||||
style={{ lineHeight: "32px" }}
|
||||
>
|
||||
{t("joblines.fields.lbr_types.LAM")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LAM"
|
||||
style={{ lineHeight: "32px" }}
|
||||
>
|
||||
{t("joblines.fields.lbr_types.LAM")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LAR"
|
||||
style={{ lineHeight: "32px" }}
|
||||
>
|
||||
{t("joblines.fields.lbr_types.LAR")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LAS"
|
||||
style={{ lineHeight: "32px" }}
|
||||
>
|
||||
{t("joblines.fields.lbr_types.LAS")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LAU"
|
||||
style={{ lineHeight: "32px" }}
|
||||
>
|
||||
{t("joblines.fields.lbr_types.LAU")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LA1"
|
||||
style={{ lineHeight: "32px" }}
|
||||
>
|
||||
{t("joblines.fields.lbr_types.LA1")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LA2"
|
||||
style={{ lineHeight: "32px" }}
|
||||
>
|
||||
{t("joblines.fields.lbr_types.LA2")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LA3"
|
||||
style={{ lineHeight: "32px" }}
|
||||
>
|
||||
{t("joblines.fields.lbr_types.LA3")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Checkbox
|
||||
value="LA4"
|
||||
style={{ lineHeight: "32px" }}
|
||||
>
|
||||
{t("joblines.fields.lbr_types.LA4")}
|
||||
</Checkbox>
|
||||
</Col>
|
||||
</Row>
|
||||
</Checkbox.Group>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.md_tasks_presets.percent")}
|
||||
key={`${index}percent`}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
//message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
name={[field.name, "percent"]}
|
||||
>
|
||||
<InputNumber min={0} max={100} />
|
||||
@@ -128,6 +230,17 @@ export default function ShopInfoTaskPresets({ form }) {
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.md_tasks_presets.nextstatus")}
|
||||
key={`${index}nextstatus`}
|
||||
name={[field.name, "nextstatus"]}
|
||||
>
|
||||
<Select
|
||||
options={bodyshop.md_ro_statuses.production_statuses.map(
|
||||
(o) => ({ value: o, label: o })
|
||||
)}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Space wrap>
|
||||
<DeleteFilled
|
||||
onClick={() => {
|
||||
|
||||
Reference in New Issue
Block a user