From 90532427b67f3833f54ad8df71190a8801533206 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Wed, 21 Aug 2024 15:32:22 -0400 Subject: [PATCH] - Checkpoint Signed-off-by: Dave Richer --- ...oduction-list-config-manager.component.jsx | 40 +++++++++++++++++-- client/src/translations/en_us/common.json | 7 +++- client/src/translations/es/common.json | 7 +++- client/src/translations/fr/common.json | 7 +++- 4 files changed, 52 insertions(+), 9 deletions(-) diff --git a/client/src/components/production-list-table/production-list-config-manager.component.jsx b/client/src/components/production-list-table/production-list-config-manager.component.jsx index 95f4ceccf..80c32985f 100644 --- a/client/src/components/production-list-table/production-list-config-manager.component.jsx +++ b/client/src/components/production-list-table/production-list-config-manager.component.jsx @@ -362,7 +362,25 @@ export function ProductionListConfigManager({
{isAddingNewProfile && ( - + { + if (!value) { + return Promise.resolve(); + } + const nameExists = bodyshop.production_config.some((pc) => pc.name === value); + if (nameExists) { + return Promise.reject(new Error(t("production.errors.name_exists"))); + } + return Promise.resolve(); + } + } + ]} + > )} @@ -376,13 +394,22 @@ export function ProductionListConfigManager({ > {t("general.actions.save")} + @@ -417,7 +444,14 @@ export function ProductionListConfigManager({ .map((config) => (
- + {config.name} {config.name !== t("production.constants.main_profile") && ( diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 1304eff5f..98d9418ec 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1165,7 +1165,8 @@ "tryagain": "Try Again", "view": "View", "viewreleasenotes": "See What's Changed", - "remove_alert": "Are you sure you want to dismiss the alert?" + "remove_alert": "Are you sure you want to dismiss the alert?", + "saveas": "Save As" }, "errors": { "fcm": "You must allow notification permissions to have real time messaging. Click to try again.", @@ -2788,7 +2789,9 @@ "errors": { "boardupdate": "Error encountered updating Job. {{message}}", "removing": "Error removing from production board. {{error}}", - "settings": "Error saving board settings: {{error}}" + "settings": "Error saving board settings: {{error}}", + "name_exists": "A Profile with this name already exists. Please choose a different name.", + "name_required": "Profile name is required." }, "labels": { "kiosk_mode": "Kiosk Mode", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 76f537e61..18edcbeeb 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1165,7 +1165,8 @@ "tryagain": "", "view": "", "viewreleasenotes": "", - "remove_alert": "" + "remove_alert": "", + "saveas": "" }, "errors": { "fcm": "", @@ -2788,7 +2789,9 @@ "errors": { "boardupdate": "", "removing": "", - "settings": "" + "settings": "", + "name_exists": "", + "name_required": "" }, "labels": { "kiosk_mode": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index fccb1ce65..adc23a1a0 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1165,7 +1165,8 @@ "tryagain": "", "view": "", "viewreleasenotes": "", - "remove_alert": "" + "remove_alert": "", + "saveas": "" }, "errors": { "fcm": "", @@ -2788,7 +2789,9 @@ "errors": { "boardupdate": "", "removing": "", - "settings": "" + "settings": "", + "name_exists": "", + "name_required": "" }, "labels": { "kiosk_mode": "",