Skip to content

Commit

Permalink
Merge pull request #690 from NBISweden/hotfix/yearly-report-blocker
Browse files Browse the repository at this point in the history
hotfix: do not allow a user to report a rabbit on the same day
  • Loading branch information
jhagberg authored Dec 20, 2023
2 parents 0e2f997 + a6185ed commit b45a09c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions frontend/src/individual_report.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export function IndividualReport({ individual }: { individual: Individual }) {
className={style.datePicker}
disableFuture
minDate={minDate}
minDateMessage="Datumet måste ligga efter senaste rapporteringsdatum."
minDateMessage="Datumet måste ligga efter senaste rapporteringsdatum. Förmodligen har du redan årsrapporterad denna kanin idag"
variant="inline"
inputVariant="outlined"
label="Datum för årsrapporten"
Expand All @@ -175,7 +175,7 @@ export function IndividualReport({ individual }: { individual: Individual }) {
</MuiPickersUtilsProvider>
<FormControl
component="fieldset"
disabled={!reportDate}
disabled={reportDate <= minDate}
error={error}
className={style.checkContainer}
>
Expand Down Expand Up @@ -223,7 +223,12 @@ export function IndividualReport({ individual }: { individual: Individual }) {
</Button>
</div>
<div className={style.buttonContainer}>
<Button variant="contained" color="primary" onClick={onSave}>
<Button
variant="contained"
color="primary"
onClick={onSave}
disabled={!isStillOwner || reportDate <= minDate}
>
Skicka
</Button>
</div>{" "}
Expand Down

0 comments on commit b45a09c

Please sign in to comment.