From b7055aac8480919548686f03c7c930382b05192f Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 26 Mar 2024 13:45:04 -0700 Subject: [PATCH 1/7] IO-2702 Limit Production Colors to Production Statuses Signed-off-by: Allan Carr --- .../shop-info/shop-info.rostatus.component.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/src/components/shop-info/shop-info.rostatus.component.jsx b/client/src/components/shop-info/shop-info.rostatus.component.jsx index 7fab39746..e1d633417 100644 --- a/client/src/components/shop-info/shop-info.rostatus.component.jsx +++ b/client/src/components/shop-info/shop-info.rostatus.component.jsx @@ -39,6 +39,14 @@ export function ShopInfoROStatusComponent({ bodyshop, form }) { form.getFieldValue(["md_ro_statuses", "statuses"]) || [] ); + const [productionStatus] = useState( + form + .getFieldValue(["md_ro_statuses", "production_statuses"]) + .concat( + form.getFieldValue(["md_ro_statuses", "additional_board_statuses"]) + ) || [] + ); + const handleBlur = () => { setOptions(form.getFieldValue(["md_ro_statuses", "statuses"])); }; @@ -346,7 +354,7 @@ export function ShopInfoROStatusComponent({ bodyshop, form }) { ]} > - - - - - - - {bodyshop.md_ins_cos.map((s) => ( {s.name} @@ -67,7 +80,15 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) { - + + {t("jobs.fields.ins_ct_ln")} + + + } + name="ins_ct_ln" + > @@ -95,11 +116,24 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) { > - + + + + + + - + + {t("jobs.fields.est_ct_fn")} + + + } + name="est_ct_fn" + > diff --git a/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx b/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx index e2cecb4f5..4af64e694 100644 --- a/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx +++ b/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx @@ -37,6 +37,15 @@ const lossColDamage = { sm: { span: 24 }, md: { span: 6 }, lg: { span: 4 } }; export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) { const { getFieldValue } = form; const { t } = useTranslation(); + + const handleInsCoChange = (value) => { + const selectedCompany = bodyshop.md_ins_cos.find((s) => s.name === value); + if (selectedCompany) { + form.setFieldValue("ins_addr1", selectedCompany.street1); + form.setFieldValue("ins_city", selectedCompany.city); + } + }; + return (
@@ -71,7 +80,7 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) { - {bodyshop.md_ins_cos.map((s) => ( {s.name} diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index de1c35af8..210f04c0f 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1573,7 +1573,7 @@ "federal_tax_payable": "Federal Tax Payable", "federal_tax_rate": "Federal Tax Rate", "ins_addr1": "Insurance Co. Address", - "ins_city": "Insurance City", + "ins_city": "Insurance Co. City", "ins_co_id": "Insurance Co. ID", "ins_co_nm": "Insurance Company Name", "ins_co_nm_short": "Ins. Co.", From cc734d39817072a3b794a207faee4a60fd60f59d Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 26 Mar 2024 16:04:05 -0700 Subject: [PATCH 3/7] IO-2714 New Payment Cache Signed-off-by: Allan Carr --- .../src/components/payment-modal/payment-modal.container.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/src/components/payment-modal/payment-modal.container.jsx b/client/src/components/payment-modal/payment-modal.container.jsx index 650a4857c..e53894920 100644 --- a/client/src/components/payment-modal/payment-modal.container.jsx +++ b/client/src/components/payment-modal/payment-modal.container.jsx @@ -19,8 +19,8 @@ import { import { GenerateDocument } from "../../utils/RenderTemplate"; import { TemplateList } from "../../utils/TemplateConstants"; import PaymentForm from "../payment-form/payment-form.component"; -import PaymentReexportButton from "../payment-reexport-button/payment-reexport-button.component"; import PaymentMarkForExportButton from "../payment-mark-export-button/payment-mark-export-button-component"; +import PaymentReexportButton from "../payment-reexport-button/payment-reexport-button.component"; const mapStateToProps = createStructuredSelector({ paymentModal: selectPayment, @@ -194,7 +194,6 @@ function PaymentModalContainer({ autoComplete={"off"} form={form} layout="vertical" - initialValues={context || {}} disabled={context?.exportedat} > From 1fa83d124d8f1d644ac1f51bc569d4b794f3b72e Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 27 Mar 2024 12:14:47 -0700 Subject: [PATCH 4/7] IO-2727 Payment Re-export/Export button Send data back to page Signed-off-by: Allan Carr --- .../payment-mark-export-button-component.jsx | 23 ++++++++++--------- .../payment-reexport-button.component.jsx | 19 +++++++-------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/client/src/components/payment-mark-export-button/payment-mark-export-button-component.jsx b/client/src/components/payment-mark-export-button/payment-mark-export-button-component.jsx index be6c80356..5f8cb395a 100644 --- a/client/src/components/payment-mark-export-button/payment-mark-export-button-component.jsx +++ b/client/src/components/payment-mark-export-button/payment-mark-export-button-component.jsx @@ -1,13 +1,13 @@ -import React from "react"; -import { Button, notification } from "antd"; import { useMutation } from "@apollo/client"; +import { Button, notification } from "antd"; +import React from "react"; import { useTranslation } from "react-i18next"; -import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries"; -import { setModalContext } from "../../redux/modals/modals.actions"; import { connect } from "react-redux"; -import { UPDATE_PAYMENT } from "../../graphql/payments.queries"; -import { selectCurrentUser } from "../../redux/user/user.selectors"; import { createStructuredSelector } from "reselect"; +import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries"; +import { UPDATE_PAYMENT } from "../../graphql/payments.queries"; +import { setModalContext } from "../../redux/modals/modals.actions"; +import { selectCurrentUser } from "../../redux/user/user.selectors"; const mapStateToProps = createStructuredSelector({ currentUser: selectCurrentUser, @@ -46,7 +46,6 @@ const PaymentMarkForExportButton = ({ ], }, }); - const paymentUpdateResponse = await updatePayment({ variables: { paymentId: payment.id, @@ -55,16 +54,12 @@ const PaymentMarkForExportButton = ({ }, }, }); - if (!!!paymentUpdateResponse.errors) { notification.open({ type: "success", key: "paymentsuccessmarkforexport", message: t("payments.successes.markexported"), }); - - if (refetch) refetch(); - setPaymentContext({ actions: { refetch, @@ -74,6 +69,12 @@ const PaymentMarkForExportButton = ({ exportedat: today, }, }); + + if (refetch) + refetch( + paymentUpdateResponse && + paymentUpdateResponse.data.update_payments.returning[0] + ); } else { notification["error"]({ message: t("payments.errors.exporting", { diff --git a/client/src/components/payment-reexport-button/payment-reexport-button.component.jsx b/client/src/components/payment-reexport-button/payment-reexport-button.component.jsx index a3adb5422..a7434e76d 100644 --- a/client/src/components/payment-reexport-button/payment-reexport-button.component.jsx +++ b/client/src/components/payment-reexport-button/payment-reexport-button.component.jsx @@ -1,10 +1,10 @@ -import React from "react"; -import { Button, notification } from "antd"; -import { useTranslation } from "react-i18next"; -import { UPDATE_PAYMENT } from "../../graphql/payments.queries"; import { useMutation } from "@apollo/client"; -import { setModalContext } from "../../redux/modals/modals.actions"; +import { Button, notification } from "antd"; +import React from "react"; +import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; +import { UPDATE_PAYMENT } from "../../graphql/payments.queries"; +import { setModalContext } from "../../redux/modals/modals.actions"; const mapDispatchToProps = (dispatch) => ({ setPaymentContext: (context) => @@ -24,16 +24,12 @@ const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => { }, }, }); - if (!!!paymentUpdateResponse.errors) { notification.open({ type: "success", key: "paymentsuccessexport", message: t("payments.successes.markreexported"), }); - - if (refetch) refetch(); - setPaymentContext({ actions: { refetch, @@ -43,6 +39,11 @@ const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => { exportedat: null, }, }); + if (refetch) + refetch( + paymentUpdateResponse && + paymentUpdateResponse.data.update_payments.returning[0] + ); } else { notification["error"]({ message: t("payments.errors.exporting", { From c2e64a124d1c8991d640e6f4883812c0230ad01a Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 27 Mar 2024 12:21:28 -0700 Subject: [PATCH 5/7] Cherry picked from Rome changes to apply to IO. --- .../production-board-kanban/production-board-kanban.utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/production-board-kanban/production-board-kanban.utils.js b/client/src/components/production-board-kanban/production-board-kanban.utils.js index 4ed1a45d5..9cfc81657 100644 --- a/client/src/components/production-board-kanban/production-board-kanban.utils.js +++ b/client/src/components/production-board-kanban/production-board-kanban.utils.js @@ -18,8 +18,8 @@ const sortByParentId = (arr) => { //console.log("sortByParentId -> byParentsIdsList", byParentsIdsList); while (byParentsIdsList[parentId]) { - sortedList.push(byParentsIdsList[parentId][0]); - parentId = byParentsIdsList[parentId][0].id; + sortedList.push(...byParentsIdsList[parentId]); //Spread in the whole list in case several items have the same parents. + parentId = byParentsIdsList[parentId][byParentsIdsList[parentId].length -1].id; //Grab the ID from the last one. } if (byParentsIdsList["null"]) From af6bc0fb5a243086262e261ceea2dc1bab65d95f Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 28 Mar 2024 10:23:22 -0700 Subject: [PATCH 6/7] Resolve hasura API url again. --- hasura/metadata/tables.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 2f47a4e8f..38dff43fa 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -4242,7 +4242,7 @@ interval_sec: 10 num_retries: 0 timeout_sec: 60 - webhook: https://worktest.home.irony.online + webhook_from_env: HASURA_API_URL headers: - name: event-secret value_from_env: EVENT_SECRET @@ -5761,6 +5761,7 @@ _eq: X-Hasura-User-Id - active: _eq: true + allow_aggregations: true update_permissions: - role: user permission: From fd9575e5a5dc69de5b4f8f0c5b55d92fc63a1f41 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 28 Mar 2024 13:25:13 -0700 Subject: [PATCH 7/7] IO-2702 Adjust concat Signed-off-by: Allan Carr --- .../shop-info.rostatus.component.jsx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/client/src/components/shop-info/shop-info.rostatus.component.jsx b/client/src/components/shop-info/shop-info.rostatus.component.jsx index e1d633417..7c90a49a2 100644 --- a/client/src/components/shop-info/shop-info.rostatus.component.jsx +++ b/client/src/components/shop-info/shop-info.rostatus.component.jsx @@ -39,16 +39,23 @@ export function ShopInfoROStatusComponent({ bodyshop, form }) { form.getFieldValue(["md_ro_statuses", "statuses"]) || [] ); - const [productionStatus] = useState( - form - .getFieldValue(["md_ro_statuses", "production_statuses"]) - .concat( - form.getFieldValue(["md_ro_statuses", "additional_board_statuses"]) - ) || [] + const [productionStatus, setProductionStatus] = useState( + ( + form.getFieldValue(["md_ro_statuses", "production_statuses"]) || [] + ).concat( + form.getFieldValue(["md_ro_statuses", "additional_board_statuses"]) || [] + ) || [] ); const handleBlur = () => { setOptions(form.getFieldValue(["md_ro_statuses", "statuses"])); + setProductionStatus( + form + .getFieldValue(["md_ro_statuses", "production_statuses"]) + .concat( + form.getFieldValue(["md_ro_statuses", "additional_board_statuses"]) + ) + ); }; return (