From 275143753410e01390cc8d5642c7c3148e66c50d Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 18 May 2021 11:29:05 -0700 Subject: [PATCH 01/11] Updated package.json. --- client/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/package.json b/client/package.json index c9787cb6e..ac2eec8c5 100644 --- a/client/package.json +++ b/client/package.json @@ -75,8 +75,8 @@ "start": "craco start", "build": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` craco build", "build:test": "env-cmd -f .env.test npm run build", + "build-deploy:test": "npm run build:test && s3cmd sync build/* s3://imex-online-test && echo '🚀 TESTING Deployed!'", "buildcra": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` react-scripts build", - "build-deploy": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` craco build && s3cmd sync build/* s3://imex-online-production && echo '🚀 Deployed!'", "test": "craco test", "eject": "react-scripts eject", "madge": "madge --image ./madge-graph.svg --extensions js,jsx,ts,tsx --circular ." From 043ee68e58010a165c62c8d1e63e91579ec7701d Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 18 May 2021 13:35:48 -0700 Subject: [PATCH 02/11] IO-1145 Remove force token refresh. --- admin/src/components/auth-provider/auth-provider.js | 2 +- .../jobs-close-export-button.component.jsx | 6 +++--- .../jobs-export-all-button.component.jsx | 4 ++-- .../payable-export-all-button.component.jsx | 2 +- .../payable-export-button.component.jsx | 2 +- .../payment-export-button.component.jsx | 2 +- .../payments-export-all-button.component.jsx | 2 +- client/src/utils/CleanAxios.js | 3 +-- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/admin/src/components/auth-provider/auth-provider.js b/admin/src/components/auth-provider/auth-provider.js index 2adf29d50..ba8132048 100644 --- a/admin/src/components/auth-provider/auth-provider.js +++ b/admin/src/components/auth-provider/auth-provider.js @@ -8,7 +8,7 @@ const authProvider = { username, password ); - const token = await user.getIdToken(true); + const token = await user.getIdToken(); localStorage.setItem("token", token); return Promise.resolve(); } catch (error) { diff --git a/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx b/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx index fa6875628..b6e2006f8 100644 --- a/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx +++ b/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx @@ -40,7 +40,7 @@ export function JobsCloseExportButton({ { jobIds: [jobId] }, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); @@ -64,7 +64,7 @@ export function JobsCloseExportButton({ QbXmlResponse.data, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); @@ -86,7 +86,7 @@ export function JobsCloseExportButton({ failedTransactions.forEach((ft) => { //insert failed export log notification.open({ - // key: "failedexports", + // key: "failedexports", type: "error", message: t("jobs.errors.exporting", { error: ft.errorMessage || "", diff --git a/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx b/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx index 56b38122d..e0be5621c 100644 --- a/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx +++ b/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx @@ -43,7 +43,7 @@ export function JobsExportAllButton({ { jobIds: jobIds }, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); @@ -66,7 +66,7 @@ export function JobsExportAllButton({ QbXmlResponse.data, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); diff --git a/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx b/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx index 7e190bb7f..4583251f9 100644 --- a/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx +++ b/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx @@ -46,7 +46,7 @@ export function PayableExportAll({ { bills: billids }, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); diff --git a/client/src/components/payable-export-button/payable-export-button.component.jsx b/client/src/components/payable-export-button/payable-export-button.component.jsx index 1ba480b78..bdeaa4455 100644 --- a/client/src/components/payable-export-button/payable-export-button.component.jsx +++ b/client/src/components/payable-export-button/payable-export-button.component.jsx @@ -44,7 +44,7 @@ export function PayableExportButton({ { bills: [billId] }, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); diff --git a/client/src/components/payment-export-button/payment-export-button.component.jsx b/client/src/components/payment-export-button/payment-export-button.component.jsx index d808a0d37..3c0254180 100644 --- a/client/src/components/payment-export-button/payment-export-button.component.jsx +++ b/client/src/components/payment-export-button/payment-export-button.component.jsx @@ -43,7 +43,7 @@ export function PaymentExportButton({ { payments: [paymentId] }, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); diff --git a/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx b/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx index 77381c810..62f47b890 100644 --- a/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx +++ b/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx @@ -42,7 +42,7 @@ export function PaymentsExportAllButton({ { payments: paymentIds }, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); diff --git a/client/src/utils/CleanAxios.js b/client/src/utils/CleanAxios.js index a35b44aa4..49da5740a 100644 --- a/client/src/utils/CleanAxios.js +++ b/client/src/utils/CleanAxios.js @@ -9,8 +9,7 @@ if (process.env.NODE_ENV === "production") { export const axiosAuthInterceptorId = axios.interceptors.request.use( async (config) => { if (!config.headers.Authorization) { - const token = - auth.currentUser && (await auth.currentUser.getIdToken(true)); + const token = auth.currentUser && (await auth.currentUser.getIdToken()); if (token) { config.headers.Authorization = `Bearer ${token}`; } From b8fe2f29e5584c8e13c74864e12220e1b1e361e0 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 18 May 2021 13:38:27 -0700 Subject: [PATCH 03/11] IO-1145 Remove force refresh (and move from test branch to dev). --- admin/src/components/auth-provider/auth-provider.js | 2 +- .../jobs-close-export-button.component.jsx | 6 +++--- .../jobs-export-all-button.component.jsx | 4 ++-- .../payable-export-all-button.component.jsx | 2 +- .../payable-export-button.component.jsx | 2 +- .../payment-export-button.component.jsx | 2 +- .../payments-export-all-button.component.jsx | 2 +- client/src/utils/CleanAxios.js | 3 +-- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/admin/src/components/auth-provider/auth-provider.js b/admin/src/components/auth-provider/auth-provider.js index 2adf29d50..ba8132048 100644 --- a/admin/src/components/auth-provider/auth-provider.js +++ b/admin/src/components/auth-provider/auth-provider.js @@ -8,7 +8,7 @@ const authProvider = { username, password ); - const token = await user.getIdToken(true); + const token = await user.getIdToken(); localStorage.setItem("token", token); return Promise.resolve(); } catch (error) { diff --git a/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx b/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx index fa6875628..b6e2006f8 100644 --- a/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx +++ b/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx @@ -40,7 +40,7 @@ export function JobsCloseExportButton({ { jobIds: [jobId] }, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); @@ -64,7 +64,7 @@ export function JobsCloseExportButton({ QbXmlResponse.data, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); @@ -86,7 +86,7 @@ export function JobsCloseExportButton({ failedTransactions.forEach((ft) => { //insert failed export log notification.open({ - // key: "failedexports", + // key: "failedexports", type: "error", message: t("jobs.errors.exporting", { error: ft.errorMessage || "", diff --git a/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx b/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx index 56b38122d..e0be5621c 100644 --- a/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx +++ b/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx @@ -43,7 +43,7 @@ export function JobsExportAllButton({ { jobIds: jobIds }, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); @@ -66,7 +66,7 @@ export function JobsExportAllButton({ QbXmlResponse.data, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); diff --git a/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx b/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx index 7e190bb7f..4583251f9 100644 --- a/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx +++ b/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx @@ -46,7 +46,7 @@ export function PayableExportAll({ { bills: billids }, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); diff --git a/client/src/components/payable-export-button/payable-export-button.component.jsx b/client/src/components/payable-export-button/payable-export-button.component.jsx index 1ba480b78..bdeaa4455 100644 --- a/client/src/components/payable-export-button/payable-export-button.component.jsx +++ b/client/src/components/payable-export-button/payable-export-button.component.jsx @@ -44,7 +44,7 @@ export function PayableExportButton({ { bills: [billId] }, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); diff --git a/client/src/components/payment-export-button/payment-export-button.component.jsx b/client/src/components/payment-export-button/payment-export-button.component.jsx index d808a0d37..3c0254180 100644 --- a/client/src/components/payment-export-button/payment-export-button.component.jsx +++ b/client/src/components/payment-export-button/payment-export-button.component.jsx @@ -43,7 +43,7 @@ export function PaymentExportButton({ { payments: [paymentId] }, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); diff --git a/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx b/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx index 77381c810..62f47b890 100644 --- a/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx +++ b/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx @@ -42,7 +42,7 @@ export function PaymentsExportAllButton({ { payments: paymentIds }, { headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`, + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, }, } ); diff --git a/client/src/utils/CleanAxios.js b/client/src/utils/CleanAxios.js index a35b44aa4..49da5740a 100644 --- a/client/src/utils/CleanAxios.js +++ b/client/src/utils/CleanAxios.js @@ -9,8 +9,7 @@ if (process.env.NODE_ENV === "production") { export const axiosAuthInterceptorId = axios.interceptors.request.use( async (config) => { if (!config.headers.Authorization) { - const token = - auth.currentUser && (await auth.currentUser.getIdToken(true)); + const token = auth.currentUser && (await auth.currentUser.getIdToken()); if (token) { config.headers.Authorization = `Bearer ${token}`; } From 2e614197e17e9d1f1d33f291cddac79ad0498981 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 18 May 2021 14:11:54 -0700 Subject: [PATCH 04/11] IO-1034 Resolve undefined error messages for reqd form list fields. --- .../bill-form/bill-form.lines.component.jsx | 15 ++++++++++++++- .../jobs-close-lines.component.jsx | 6 ++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/client/src/components/bill-form/bill-form.lines.component.jsx b/client/src/components/bill-form/bill-form.lines.component.jsx index 82d9b6931..ffe6a45e5 100644 --- a/client/src/components/bill-form/bill-form.lines.component.jsx +++ b/client/src/components/bill-form/bill-form.lines.component.jsx @@ -47,6 +47,7 @@ export function BillEnterModalLinesComponent({ return { key: `${field.index}joblinename`, name: [field.name, "joblineid"], + label: t("billlines.fields.jobline"), rules: [ { required: true, @@ -94,6 +95,7 @@ export function BillEnterModalLinesComponent({ return { key: `${field.index}line_desc`, name: [field.name, "line_desc"], + label: t("billlines.fields.line_desc"), rules: [ { required: true, @@ -113,6 +115,7 @@ export function BillEnterModalLinesComponent({ return { key: `${field.index}quantity`, name: [field.name, "quantity"], + label: t("billlines.fields.quantity"), rules: [ { required: true, @@ -134,6 +137,7 @@ export function BillEnterModalLinesComponent({ return { key: `${field.index}actual_price`, name: [field.name, "actual_price"], + label: t("billlines.fields.actual_price"), rules: [ { required: true, @@ -186,10 +190,12 @@ export function BillEnterModalLinesComponent({ dataIndex: "actual_cost", editable: true, width: "8rem", + formItemProps: (field) => { return { key: `${field.index}actual_cost`, name: [field.name, "actual_cost"], + label: t("billlines.fields.actual_cost"), rules: [ { required: true, @@ -221,10 +227,12 @@ export function BillEnterModalLinesComponent({ title: t("billlines.fields.cost_center"), dataIndex: "cost_center", editable: true, + formItemProps: (field) => { return { key: `${field.index}cost_center`, name: [field.name, "cost_center"], + label: t("billlines.fields.cost_center"), rules: [ { required: true, @@ -246,6 +254,7 @@ export function BillEnterModalLinesComponent({ title: t("billlines.fields.location"), dataIndex: "location", editable: true, + label: t("billlines.fields.location"), formItemProps: (field) => { return { key: `${field.index}location`, @@ -499,7 +508,11 @@ const EditableCell = ({ return ( - + {(formInput && formInput(record, record.key)) || children} diff --git a/client/src/components/jobs-close-lines/jobs-close-lines.component.jsx b/client/src/components/jobs-close-lines/jobs-close-lines.component.jsx index 4e4d804c4..d3b7d6028 100644 --- a/client/src/components/jobs-close-lines/jobs-close-lines.component.jsx +++ b/client/src/components/jobs-close-lines/jobs-close-lines.component.jsx @@ -102,9 +102,10 @@ export function JobsCloseLines({ bodyshop, job, jobRO }) { Date: Tue, 18 May 2021 14:29:14 -0700 Subject: [PATCH 05/11] IO-1050 Mark for Reexport disable logic. --- .../jobs-admin-mark-reexport.component.jsx | 2 +- client/src/pages/jobs-admin/jobs-admin.page.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/jobs-admin-mark-reexport/jobs-admin-mark-reexport.component.jsx b/client/src/components/jobs-admin-mark-reexport/jobs-admin-mark-reexport.component.jsx index cc69a1f2b..f6002d144 100644 --- a/client/src/components/jobs-admin-mark-reexport/jobs-admin-mark-reexport.component.jsx +++ b/client/src/components/jobs-admin-mark-reexport/jobs-admin-mark-reexport.component.jsx @@ -57,7 +57,7 @@ export function JobAdminMarkReexport({ bodyshop, job }) { return ( )} - + } destroyOnClose > @@ -255,7 +255,6 @@ function BillEnterModalContainer({ onFinishFailed={() => { setEnterAgain(false); }} - // initialValues={formValues} > {(formInput && formInput(record, record.key)) || children} diff --git a/client/src/components/courtesy-car-return-modal/courtesy-car-return-modal.container.jsx b/client/src/components/courtesy-car-return-modal/courtesy-car-return-modal.container.jsx index 98a6ebf9c..a1fcff8b7 100644 --- a/client/src/components/courtesy-car-return-modal/courtesy-car-return-modal.container.jsx +++ b/client/src/components/courtesy-car-return-modal/courtesy-car-return-modal.container.jsx @@ -20,7 +20,7 @@ const mapDispatchToProps = (dispatch) => ({ toggleModalVisible: () => dispatch(toggleModalVisible("courtesyCarReturn")), }); -export function BillEnterModalContainer({ +export function CCReturnModalContainer({ courtesyCarReturnModal, toggleModalVisible, bodyshop, @@ -85,4 +85,4 @@ export function BillEnterModalContainer({ export default connect( mapStateToProps, mapDispatchToProps -)(BillEnterModalContainer); +)(CCReturnModalContainer); diff --git a/client/src/components/job-search-select/job-search-select.component.jsx b/client/src/components/job-search-select/job-search-select.component.jsx index 36782ded0..c3d297637 100644 --- a/client/src/components/job-search-select/job-search-select.component.jsx +++ b/client/src/components/job-search-select/job-search-select.component.jsx @@ -36,10 +36,8 @@ const JobSearchSelect = ( } ); - const [ - callIdSearch, - { loading: idLoading, error: idError, data: idData }, - ] = useLazyQuery(SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE); + const [callIdSearch, { loading: idLoading, error: idError, data: idData }] = + useLazyQuery(SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE); const executeSearch = (v) => { callSearch(v); @@ -63,6 +61,7 @@ const JobSearchSelect = ( ], "id" ); + console.log("restProps", restProps); return (
@@ -81,7 +80,7 @@ const JobSearchSelect = ( > {theOptions ? theOptions.map((o) => ( -