Skip to content

Commit

Permalink
Added missing alert type in the event details for GDACS
Browse files Browse the repository at this point in the history
  • Loading branch information
roshni73 committed Jan 11, 2024
1 parent c5a9b75 commit b37ee3e
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/Alert/i18n.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"namespace": "common",
"strings": {
"alertCopyErrorDetails": "Copy error details",
"CopyErrorDetails": "Copy error details",
"closeButtonTitle": "Close"
}
}
1 change: 1 addition & 0 deletions src/components/Alert/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ function Alert<N extends string>(props: Props<N>) {
onClick={handleCopyDebugMessageButtonClick}
variant="tertiary-on-dark"
>
{/* FIXME: there is string in json file */}
{strings.alertCopyErrorDetails}
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"eventPopulationLabel": "Population exposed",
"eventPeopleAffectedLabel": "People affected",
"eventImpactLabel": "Impact",
"eventSeverityLabel": "Severity"
"eventSeverityLabel": "Severity",
"eventAlertType": "Alert Type"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ interface GdacsEventDetails {
iso3: string;
countryname: string;
}[];
alert_sent?: boolean;
alert_level?: 'Red' | 'Orange' | 'Green' | 'Cones' | null;
alertlevel?: string;
alertscore?: number;
country?: string;
Expand Down Expand Up @@ -55,7 +57,6 @@ interface GdacsEventDetails {
geometry?: string;
},
}

interface GdacsPopulationExposure {
death?: number;
displaced?: number;
Expand Down Expand Up @@ -153,6 +154,12 @@ function EventDetails(props: Props) {
value={eventDetails?.severitydata?.severitytext}
/>
)}
{isDefined(eventDetails?.alertlevel) && (
<TextOutput
label={strings.eventAlertType}
value={eventDetails?.alertlevel}
/>
)}
</div>
{isDefined(eventDetails)
&& isDefined(eventDetails.url)
Expand Down
1 change: 1 addition & 0 deletions src/components/domain/RiskImminentEvents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type BaseProps = {
title: React.ReactNode;
bbox: LngLatBoundsLike | undefined;
defaultSource?: ImminentEventSource;
alertType?:string;
}

type Props = BaseProps & ({
Expand Down
2 changes: 1 addition & 1 deletion src/views/Emergencies/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function Component() {
query: {
model_type: 'event',
unit: 'month',
start_date: encodeDate(oneYearAgo),
start_date: encodeDate(thirtyDaysAgo),
} as never,
});

Expand Down
2 changes: 0 additions & 2 deletions src/views/RegionRiskWatchImminent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import getBbox from '@turf/bbox';

import RiskImminentEvents from '#components/domain/RiskImminentEvents';
import { RegionOutletContext } from '#utils/outletContext';

import styles from './styles.module.css';

// TODO: Add historic data chart
Expand All @@ -17,7 +16,6 @@ export function Component() {
() => (regionResponse ? getBbox(regionResponse.bbox) : undefined),
[regionResponse],
);

return (
<div className={styles.regionImminentRiskWatch}>
{regionResponse && (
Expand Down

0 comments on commit b37ee3e

Please sign in to comment.