From 7197fb6eb3a80f7a0254dc15f601efa516af2a8f Mon Sep 17 00:00:00 2001 From: puranban Date: Thu, 7 Dec 2023 17:33:12 +0545 Subject: [PATCH] Add targeting strategy document in DREF form and export --- src/views/DrefApplicationExport/i18n.json | 3 +- src/views/DrefApplicationExport/index.tsx | 20 ++++++++++-- .../DrefApplicationForm/Operation/i18n.json | 4 ++- .../DrefApplicationForm/Operation/index.tsx | 16 ++++++++++ .../DrefApplicationForm/Overview/index.tsx | 31 ++++++++++--------- src/views/DrefApplicationForm/index.tsx | 9 +++++- src/views/DrefApplicationForm/schema.ts | 4 ++- 7 files changed, 66 insertions(+), 21 deletions(-) diff --git a/src/views/DrefApplicationExport/i18n.json b/src/views/DrefApplicationExport/i18n.json index 082e32baf8..603ced00d2 100644 --- a/src/views/DrefApplicationExport/i18n.json +++ b/src/views/DrefApplicationExport/i18n.json @@ -96,6 +96,7 @@ "drefApplicationExportMitigation": "Mitigation action", "drefApplicationSupportingDocumentation": "Supporting Documentation", "drefAssessmentReportLink": "Assessment Report", - "crisisCategorySupportingDocumentLabel": "Crisis Category Supporting Document" + "crisisCategorySupportingDocumentLabel": "Crisis Category Supporting Document", + "targetingStrategySupportingDocument": "Targeting Strategy Supporting Document" } } diff --git a/src/views/DrefApplicationExport/index.tsx b/src/views/DrefApplicationExport/index.tsx index ed3001ef0c..435140f1a1 100644 --- a/src/views/DrefApplicationExport/index.tsx +++ b/src/views/DrefApplicationExport/index.tsx @@ -166,7 +166,7 @@ export function Component() { // eslint-disable-next-line max-len identifiedNeedsAndGapsSortedList.indexOf(a.title) - identifiedNeedsAndGapsSortedList.indexOf(b.title) )), - [drefResponse?.identified_gaps], + [drefResponse?.needs_identified], ); const sortedNsActions = useMemo( @@ -243,7 +243,12 @@ export function Component() { const peopleAssistedDefined = isTruthyString(drefResponse?.people_assisted?.trim()); const selectionCriteriaDefined = isTruthyString(drefResponse?.selection_criteria?.trim()); - const showTargetingStrategySection = peopleAssistedDefined || selectionCriteriaDefined; + const targetingStrategySupportingDocumentDefined = isDefined( + drefResponse?.targeting_strategy_support_file_details, + ); + const showTargetingStrategySection = peopleAssistedDefined + || selectionCriteriaDefined + || targetingStrategySupportingDocumentDefined; const riskSecurityDefined = isDefined(drefResponse) && isDefined(drefResponse.risk_security) @@ -812,6 +817,17 @@ export function Component() { )} + {targetingStrategySupportingDocumentDefined && ( + + + {strings.targetingStrategySupportingDocument} + + + )} )} + + + {strings.drefFormUploadTargetingDocumentButtonLabel} + + - {(value?.disaster_type === DISASTER_FIRE - || value?.disaster_type === DISASTER_FLASH_FLOOD - || value?.disaster_type === DISASTER_FLOOD) - ? ( - - ) : ( -
- )} + {( + value?.disaster_type === DISASTER_FIRE + || value?.disaster_type === DISASTER_FLASH_FLOOD + || value?.disaster_type === DISASTER_FLOOD) ? ( + + ) : ( +
+ )} + ; + formFields = addCondition( formFields, formValue,