From 862511263f5531704d4c55d905ea1cf84f2626b5 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Thu, 4 Feb 2021 15:30:05 -0800 Subject: [PATCH] Added template list items. --- bodyshop_translations.babel | 63 +++++++++++++++++++ client/src/components/_test/paymentMethod.jsx | 2 +- .../parts-order-list-table.component.jsx | 2 +- .../parts-order-modal.container.jsx | 7 +-- client/src/translations/en_us/common.json | 5 +- client/src/translations/es/common.json | 3 + client/src/translations/fr/common.json | 3 + client/src/utils/RenderTemplate.js | 2 +- client/src/utils/TemplateConstants.js | 33 +++++++++- 9 files changed, 109 insertions(+), 11 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index c9f8081c9..0ea39ed55 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -23510,6 +23510,27 @@ + + parts_order + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + parts_order_confirmation false @@ -23552,6 +23573,48 @@ + + payments_by_job + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ro_with_description + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + window_tag false diff --git a/client/src/components/_test/paymentMethod.jsx b/client/src/components/_test/paymentMethod.jsx index af5c38d1c..c90fef0a7 100644 --- a/client/src/components/_test/paymentMethod.jsx +++ b/client/src/components/_test/paymentMethod.jsx @@ -72,7 +72,7 @@ function Test({ bodyshop, setEmailOptions }) { replyTo: bodyshop.email, }, template: { - name: TemplateList().parts_order_confirmation.key, + name: TemplateList().parts_order.key, variables: { id: "a7c2d4e1-f519-42a9-a071-c48cf0f22979", }, diff --git a/client/src/components/parts-order-list-table/parts-order-list-table.component.jsx b/client/src/components/parts-order-list-table/parts-order-list-table.component.jsx index f67e5788a..55e55270b 100644 --- a/client/src/components/parts-order-list-table/parts-order-list-table.component.jsx +++ b/client/src/components/parts-order-list-table/parts-order-list-table.component.jsx @@ -139,7 +139,7 @@ export function PartsOrderListTableComponent({ templateObject={{ name: record.isReturn ? TemplateList("partsorder").parts_return_confirmation.key - : TemplateList("partsorder").parts_order_confirmation.key, + : TemplateList("partsorder").parts_order.key, variables: { id: record.id }, }} /> diff --git a/client/src/components/parts-order-modal/parts-order-modal.container.jsx b/client/src/components/parts-order-modal/parts-order-modal.container.jsx index 8fbf0f900..7542bcdc9 100644 --- a/client/src/components/parts-order-modal/parts-order-modal.container.jsx +++ b/client/src/components/parts-order-modal/parts-order-modal.container.jsx @@ -161,7 +161,7 @@ export function PartsOrderModalContainer({ { name: isReturn ? TemplateList("partsorder").parts_return_confirmation.key - : TemplateList("partsorder").parts_order_confirmation.key, + : TemplateList("partsorder").parts_order.key, variables: { id: insertResult.data.insert_parts_orders.returning[0].id, }, @@ -169,8 +169,7 @@ export function PartsOrderModalContainer({ { to: matchingVendor ? [matchingVendor.email] : null, replyTo: bodyshop.email, - subject: TemplateList("partsorder", {}).parts_order_confirmation - .subject, + subject: TemplateList("partsorder", {}).parts_order.subject, }, "e" ); @@ -179,7 +178,7 @@ export function PartsOrderModalContainer({ { name: isReturn ? TemplateList("partsorder").parts_return_confirmation.key - : TemplateList("partsorder").parts_order_confirmation.key, + : TemplateList("partsorder").parts_order.key, variables: { id: insertResult.data.insert_parts_orders.returning[0].id, }, diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index d2a3adf78..80ad95a2d 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1434,8 +1434,11 @@ "estimate_detail": "Estimate Details", "fippa_authorization": "FIPPA Authorization", "job_notes": "Job Notes", - "parts_order_confirmation": "Parts Order Confirmation", + "parts_order": "Parts Order Confirmation", + "parts_order_confirmation": "", "payment_receipt": "Payment Receipt", + "payments_by_job": "Job Payments", + "ro_with_description": "RO Summary with Descriptions", "window_tag": "Window Tag", "work_authorization": "Work Authorization" }, diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index cac65bf94..d833d1411 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1434,8 +1434,11 @@ "estimate_detail": "", "fippa_authorization": "", "job_notes": "", + "parts_order": "", "parts_order_confirmation": "", "payment_receipt": "", + "payments_by_job": "", + "ro_with_description": "", "window_tag": "", "work_authorization": "" }, diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 8b5777d51..ad9072b02 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1434,8 +1434,11 @@ "estimate_detail": "", "fippa_authorization": "", "job_notes": "", + "parts_order": "", "parts_order_confirmation": "", "payment_receipt": "", + "payments_by_job": "", + "ro_with_description": "", "window_tag": "", "work_authorization": "" }, diff --git a/client/src/utils/RenderTemplate.js b/client/src/utils/RenderTemplate.js index a3d1fcc1b..3a5db3d0d 100644 --- a/client/src/utils/RenderTemplate.js +++ b/client/src/utils/RenderTemplate.js @@ -15,7 +15,7 @@ export default async function RenderTemplate( ) { //Template Object // { - // name: TemplateList().parts_order_confirmation.key, + // name: TemplateList().parts_order.key, // variables: { // id: insertResult.data.insert_parts_orders.returning[0].id, // }, diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index c3d9c400c..4565dc5a5 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -48,6 +48,33 @@ export const TemplateList = (type, context) => { key: "job_notes", disabled: false, }, + ro_with_description: { + title: i18n.t("printcenter.jobs.ro_with_description"), + description: "All Jobs Notes", + subject: `${i18n.t("printcenter.jobs.ro_with_description")} - ${ + context && context.job && context.job.ro_number + }`, + key: "ro_with_description", + disabled: false, + }, + window_tag: { + title: i18n.t("printcenter.jobs.window_tag"), + description: "All Jobs Notes", + subject: `${i18n.t("printcenter.jobs.window_tag")} - ${ + context && context.job && context.job.ro_number + }`, + key: "window_tag", + disabled: false, + }, + payments_by_job: { + title: i18n.t("printcenter.jobs.payments_by_job"), + description: "All Jobs Notes", + subject: `${i18n.t("printcenter.jobs.payments_by_job")} - ${ + context && context.job && context.job.ro_number + }`, + key: "payments_by_job", + disabled: false, + }, } : {}), ...(!type || type === "appointment" @@ -65,10 +92,10 @@ export const TemplateList = (type, context) => { : {}), ...(!type || type === "partsorder" ? { - parts_order_confirmation: { - title: i18n.t("printcenter.jobs.parts_order_confirmation"), + parts_order: { + title: i18n.t("printcenter.jobs.parts_order"), description: "Parts Order", - key: "parts_order_confirmation", + key: "parts_order", subject: `${bodyshop.shopname} Parts Order ${ (context && context &&