From 1f775b3e51d7680d4a901b490392689558f66f42 Mon Sep 17 00:00:00 2001
From: Dinesh <97143739+dinesh-aot@users.noreply.github.com>
Date: Thu, 23 May 2024 09:34:32 -0700
Subject: [PATCH] anticipated date changable even after the event is locked
(#2269)
---
.../src/components/workPlan/event/EventForm.tsx | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/epictrack-web/src/components/workPlan/event/EventForm.tsx b/epictrack-web/src/components/workPlan/event/EventForm.tsx
index 2c16922f9..0dba3c640 100644
--- a/epictrack-web/src/components/workPlan/event/EventForm.tsx
+++ b/epictrack-web/src/components/workPlan/event/EventForm.tsx
@@ -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) {
@@ -709,6 +714,7 @@ const EventForm = ({
{actualDateLabel}