From cf0c25c76100223b5e4f9a7a799434c30de1446d Mon Sep 17 00:00:00 2001 From: erinz2020 Date: Thu, 11 Sep 2025 13:43:40 +0000 Subject: [PATCH 1/2] update disabled button colors and bulk import task page --- frontend/src/components/MainButton.jsx | 12 +++++++----- frontend/src/locale/de.json | 3 ++- frontend/src/locale/en.json | 3 ++- frontend/src/locale/es.json | 3 ++- frontend/src/locale/fr.json | 3 ++- frontend/src/locale/it.json | 3 ++- frontend/src/pages/BulkImport/BulkImportTask.jsx | 10 ++++++++++ 7 files changed, 27 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/MainButton.jsx b/frontend/src/components/MainButton.jsx index e921349251..3a227ac826 100644 --- a/frontend/src/components/MainButton.jsx +++ b/frontend/src/components/MainButton.jsx @@ -34,11 +34,13 @@ export default function MainButton({ type={type} className={`d-flex justify-content-center align-items-center ${className}`} style={{ - backgroundColor: backgroundColor, - border: borderColor - ? `2px solid ${borderColor}` - : `2px solid ${backgroundColor}`, - color: color, + backgroundColor: disabled ? "gray" : backgroundColor, + border: disabled + ? "gray" + : borderColor + ? `2px solid ${borderColor}` + : `2px solid ${backgroundColor}`, + color: disabled ? "black" : color, margin: "8px", borderRadius: "4.8px", fontWeight: "bold", diff --git a/frontend/src/locale/de.json b/frontend/src/locale/de.json index 790df0d676..0713d37b94 100644 --- a/frontend/src/locale/de.json +++ b/frontend/src/locale/de.json @@ -526,6 +526,7 @@ "FILTER_BULK_IMPORT_FILE_NAMES": "Dateinamen für den Massenimport", "BULK_IMPORT_SEND_TO_IDENTIFICATION": "Zur Identifizierung senden", "BULK_IMPORT_LOCATION_ID_DESC": "Je mehr Optionen Sie auswählen, desto länger dauert die Identifizierung. Seien Sie so präzise wie möglich.", - "DANGER_ZONE": "Gefahrenzone" + "DANGER_ZONE": "Gefahrenzone", + "BULK_IMPORT_SEND_TO_IDENTIFICATION_DISABLED_DESC": "Die Schaltfläche ist deaktiviert, wenn die Erkennung oder die erste Identifizierungsaufgabe nicht abgeschlossen ist. Bitte warten Sie, bis die Aufgabe abgeschlossen ist, bevor Sie zur Identifizierung senden." } diff --git a/frontend/src/locale/en.json b/frontend/src/locale/en.json index c08d724f3b..4ec609ae6b 100644 --- a/frontend/src/locale/en.json +++ b/frontend/src/locale/en.json @@ -525,5 +525,6 @@ "FILTER_BULK_IMPORT_FILE_NAMES": "Bulk Import File Names", "BULK_IMPORT_SEND_TO_IDENTIFICATION": "Send to Identification", "BULK_IMPORT_LOCATION_ID_DESC": "The more options you select, the longer identification takes. Be as specific as possible.", - "DANGER_ZONE": "Danger Zone" + "DANGER_ZONE": "Danger Zone", + "BULK_IMPORT_SEND_TO_IDENTIFICATION_DISABLED_DESC": "Button is disabled if detection or initial identification task is incomplete. Please wait for the task to complete before sending to identification." } \ No newline at end of file diff --git a/frontend/src/locale/es.json b/frontend/src/locale/es.json index 5e8d8caf4d..b08e6b4156 100644 --- a/frontend/src/locale/es.json +++ b/frontend/src/locale/es.json @@ -524,5 +524,6 @@ "FILTER_BULK_IMPORT_FILE_NAMES": "Nombres de archivos de importación masiva", "BULK_IMPORT_SEND_TO_IDENTIFICATION": "Enviar para identificación", "BULK_IMPORT_LOCATION_ID_DESC": "Cuantas más opciones seleccione, más tiempo tardará la identificación. Sea lo más específico posible.", - "DANGER_ZONE": "Zona de Peligro" + "DANGER_ZONE": "Zona de Peligro", + "BULK_IMPORT_SEND_TO_IDENTIFICATION_DISABLED_DESC": "El botón está deshabilitado si la detección o la tarea de identificación inicial no se ha completado. Espere a que la tarea finalice antes de enviar a identificación." } \ No newline at end of file diff --git a/frontend/src/locale/fr.json b/frontend/src/locale/fr.json index 5cbf48feaa..1c7cdd5d06 100644 --- a/frontend/src/locale/fr.json +++ b/frontend/src/locale/fr.json @@ -524,5 +524,6 @@ "FILTER_BULK_IMPORT_FILE_NAMES": "Noms de fichiers d'importation en masse", "BULK_IMPORT_SEND_TO_IDENTIFICATION": "Envoyer à l’identification", "BULK_IMPORT_LOCATION_ID_DESC": "Plus vous sélectionnez d’options, plus l’identification prendra du temps. Soyez aussi précis que possible.", - "DANGER_ZONE": "Zone de danger" + "DANGER_ZONE": "Zone de danger", + "BULK_IMPORT_SEND_TO_IDENTIFICATION_DISABLED_DESC": "Le bouton est désactivé si la détection ou la tâche d’identification initiale n’est pas terminée. Veuillez attendre la fin de la tâche avant d’envoyer à l’identification." } \ No newline at end of file diff --git a/frontend/src/locale/it.json b/frontend/src/locale/it.json index 0fb4aa15a4..3605827734 100644 --- a/frontend/src/locale/it.json +++ b/frontend/src/locale/it.json @@ -525,5 +525,6 @@ "FILTER_BULK_IMPORT_FILE_NAMES": "Nomi dei file di importazione in blocco", "BULK_IMPORT_SEND_TO_IDENTIFICATION": "Invia per l’identificazione", "BULK_IMPORT_LOCATION_ID_DESC": "Più opzioni selezioni, più tempo richiederà l’identificazione. Sii il più specifico possibile.", - "DANGER_ZONE": "Zona pericolosa" + "DANGER_ZONE": "Zona pericolosa", + "BULK_IMPORT_SEND_TO_IDENTIFICATION_DISABLED_DESC": "Il pulsante è disabilitato se il rilevamento o l’attività di identificazione iniziale non è completata. Attendere il completamento dell’attività prima di inviare all’identificazione." } \ No newline at end of file diff --git a/frontend/src/pages/BulkImport/BulkImportTask.jsx b/frontend/src/pages/BulkImport/BulkImportTask.jsx index 21e20117b9..2caab4edcd 100644 --- a/frontend/src/pages/BulkImport/BulkImportTask.jsx +++ b/frontend/src/pages/BulkImport/BulkImportTask.jsx @@ -499,6 +499,16 @@ const BulkImportTask = observer(() => { > +

+ +

From 4b5904074e69afb2f327af143fd2a5191945f336 Mon Sep 17 00:00:00 2001 From: erinz2020 Date: Thu, 11 Sep 2025 14:38:40 +0000 Subject: [PATCH 2/2] conditional rendering message, update another button too --- frontend/src/components/BrutalismButton.jsx | 36 ++++++++++--------- .../src/pages/BulkImport/BulkImportTask.jsx | 26 ++++++++------ 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/frontend/src/components/BrutalismButton.jsx b/frontend/src/components/BrutalismButton.jsx index 44c96bc023..9164f27b02 100644 --- a/frontend/src/components/BrutalismButton.jsx +++ b/frontend/src/components/BrutalismButton.jsx @@ -40,12 +40,16 @@ export default function BrutalismButton({ position: "relative", width: "auto", height: "auto", - background: backgroundColor, - border: `2px solid ${borderColor}`, + backgroundColor: disabled ? "gray" : backgroundColor, + border: disabled + ? "gray" + : borderColor + ? `2px solid ${borderColor}` + : `2px solid ${backgroundColor}`, boxShadow: boxShadowStyle, borderRadius: "4.8px", fontSize: "16px", - color: color, + color: disabled ? "black" : color, fontWeight: "bold", margin: "8px 8px 0 0", whiteSpace: "nowrap", @@ -68,19 +72,19 @@ export default function BrutalismButton({ > {children} - - { - noArrow ? null : - - - } + + {noArrow ? null : ( + + + + )} ); diff --git a/frontend/src/pages/BulkImport/BulkImportTask.jsx b/frontend/src/pages/BulkImport/BulkImportTask.jsx index 2caab4edcd..7acb3b6e89 100644 --- a/frontend/src/pages/BulkImport/BulkImportTask.jsx +++ b/frontend/src/pages/BulkImport/BulkImportTask.jsx @@ -499,16 +499,22 @@ const BulkImportTask = observer(() => { > -

- -

+ {((!userRoles?.includes("admin") && + !userRoles?.includes("researcher")) || + !store.locationIDString || + task?.status !== "complete" || + task?.iaSummary?.detectionStatus !== "complete") && ( +

+ +

+ )}