|
|
|
|
@@ -4,8 +4,6 @@ import React, { useEffect, useState } from "react";
|
|
|
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
|
import { UPDATE_KANBAN_SETTINGS } from "../../graphql/user.queries";
|
|
|
|
|
|
|
|
|
|
const { TabPane } = Tabs;
|
|
|
|
|
|
|
|
|
|
export default function ProductionBoardKanbanSettings({ associationSettings, parentLoading }) {
|
|
|
|
|
const [form] = Form.useForm();
|
|
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
|
@@ -14,7 +12,7 @@ export default function ProductionBoardKanbanSettings({ associationSettings, par
|
|
|
|
|
const [updateKbSettings] = useMutation(UPDATE_KANBAN_SETTINGS);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
form.setFieldsValue(associationSettings && associationSettings.kanban_settings);
|
|
|
|
|
form.setFieldsValue(associationSettings?.kanban_settings);
|
|
|
|
|
}, [form, associationSettings, open]);
|
|
|
|
|
|
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
@@ -25,7 +23,7 @@ export default function ProductionBoardKanbanSettings({ associationSettings, par
|
|
|
|
|
|
|
|
|
|
const result = await updateKbSettings({
|
|
|
|
|
variables: {
|
|
|
|
|
id: associationSettings && associationSettings.id,
|
|
|
|
|
id: associationSettings?.id,
|
|
|
|
|
ks: values
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@@ -43,7 +41,7 @@ export default function ProductionBoardKanbanSettings({ associationSettings, par
|
|
|
|
|
setHasChanges(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleValuesChange = (changedValues, allValues) => {
|
|
|
|
|
const handleValuesChange = () => {
|
|
|
|
|
setHasChanges(true);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@@ -139,80 +137,39 @@ export default function ProductionBoardKanbanSettings({ associationSettings, par
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Card>
|
|
|
|
|
{/*<Card title={t("settings.sections.information")} style={cardStyle}>*/}
|
|
|
|
|
{/* <Row gutter={[16, 16]}>*/}
|
|
|
|
|
{/* <Col span={4}>*/}
|
|
|
|
|
{/* <Form.Item name="board_setting_3" valuePropName="checked">*/}
|
|
|
|
|
{/* <Checkbox>{t("board.labels.some_setting_3")}</Checkbox>*/}
|
|
|
|
|
{/* </Form.Item>*/}
|
|
|
|
|
{/* </Col>*/}
|
|
|
|
|
{/* <Col span={4}>*/}
|
|
|
|
|
{/* <Form.Item name="board_setting_4" valuePropName="checked">*/}
|
|
|
|
|
{/* <Checkbox>{t("board.labels.some_setting_4")}</Checkbox>*/}
|
|
|
|
|
{/* </Form.Item>*/}
|
|
|
|
|
{/* </Col>*/}
|
|
|
|
|
{/* </Row>*/}
|
|
|
|
|
{/*</Card>*/}
|
|
|
|
|
{/*<Card title={t("settings.sections.beta")} style={cardStyle}>*/}
|
|
|
|
|
{/* <Row gutter={[16, 16]}>*/}
|
|
|
|
|
{/* <Col span={4}>/!* Add beta settings here if any *!/</Col>*/}
|
|
|
|
|
{/* </Row>*/}
|
|
|
|
|
{/*</Card>*/}
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const renderLaneSettings = () => (
|
|
|
|
|
<>
|
|
|
|
|
<Card title={t("production.settings.layout")} style={cardStyle}>
|
|
|
|
|
<Row gutter={[16, 16]}>
|
|
|
|
|
{/*<Col span={4}>*/}
|
|
|
|
|
{/* <Form.Item name="lane_setting_1" valuePropName="checked">*/}
|
|
|
|
|
{/* <Checkbox>{t("lane.labels.some_setting_1")}</Checkbox>*/}
|
|
|
|
|
{/* </Form.Item>*/}
|
|
|
|
|
{/*</Col>*/}
|
|
|
|
|
{/*<Col span={4}>*/}
|
|
|
|
|
{/* <Form.Item name="lane_setting_2" valuePropName="checked">*/}
|
|
|
|
|
{/* <Checkbox>{t("lane.labels.some_setting_2")}</Checkbox>*/}
|
|
|
|
|
{/* </Form.Item>*/}
|
|
|
|
|
{/*</Col>*/}
|
|
|
|
|
</Row>
|
|
|
|
|
<Row gutter={[16, 16]}></Row>
|
|
|
|
|
</Card>
|
|
|
|
|
{/*<Card title={t("settings.sections.information")} style={cardStyle}>*/}
|
|
|
|
|
{/* <Row gutter={[16, 16]}>*/}
|
|
|
|
|
{/* <Col span={4}>*/}
|
|
|
|
|
{/* <Form.Item name="lane_setting_3" valuePropName="checked">*/}
|
|
|
|
|
{/* <Checkbox>{t("lane.labels.some_setting_3")}</Checkbox>*/}
|
|
|
|
|
{/* </Form.Item>*/}
|
|
|
|
|
{/* </Col>*/}
|
|
|
|
|
{/* <Col span={4}>*/}
|
|
|
|
|
{/* <Form.Item name="lane_setting_4" valuePropName="checked">*/}
|
|
|
|
|
{/* <Checkbox>{t("lane.labels.some_setting_4")}</Checkbox>*/}
|
|
|
|
|
{/* </Form.Item>*/}
|
|
|
|
|
{/* </Col>*/}
|
|
|
|
|
{/* </Row>*/}
|
|
|
|
|
{/*</Card>*/}
|
|
|
|
|
{/*<Card title={t("settings.sections.beta")} style={cardStyle}>*/}
|
|
|
|
|
{/* <Row gutter={[16, 16]}>*/}
|
|
|
|
|
{/* <Col span={4}>/!* Add beta settings here if any *!/</Col>*/}
|
|
|
|
|
{/* </Row>*/}
|
|
|
|
|
{/*</Card>*/}
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const items = [
|
|
|
|
|
{
|
|
|
|
|
key: "1",
|
|
|
|
|
label: t("production.settings.tabs.card"),
|
|
|
|
|
children: renderCardSettings()
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: "2",
|
|
|
|
|
label: t("production.settings.tabs.board"),
|
|
|
|
|
children: renderBoardSettings()
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: "3",
|
|
|
|
|
label: t("production.settings.tabs.lane"),
|
|
|
|
|
children: renderLaneSettings()
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const overlay = (
|
|
|
|
|
<Card>
|
|
|
|
|
<Form form={form} onFinish={handleFinish} layout="vertical" onValuesChange={handleValuesChange}>
|
|
|
|
|
<Tabs defaultActiveKey="1">
|
|
|
|
|
<TabPane tab={t("production.settings.tabs.card")} key="1">
|
|
|
|
|
{renderCardSettings()}
|
|
|
|
|
</TabPane>
|
|
|
|
|
<TabPane tab={t("production.settings.tabs.board")} key="2">
|
|
|
|
|
{renderBoardSettings()}
|
|
|
|
|
</TabPane>
|
|
|
|
|
<TabPane tab={t("production.settings.tabs.lane")} key="3">
|
|
|
|
|
{renderLaneSettings()}
|
|
|
|
|
</TabPane>
|
|
|
|
|
</Tabs>
|
|
|
|
|
<Tabs defaultActiveKey="1" items={items} />
|
|
|
|
|
<Row justify="center" style={{ marginTop: 15 }} gutter={16}>
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
<Button block onClick={() => setOpen(false)}>
|
|
|
|
|
|