From 1f5c1b9658f636eb6b3c6c43d4e7b748005f8761 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 4 Apr 2024 17:00:30 -0700 Subject: [PATCH 1/5] IO-2750 Missing Mutation return fields Signed-off-by: Allan Carr --- client/src/graphql/jobs-lines.queries.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/graphql/jobs-lines.queries.js b/client/src/graphql/jobs-lines.queries.js index c3b9ddfcb..cb4b6d06e 100644 --- a/client/src/graphql/jobs-lines.queries.js +++ b/client/src/graphql/jobs-lines.queries.js @@ -172,6 +172,12 @@ export const UPDATE_JOB_LINE = gql` id notes mod_lbr_ty + mod_lb_hrs + part_type + op_code_desc + prt_dsmk_m + prt_dsmk_p + tax_part part_qty db_price act_price From 69ff75157d27c809d7aa78fa2e20dd097c3359da Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Fri, 5 Apr 2024 13:35:44 -0400 Subject: [PATCH 2/5] - reversion Signed-off-by: Dave Richer --- .../payment-modal/payment-modal.container.jsx | 41 ++++++++++--------- .../payment-list-paginated.component.jsx | 2 +- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/client/src/components/payment-modal/payment-modal.container.jsx b/client/src/components/payment-modal/payment-modal.container.jsx index 0c5a9eb3c..51cd9bfc0 100644 --- a/client/src/components/payment-modal/payment-modal.container.jsx +++ b/client/src/components/payment-modal/payment-modal.container.jsx @@ -1,32 +1,30 @@ -import { useMutation } from "@apollo/client"; -import { Button, Form, Modal, notification, Space } from "antd"; -import React, { useEffect, useState } from "react"; -import { useTranslation } from "react-i18next"; -import { connect } from "react-redux"; -import { createStructuredSelector } from "reselect"; -import { INSERT_NEW_PAYMENT, UPDATE_PAYMENT } from "../../graphql/payments.queries"; -import { setEmailOptions } from "../../redux/email/email.actions"; -import { toggleModalVisible } from "../../redux/modals/modals.actions"; -import { selectPayment } from "../../redux/modals/modals.selectors"; -import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors"; -import { GenerateDocument } from "../../utils/RenderTemplate"; -import { TemplateList } from "../../utils/TemplateConstants"; +import {useMutation} from "@apollo/client"; +import {Button, Form, Modal, notification, Space} from "antd"; +import React, {useEffect, useState} from "react"; +import {useTranslation} from "react-i18next"; +import {connect} from "react-redux"; +import {createStructuredSelector} from "reselect"; +import {INSERT_NEW_PAYMENT, UPDATE_PAYMENT} from "../../graphql/payments.queries"; +import {toggleModalVisible} from "../../redux/modals/modals.actions"; +import {selectPayment} from "../../redux/modals/modals.selectors"; +import {selectBodyshop} from "../../redux/user/user.selectors"; +import {GenerateDocument} from "../../utils/RenderTemplate"; +import {TemplateList} from "../../utils/TemplateConstants"; import PaymentForm from "../payment-form/payment-form.component"; -import PaymentMarkForExportButton from "../payment-mark-export-button/payment-mark-export-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, bodyshop: selectBodyshop, - currentUser: selectCurrentUser }); const mapDispatchToProps = (dispatch) => ({ - setEmailOptions: (e) => dispatch(setEmailOptions(e)), toggleModalVisible: () => dispatch(toggleModalVisible("payment")) }); -function PaymentModalContainer({ paymentModal, toggleModalVisible, bodyshop, currentUser, setEmailOptions }) { +function PaymentModalContainer({paymentModal, toggleModalVisible, bodyshop }) { const [form] = Form.useForm(); const [enterAgain, setEnterAgain] = useState(false); const [insertPayment] = useMutation(INSERT_NEW_PAYMENT); @@ -34,7 +32,7 @@ function PaymentModalContainer({ paymentModal, toggleModalVisible, bodyshop, cur const { t } = useTranslation(); const { context, actions, open } = paymentModal; - + const { smartRefetch } = context; const [loading, setLoading] = useState(false); const handleFinish = async (values) => { @@ -90,8 +88,11 @@ function PaymentModalContainer({ paymentModal, toggleModalVisible, bodyshop, cur } } - if (actions.refetch) actions.refetch(); - + if (actions.refetch) { + const updatedData = smartRefetch && updatedPayment ? updatedPayment.data.update_payments.returning[0] : undefined; + actions.refetch(updatedData); + } + if (enterAgain) { const prev = form.getFieldsValue(["date"]); diff --git a/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx b/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx index 1a5dd6774..e9e96057f 100644 --- a/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx +++ b/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx @@ -171,7 +171,7 @@ export function PaymentsListPaginated({ } : refetch }, - context: apolloResults ? apolloResults : record + context: apolloResults ? { smartRefetch: true, ...apolloResults} : {smartRefetch: true, ...record} }); }} > From 6722f8b1e54acef53af09762875d27d7a1d8b8aa Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Fri, 5 Apr 2024 13:41:37 -0400 Subject: [PATCH 3/5] - reversion Signed-off-by: Dave Richer --- client/src/components/payment-modal/payment-modal.container.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/payment-modal/payment-modal.container.jsx b/client/src/components/payment-modal/payment-modal.container.jsx index 51cd9bfc0..b7e2eaf9c 100644 --- a/client/src/components/payment-modal/payment-modal.container.jsx +++ b/client/src/components/payment-modal/payment-modal.container.jsx @@ -32,7 +32,7 @@ function PaymentModalContainer({paymentModal, toggleModalVisible, bodyshop }) { const { t } = useTranslation(); const { context, actions, open } = paymentModal; - const { smartRefetch } = context; + const smartRefetch = context?.smartRefetch || false; const [loading, setLoading] = useState(false); const handleFinish = async (values) => { From b61fd17879beba023d683b670b1c069c24b99ec1 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Fri, 5 Apr 2024 14:54:16 -0400 Subject: [PATCH 4/5] - add smart refetch to mark-export and reexport Signed-off-by: Dave Richer --- .../payment-mark-export-button-component.jsx | 1 + .../payment-reexport-button.component.jsx | 1 + 2 files changed, 2 insertions(+) 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 59819e03c..788584a08 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 @@ -57,6 +57,7 @@ const PaymentMarkForExportButton = ({ bodyshop, payment, refetch, setPaymentCont }, context: { ...payment, + smartRefetch: true, exportedat: today } }); 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 5325231e4..d85cb14d3 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 @@ -34,6 +34,7 @@ const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => { refetch }, context: { + smartRefetch: true, ...payment, exportedat: null } From b5a371d0cfe815c941a69e525ea1334994ffe8ae Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 5 Apr 2024 12:01:26 -0700 Subject: [PATCH 5/5] IO-2568 Button Padding in Print Center Label Modal Signed-off-by: Allan Carr --- .../print-center-jobs-labels.component.jsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/client/src/components/print-center-jobs-labels/print-center-jobs-labels.component.jsx b/client/src/components/print-center-jobs-labels/print-center-jobs-labels.component.jsx index 5bd0f15e5..c42756de9 100644 --- a/client/src/components/print-center-jobs-labels/print-center-jobs-labels.component.jsx +++ b/client/src/components/print-center-jobs-labels/print-center-jobs-labels.component.jsx @@ -6,6 +6,7 @@ import { notification, Popover, Radio, + Space, } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; @@ -115,10 +116,16 @@ export function PrintCenterJobsLabels({ bodyshop, jobId }) { > - - +
+ + + + +
);