Skip to content

Commit 27bb74d

Browse files
authored
Merge pull request #511 from IFRCGo/fix/date-of-approximate
Fix condition for approximate date of impact
2 parents 52cf3ec + b468fbb commit 27bb74d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/views/DrefApplicationExport/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,13 @@ export function Component() {
181181
const eventDateDefined = drefResponse?.type_of_dref !== DREF_TYPE_IMMINENT
182182
&& isDefined(drefResponse?.event_date);
183183
const eventTextDefined = drefResponse?.type_of_dref === DREF_TYPE_IMMINENT
184-
&& isDefined(drefResponse?.event_text);
184+
&& isTruthyString(drefResponse?.event_text?.trim());
185185
const showEventDescriptionSection = eventDescriptionDefined
186186
|| eventScopeDefined
187187
|| imagesFileDefined
188188
|| anticipatoryActionsDefined
189-
|| eventDateDefined
190189
|| eventTextDefined
190+
|| eventDateDefined
191191
|| isDefined(drefResponse?.event_map_file?.file);
192192

193193
const lessonsLearnedDefined = isTruthyString(drefResponse?.lessons_learned?.trim());
@@ -485,7 +485,7 @@ export function Component() {
485485
{eventTextDefined && (
486486
<Container heading={strings.approximateDateOfImpactHeading}>
487487
<DescriptionText>
488-
{drefResponse.event_text}
488+
{drefResponse?.event_text}
489489
</DescriptionText>
490490
</Container>
491491
)}

src/views/DrefFinalReportExport/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export function Component() {
149149
const eventDateDefined = drefResponse?.type_of_dref !== DREF_TYPE_IMMINENT
150150
&& isDefined(drefResponse?.event_date);
151151
const eventTextDefined = drefResponse?.type_of_dref === DREF_TYPE_IMMINENT
152-
&& isDefined(drefResponse?.event_text);
152+
&& isTruthyString(drefResponse?.event_text?.trim());
153153
const showEventDescriptionSection = eventDescriptionDefined
154154
|| eventScopeDefined
155155
|| imagesFileDefined

src/views/DrefOperationalUpdateExport/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export function Component() {
167167
const eventDateDefined = drefResponse?.type_of_dref !== DREF_TYPE_IMMINENT
168168
&& isDefined(drefResponse?.event_date);
169169
const eventTextDefined = drefResponse?.type_of_dref === DREF_TYPE_IMMINENT
170-
&& isDefined(drefResponse?.event_text);
170+
&& isDefined(drefResponse?.event_text?.trim());
171171
const anticipatoryActionsDefined = drefResponse?.type_of_dref === DREF_TYPE_IMMINENT
172172
&& isTruthyString(drefResponse?.anticipatory_actions?.trim());
173173
const showEventDescriptionSection = eventDescriptionDefined

0 commit comments

Comments
 (0)