From c8ecb9d048709a67994f13e690d17f2b2481cadf Mon Sep 17 00:00:00 2001 From: Wes Cutting Date: Tue, 24 Oct 2023 12:10:07 -0500 Subject: [PATCH] Modify reason list with deprecation check --- .../ExplanationOfProgress.graphql | 1 + .../ExplanationOfProgress.tsx | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/scenes/ProgressReports/EditForm/Steps/ExplanationOfProgress/ExplanationOfProgress.graphql b/src/scenes/ProgressReports/EditForm/Steps/ExplanationOfProgress/ExplanationOfProgress.graphql index 0e37c23b3c..dac4e1ae94 100644 --- a/src/scenes/ProgressReports/EditForm/Steps/ExplanationOfProgress/ExplanationOfProgress.graphql +++ b/src/scenes/ProgressReports/EditForm/Steps/ExplanationOfProgress/ExplanationOfProgress.graphql @@ -9,6 +9,7 @@ fragment ExplanationOfProgressStep on ProgressReport { ahead behind onTime + deprecated } reasons { ...SecuredStringList diff --git a/src/scenes/ProgressReports/EditForm/Steps/ExplanationOfProgress/ExplanationOfProgress.tsx b/src/scenes/ProgressReports/EditForm/Steps/ExplanationOfProgress/ExplanationOfProgress.tsx index 8ff338b7fe..1ca717210f 100644 --- a/src/scenes/ProgressReports/EditForm/Steps/ExplanationOfProgress/ExplanationOfProgress.tsx +++ b/src/scenes/ProgressReports/EditForm/Steps/ExplanationOfProgress/ExplanationOfProgress.tsx @@ -24,7 +24,7 @@ import { ExplainProgressVarianceDocument } from './ExplanationOfProgress.graphql type OptionGroup = typeof groups extends Array ? T : never; -const groups = ['behind', 'onTime', 'ahead'] satisfies Array< +const groups = ['behind', 'onTime', 'ahead', 'deprecated'] satisfies Array< keyof ReasonOptions >; @@ -170,11 +170,20 @@ export const ExplanationOfProgress: StepComponent = ({ report }) => { + > + {optionsByGroup[group].map((reason) => ( + + fieldName={reason} + key={reason} + variant="radio" + value={reason} + disabled={optionsByGroup.deprecated.includes(reason)} + /> + ))} + )}