Skip to content

Commit 7ce11d0

Browse files
committed
Fix label for slow and sudden onset
1 parent df338b1 commit 7ce11d0

File tree

7 files changed

+28
-6
lines changed

7 files changed

+28
-6
lines changed

src/utils/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ export const DREF_TYPE_ASSESSMENT = 1 satisfies TypeOfDrefEnum;
9797
export const DREF_TYPE_RESPONSE = 2 satisfies TypeOfDrefEnum;
9898
export const DREF_TYPE_LOAN = 3 satisfies TypeOfDrefEnum;
9999

100+
type TypeOfOnsetEnum = components<'read'>['schemas']['TypeValidatedEnum'];
101+
export const ONSET_SLOW = 1 satisfies TypeOfOnsetEnum;
102+
100103
// Subscriptions
101104
type SubscriptionRecordTypeEnum = components<'read'>['schemas']['RtypeEnum'];
102105
export const SUBSCRIPTION_SURGE_ALERT = 3 satisfies SubscriptionRecordTypeEnum;

src/views/DrefApplicationExport/i18n.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"eventDescriptionSectionHeading": "Description of the Event",
2626
"approximateDateOfImpactHeading": "Approximate date of impact",
2727
"whatWhereWhenSectionHeading": "What happened, where and when?",
28-
"dateWhenTheTriggerWasMetHeading": "Date of event / Date when the trigger was met",
28+
"dateOfEventSlowHeading": "Date of event",
29+
"dateWhenTriggerWasMetHeading": "Date when the trigger was met",
2930
"situationUpdateSectionHeading": "Provide any updates in the situation since the field report and explain what is expected to happen.",
3031
"anticipatoryActionsHeading": "Why your National Society is acting now and what criteria is used to launch this operation.",
3132
"scopeAndScaleSectionHeading": "Scope and Scale",

src/views/DrefApplicationExport/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
DISASTER_CATEGORY_YELLOW,
2424
DREF_TYPE_ASSESSMENT,
2525
DREF_TYPE_IMMINENT,
26+
ONSET_SLOW,
2627
DisasterCategory,
2728
} from '#utils/constants';
2829
import {
@@ -489,7 +490,11 @@ export function Component() {
489490
</Container>
490491
)}
491492
{eventDateDefined && (
492-
<Container heading={strings.dateWhenTheTriggerWasMetHeading}>
493+
<Container
494+
heading={drefResponse?.type_of_onset === ONSET_SLOW
495+
? strings.dateWhenTriggerWasMetHeading
496+
: strings.dateOfEventSlowHeading}
497+
>
493498
<DateOutput
494499
value={drefResponse?.event_date}
495500
/>

src/views/DrefFinalReportExport/i18n.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@
2626
"targetedAreasLabel": "Targeted Areas",
2727
"eventDescriptionSectionHeading": "Description of the Event",
2828
"approximateDateOfImpactHeading": "Approximate date of impact",
29-
"dateWhenTheTriggerWasMetHeading": "Date of event / Date when the trigger was met",
3029
"whatWhereWhenSectionHeading": "What happened, where and when?",
30+
"dateOfEventSlowHeading": "Date of event",
31+
"dateWhenTriggerWasMetHeading": "Date when the trigger was met",
32+
3133
"situationUpdateSectionHeading": "Provide any updates in the situation since the field report and explain what is expected to happen.",
3234
"anticipatoryActionsHeading": "Why your National Society is acting now and what criteria is used to launch this operation.",
3335
"scopeAndScaleSectionHeading": "Scope and Scale",

src/views/DrefFinalReportExport/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
DREF_TYPE_ASSESSMENT,
2727
DREF_TYPE_IMMINENT,
2828
DisasterCategory,
29+
ONSET_SLOW,
2930
} from '#utils/constants';
3031
import {
3132
identifiedNeedsAndGapsOrder,
@@ -409,7 +410,11 @@ export function Component() {
409410
</Container>
410411
)}
411412
{eventDateDefined && (
412-
<Container heading={strings.dateWhenTheTriggerWasMetHeading}>
413+
<Container
414+
heading={drefResponse?.type_of_onset === ONSET_SLOW
415+
? strings.dateWhenTriggerWasMetHeading
416+
: strings.dateOfEventSlowHeading}
417+
>
413418
<DateOutput
414419
value={drefResponse?.event_date}
415420
/>

src/views/DrefOperationalUpdateExport/i18n.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"anticipatoryActionsHeading": "Why your National Society is acting now and what criteria is used to launch this operation.",
3131
"scopeAndScaleSectionHeading": "Scope and Scale",
3232
"approximateDateOfImpactHeading": "Approximate date of impact",
33-
"dateWhenTheTriggerWasMetHeading": "Date of event / Date when the trigger was met",
33+
"dateOfEventSlowHeading": "Date of event",
34+
"dateWhenTriggerWasMetHeading": "Date when the trigger was met",
3435

3536
"summaryOfChangesSectionHeading": "Summary of Changes",
3637
"changingTimeFrameLabel":"Are you changing the timeframe of the operation",

src/views/DrefOperationalUpdateExport/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
DISASTER_CATEGORY_YELLOW,
2626
DREF_TYPE_ASSESSMENT,
2727
DREF_TYPE_IMMINENT,
28+
ONSET_SLOW,
2829
DisasterCategory,
2930
} from '#utils/constants';
3031
import {
@@ -472,7 +473,11 @@ export function Component() {
472473
</Container>
473474
)}
474475
{eventDateDefined && (
475-
<Container heading={strings.dateWhenTheTriggerWasMetHeading}>
476+
<Container
477+
heading={drefResponse?.type_of_onset === ONSET_SLOW
478+
? strings.dateWhenTriggerWasMetHeading
479+
: strings.dateOfEventSlowHeading}
480+
>
476481
<DateOutput
477482
value={drefResponse?.event_date}
478483
/>

0 commit comments

Comments
 (0)