+
+ {cardSettings && cardSettings.compact ? (
+ {`${card.ownr_ln || ""} ${
+ card.ownr_co_nm || ""
+ }`}
+ ) : (
+ {`${card.ownr_ln || ""}, ${
+ card.ownr_fn || ""
+ } ${card.ownr_co_nm || ""}`}
+ )}
+
+
+ {`${card.v_model_yr || ""} ${
+ card.v_make_desc || ""
+ } ${card.v_model_desc || ""}`}
+
+
+ {cardSettings && cardSettings.clm_no === "front" && (
+
+ {card.clm_no || ""}
+
+ )}
+ {cardSettings && cardSettings.ins_co_nm === "front" && (
+
+ {card.ins_co_nm || ""}
+
+ )}
+ {cardSettings && cardSettings.laborhrs === "front" && (
+
+
+ {`B: ${card.labhrs.aggregate.sum.mod_lb_hrs || "?"}`}
+ {`R: ${card.larhrs.aggregate.sum.mod_lb_hrs || "?"}`}
+
+
+ )}
+ {cardSettings && cardSettings.employeeassignments === "front" && (
+
+
+ {`B: ${
+ employee_body
+ ? `${employee_body.first_name} ${employee_body.last_name}`
+ : ""
+ }`}
+ {`P: ${
+ employee_prep
+ ? `${employee_prep.first_name} ${employee_prep.last_name}`
+ : ""
+ }`}
+ {`R: ${
+ employee_refinish
+ ? `${employee_refinish.first_name} ${employee_refinish.last_name}`
+ : ""
+ }`}
+ {`CSR: ${
+ employee_csr
+ ? `${employee_csr.first_name} ${employee_csr.last_name}`
+ : ""
+ }`}
+
+
+ )}
+ {cardSettings && cardSettings.scheduled_completion === "front" && (
+
+
+
+
+ {card.scheduled_completion}
+
+
+
+ )}
+ {cardSettings && cardSettings.ats === "front" && (
+
+ {card.alt_transport || ""}
+
+ )}
+ {cardSettings && cardSettings.sublets === "front" && (
+
+
+
+ )}
+ {cardSettings && cardSettings.production_note === "front" && (
+
+ {cardSettings && cardSettings.production_note === "front" && (
+
+ )}
+
+ )}
+
+ )}
+
);
}
diff --git a/client/src/components/production-board-kanban/production-board-kanban.card-settings.component.jsx b/client/src/components/production-board-kanban/production-board-kanban.card-settings.component.jsx
index c8c595100..9ae6666a1 100644
--- a/client/src/components/production-board-kanban/production-board-kanban.card-settings.component.jsx
+++ b/client/src/components/production-board-kanban/production-board-kanban.card-settings.component.jsx
@@ -1,6 +1,16 @@
import { useMutation } from "@apollo/client";
-import { Button, Card, Dropdown, Form, Switch } from "antd";
-import React, { useEffect } from "react";
+import {
+ Button,
+ Card,
+ Col,
+ Form,
+ notification,
+ Popover,
+ Radio,
+ Row,
+ Switch,
+} from "antd";
+import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { UPDATE_KANBAN_SETTINGS } from "../../graphql/user.queries";
@@ -8,70 +18,149 @@ export default function ProductionBoardKanbanCardSettings({
associationSettings,
}) {
const [form] = Form.useForm();
+ const [visible, setVisible] = useState(false);
+ const [loading, setLoading] = useState(false);
const [updateKbSettings] = useMutation(UPDATE_KANBAN_SETTINGS);
+
useEffect(() => {
form.setFieldsValue(
associationSettings && associationSettings.kanban_settings
);
- }, [form, associationSettings]);
+ }, [form, associationSettings, visible]);
const { t } = useTranslation();
const handleFinish = async (values) => {
- await updateKbSettings({
+ setLoading(true);
+ const result = await updateKbSettings({
variables: {
id: associationSettings && associationSettings.id,
ks: values,
},
});
+ if (result.errors) {
+ notification.open({
+ type: "error",
+ message: t("production.errors.settings", {
+ error: JSON.stringify(result.errors),
+ }),
+ });
+ }
+ setVisible(false);
+ setLoading(false);
};
const overlay = (