Skip to content

Commit

Permalink
anticipated date changable even after the event is locked (#2269)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinesh-aot authored May 23, 2024
1 parent 61114b9 commit 1f775b3
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions epictrack-web/src/components/workPlan/event/EventForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,15 @@ const EventForm = ({
}),
[selectedConfiguration, actualAdded]
);
const disableAnticipatedDate = Boolean(
selectedConfiguration?.id &&
selectedWorkPhase?.work_phase.legislated &&
selectedConfiguration?.event_position === EventPosition.END
const disableAnticipatedDate = useMemo(
() =>
isFormFieldsLocked ||
Boolean(
selectedConfiguration?.id &&
selectedWorkPhase?.work_phase.legislated &&
selectedConfiguration?.event_position === EventPosition.END
),
[selectedConfiguration, selectedWorkPhase]
);
const isHighPriorityActive = useMemo(() => {
if (event) {
Expand Down Expand Up @@ -709,6 +714,7 @@ const EventForm = ({
<ETFormLabel>{actualDateLabel}</ETFormLabel>
<ControlledDatePicker
name="actual_date"
disabled={isFormFieldsLocked}
defaultValue={
event?.actual_date ? dayjs(event?.actual_date).format() : ""
}
Expand Down

0 comments on commit 1f775b3

Please sign in to comment.