Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: do not allow a user to report a rabbit on the same day #690

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading