Skip to content

Commit 5be26d8

Browse files
authored
Merge pull request #1242 from WildMeOrg/update_disabled_button_color
Update disabled button color
2 parents 84c9a04 + 4b59040 commit 5be26d8

File tree

8 files changed

+53
-26
lines changed

8 files changed

+53
-26
lines changed

frontend/src/components/BrutalismButton.jsx

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,16 @@ export default function BrutalismButton({
4040
position: "relative",
4141
width: "auto",
4242
height: "auto",
43-
background: backgroundColor,
44-
border: `2px solid ${borderColor}`,
43+
backgroundColor: disabled ? "gray" : backgroundColor,
44+
border: disabled
45+
? "gray"
46+
: borderColor
47+
? `2px solid ${borderColor}`
48+
: `2px solid ${backgroundColor}`,
4549
boxShadow: boxShadowStyle,
4650
borderRadius: "4.8px",
4751
fontSize: "16px",
48-
color: color,
52+
color: disabled ? "black" : color,
4953
fontWeight: "bold",
5054
margin: "8px 8px 0 0",
5155
whiteSpace: "nowrap",
@@ -68,19 +72,19 @@ export default function BrutalismButton({
6872
>
6973
{children}
7074
<span style={{ marginLeft: 10 }}></span>
71-
72-
{
73-
noArrow ? null : <svg
74-
xmlns="http://www.w3.org/2000/svg"
75-
width="14"
76-
height="14"
77-
fill="currentColor"
78-
className="bi bi-arrow-right-circle-fill"
79-
viewBox="0 0 16 16"
80-
>
81-
<path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0M4.5 7.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H4.5z" />
82-
</svg>
83-
}
75+
76+
{noArrow ? null : (
77+
<svg
78+
xmlns="http://www.w3.org/2000/svg"
79+
width="14"
80+
height="14"
81+
fill="currentColor"
82+
className="bi bi-arrow-right-circle-fill"
83+
viewBox="0 0 16 16"
84+
>
85+
<path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0M4.5 7.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H4.5z" />
86+
</svg>
87+
)}
8488
</a>
8589
</Button>
8690
);

frontend/src/components/MainButton.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ export default function MainButton({
3434
type={type}
3535
className={`d-flex justify-content-center align-items-center ${className}`}
3636
style={{
37-
backgroundColor: backgroundColor,
38-
border: borderColor
39-
? `2px solid ${borderColor}`
40-
: `2px solid ${backgroundColor}`,
41-
color: color,
37+
backgroundColor: disabled ? "gray" : backgroundColor,
38+
border: disabled
39+
? "gray"
40+
: borderColor
41+
? `2px solid ${borderColor}`
42+
: `2px solid ${backgroundColor}`,
43+
color: disabled ? "black" : color,
4244
margin: "8px",
4345
borderRadius: "4.8px",
4446
fontWeight: "bold",

frontend/src/locale/de.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@
526526
"FILTER_BULK_IMPORT_FILE_NAMES": "Dateinamen für den Massenimport",
527527
"BULK_IMPORT_SEND_TO_IDENTIFICATION": "Zur Identifizierung senden",
528528
"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.",
529-
"DANGER_ZONE": "Gefahrenzone"
529+
"DANGER_ZONE": "Gefahrenzone",
530+
"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."
530531
}
531532

frontend/src/locale/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,5 +525,6 @@
525525
"FILTER_BULK_IMPORT_FILE_NAMES": "Bulk Import File Names",
526526
"BULK_IMPORT_SEND_TO_IDENTIFICATION": "Send to Identification",
527527
"BULK_IMPORT_LOCATION_ID_DESC": "The more options you select, the longer identification takes. Be as specific as possible.",
528-
"DANGER_ZONE": "Danger Zone"
528+
"DANGER_ZONE": "Danger Zone",
529+
"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."
529530
}

frontend/src/locale/es.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,5 +524,6 @@
524524
"FILTER_BULK_IMPORT_FILE_NAMES": "Nombres de archivos de importación masiva",
525525
"BULK_IMPORT_SEND_TO_IDENTIFICATION": "Enviar para identificación",
526526
"BULK_IMPORT_LOCATION_ID_DESC": "Cuantas más opciones seleccione, más tiempo tardará la identificación. Sea lo más específico posible.",
527-
"DANGER_ZONE": "Zona de Peligro"
527+
"DANGER_ZONE": "Zona de Peligro",
528+
"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."
528529
}

frontend/src/locale/fr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,5 +524,6 @@
524524
"FILTER_BULK_IMPORT_FILE_NAMES": "Noms de fichiers d'importation en masse",
525525
"BULK_IMPORT_SEND_TO_IDENTIFICATION": "Envoyer à l’identification",
526526
"BULK_IMPORT_LOCATION_ID_DESC": "Plus vous sélectionnez d’options, plus l’identification prendra du temps. Soyez aussi précis que possible.",
527-
"DANGER_ZONE": "Zone de danger"
527+
"DANGER_ZONE": "Zone de danger",
528+
"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."
528529
}

frontend/src/locale/it.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,5 +525,6 @@
525525
"FILTER_BULK_IMPORT_FILE_NAMES": "Nomi dei file di importazione in blocco",
526526
"BULK_IMPORT_SEND_TO_IDENTIFICATION": "Invia per l’identificazione",
527527
"BULK_IMPORT_LOCATION_ID_DESC": "Più opzioni selezioni, più tempo richiederà l’identificazione. Sii il più specifico possibile.",
528-
"DANGER_ZONE": "Zona pericolosa"
528+
"DANGER_ZONE": "Zona pericolosa",
529+
"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."
529530
}

frontend/src/pages/BulkImport/BulkImportTask.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,22 @@ const BulkImportTask = observer(() => {
499499
>
500500
<FormattedMessage id="BULK_IMPORT_SEND_TO_IDENTIFICATION" />
501501
</MainButton>
502+
{((!userRoles?.includes("admin") &&
503+
!userRoles?.includes("researcher")) ||
504+
!store.locationIDString ||
505+
task?.status !== "complete" ||
506+
task?.iaSummary?.detectionStatus !== "complete") && (
507+
<p
508+
style={{
509+
color: theme.grayColors.gray500,
510+
}}
511+
>
512+
<FormattedMessage
513+
id="BULK_IMPORT_SEND_TO_IDENTIFICATION_DISABLED_DESC"
514+
defaultMessage="Button is disabled if detection or initial identification task is incomplete"
515+
/>
516+
</p>
517+
)}
502518
</Col>
503519
</Row>
504520
<Row>

0 commit comments

Comments
 (0)