From 16562c11981bbe26aa2f5695e2025954faf340ee Mon Sep 17 00:00:00 2001 From: Sigrid Elnan <55406589+sigridge@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:00:49 +0200 Subject: [PATCH] Disable lost or closed projects (#517) --- frontend/src/components/Staffing/AddEngagementForm.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Staffing/AddEngagementForm.tsx b/frontend/src/components/Staffing/AddEngagementForm.tsx index faf24ecb..0790a54f 100644 --- a/frontend/src/components/Staffing/AddEngagementForm.tsx +++ b/frontend/src/components/Staffing/AddEngagementForm.tsx @@ -77,12 +77,18 @@ export function AddEngagementForm({ return sum; } + const isLostOrClosed = + project.bookingType === EngagementState.Closed || + project.bookingType === EngagementState.Lost; + return [ ...sum, { value: `${project.engagementId}`, label: `${project.engagementName}`, - disabled: disabledProjectIds.includes(project.engagementId), + disabled: + disabledProjectIds.includes(project.engagementId) || + isLostOrClosed, }, ]; },