From 1c8f3772127fe51ae08f271d83dab8251ebf4e72 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Fri, 8 Mar 2024 12:47:11 -0500 Subject: [PATCH] - Add new special filters Signed-off-by: Dave Richer --- ...center-modal-filters-sorters-component.jsx | 3 ++- .../report-center-modal-utils.js | 22 +++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/client/src/components/report-center-modal/report-center-modal-filters-sorters-component.jsx b/client/src/components/report-center-modal/report-center-modal-filters-sorters-component.jsx index 892ce67d5..9a2daff8a 100644 --- a/client/src/components/report-center-modal/report-center-modal-filters-sorters-component.jsx +++ b/client/src/components/report-center-modal/report-center-modal-filters-sorters-component.jsx @@ -142,7 +142,8 @@ function FiltersSection({filters, form, bodyshop}) { return generateInternalReflections({ bodyshop, upperPath, - finalPath + finalPath, + t }); }; diff --git a/client/src/components/report-center-modal/report-center-modal-utils.js b/client/src/components/report-center-modal/report-center-modal-utils.js index b8a9e8adf..d78405cfd 100644 --- a/client/src/components/report-center-modal/report-center-modal-utils.js +++ b/client/src/components/report-center-modal/report-center-modal-utils.js @@ -56,19 +56,26 @@ const generateOptionsFromObject = (bodyshop, path, labelPath, valuePath) => { * Generate special reflections * @param bodyshop * @param finalPath + * @param t - i18n * @returns {{label: *, value: *}[]|{label: *, value: *}[]|{label: string, value: *}[]|*[]} */ -const generateSpecialReflections = (bodyshop, finalPath) => { +const generateSpecialReflections = (bodyshop, finalPath, t) => { switch (finalPath) { case 'payment_payers': return [ { - label: 'Customer', - value: 'Customer' + label: t("payments.labels.customer"), + value: t("payments.labels.customer"), }, { - label: 'Insurance', - value: 'Insurance' + label: t("payments.labels.insurance"), + value: t("payments.labels.insurance"), + }, + // This is a weird one supposedly only used by one shop and could potentially be + // placed behind a SplitSDK + { + label: t("payments.labels.external"), + value: t("payments.labels.external"), } ]; case 'payment_types': @@ -137,12 +144,13 @@ const generateBodyshopReflections = (bodyshop, finalPath) => { * @param bodyshop * @param upperPath * @param finalPath + * @param t - i18n * @returns {{label: *, value: *}[]|[]|{label: *, value: *}[]|{label: string, value: *}[]|{label: *, value: *}[]|*[]} */ -const generateInternalReflections = ({bodyshop, upperPath, finalPath}) => { +const generateInternalReflections = ({bodyshop, upperPath, finalPath, t}) => { switch (upperPath) { case 'special': - return generateSpecialReflections(bodyshop, finalPath); + return generateSpecialReflections(bodyshop, finalPath, t); case 'bodyshop': return generateBodyshopReflections(bodyshop, finalPath); default: