Skip to content

Commit 767e4ef

Browse files
committed
feat(emergency): add last updated date for crisis categorization
1 parent 51a9510 commit 767e4ef

File tree

4 files changed

+44
-7
lines changed

4 files changed

+44
-7
lines changed

app/src/components/domain/HighlightedOperations/OperationCard/index.tsx

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ function OperationCard(props: Props) {
5454
id,
5555
name,
5656
ifrc_severity_level,
57+
ifrc_severity_level_update_date,
5758
ifrc_severity_level_display,
5859
updated_at,
5960
appeals,
@@ -139,15 +140,26 @@ function OperationCard(props: Props) {
139140
<Tooltip
140141
description={(
141142
<>
142-
<TextOutput
143-
label={(
144-
<SeverityIndicator
145-
level={ifrc_severity_level}
143+
<div className={styles.severityContainer}>
144+
<TextOutput
145+
label={(
146+
<SeverityIndicator
147+
level={ifrc_severity_level}
148+
/>
149+
)}
150+
value={ifrc_severity_level_display}
151+
withoutLabelColon
152+
/>
153+
{ifrc_severity_level_update_date && ','}
154+
{ifrc_severity_level_update_date && (
155+
<TextOutput
156+
className={styles.date}
157+
value={ifrc_severity_level_update_date}
158+
valueType="date"
159+
withoutLabelColon
146160
/>
147161
)}
148-
value={ifrc_severity_level_display}
149-
withoutLabelColon
150-
/>
162+
</div>
151163
<TextOutput
152164
label={<FocusLineIcon />}
153165
value={countriesInfoDisplay}

app/src/components/domain/HighlightedOperations/OperationCard/styles.module.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,12 @@
4040
}
4141
}
4242
}
43+
44+
.severity-container {
45+
display: flex;
46+
47+
.date {
48+
padding-left: var(--go-ui-spacing-xs);
49+
}
50+
}
51+

app/src/views/EmergencyDetails/i18n.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"situationalOverviewTitle": "Situational Overview",
1515
"linksTitle": "Links",
1616
"emergencyMapTitle": "Affected Provinces",
17+
"severityLevelUpdateDateLabel": "Updated date",
1718
"exportMap": "Export",
1819
"contactsTitle": "Contacts",
1920
"sourceLabel": "Source {source}"

app/src/views/EmergencyDetails/index.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useOutletContext } from 'react-router-dom';
33
import {
44
Container,
55
HtmlOutput,
6+
InfoPopup,
67
KeyFigure,
78
TextOutput,
89
} from '@ifrc-go/ui';
@@ -193,6 +194,20 @@ export function Component() {
193194
<SeverityIndicator
194195
level={emergencyResponse.ifrc_severity_level}
195196
/>
197+
{emergencyResponse.ifrc_severity_level_update_date && (
198+
<InfoPopup
199+
description={(
200+
<TextOutput
201+
label={strings.severityLevelUpdateDateLabel}
202+
value={
203+
emergencyResponse
204+
.ifrc_severity_level_update_date
205+
}
206+
valueType="date"
207+
/>
208+
)}
209+
/>
210+
)}
196211
</>
197212
)}
198213
valueClassName={styles.disasterCategoryValue}

0 commit comments

Comments
 (0)