Skip to content

Commit 3907128

Browse files
authored
Merge pull request #1855 from IFRCGo/feature/final-reports-dref-field
New assisted population field in Dref final report
2 parents f23eb34 + 54df6ff commit 3907128

File tree

10 files changed

+201
-93
lines changed

10 files changed

+201
-93
lines changed

.changeset/olive-worms-post.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"go-web-app": patch
3+
---
4+
5+
Update DREF final report form
6+
7+
- The DREF final report form and export now include a new "Assisted Population" field, replacing the "Targeted Population" field.

app/src/views/AccountMyFormsDref/DownloadImportTemplateButton/DownloadImportTemplateModal/useImportTemplateSchema.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -592,56 +592,56 @@ function useImportTemplateSchema() {
592592
type: 'input',
593593
validation: 'number',
594594
label: 'Targeted Population: <b>Women</b>',
595-
description: '<i>Number, e.g. XX,XXX.</i>',
595+
description: '<i>Number, e.g. XX,XXX.</i> If 0, leave the box empty.',
596596
},
597597

598598
men: {
599599
type: 'input',
600600
validation: 'number',
601601
label: 'Targeted Population: <b>Men</b>',
602-
description: '<i>Number, e.g. XX,XXX.</i>',
602+
description: '<i>Number, e.g. XX,XXX.</i> If 0, leave the box empty.',
603603
},
604604

605605
girls: {
606606
type: 'input',
607607
validation: 'number',
608608
label: 'Targeted Population: <b>Girls (under 18)</b>',
609-
description: '<i>Number, e.g. XX,XXX.</i>',
609+
description: '<i>Number, e.g. XX,XXX.</i> If 0, leave the box empty.',
610610
},
611611

612612
boys: {
613613
type: 'input',
614614
validation: 'number',
615615
label: 'Targeted Population: <b>Boys (under 18)</b>',
616-
description: '<i>Number, e.g. XX,XXX.</i>',
616+
description: '<i>Number, e.g. XX,XXX.</i> If 0, leave the box empty.',
617617
},
618618

619619
total_targeted_population: {
620620
type: 'input',
621621
validation: 'number',
622622
label: 'Targeted Population: <b>Total</b>',
623-
description: '<i>Number, e.g. XX,XXX.</i>',
623+
description: '<i>Number, e.g. XX,XXX.</i> If 0, leave the box empty.',
624624
},
625625

626626
disability_people_per: {
627627
type: 'input',
628628
validation: 'number',
629629
label: 'Estimated Percentage: <b>People with Disability</b>',
630-
description: '<i>Percentage, e.g. XX%.</i>',
630+
description: '<i>Percentage, e.g. XX%.</i> If 0, leave the box empty.',
631631
},
632632

633633
people_per_urban: {
634634
type: 'input',
635635
validation: 'number',
636636
label: 'Estimated Percentage: <b>Urban</b>',
637-
description: '<i>Percentage, e.g. XX%.</i>',
637+
description: '<i>Percentage, e.g. XX%.</i> If 0, leave the box empty.',
638638
},
639639

640640
people_per_local: {
641641
type: 'input',
642642
validation: 'number',
643643
label: 'Estimated Percentage: <b>Rural</b>',
644-
description: '<i>Percentage, e.g. XX%.</i>',
644+
description: '<i>Percentage, e.g. XX%.</i> If 0, leave the box empty.',
645645
},
646646

