Skip to content

Commit

Permalink
fix(ZMS-3253): check boxes disabled for past opening hours
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Fink authored and Thomas Fink committed Feb 5, 2025
1 parent 97e70f1 commit 4deb527
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions zmsadmin/js/page/availabilityDay/form/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const FormContent = (props) => {
} = props;

const hasEndTimePastError = Object.values(errorList)
.some(error => error.itemList?.[0]?.[0]?.type === 'endTimePast');
.some(error => error.itemList?.[0]?.[0]?.type === 'endTimePast' ||
error.itemList?.some(items => items.some(item => item.type === 'endTimePast')));
const calenderDisabled = data.type && data.slotTimeInMinutes ? false : true;
const inputDisabled = hasEndTimePastError || calenderDisabled;

Expand Down Expand Up @@ -150,8 +151,7 @@ const FormContent = (props) => {
inline={true}
{...{ onChange }}
boxes={weekDayList}
attributes={{ "disabled": inputDisabled }}
disabled={!data.repeat ? true : false}
disabled={inputDisabled || !data.repeat}
/>
</Controls>
</FormGroup>
Expand All @@ -175,7 +175,8 @@ const FormContent = (props) => {
<Inputs.Checkbox name="multipleSlotsAllowed"
checked={"1" == data.multipleSlotsAllowed} {...{ onChange }}
value="1"
attributes={{ "id": "AvDayMultipleSlots", "disabled": inputDisabled }}
disabled={inputDisabled}
id="AvDayMultipleSlots"
/>
<Label attributes={{ "htmlFor": "AvDayMultipleSlots", "className": "light" }}>Die Dienstleistungen dürfen mehr als einen Zeitschlitz beanspruchen</Label>
</Controls>
Expand Down

0 comments on commit 4deb527

Please sign in to comment.