647647
displaced_people: {

app/src/views/DrefFinalReportExport/i18n.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"hasChildProtectionPolicy": "Does your National Society have child protection/child safeguarding policy?",
2323
"hasWhistleblowerProtectionPolicy": "Does your National Society have whistleblower protection policy?",
2424
"hasAntiSexualHarassmentPolicy": "Does your National Society have anti-sexual harassment policy?",
25-
"peopleAssistedLabel": "People Assisted",
25+
"peopleAssistedLabel": "Total Population Assisted",
2626
"peopleSuffix": " people",
2727
"operationStartDateLabel": "Operation Start Date",
2828
"operationTimeframeLabel": "Total Operating Timeframe",
@@ -58,11 +58,11 @@
5858
"targetingStrategySectionHeading": "Targeting Strategy",
5959
"peopleAssistedHeading": "Who was targeted by this operation?",
6060
"selectionCriteriaHeading": "Explain the selection criteria for the targeted population",
61-
"targetPopulationSectionHeading": "Total Targeted Population",
62-
"womenLabel": "Women",
63-
"girlsLabel": "Girls (under 18)",
64-
"menLabel": "Men",
65-
"boysLabel": "Boys (under 18)",
61+
"targetPopulationSectionHeading": "Total Assisted Population",
62+
"womenLabel": "Assisted Women",
63+
"girlsLabel": "Assisted Girls (under 18)",
64+
"menLabel": "Assisted Men",
65+
"boysLabel": "Assisted Boys (under 18)",
6666
"targetedPopulationLabel": "Total targeted population",
6767
"ruralLabel": "Rural",
6868
"urbanLabel": "Urban",

app/src/views/DrefFinalReportExport/index.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -384,14 +384,6 @@ export function Component() {
384384
valueType="number"
385385
strongValue
386386
/>
387-
<TextOutput
388-
className={styles.metaItem}
389-
label={strings.peopleAssistedLabel}
390-
value={drefResponse?.num_assisted}
391-
suffix={strings.peopleSuffix}
392-
valueType="number"
393-
strongValue
394-
/>
395387
<TextOutput
396388
className={styles.metaItem}
397389
label={strings.eventOnsetLabel}
@@ -718,7 +710,7 @@ export function Component() {
718710
{drefResponse?.type_of_dref !== DREF_TYPE_ASSESSMENT && (
719711
<BlockTextOutput
720712
label={strings.womenLabel}
721-
value={drefResponse?.women}
713+
value={drefResponse?.assisted_num_of_women}
722714
valueType="number"
723715
strongValue
724716
/>
@@ -733,7 +725,7 @@ export function Component() {
733725
{drefResponse?.type_of_dref !== DREF_TYPE_ASSESSMENT && (
734726
<BlockTextOutput
735727
label={strings.girlsLabel}
736-
value={drefResponse?.girls}
728+
value={drefResponse?.assisted_num_of_girls_under_18}
737729
valueType="number"
738730
strongValue
739731
/>
@@ -748,7 +740,7 @@ export function Component() {
748740
{drefResponse?.type_of_dref !== DREF_TYPE_ASSESSMENT && (
749741
<BlockTextOutput
750742
label={strings.menLabel}
751-
value={drefResponse?.men}
743+
value={drefResponse?.assisted_num_of_men}
752744
valueType="number"
753745
strongValue
754746
/>
@@ -764,12 +756,21 @@ export function Component() {
764756
{drefResponse?.type_of_dref !== DREF_TYPE_ASSESSMENT && (
765757
<BlockTextOutput
766758
label={strings.boysLabel}
767-
value={drefResponse?.boys}
759+
value={drefResponse?.assisted_num_of_boys_under_18}
768760
valueType="number"
769761
strongValue
770762
/>
771763
)}
772764
<div className={styles.emptyBlock} />
765+
<BlockTextOutput
766+
className={styles.metaItem}
767+
label={strings.peopleAssistedLabel}
768+
value={drefResponse?.num_assisted}
769+
suffix={strings.peopleSuffix}
770+
valueType="number"
771+
strongValue
772+
/>
773+
<div className={styles.emptyBlock} />
773774
<BlockTextOutput
774775
label={strings.targetedPopulationLabel}
775776
value={drefResponse?.total_targeted_population}

app/src/views/DrefFinalReportForm/EventDetail/i18n.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
"drefFormEstimatedPeopleInNeed": "Estimated people in need (Optional)",
3030
"drefFormPeopleInNeed": "People in need (Optional)",
3131
"drefFormPeopleInNeedDescriptionImminent": "Include all those whose physical security, basic rights, dignity, living conditions or livelihoods are threatened or have been disrupted, and whose current level of access to basic services, goods and social protection will be inadequate to re-establish normal living conditions without additional assistance",
32-
"drefFormPeopleAssisted": "Number of people assisted",
33-
"drefFormPeopleAssistedDescription": "Include all those whose the National Society assisted",
3432
"drefFormPeopleInNeedDescriptionSlowSudden": "People in Need (PIN) are those members whose physical security, basic rights, dignity, living conditions or livelihoods are threatened or have been disrupted, and whose current level of access to basic services, goods and social protection is inadequate to re-establish normal living conditions without additional assistance.",
3533
"drefFormSourceInformationAddButton": "Add New Source Information",
3634
"drefFormSourceInformationTitle": "Source Information",

app/src/views/DrefFinalReportForm/EventDetail/index.tsx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ interface Props {
4545

4646
const totalPopulationRiskImminentLink = 'https://ifrcorg.sharepoint.com/sites/IFRCSharing/Shared%20Documents/Forms/AllItems.aspx?id=%2Fsites%2FIFRCSharing%2FShared%20Documents%2FDREF%2FHum%20Pop%20Definitions%20for%20DREF%20Form%5F21072022%2Epdf&parent=%2Fsites%2FIFRCSharing%2FShared%20Documents%2FDREF&p=true&ga=1';
4747
const totalPeopleAffectedSlowSuddenLink = 'https://ifrcorg.sharepoint.com/sites/IFRCSharing/Shared%20Documents/Forms/AllItems.aspx?id=%2Fsites%2FIFRCSharing%2FShared%20Documents%2FDREF%2FHum%20Pop%20Definitions%20for%20DREF%20Form%5F21072022%2Epdf&parent=%2Fsites%2FIFRCSharing%2FShared%20Documents%2FDREF&p=true&ga=1';
48-
const peopleTargetedLink = 'https://ifrcorg.sharepoint.com/sites/IFRCSharing/Shared%20Documents/Forms/AllItems.aspx?id=%2Fsites%2FIFRCSharing%2FShared%20Documents%2FDREF%2FHum%20Pop%20Definitions%20for%20DREF%20Form%5F21072022%2Epdf&parent=%2Fsites%2FIFRCSharing%2FShared%20Documents%2FDREF&p=true&ga=1';
4948
const peopleInNeedLink = 'https://ifrcorg.sharepoint.com/sites/IFRCSharing/Shared%20Documents/Forms/AllItems.aspx?id=%2Fsites%2FIFRCSharing%2FShared%20Documents%2FDREF%2FHum%20Pop%20Definitions%20for%20DREF%20Form%5F21072022%2Epdf&parent=%2Fsites%2FIFRCSharing%2FShared%20Documents%2FDREF&p=true&ga=1';
5049

5150
function EventDetail(props: Props) {
@@ -217,28 +216,6 @@ function EventDetail(props: Props) {
217216
error={error?.estimated_number_of_affected_boys_under_18}
218217
disabled={disabled}
219218
/>
220-
<NumberInput
221-
label={(
222-
<>
223-
{strings.drefFormPeopleAssisted}
224-
<Link
225-
title={strings.drefFormClickEmergencyResponseFramework}
226-
href={peopleTargetedLink}
227-
external
228-
>
229-
<WikiHelpSectionLineIcon />
230-
</Link>
231-
</>
232-
)}
233-
name="num_assisted"
234-
value={value?.num_assisted}
235-
onChange={setFieldValue}
236-
error={error?.num_assisted}
237-
hint={strings.drefFormPeopleAssistedDescription}
238-
disabled={disabled}
239-
/>
240-
{/* NOTE: Empty div to preserve the layout */}
241-
<div />
242219
</InputSection>
243220
<InputSection
244221
title={

app/src/views/DrefFinalReportForm/Operation/i18n.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@
5151
"drefChildSafeguardingRiskAnalysisDescription":"Q&A Child Safeguarding Risk Analysis",
5252
"drefFormSelectionCriteria": "Explain the selection criteria for the targeted population",
5353
"drefFormSelectionCriteriaDescription": "Explain the rational and logic behind which groups are being targeted and why and address vulnerable groups",
54-
"drefFormTargetedPopulation": "Targeted Population",
54+
"drefFormTargetedPopulation": "Assisted Population",
5555
"drefFormTargetingStrategy": "Targeting Strategy",
5656
"drefFormTotal": "Total Population",
57-
"drefFormWomen": "Women",
57+
"drefFormWomen": "Assisted Women",
5858
"drefFormResponseAddButton": "Add",
59-
"drefFormAssistedPopulation": "Total Targeted Population",
60-
"drefFormBoys": "Boys (under 18)",
59+
"drefFormAssistedPopulation": "Total Assisted Population",
60+
"drefFormBoys": "Assisted Boys (under 18)",
6161
"drefFormBudgetTemplateLabel": "Budget template",
6262
"drefFormOperationDescription": "Description",
6363
"drefFormEstimatedDisplacedPeople": "Estimated Number of People on the move (if any)",
@@ -66,7 +66,7 @@
6666
"drefFormEstimatedUrban": "Urban",
6767
"drefFormEstimatePeopleDisability": "Estimated Percentage People with Disability",
6868
"drefFormEstimateResponse": "Estimate",
69-
"drefFormGirls": "Girls (under 18)",
69+
"drefFormGirls": "Assisted Girls (under 18)",
7070
"drefFormInterventionsLabel": "Select the interventions that apply.",
7171
"finalReportTotalAllocation": "Total DREF Allocation",
7272
"drefFinalReportRequestAmountDescription": "General funding requested to fund the interventions. List specific activities that will be carried out as part of the intervention in each sector. The activities should directly address the identified needs and align with the operation’s strategic objectives.",
@@ -77,7 +77,10 @@
7777
"drefFinalReportRequestAmountDescriptionPoint4": "Consider the type of indicator unit. For example, it’s often simpler and clearer to track and report on the “number of people” rather than a “percentage of people.”",
7878
"drefFinalReportRequestAmountDescriptionPoint5": "For each indicator, set a target. This helps track progress and measure whether the operation is achieving its key objectives, making it easier to report results later on.",
7979
"drefFormUploadTargetingSupportingDescription": "Financial report file types: pdf",
80-
"drefFormMen": "Men",
81-
"drefFinalReportTotalTargeted": "Total targeted population is not equal to sum of other population fields"
80+
"drefFormMen": "Assisted Men",
81+
"drefFormPeopleAssistedDescription": "Include all those whose the National Society assisted",
82+
"drefFormPeopleAssisted": "Total population assisted",
83+
"drefFormOperationClickEmergencyResponseFramework": "Click to view Emergency Response Framework",
84+
"drefFinalReportTotalTargeted": "Total assisted population is not equal to sum of other population fields"
8285
}
8386
}

app/src/views/DrefFinalReportForm/Operation/index.tsx

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import {
33
useMemo,
44
useState,
55
} from 'react';
6-
import { ErrorWarningFillIcon } from '@ifrc-go/icons';
6+
import {
7+
ErrorWarningFillIcon,
8+
WikiHelpSectionLineIcon,
9+
} from '@ifrc-go/icons';
710
import {
811
BooleanInput,
912
Button,
@@ -60,6 +63,8 @@ function plannedInterventionKeySelector(option: PlannedInterventionOption) {
6063
return option.key;
6164
}
6265

66+
const peopleTargetedLink = 'https://ifrcorg.sharepoint.com/sites/IFRCSharing/Shared%20Documents/Forms/AllItems.aspx?id=%2Fsites%2FIFRCSharing%2FShared%20Documents%2FDREF%2FHum%20Pop%20Definitions%20for%20DREF%20Form%5F21072022%2Epdf&parent=%2Fsites%2FIFRCSharing%2FShared%20Documents%2FDREF&p=true&ga=1';
67+
6368
interface Props {
6469
value: Value;
6570
setFieldValue: (...entries: EntriesAsList<Value>) => void;
@@ -123,29 +128,29 @@ function Operation(props: Props) {
123128
}, [setFieldValue, setSelectedIntervention]);
124129

125130
const warnings = useMemo(() => {
126-
if (isNotDefined(value?.total_targeted_population)) {
131+
if (isNotDefined(value?.num_assisted)) {
127132
return [];
128133
}
129134

130135
const w = [];
131136

132137
if (sumSafe([
133-
value?.women,
134-
value?.men,
135-
value?.girls,
136-
value?.boys,
137-
]) !== value?.total_targeted_population) {
138+
value?.assisted_num_of_women,
139+
value?.assisted_num_of_men,
140+
value?.assisted_num_of_girls_under_18,
141+
value?.assisted_num_of_boys_under_18,
142+
]) !== value?.num_assisted) {
138143
w.push(strings.drefFinalReportTotalTargeted);
139144
}
140145

141146
return w;
142147
}, [
143148
strings.drefFinalReportTotalTargeted,
144-
value?.women,
145-
value?.men,
146-
value?.girls,
147-
value?.boys,
148-
value?.total_targeted_population,
149+
value?.assisted_num_of_women,
150+
value?.assisted_num_of_men,
151+
value?.assisted_num_of_girls_under_18,
152+
value?.assisted_num_of_boys_under_18,
153+
value?.num_assisted,
149154
]);
150155

151156
const interventionMap = useMemo(() => (
@@ -328,38 +333,60 @@ function Operation(props: Props) {
328333
<>
329334
<NumberInput
330335
label={strings.drefFormWomen}
331-
name="women"
332-
value={value.women}
336+
name="assisted_num_of_women"
337+
value={value.assisted_num_of_women}
333338
onChange={setFieldValue}
334-
error={error?.women}
339+
error={error?.assisted_num_of_women}
335340
disabled={disabled}
336341
/>
337342
<NumberInput
338343
label={strings.drefFormMen}
339-
name="men"
340-
value={value.men}
344+
name="assisted_num_of_men"
345+
value={value.assisted_num_of_men}
341346
onChange={setFieldValue}
342-
error={error?.men}
347+
error={error?.assisted_num_of_men}
343348
disabled={disabled}
344349
/>
345350
<NumberInput
346351
label={strings.drefFormGirls}
347-
name="girls"
348-
value={value.girls}
352+
name="assisted_num_of_girls_under_18"
353+
value={value.assisted_num_of_girls_under_18}
349354
onChange={setFieldValue}
350-
error={error?.girls}
355+
error={error?.assisted_num_of_girls_under_18}
351356
disabled={disabled}
352357
/>
353358
<NumberInput
354359
label={strings.drefFormBoys}
355-
name="boys"
356-
value={value.boys}
360+
name="assisted_num_of_boys_under_18"
361+
value={value.assisted_num_of_boys_under_18}
357362
onChange={setFieldValue}
358363
error={error?.boys}
359364
disabled={disabled}
360365
/>
361366
</>
362367
)}
368+
<NumberInput
369+
label={(
370+
<>
371+
{strings.drefFormPeopleAssisted}
372+
<Link
373+
title={strings.drefFormOperationClickEmergencyResponseFramework}
374+
href={peopleTargetedLink}
375+
external
376+
>
377+
<WikiHelpSectionLineIcon />
378+
</Link>
379+
</>
380+
)}
381+
name="num_assisted"
382+
value={value?.num_assisted}
383+
onChange={setFieldValue}
384+
error={error?.num_assisted}
385+
hint={strings.drefFormPeopleAssistedDescription}
386+
disabled={disabled}
387+
/>
388+
{/* NOTE: Empty div to preserve the layout */}
389+
<div />
363390
<NumberInput
364391
label={strings.drefFormTotal}
365392
name="total_targeted_population"

0 commit comments

Comments
 (0)