From d85f64d305429ed7ca801ec32ea66a6856d969d1 Mon Sep 17 00:00:00 2001 From: tnagorra Date: Thu, 7 Nov 2024 14:36:36 +0545 Subject: [PATCH 01/17] Hide WFPAdam in RiskWatch on production - Show exposure control only for GDACs source --- .changeset/swift-humans-occur.md | 8 +++ .../LayerOptions/index.tsx | 45 ++++++++------- .../domain/RiskImminentEventMap/index.tsx | 7 +++ .../domain/RiskImminentEvents/Gdacs/index.tsx | 1 + .../RiskImminentEvents/MeteoSwiss/index.tsx | 1 + .../domain/RiskImminentEvents/Pdc/index.tsx | 1 + .../RiskImminentEvents/WfpAdam/index.tsx | 1 + .../domain/RiskImminentEvents/index.tsx | 56 ++++++++++--------- 8 files changed, 73 insertions(+), 47 deletions(-) create mode 100644 .changeset/swift-humans-occur.md diff --git a/.changeset/swift-humans-occur.md b/.changeset/swift-humans-occur.md new file mode 100644 index 0000000000..91670298ac --- /dev/null +++ b/.changeset/swift-humans-occur.md @@ -0,0 +1,8 @@ +--- +"go-web-app": patch +--- + +Update Imminent Events + +- Hide WFP ADAM temporarily from list sources +- Show exposure control for cyclones from GDACS only diff --git a/app/src/components/domain/RiskImminentEventMap/LayerOptions/index.tsx b/app/src/components/domain/RiskImminentEventMap/LayerOptions/index.tsx index fb9a4837b1..8ca7ba3196 100644 --- a/app/src/components/domain/RiskImminentEventMap/LayerOptions/index.tsx +++ b/app/src/components/domain/RiskImminentEventMap/LayerOptions/index.tsx @@ -43,10 +43,13 @@ function colorSelector(item: SeverityLegendItem) { interface Props { value: LayerOptionsValue; onChange: React.Dispatch>; + + exposureAreaControlHidden?: boolean; } function LayerOptions(props: Props) { const { + exposureAreaControlHidden, value, onChange, } = props; @@ -92,28 +95,30 @@ function LayerOptions(props: Props) { withBackground withInvertedView /> -
- - {value.showExposedArea && ( - + - )} -
+ {value.showExposedArea && ( + + )} + + )} { type Footprint = GeoJSON.FeatureCollection | undefined; +// FIXME: read this from common type +export type ImminentEventSource = 'pdc' | 'wfpAdam' | 'gdacs' | 'meteoSwiss'; + interface Props { + source: ImminentEventSource; events: EVENT[] | undefined; keySelector: (event: EVENT) => KEY; hazardTypeSelector: (event: EVENT) => HazardType | '' | undefined; @@ -134,6 +138,7 @@ function RiskImminentEventMap< bbox, onActiveEventChange, activeEventExposurePending, + source, } = props; const strings = useTranslation(i18n); @@ -473,6 +478,8 @@ function RiskImminentEventMap< {hazardTypeSelector(activeEvent) === 'TC' && ( )} diff --git a/app/src/components/domain/RiskImminentEvents/Gdacs/index.tsx b/app/src/components/domain/RiskImminentEvents/Gdacs/index.tsx index 49f5bd3c13..60caa76c10 100644 --- a/app/src/components/domain/RiskImminentEvents/Gdacs/index.tsx +++ b/app/src/components/domain/RiskImminentEvents/Gdacs/index.tsx @@ -265,6 +265,7 @@ function Gdacs(props: Props) { return ( )} /> - - {strings.here} - - ), - }, - )} - /> - )} - /> + {environment !== 'production' && ( + + {strings.here} + + ), + }, + )} + /> + )} + /> + )} Date: Thu, 7 Nov 2024 18:55:29 +0545 Subject: [PATCH 02/17] v7.6.4-hotfix --- .changeset/swift-humans-occur.md | 8 -------- app/CHANGELOG.md | 9 +++++++++ app/package.json | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) delete mode 100644 .changeset/swift-humans-occur.md diff --git a/.changeset/swift-humans-occur.md b/.changeset/swift-humans-occur.md deleted file mode 100644 index 91670298ac..0000000000 --- a/.changeset/swift-humans-occur.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"go-web-app": patch ---- - -Update Imminent Events - -- Hide WFP ADAM temporarily from list sources -- Show exposure control for cyclones from GDACS only diff --git a/app/CHANGELOG.md b/app/CHANGELOG.md index b35e83bd2f..c02e7f9a10 100644 --- a/app/CHANGELOG.md +++ b/app/CHANGELOG.md @@ -1,5 +1,14 @@ # go-web-app +## 7.6.4 + +### Patch Changes + +- d85f64d: Update Imminent Events + + - Hide WFP ADAM temporarily from list sources + - Show exposure control for cyclones from GDACS only + ## 7.6.3 ### Patch Changes diff --git a/app/package.json b/app/package.json index 819902edd4..f23c9be3b5 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "go-web-app", - "version": "7.6.3", + "version": "7.6.4", "type": "module", "private": true, "license": "MIT", From a2eece29400169aa38e2e3c65051f900c4849c74 Mon Sep 17 00:00:00 2001 From: tnagorra Date: Tue, 12 Nov 2024 16:23:37 +0545 Subject: [PATCH 03/17] Fix issues on dref import and imminent risk map - Update labels for severity control - Green -> 60 km/h - Orange -> 90 km/h - Red -> 120 km/h - Update how event details is shown - Previously, we had a navigation system - Now, we have exandable container - Fix issue related to richtext and excel - Filtered out empty text items - Fix issue with injecting client id - We were injecting clientId instead of client_id - We were not injecting clientId if keyFieldName was defined --- app/scripts/translatte/main.ts | 1 - .../LayerOptions/index.tsx | 8 +- .../domain/RiskImminentEventMap/i18n.json | 1 - .../domain/RiskImminentEventMap/index.tsx | 100 +++++++++--------- .../Gdacs/EventDetails/i18n.json | 1 - .../Gdacs/EventDetails/index.tsx | 11 -- .../Gdacs/EventListItem/i18n.json | 2 +- .../Gdacs/EventListItem/index.tsx | 80 ++++++++++---- .../MeteoSwiss/EventDetails/i18n.json | 2 - .../MeteoSwiss/EventDetails/index.tsx | 29 ----- .../MeteoSwiss/EventListItem/i18n.json | 2 +- .../MeteoSwiss/EventListItem/index.tsx | 80 ++++++++++---- .../Pdc/EventDetails/i18n.json | 1 - .../Pdc/EventDetails/index.tsx | 11 -- .../Pdc/EventListItem/i18n.json | 2 +- .../Pdc/EventListItem/index.tsx | 80 ++++++++++---- .../WfpAdam/EventDetails/i18n.json | 1 - .../WfpAdam/EventDetails/index.tsx | 12 --- .../WfpAdam/EventListItem/i18n.json | 2 +- .../WfpAdam/EventListItem/index.tsx | 80 ++++++++++---- app/src/utils/importTemplate.ts | 6 +- app/src/utils/richText.ts | 4 +- .../DistrictMap/DistrictMapModal/index.tsx | 3 - 23 files changed, 294 insertions(+), 225 deletions(-) diff --git a/app/scripts/translatte/main.ts b/app/scripts/translatte/main.ts index cdedb2c371..fd657ec75c 100644 --- a/app/scripts/translatte/main.ts +++ b/app/scripts/translatte/main.ts @@ -112,7 +112,6 @@ yargs(hideBin(process.argv)) }); }, async (argv) => { - console.warn(argv); await applyMigrations( currentDir, argv.SOURCE_FILE as string, diff --git a/app/src/components/domain/RiskImminentEventMap/LayerOptions/index.tsx b/app/src/components/domain/RiskImminentEventMap/LayerOptions/index.tsx index 8ca7ba3196..48847833dc 100644 --- a/app/src/components/domain/RiskImminentEventMap/LayerOptions/index.tsx +++ b/app/src/components/domain/RiskImminentEventMap/LayerOptions/index.tsx @@ -57,20 +57,22 @@ function LayerOptions(props: Props) { const setFieldValue = useSetFieldValue(onChange); // FIXME: use strings + // FIXME: These are hard-coded for Gdacs source. + // Currently we are only showing severity control for Gdacs const severityLegendItems = useMemo(() => ([ { severity: 'green', - label: 'Green', + label: '60 km/h', color: COLOR_GREEN, }, { severity: 'orange', - label: 'Orange', + label: '90 km/h', color: COLOR_ORANGE, }, { severity: 'red', - label: 'Red', + label: '120 km/h', color: COLOR_RED, }, { diff --git a/app/src/components/domain/RiskImminentEventMap/i18n.json b/app/src/components/domain/RiskImminentEventMap/i18n.json index fdff7f56fd..4749ffc7ac 100644 --- a/app/src/components/domain/RiskImminentEventMap/i18n.json +++ b/app/src/components/domain/RiskImminentEventMap/i18n.json @@ -2,7 +2,6 @@ "namespace": "common", "strings": { "riskImminentEventsMap": "Risk Imminent Events Map", - "backToEventsLabel": "Back to events", "emptyImminentEventMessage": "No imminent event forecasted" } } diff --git a/app/src/components/domain/RiskImminentEventMap/index.tsx b/app/src/components/domain/RiskImminentEventMap/index.tsx index f33510d8df..f02d6af158 100644 --- a/app/src/components/domain/RiskImminentEventMap/index.tsx +++ b/app/src/components/domain/RiskImminentEventMap/index.tsx @@ -3,9 +3,7 @@ import { useMemo, useState, } from 'react'; -import { ChevronLeftLineIcon } from '@ifrc-go/icons'; import { - Button, Container, List, } from '@ifrc-go/ui'; @@ -86,8 +84,10 @@ export type EventPointFeature = GeoJSON.Feature { data: EVENT; + expanded: boolean; onExpandClick: (eventId: number | string) => void; className?: string; + children?: React.ReactNode; } export interface RiskEventDetailProps { @@ -243,10 +243,15 @@ function RiskImminentEventMap< (eventId: string | number | undefined) => { const eventIdSafe = eventId as KEY | undefined; - setActiveEventId(eventIdSafe); - onActiveEventChange(eventIdSafe); + if (activeEventId === eventIdSafe) { + setActiveEventId(undefined); + onActiveEventChange(undefined); + } else { + setActiveEventId(eventIdSafe); + onActiveEventChange(eventIdSafe); + } }, - [onActiveEventChange], + [onActiveEventChange, activeEventId], ); const handlePointClick = useCallback( @@ -258,17 +263,44 @@ function RiskImminentEventMap< [setActiveEventIdSafe], ); + const DetailComponent = detailRenderer; + const eventListRendererParams = useCallback( (_: string | number, event: EVENT): RiskEventListItemProps => ({ data: event, onExpandClick: setActiveEventIdSafe, + expanded: activeEventId === keySelector(event), className: styles.riskEventListItem, + children: activeEventId === keySelector(event) && ( + + {hazardTypeSelector(event) === 'TC' && ( + + )} + + ), }), - [setActiveEventIdSafe], + [ + setActiveEventIdSafe, + activeEventExposure, + activeEventExposurePending, + layerOptions, + hazardTypeSelector, + DetailComponent, + activeEventId, + keySelector, + source, + ], ); - const DetailComponent = detailRenderer; - const [loadedIcons, setLoadedIcons] = useState>({}); const handleIconLoad = useCallback( @@ -443,48 +475,18 @@ function RiskImminentEventMap< withInternalPadding childrenContainerClassName={styles.content} spacing="cozy" - actions={isDefined(activeEventId) && ( - - )} > - {isNotDefined(activeEventId) && ( - - )} - {isDefined(activeEvent) && ( - - {hazardTypeSelector(activeEvent) === 'TC' && ( - - )} - - )} + ); diff --git a/app/src/components/domain/RiskImminentEvents/Gdacs/EventDetails/i18n.json b/app/src/components/domain/RiskImminentEvents/Gdacs/EventDetails/i18n.json index ddcd9c1f75..418693af3f 100644 --- a/app/src/components/domain/RiskImminentEvents/Gdacs/EventDetails/i18n.json +++ b/app/src/components/domain/RiskImminentEvents/Gdacs/EventDetails/i18n.json @@ -1,7 +1,6 @@ { "namespace": "common", "strings": { - "eventStartOnLabel": "Started on", "eventMoreDetailsLink": "More Details", "eventSourceLabel": "Forecast provider", "eventDeathLabel": "Estimated deaths", diff --git a/app/src/components/domain/RiskImminentEvents/Gdacs/EventDetails/index.tsx b/app/src/components/domain/RiskImminentEvents/Gdacs/EventDetails/index.tsx index e4b3906b1d..c8d6a488d2 100644 --- a/app/src/components/domain/RiskImminentEvents/Gdacs/EventDetails/index.tsx +++ b/app/src/components/domain/RiskImminentEvents/Gdacs/EventDetails/index.tsx @@ -70,8 +70,6 @@ type Props = RiskEventDetailProps; function EventDetails(props: Props) { const { data: { - hazard_name, - start_date, event_details, }, exposure, @@ -87,16 +85,7 @@ function EventDetails(props: Props) { return ( - )} withBorderAndHeaderBackground pending={pending} > diff --git a/app/src/components/domain/RiskImminentEvents/Gdacs/EventListItem/i18n.json b/app/src/components/domain/RiskImminentEvents/Gdacs/EventListItem/i18n.json index 05c98dbe01..a834b17335 100644 --- a/app/src/components/domain/RiskImminentEvents/Gdacs/EventListItem/i18n.json +++ b/app/src/components/domain/RiskImminentEvents/Gdacs/EventListItem/i18n.json @@ -1,7 +1,7 @@ { "namespace": "common", "strings": { - "gdacsEventViewDetails": "View Details", + "gdacsEventViewDetails": "View / Hide Details", "gdacsEventStartedOn": "Started On" } } diff --git a/app/src/components/domain/RiskImminentEvents/Gdacs/EventListItem/index.tsx b/app/src/components/domain/RiskImminentEvents/Gdacs/EventListItem/index.tsx index c20a9d799b..c7e4798e1f 100644 --- a/app/src/components/domain/RiskImminentEvents/Gdacs/EventListItem/index.tsx +++ b/app/src/components/domain/RiskImminentEvents/Gdacs/EventListItem/index.tsx @@ -1,4 +1,11 @@ -import { ChevronRightLineIcon } from '@ifrc-go/icons'; +import { + useEffect, + useRef, +} from 'react'; +import { + ChevronDownLineIcon, + ChevronUpLineIcon, +} from '@ifrc-go/icons'; import { Button, Header, @@ -25,35 +32,62 @@ function EventListItem(props: Props) { hazard_name, start_date, }, + expanded, onExpandClick, className, + children, } = props; const strings = useTranslation(i18n); + const elementRef = useRef(null); + + useEffect( + () => { + if (expanded && elementRef.current) { + const y = window.scrollY; + const x = window.scrollX; + elementRef.current.scrollIntoView({ + behavior: 'instant', + block: 'start', + }); + // NOTE: We need to scroll back because scrollIntoView also + // scrolls the parent container + window.scroll(x, y); + } + }, + [expanded], + ); + return ( -
- - - )} - spacing="cozy" - > - -
+ <> +
+ {expanded + ? + : } + + )} + spacing="cozy" + > + +
+ {children} + ); } diff --git a/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventDetails/i18n.json b/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventDetails/i18n.json index a735778f8c..6c9c396990 100644 --- a/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventDetails/i18n.json +++ b/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventDetails/i18n.json @@ -9,8 +9,6 @@ "meteoSwissAuthoritativeMessage": "Please also consider {link} and classification of {classificationLink}.", "meteoSwissAuthoritativeLinkLabel": "authoritative information about the hazard", "meteoSwissTropicalStorm": "tropical storm", - "meteoSwissEventDetailsStartedOnLabel": "Started on", - "meteoSwissEventDetailsUpdatedAtLabel": "Updated at", "meteoSwissHazardName": "{hazardType} - {hazardName}", "meteoSwissImpactValue": "{value} ({fivePercent} - {ninetyFivePercent}) {unit}", "beta": "beta", diff --git a/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventDetails/index.tsx b/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventDetails/index.tsx index dd1b8bf174..bf666a4522 100644 --- a/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventDetails/index.tsx +++ b/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventDetails/index.tsx @@ -41,8 +41,6 @@ interface Props { function EventDetails(props: Props) { const { data: { - // id, - hazard_type_display, country_details, start_date, updated_at, @@ -55,14 +53,6 @@ function EventDetails(props: Props) { const strings = useTranslation(i18n); - const hazardName = resolveToString( - strings.meteoSwissHazardName, - { - hazardType: hazard_type_display, - hazardName: country_details?.name ?? hazard_name, - }, - ); - const getSaffirSimpsonScaleDescription = useCallback((windspeed: number) => { if (windspeed < 33) { return strings.tropicalStormDescription; @@ -179,25 +169,6 @@ function EventDetails(props: Props) { - - - - )} contentViewType="vertical" > {pending && } diff --git a/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventListItem/i18n.json b/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventListItem/i18n.json index 8afd1399ef..33064d1f8d 100644 --- a/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventListItem/i18n.json +++ b/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventListItem/i18n.json @@ -1,7 +1,7 @@ { "namespace": "common", "strings": { - "meteoSwissEventListViewDetails": "View Details", + "meteoSwissEventListViewDetails": "View / Hide Details", "meteoSwissEventListStartedOn": "Started On" } } diff --git a/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventListItem/index.tsx b/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventListItem/index.tsx index 51b5f05ca3..7a87b8d436 100644 --- a/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventListItem/index.tsx +++ b/app/src/components/domain/RiskImminentEvents/MeteoSwiss/EventListItem/index.tsx @@ -1,4 +1,11 @@ -import { ChevronRightLineIcon } from '@ifrc-go/icons'; +import { + useEffect, + useRef, +} from 'react'; +import { + ChevronDownLineIcon, + ChevronUpLineIcon, +} from '@ifrc-go/icons'; import { Button, Header, @@ -27,37 +34,64 @@ function EventListItem(props: Props) { start_date, hazard_name, }, + expanded, onExpandClick, className, + children, } = props; const strings = useTranslation(i18n); const hazardName = `${hazard_type_display} - ${country_details?.name ?? hazard_name}`; + const elementRef = useRef(null); + + useEffect( + () => { + if (expanded && elementRef.current) { + const y = window.scrollY; + const x = window.scrollX; + elementRef.current.scrollIntoView({ + behavior: 'instant', + block: 'start', + }); + // NOTE: We need to scroll back because scrollIntoView also + // scrolls the parent container + window.scroll(x, y); + } + }, + [expanded], + ); + return ( -
- - - )} - spacing="condensed" - > - -
+ <> +
+ {expanded + ? + : } + + )} + spacing="condensed" + > + +
+ {children} + ); } diff --git a/app/src/components/domain/RiskImminentEvents/Pdc/EventDetails/i18n.json b/app/src/components/domain/RiskImminentEvents/Pdc/EventDetails/i18n.json index 9ac8a9b2b4..c5445e518c 100644 --- a/app/src/components/domain/RiskImminentEvents/Pdc/EventDetails/i18n.json +++ b/app/src/components/domain/RiskImminentEvents/Pdc/EventDetails/i18n.json @@ -1,7 +1,6 @@ { "namespace": "common", "strings": { - "eventDetailsStartedOn": "Started on", "eventDetailsCreatedOn": "Created on", "eventDetailsUpdatedOn": "Updated on", "eventDetailsPeopleExposed": "People exposed / Potentially affected", diff --git a/app/src/components/domain/RiskImminentEvents/Pdc/EventDetails/index.tsx b/app/src/components/domain/RiskImminentEvents/Pdc/EventDetails/index.tsx index 2ef85f22bf..83afc3ea4e 100644 --- a/app/src/components/domain/RiskImminentEvents/Pdc/EventDetails/index.tsx +++ b/app/src/components/domain/RiskImminentEvents/Pdc/EventDetails/index.tsx @@ -18,8 +18,6 @@ type Props = RiskEventDetailProps; function EventDetails(props: Props) { const { data: { - hazard_name, - start_date, pdc_created_at, pdc_updated_at, description, @@ -53,16 +51,7 @@ function EventDetails(props: Props) { return ( - )} withBorderAndHeaderBackground pending={pending} > diff --git a/app/src/components/domain/RiskImminentEvents/Pdc/EventListItem/i18n.json b/app/src/components/domain/RiskImminentEvents/Pdc/EventListItem/i18n.json index 407f9de522..b7dc5a96b9 100644 --- a/app/src/components/domain/RiskImminentEvents/Pdc/EventListItem/i18n.json +++ b/app/src/components/domain/RiskImminentEvents/Pdc/EventListItem/i18n.json @@ -1,7 +1,7 @@ { "namespace": "common", "strings": { - "eventListViewDetails": "View Details", + "eventListViewDetails": "View / Hide Details", "eventListStartedOn": "Started on" } } diff --git a/app/src/components/domain/RiskImminentEvents/Pdc/EventListItem/index.tsx b/app/src/components/domain/RiskImminentEvents/Pdc/EventListItem/index.tsx index e797243af2..1cfc7eecc5 100644 --- a/app/src/components/domain/RiskImminentEvents/Pdc/EventListItem/index.tsx +++ b/app/src/components/domain/RiskImminentEvents/Pdc/EventListItem/index.tsx @@ -1,4 +1,11 @@ -import { ChevronRightLineIcon } from '@ifrc-go/icons'; +import { + useEffect, + useRef, +} from 'react'; +import { + ChevronDownLineIcon, + ChevronUpLineIcon, +} from '@ifrc-go/icons'; import { Button, Header, @@ -25,35 +32,62 @@ function EventListItem(props: Props) { hazard_name, start_date, }, + expanded, onExpandClick, className, + children, } = props; const strings = useTranslation(i18n); + const elementRef = useRef(null); + + useEffect( + () => { + if (expanded && elementRef.current) { + const y = window.scrollY; + const x = window.scrollX; + elementRef.current.scrollIntoView({ + behavior: 'instant', + block: 'start', + }); + // NOTE: We need to scroll back because scrollIntoView also + // scrolls the parent container + window.scroll(x, y); + } + }, + [expanded], + ); + return ( -
- - - )} - spacing="cozy" - > - -
+ <> +
+ {expanded + ? + : } + + )} + spacing="cozy" + > + +
+ {children} + ); } diff --git a/app/src/components/domain/RiskImminentEvents/WfpAdam/EventDetails/i18n.json b/app/src/components/domain/RiskImminentEvents/WfpAdam/EventDetails/i18n.json index 934b051221..61917aab20 100644 --- a/app/src/components/domain/RiskImminentEvents/WfpAdam/EventDetails/i18n.json +++ b/app/src/components/domain/RiskImminentEvents/WfpAdam/EventDetails/i18n.json @@ -1,7 +1,6 @@ { "namespace": "common", "strings": { - "wfpEventDetailsPublishedOn": "Published on", "wfpEventDetailsKm": "{point} Km/h on {pointDate}", "wfpUsefulLinks": "Useful Links:", "wfpDashboard": "Dashboard", diff --git a/app/src/components/domain/RiskImminentEvents/WfpAdam/EventDetails/index.tsx b/app/src/components/domain/RiskImminentEvents/WfpAdam/EventDetails/index.tsx index 03329622d6..a7a70d47cb 100644 --- a/app/src/components/domain/RiskImminentEvents/WfpAdam/EventDetails/index.tsx +++ b/app/src/components/domain/RiskImminentEvents/WfpAdam/EventDetails/index.tsx @@ -84,8 +84,6 @@ type Props = RiskEventDetailProps; function EventDetails(props: Props) { const { data: { - title, - publish_date, event_details, }, exposure, @@ -162,17 +160,7 @@ function EventDetails(props: Props) { className={styles.eventDetails} contentViewType="vertical" childrenContainerClassName={styles.content} - heading={title} - headingLevel={5} spacing="cozy" - headerDescription={( - - )} pending={pending} > {stormPoints && stormPoints.length > 0 && isDefined(maxWindSpeed) && ( diff --git a/app/src/components/domain/RiskImminentEvents/WfpAdam/EventListItem/i18n.json b/app/src/components/domain/RiskImminentEvents/WfpAdam/EventListItem/i18n.json index 7e62fc4b38..0830c5d6b9 100644 --- a/app/src/components/domain/RiskImminentEvents/WfpAdam/EventListItem/i18n.json +++ b/app/src/components/domain/RiskImminentEvents/WfpAdam/EventListItem/i18n.json @@ -1,7 +1,7 @@ { "namespace": "common", "strings": { - "wfpEventListViewDetails": "View Details", + "wfpEventListViewDetails": "View / Hide Details", "wfpEventListPublishedOn": "Published on" } } diff --git a/app/src/components/domain/RiskImminentEvents/WfpAdam/EventListItem/index.tsx b/app/src/components/domain/RiskImminentEvents/WfpAdam/EventListItem/index.tsx index 1becd6c66c..701068a292 100644 --- a/app/src/components/domain/RiskImminentEvents/WfpAdam/EventListItem/index.tsx +++ b/app/src/components/domain/RiskImminentEvents/WfpAdam/EventListItem/index.tsx @@ -1,4 +1,11 @@ -import { ChevronRightLineIcon } from '@ifrc-go/icons'; +import { + useEffect, + useRef, +} from 'react'; +import { + ChevronDownLineIcon, + ChevronUpLineIcon, +} from '@ifrc-go/icons'; import { Button, Header, @@ -25,35 +32,62 @@ function EventListItem(props: Props) { publish_date, title, }, + expanded, onExpandClick, className, + children, } = props; const strings = useTranslation(i18n); + const elementRef = useRef(null); + + useEffect( + () => { + if (expanded && elementRef.current) { + const y = window.scrollY; + const x = window.scrollX; + elementRef.current.scrollIntoView({ + behavior: 'instant', + block: 'start', + }); + // NOTE: We need to scroll back because scrollIntoView also + // scrolls the parent container + window.scroll(x, y); + } + }, + [expanded], + ); + return ( -
- - - )} - spacing="cozy" - > - -
+ <> +
+ {expanded + ? + : } + + )} + spacing="cozy" + > + +
+ {children} + ); } diff --git a/app/src/utils/importTemplate.ts b/app/src/utils/importTemplate.ts index 4de551adea..cd4820387a 100644 --- a/app/src/utils/importTemplate.ts +++ b/app/src/utils/importTemplate.ts @@ -300,7 +300,7 @@ export function createImportTemplate< } function addClientId(item: object): object { - return { ...item, clientId: randomString() }; + return { ...item, client_id: randomString() }; } export function getValueFromImportTemplate< @@ -311,7 +311,7 @@ export function getValueFromImportTemplate< optionsMap: OPTIONS_MAPPING, formValues: Record, fieldName: string | undefined = undefined, - transformListObject: (item: object) => object = addClientId, + transformListObject: ((item: object) => object) = addClientId, ): unknown { const optionsReverseMap = mapToMap( optionsMap, @@ -374,7 +374,7 @@ export function getValueFromImportTemplate< if (schema.keyFieldName) { return { [schema.keyFieldName]: option.key, - ...value, + ...transformListObject(value), }; } return transformListObject(value); diff --git a/app/src/utils/richText.ts b/app/src/utils/richText.ts index 8fd042da39..ef5eccb2d4 100644 --- a/app/src/utils/richText.ts +++ b/app/src/utils/richText.ts @@ -102,9 +102,11 @@ export function parsePseudoHtml( (acc, plugin) => plugin.transformer(token, acc), { text: token }, ); + if (richTextItem.text === '') { + return undefined; + } return richTextItem; }).filter(isDefined); - // TODO: Check correctness to check that stack is empty return { richText }; } diff --git a/app/src/views/ThreeWProjectForm/DistrictMap/DistrictMapModal/index.tsx b/app/src/views/ThreeWProjectForm/DistrictMap/DistrictMapModal/index.tsx index 0d8099ed35..d06624f16c 100644 --- a/app/src/views/ThreeWProjectForm/DistrictMap/DistrictMapModal/index.tsx +++ b/app/src/views/ThreeWProjectForm/DistrictMap/DistrictMapModal/index.tsx @@ -360,7 +360,6 @@ function DistrictMap(props: Props { - // console.log('single click register', new Date().getTime()); const properties = clickedFeature.properties as { country_id?: number; district_id?: number; @@ -395,7 +394,6 @@ function DistrictMap(props: Props { - // console.log('single click call', new Date().getTime()); const index = oldVal?.indexOf(id); if (isNotDefined(index) || index === -1) { return [ @@ -422,7 +420,6 @@ function DistrictMap(props: Props { - // console.log('double click call', new Date().getTime()); const properties = clickedFeature?.properties as { country_id?: number; district_id?: number; From 478e73bcd4b45bb26acb25c739cd1022b041341d Mon Sep 17 00:00:00 2001 From: tnagorra Date: Wed, 13 Nov 2024 11:18:48 +0545 Subject: [PATCH 04/17] Add changeset --- .changeset/cool-eggs-judge.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .changeset/cool-eggs-judge.md diff --git a/.changeset/cool-eggs-judge.md b/.changeset/cool-eggs-judge.md new file mode 100644 index 0000000000..858992bb30 --- /dev/null +++ b/.changeset/cool-eggs-judge.md @@ -0,0 +1,8 @@ +--- +"go-web-app": patch +--- + +Update labels for severity control in Imminent Risk Map. +Update navigation for the events in Imminent Risk Map. +Fix issue displayed when opening a DREF import template. +Fix submission issue when importing a DREF import file. From 5146eca8d1c7e7844fba5861812e6cf52124c5cc Mon Sep 17 00:00:00 2001 From: tnagorra Date: Wed, 13 Nov 2024 11:46:54 +0545 Subject: [PATCH 05/17] Update descriptions on the dref import template --- .../useImportTemplateSchema.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/app/src/views/AccountMyFormsDref/DownloadImportTemplateButton/DownloadImportTemplateModal/useImportTemplateSchema.ts b/app/src/views/AccountMyFormsDref/DownloadImportTemplateButton/DownloadImportTemplateModal/useImportTemplateSchema.ts index 7959482757..ef7a3dac26 100644 --- a/app/src/views/AccountMyFormsDref/DownloadImportTemplateButton/DownloadImportTemplateModal/useImportTemplateSchema.ts +++ b/app/src/views/AccountMyFormsDref/DownloadImportTemplateButton/DownloadImportTemplateModal/useImportTemplateSchema.ts @@ -234,7 +234,7 @@ function useImportTemplateSchema() { optionsKey: '__boolean', validation: 'boolean', description: ( - 'Indicate only if there was a similar event affecting the same area in the last 3 years.\n' + 'Indicate only if it affected the same population groups\n' + 'Otherwise, leave the box empty.' ), }, @@ -245,7 +245,7 @@ function useImportTemplateSchema() { optionsKey: '__boolean', validation: 'boolean', description: ( - 'Indicate only if there was a similar event affecting the same area in the last 3 years.\n' + 'Indicate only if the national society responded\n' + 'Otherwise, leave the box empty.' ), }, @@ -255,7 +255,7 @@ function useImportTemplateSchema() { label: 'If yes, please specify which operations', validation: 'string', description: ( - 'Indicate only if there was a similar event affecting the same area in the last 3 years.\n' + 'Indicate only if the national society requested funding from DREF for that event(s).\n' + 'Otherwise, leave the box empty.' ), }, @@ -465,6 +465,17 @@ function useImportTemplateSchema() { ), }, + major_coordination_mechanism: { + type: 'input', + validation: 'textArea', + label: 'Major coordination mechanism', + description: ( + 'List coordination mechanisms/platform in place at local/district and national level. Indicate the lead authorities/agencies. How the National Society is involved/positioned in this coordination. Does the NS in any lead/co-lead role? Any identified gap/overlap in the coordination (e.g., sector missing…)?\n' + + 'Indicate only if there are major coordination mechanism in place\n' + + 'Otherwise, leave the box empty.' + ), + }, + needs_identified: { type: 'list', label: 'Needs (Gaps) Identified', From 11e67c9ad33fe99b211c4177bef25114188aeacb Mon Sep 17 00:00:00 2001 From: Szabo Zoltan Date: Wed, 6 Nov 2024 14:52:56 +0100 Subject: [PATCH 06/17] Health updates and typo fixes --- app/src/App/routes/SurgeRoutes.tsx | 40 +++++-- app/src/views/SurgeCatalogueHealth/i18n.json | 1 + app/src/views/SurgeCatalogueHealth/index.tsx | 32 ++++-- .../i18n.json | 26 ++--- .../index.tsx | 28 ++--- .../i18n.json | 33 ------ .../i18n.json | 33 ++++++ .../index.tsx | 10 +- .../i18n.json | 2 +- .../index.tsx | 2 +- .../i18n.json | 41 +++++++ .../index.tsx | 103 ++++++++++++++++++ .../i18n.json | 15 +-- 13 files changed, 260 insertions(+), 106 deletions(-) delete mode 100644 app/src/views/SurgeCatalogueHealthCommunityCaseManagementChlorea/i18n.json create mode 100644 app/src/views/SurgeCatalogueHealthCommunityCaseManagementCholera/i18n.json rename app/src/views/{SurgeCatalogueHealthCommunityCaseManagementChlorea => SurgeCatalogueHealthCommunityCaseManagementCholera}/index.tsx (95%) rename app/src/views/{SurgeCatalogueHealthEruChloreaTreatment => SurgeCatalogueHealthEruCholeraTreatment}/i18n.json (99%) rename app/src/views/{SurgeCatalogueHealthEruChloreaTreatment => SurgeCatalogueHealthEruCholeraTreatment}/index.tsx (98%) create mode 100644 app/src/views/SurgeCatalogueHealthInfectionPreventionAndControl/i18n.json create mode 100644 app/src/views/SurgeCatalogueHealthInfectionPreventionAndControl/index.tsx diff --git a/app/src/App/routes/SurgeRoutes.tsx b/app/src/App/routes/SurgeRoutes.tsx index 44952dd320..eef68fb222 100644 --- a/app/src/App/routes/SurgeRoutes.tsx +++ b/app/src/App/routes/SurgeRoutes.tsx @@ -416,30 +416,30 @@ const surgeCatalogueHealthEmergencyClinic = customWrapRoute({ }, }); -const surgeCatalogueHealthEruChloreaTreatment = customWrapRoute({ +const surgeCatalogueHealthEruCholeraTreatment = customWrapRoute({ parent: surgeCatalogueLayout, - path: 'health/eru-chlorea-treatment', + path: 'health/eru-cholera-treatment', component: { - render: () => import('#views/SurgeCatalogueHealthEruChloreaTreatment'), + render: () => import('#views/SurgeCatalogueHealthEruCholeraTreatment'), props: {}, }, wrapperComponent: Auth, context: { - title: 'Emergency Response Unit Chlorea Treatment Center', + title: 'Emergency Response Unit Cholera Treatment Center', visibility: 'anything', }, }); -const surgeCatalogueHealthCommunityCaseManagementChlorea = customWrapRoute({ +const surgeCatalogueHealthCommunityCaseManagementCholera = customWrapRoute({ parent: surgeCatalogueLayout, - path: 'health/community-case-management-chlorea', + path: 'health/community-case-management-cholera', component: { - render: () => import('#views/SurgeCatalogueHealthCommunityCaseManagementChlorea'), + render: () => import('#views/SurgeCatalogueHealthCommunityCaseManagementCholera'), props: {}, }, wrapperComponent: Auth, context: { - title: 'Community Case Management of Chlorea', + title: 'Community Case Management of Cholera', visibility: 'anything', }, }); @@ -472,6 +472,20 @@ const surgeCatalogueHealthSafeDignifiedBurials = customWrapRoute({ }, }); +const surgeCatalogueHealthInfectionPreventionAndControl = customWrapRoute({ + parent: surgeCatalogueLayout, + path: 'health/infection-prevention-and-control', + component: { + render: () => import('#views/SurgeCatalogueHealthInfectionPreventionAndControl'), + props: {}, + }, + wrapperComponent: Auth, + context: { + title: 'Infection Prevention and Control', + visibility: 'anything', + }, +}); + const surgeCatalogueHealthCommunityManagementMalnutrition = customWrapRoute({ parent: surgeCatalogueLayout, path: 'health/community-management-malnutrition', @@ -1301,9 +1315,10 @@ function DeploymentCatalogueNavigate() { 'eru-pss-module': surgeCatalogueHealthEruPsychosocialSupport, 'community-case-management-of-malnutrition-ccmm': surgeCatalogueHealthCommunityManagementMalnutrition, 'safe-and-dignified-burials': surgeCatalogueHealthSafeDignifiedBurials, + 'infection-prevention-and-control': surgeCatalogueHealthInfectionPreventionAndControl, 'community-based-surveillance-cbs': surgeCatalogueHealthCommunityBasedSurveillance, - 'community-case-management-of-cholera-ccmc': surgeCatalogueHealthCommunityCaseManagementChlorea, - 'eru-cholera-treatment-center': surgeCatalogueHealthEruChloreaTreatment, + 'community-case-management-of-cholera-ccmc': surgeCatalogueHealthCommunityCaseManagementCholera, + 'eru-cholera-treatment-center': surgeCatalogueHealthEruCholeraTreatment, 'emergency-mobile-clinic': surgeCatalogueHealthEmergencyClinic, 'maternal-newborn-health-clinic': surgeCatalogueHealthMaternalNewbornClinic, 'surgical-surge': surgeCatalogueHealthEruSurgical, @@ -1457,10 +1472,11 @@ export default { surgeCatalogueHealthEruSurgical, surgeCatalogueHealthMaternalNewbornClinic, surgeCatalogueHealthEmergencyClinic, - surgeCatalogueHealthEruChloreaTreatment, - surgeCatalogueHealthCommunityCaseManagementChlorea, + surgeCatalogueHealthEruCholeraTreatment, + surgeCatalogueHealthCommunityCaseManagementCholera, surgeCatalogueHealthCommunityBasedSurveillance, surgeCatalogueHealthSafeDignifiedBurials, + surgeCatalogueHealthInfectionPreventionAndControl, surgeCatalogueHealthCommunityManagementMalnutrition, surgeCatalogueHealthEruPsychosocialSupport, surgeCatalogueInformationManagement, diff --git a/app/src/views/SurgeCatalogueHealth/i18n.json b/app/src/views/SurgeCatalogueHealth/i18n.json index cb4c23a327..a180624a88 100644 --- a/app/src/views/SurgeCatalogueHealth/i18n.json +++ b/app/src/views/SurgeCatalogueHealth/i18n.json @@ -23,6 +23,7 @@ "healthCCMCLink": "Community Case Management of Cholera (CCMC)", "healthCBSLink": "Community-based Surveillance (CBS)", "healthBurialsTitle": "Safe and Dignified Burials", + "healthIPCTitle": "Infection Prevention and Control (IPC)", "healthCCMMTitle": "Community Case Management of Malnutrition (CCMM)", "healthPSSDetails": "24 hour clinical services for 100-200 outpatients/day.", "healthRapidResponsePersonnelTitle": "Rapid Response Personnel", diff --git a/app/src/views/SurgeCatalogueHealth/index.tsx b/app/src/views/SurgeCatalogueHealth/index.tsx index 2e34b56843..3c9519915d 100644 --- a/app/src/views/SurgeCatalogueHealth/index.tsx +++ b/app/src/views/SurgeCatalogueHealth/index.tsx @@ -50,10 +50,10 @@ export function Component() { }, ]; - const emergencyChloreaTreatment: LinkData[] = [ + const emergencyCholeraTreatment: LinkData[] = [ { title: strings.emergencyCholeraTreatmentTitleLink, - to: 'surgeCatalogueHealthEruChloreaTreatment', + to: 'surgeCatalogueHealthEruCholeraTreatment', withLinkIcon: true, }, ]; @@ -61,7 +61,7 @@ export function Component() { const healthCCMC: LinkData[] = [ { title: strings.healthCCMCLink, - to: 'surgeCatalogueHealthCommunityCaseManagementChlorea', + to: 'surgeCatalogueHealthCommunityCaseManagementCholera', withLinkIcon: true, }, ]; @@ -74,22 +74,30 @@ export function Component() { }, ]; - const healthBurials: LinkData[] = [ + const healthIPC: LinkData[] = [ { - title: strings.healthBurialsTitle, - to: 'surgeCatalogueHealthSafeDignifiedBurials', + title: strings.healthIPCTitle, + to: 'surgeCatalogueHealthInfectionPreventionAndControl', withLinkIcon: true, }, ]; - const healthCCMM: LinkData[] = [ + const healthBurials: LinkData[] = [ { - title: strings.communityCaseLink, - to: 'surgeCatalogueHealthCommunityManagementMalnutrition', + title: strings.healthBurialsTitle, + to: 'surgeCatalogueHealthSafeDignifiedBurials', withLinkIcon: true, }, ]; + // const healthCCMM: LinkData[] = [ + // { + // title: strings.communityCaseLink, + // to: 'surgeCatalogueHealthCommunityManagementMalnutrition', + // withLinkIcon: true, + // }, + // ]; + const healthPSS: LinkData[] = [ { title: strings.pssModuleLink, @@ -243,7 +251,7 @@ export function Component() { /> -
{strings.communityBasedEmergencyDetail}
+
+ {strings.communityBasedEmergencyDetailOne} +
+ {strings.communityBasedEmergencyDetailTwo} +
- -
  • {strings.communityBasedPersonnelCompositionListItemOne}
  • -
  • {strings.communityBasedPersonnelCompositionListItemTwo}
  • +
  • {strings.communityBasedPersonnelListItemOne}
  • +
  • {strings.communityBasedPersonnelListItemTwo}
  • )} - label={strings.communityBasedPersonnelCompositionLabel} strongLabel />
    @@ -60,8 +58,6 @@ export function Component() {
    • {strings.communityBasedStandardComponentsListItemOne}
    • {strings.communityBasedStandardComponentsListItemTwo}
    • -
    • {strings.communityBasedStandardComponentsListItemThree}
    • -
    • {strings.communityBasedStandardComponentsListItemFour}
    - -
      -
    • {strings.communityBasedStandardComponentsListItemOne}
    • -
    • {strings.communityBasedStandardComponentsListItemTwo}
    • -
    • {strings.communityBasedStandardComponentsListItemThree}
    • -
    • {strings.communityBasedStandardComponentsListItemFour}
    • -
    -
    diff --git a/app/src/views/SurgeCatalogueHealthCommunityCaseManagementChlorea/i18n.json b/app/src/views/SurgeCatalogueHealthCommunityCaseManagementChlorea/i18n.json deleted file mode 100644 index 6156e9a44e..0000000000 --- a/app/src/views/SurgeCatalogueHealthCommunityCaseManagementChlorea/i18n.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "namespace": "surgeCatalogueHealthCommunityCaseManagementChlorea", - "strings": { - "communityCaseTitle": "Community Case Management Of Cholera (CCMC)", - "communityCaseImageCaption": "ORP in Somaliland", - "communityCaseCapacity": "Capacity", - "communityCaseCapacityDetail": "The purpose of the Public Health ERU CCM cholera module is to help to reduce mortality and morbidity due to cholera through early response at community level. It provides oral rehydration services at standalone Oral Rehydration Points (ORP) in communities affected by outbreaks of cholera or acute watery diarrhoea.", - "communityCaseEmergencyServices": "Emergency Services", - "communityCaseEmergencyServicesDetail": "This module provides oral rehydration solution and zinc at oral rehydration points in communities which have reported cases of acute watery diarrhoea. This service is scalable to be able to expand and or move to respond to changing epidemic dynamics. The ORP functions as a first aid point for people suffering from potential cholera or acute watery diarrhoea, and advises severely ill people to seek medical care. Hygiene and health messages will be provided at ORPs. Each ORP systematically collects and reports data for monitoring, analysis and operational decision making. One ORP kit can produce enough water each day to provide ORS to approximately 35 people per day at the site. The CCMC module provides volunteer management and supervision for this activity, which is carried out by trained volunteers and staff in affected communities.", - "communityCaseDesignedFor": "Designed For", - "communityCaseDesignedForDetail": "A public health ERU CCMC module should be considered for deployment very early when there is risk of or existing AWD outbreak, where the HNS requires support in order to reach affected communities with ORP services. Unit can be deployed within 48 hours upon receiving a deployment request, is self-sufficient for 1 month and can operate for up to 4 months.", - "communityCasePersonnel": "Personnel", - "communityCasePersonnelLabel": "Total", - "communityCasePersonnelValue": "7 people.", - "communityCasePersonnelCompositionLabel": "Composition", - "communityCasePersonnelCompositionValue": "Team Leader, Public Health / Epidemiologist, Quality control/training x 2, WASH, Logistics, and Finance/Admin.", - "communityCaseStandardComponents": "Standard Components", - "communityCaseStandardListItemOne": "ORP kits (quantity as requested)", - "communityCaseStandardListItemTwo": "Field accommodation preferred", - "communityCaseStandardListItemThree": "Training kit", - "communityCaseStandardListItemFour": "Digital Data gathering kit", - "communityCaseStandardListItemFive": "Vehicles (rent or supply)", - "communityCaseSpecifications": "Specifications", - "communityCaseSpecificationsWeightLabel": "Weight", - "communityCaseSpecificationsWeightValue": "1090 kg per 6 ORPs", - "communityCaseSpecificationsVolumeLabel": "Volume", - "communityCaseSpecificationsVolumeValue": "3 pallets per 6 ORPs", - "communityCaseSpecificationNationalSocietiesLabel": "National societies providing this service", - "communityCaseSpecificationNationalSocietiesValue": "Swiss", - "communityCaseVariationOnConfiguration": "Variation On Configuration", - "communityCaseVariationOnConfigurationDetail": "Number of ORPs and kits required to be scaled based on population and geography affected by outbreak." - } -} diff --git a/app/src/views/SurgeCatalogueHealthCommunityCaseManagementCholera/i18n.json b/app/src/views/SurgeCatalogueHealthCommunityCaseManagementCholera/i18n.json new file mode 100644 index 0000000000..fe58e6bd2d --- /dev/null +++ b/app/src/views/SurgeCatalogueHealthCommunityCaseManagementCholera/i18n.json @@ -0,0 +1,33 @@ +{ + "namespace": "surgeCatalogueHealthCommunityCaseManagementCholera", + "strings": { + "communityCaseTitle": "Community Case Management Of Cholera (CCMC)", + "communityCaseImageCaption": "ORP in Somaliland", + "communityCaseCapacity": "Capacity", + "communityCaseCapacityDetail": "The overall goal of the CCMC configuration is to contribute to the reduction of mortality and morbidity due to cholera through early response to a declared cholera or acute watery diarrhoea outbreak and promptly treat people infected with mild cholera/acute watery diarrhoea at community level.", + "communityCaseEmergencyServices": "Emergency Services", + "communityCaseEmergencyServicesDetail": "Oral Rehydration Therapy at community level through Oral Rehydration Points (ORP). This is a public health intervention to reduce the morbidity and mortality due to cholera. This includes provision of oral rehydration solution at the ORP and given for home use as well as distribution of Zinc to eligible patient as defined in WHO guidelines. Referral of severely dehydrated and sick patients. WASH activities at the ORP for patients, including hygiene promotion, household water treatment, distribution of hygiene and water items in alignment with activities outside the ORP. Social mobilisation and community engagement and accountability (CEA). Data collection, analysis, interpretation and taking action (at ORP level). Safe management of dead bodies if someone dies at the ORP. One ORP kit can produce enough water each day to treat approximately 35 patients per day using the safe water from the filter. In order to calculate how many ORP kits will be needed, it is important to know the population size and how many people will get sick in the community (attack rate).", + "communityCaseDesignedFor": "Designed For", + "communityCaseDesignedForDetail": "Unit can be deployed within 48 hours upon receiving a deployment request, is self-sufficient for 1 month and can operate for up to 4 months. Designed for the provision of fixed but redeployable oral rehydration points in communities affected by cholera, with the goal of providing treatment in the community for les acute cases, and to reduce the burden on health services.", + "communityCasePersonnel": "Personnel", + "communityCasePersonnelLabel": "Typically", + "communityCasePersonnelValue": "7 people.", + "communityCasePersonnelCompositionLabel": "Composition", + "communityCasePersonnelCompositionValue": "Team Leader, Public Health / Epidemiologist, ORP Delegate, Hygiene Promotion and Community Engagement and Accountability, WASH, Logistics, and Finance/Admin.", + "communityCaseStandardComponents": "Standard Components", + "communityCaseStandardListItemOne": "ORP kits", + "communityCaseStandardListItemTwo": "An ORP kit consists of 2 modules. The infrastructure module contains various equipment to set up an ORP (e.g. table, chairs, buckets, water filters, slabs etc.). Additionally, a simple tent (gazebo) is included. The medical module contains basic medical supplies needed at the ORP, including the Oral Rehydration Salts (ORS), Zinc and Chlorine. A medical module, which should be sufficient for supporting one ORP for the first 6 weeks, weighs about 300 kg and fits on one pallet. 20 infrastructure modules (22 pallets, 2’950 kg in total) are ready to dispatch, 20 medical modules are prepositioned.", + "communityCaseStandardListItemThree": "Hygiene promotion kit", + "communityCaseStandardListItemFour": "Digital Data gathering kit", + "communityCaseStandardListItemFive": "Vehicles (rent or supply)", + "communityCaseSpecifications": "Specifications", + "communityCaseSpecificationsWeightLabel": "Weight", + "communityCaseSpecificationsWeightValue": "170 kg (infrastructure module + gazebo) + 300 kg (medical module) = 470 kg per ORP", + "communityCaseSpecificationsVolumeLabel": "Volume", + "communityCaseSpecificationsVolumeValue": "1 pallet (infrastructure module) + gazebo + 1 pallet (medical kit) = 2 pallets + gazebo per ORP", + "communityCaseSpecificationNationalSocietiesLabel": "National societies providing this service", + "communityCaseSpecificationNationalSocietiesValue": "Swiss RC", + "communityCaseVariationOnConfiguration": "Variation On Configuration", + "communityCaseVariationOnConfigurationDetail": "Number of ORPs and kits required to be scaled based on population and geography affected by outbreak." + } +} diff --git a/app/src/views/SurgeCatalogueHealthCommunityCaseManagementChlorea/index.tsx b/app/src/views/SurgeCatalogueHealthCommunityCaseManagementCholera/index.tsx similarity index 95% rename from app/src/views/SurgeCatalogueHealthCommunityCaseManagementChlorea/index.tsx rename to app/src/views/SurgeCatalogueHealthCommunityCaseManagementCholera/index.tsx index 8ab08d08c0..1b0379549d 100644 --- a/app/src/views/SurgeCatalogueHealthCommunityCaseManagementChlorea/index.tsx +++ b/app/src/views/SurgeCatalogueHealthCommunityCaseManagementCholera/index.tsx @@ -65,9 +65,11 @@ export function Component() {
  • {strings.communityCaseStandardListItemOne}
  • -
  • - {strings.communityCaseStandardListItemTwo} -
  • +
      +
    • + {strings.communityCaseStandardListItemTwo} +
    • +
  • {strings.communityCaseStandardListItemThree}
  • @@ -107,4 +109,4 @@ export function Component() { ); } -Component.displayName = 'SurgeCatalogueHealthCommunityCaseManagementChlorea'; +Component.displayName = 'SurgeCatalogueHealthCommunityCaseManagementCholera'; diff --git a/app/src/views/SurgeCatalogueHealthEruChloreaTreatment/i18n.json b/app/src/views/SurgeCatalogueHealthEruCholeraTreatment/i18n.json similarity index 99% rename from app/src/views/SurgeCatalogueHealthEruChloreaTreatment/i18n.json rename to app/src/views/SurgeCatalogueHealthEruCholeraTreatment/i18n.json index 0acd34682d..9e95a3b0ac 100644 --- a/app/src/views/SurgeCatalogueHealthEruChloreaTreatment/i18n.json +++ b/app/src/views/SurgeCatalogueHealthEruCholeraTreatment/i18n.json @@ -1,5 +1,5 @@ { - "namespace": "surgeCatalogueHealthEruChloreaTreatment", + "namespace": "surgeCatalogueHealthEruCholeraTreatment", "strings": { "choleraTreatmentHeading": "ERU Cholera Treatment Center", "choleraCapacityTitle": "Capacity", diff --git a/app/src/views/SurgeCatalogueHealthEruChloreaTreatment/index.tsx b/app/src/views/SurgeCatalogueHealthEruCholeraTreatment/index.tsx similarity index 98% rename from app/src/views/SurgeCatalogueHealthEruChloreaTreatment/index.tsx rename to app/src/views/SurgeCatalogueHealthEruCholeraTreatment/index.tsx index 6574d2734c..433beaac77 100644 --- a/app/src/views/SurgeCatalogueHealthEruChloreaTreatment/index.tsx +++ b/app/src/views/SurgeCatalogueHealthEruCholeraTreatment/index.tsx @@ -127,4 +127,4 @@ export function Component() { ); } -Component.displayName = 'SurgeCatalogueHealthEruChloreaTreatment'; +Component.displayName = 'SurgeCatalogueHealthEruCholeraTreatment'; diff --git a/app/src/views/SurgeCatalogueHealthInfectionPreventionAndControl/i18n.json b/app/src/views/SurgeCatalogueHealthInfectionPreventionAndControl/i18n.json new file mode 100644 index 0000000000..acd011d629 --- /dev/null +++ b/app/src/views/SurgeCatalogueHealthInfectionPreventionAndControl/i18n.json @@ -0,0 +1,41 @@ +{ + "namespace": "surgeCatalogueHealthInfectionPreventionAndControl", + "strings": { + "infectionPreventionAndControlTitle": "Infection Prevention and Control (IPC)", + "healthIPCCapacity": "Capacity", + "healthIPCDetail": "The purpose of the infection prevention and control public health emergency response unit (IPC ERU) is to contribute to the reduction of mortality and morbidity due to the transmission of infectious diseases (nosocomial transmisisons) in healthcare facilities during a crisis or epidemic outbreak. To achieve this, the IPC ERU supports and strengthens the IPC capacities of existing healthcare facilities. This enables a continued provision of care in a safer way, and protects the communities from harm.", + "healthIPCEmergencyServicesTitle": "Emergency Services", + "healthIPCEmergencyServicesDetail1": "Following a rapid IPC assessment conducted in the health facility(ies) to identify critical IPC needs and gaps, an IPC work plan is created and covers the following components:", + "healthIPCEmergencyServicesDetail2": "Initial training: This initial training aims to support with knowledge around best practices for all healthcare workers and support staff in the health care facility.", + "healthIPCEmergencyServicesDetail3": "Technical support for interventions: In parallel with the initial trainings, delegates provide technical support for key interventions such as setting up a screening and triage area, hand washing stations, safe water access points, etc.", + "healthIPCEmergencyServicesDetail4": "Material, equipment and services: To ensure the uptake of IPC practices, the PH IPC ERU team might need to provide material support such as PPE, disinfectants, hand-washing stations, etc. This could be done either through local or international procurement. For waste management, it might be necessary to provide incinerators or waste disposal services. Providing these quickly even in time for the training ensures best uptake as the staff will feel supported.", + "healthIPCEmergencyServicesDetail5": "Routine monitoring, supervision, and refresher trainings: Once initial trainings and interventions have been set up, delegates should continue with routine supervision and monitoring using the monitoring tools provided in this handbook.", + "healthIPCEmergencyServicesDetail6": "Planning for exit and handover: Planning for exit needs to start from the first rotation, as such, it is important to bring this notion into discussions with MoH and managers of HCF as the work goes forward, and start discussing options with appropriate stakeholders.", + "healthIPCEmergencyServicesDetail7": "Trainings and interventions activities cover the major components of IPC practices including: Triage, screening and isolation, Hand hygiene, Personal protective equipment (PPE), Injection safety, Environmental cleaning, including bed linen handling, Healthcare waste management, Decontamination and sterilization of medical devices and patient care equipment, Standard and transmission-based precautions, Rapid screening at triage for patients meeting case definition.", + "healthIPCDesignedFor": "Designed For", + "healthIPCDesignedForDetail": "Unit can be deployed within 48 hours upon receiving a deployment request, is self-sufficient for 1 month and can operate for up to 4 months. Designed for the provision of (some) equipment and technical support to existing health facilities.", + "healthIPCPersonnel": "Personnel", + "healthIPCTotalLabel": "Total", + "healthIPCTotalValue": "5-7 people.", + "healthIPCCompositionLabel": "Composition", + "healthIPCCompositionValue": "A Team Leader, 2-3 IPC trainer and specialist, a WASH specialist, a logistician, and a finance admin.", + "healthIPCStandardComponentsLabel": "Standard Components", + "healthIPCStandardComponentsListItemOne": "ERU IPC Handbook", + "healthIPCStandardComponentsListItemTwo": "IPC Delegate Training Toolkit", + "healthIPCStandardComponentsListItemThree": "IPC Field Training Toolkit", + "healthIPCStandardComponentsListItemFour": "IPC materials and equipment quantification tool", + "healthIPCStandardComponentsListItemFive": "IPC assessment tool for health centers", + "healthIPCStandardComponentsListItemSix": "Material and equipment package (variant according to local needs assessment): Hygiene equipment, Personal protective equipment (masks, gloves, etc.), Cleaning products, Waste management equipment and products, WASH material and equipment", + "healthIPCSpecificationsLabel": "Specifications", + "healthIPCSpecificationsWeightLabel": "Weight", + "healthIPCSpecificationsWeightValue": "Varies according to need assessment", + "healthIPCSpecificationsVolumeLabel": "Volume", + "healthIPCSpecificationsVolumeValue": "Varies according to need assessment", + "healthIPCSpecificationsCostLabel": "Cost (indicative)", + "healthIPCSpecificationsCostValue": "depending on configuration, scope and scale of intervention (between 50K and 700K CHF)", + "healthIPCSpecificationsNsLabel": "National societies providing this service", + "healthIPCSpecificationsNsValue": "French RC, Swedish RC", + "healthIPCVariationLabel": "Variation On Configuration", + "healthIPCVariationDescription": "Number of IPC ERU teams and volume of material and equipment is based on the nature of the risk for nosocomial transmission posed by the infectious agent involved in the outbreak (e.g. high, medium or low) and the areas and HCFs affected or at risk (one site, multiple clustered sites or multiple spread-out sites)." + } +} diff --git a/app/src/views/SurgeCatalogueHealthInfectionPreventionAndControl/index.tsx b/app/src/views/SurgeCatalogueHealthInfectionPreventionAndControl/index.tsx new file mode 100644 index 0000000000..5e93e051aa --- /dev/null +++ b/app/src/views/SurgeCatalogueHealthInfectionPreventionAndControl/index.tsx @@ -0,0 +1,103 @@ +import { TextOutput } from '@ifrc-go/ui'; +import { useTranslation } from '@ifrc-go/ui/hooks'; + +import SurgeCatalogueContainer from '#components/domain/SurgeCatalogueContainer'; +import SurgeContentContainer from '#components/domain/SurgeContentContainer'; + +import i18n from './i18n.json'; + +// eslint-disable-next-line import/prefer-default-export +export function Component() { + const strings = useTranslation(i18n); + + return ( + + +
    {strings.healthIPCDetail}
    +
    + +
    {strings.healthIPCEmergencyServicesDetail1}
    +
    +
      +
    • {strings.healthIPCEmergencyServicesDetail2}
    • +
    • {strings.healthIPCEmergencyServicesDetail3}
    • +
    • {strings.healthIPCEmergencyServicesDetail4}
    • +
    • {strings.healthIPCEmergencyServicesDetail5}
    • +
    • {strings.healthIPCEmergencyServicesDetail6}
    • +
    +
    +
    {strings.healthIPCEmergencyServicesDetail7}
    +
    + +
    {strings.healthIPCDesignedForDetail}
    +
    + + + + + +
      +
    • {strings.healthIPCStandardComponentsListItemOne}
    • +
    • {strings.healthIPCStandardComponentsListItemTwo}
    • +
    • {strings.healthIPCStandardComponentsListItemThree}
    • +
    • {strings.healthIPCStandardComponentsListItemFour}
    • +
    • {strings.healthIPCStandardComponentsListItemFive}
    • +
    • {strings.healthIPCStandardComponentsListItemSix}
    • +
    +
    + + + + + + + +
    {strings.healthIPCVariationDescription}
    +
    + +
    + ); +} + +Component.displayName = 'SurgeCatalogueHealthInfectionPreventionAndControl'; diff --git a/app/src/views/SurgeCatalogueHealthSafeDignifiedBurials/i18n.json b/app/src/views/SurgeCatalogueHealthSafeDignifiedBurials/i18n.json index 3df6132918..2dbd4f5de2 100644 --- a/app/src/views/SurgeCatalogueHealthSafeDignifiedBurials/i18n.json +++ b/app/src/views/SurgeCatalogueHealthSafeDignifiedBurials/i18n.json @@ -3,31 +3,32 @@ "strings": { "safeAndDignifiedBurialsTitle": "Safe And Dignified Burials", "healthBurialsCapacity": "Capacity", - "healthBurialsDetail": "Establishment of safe and culturally appropriate approaches to burials for outbreaks of hemorrhagic fevers (e.g. Ebola, Marburg) and other high impact diseases with a significant risk of post-mortem transmission.", + "healthBurialsDetail": "Under development.", + "healthBurialsDetailNOTyetUSEDunderDEVELOPMENT": "Establishment of safe and culturally appropriate approaches to burials for outbreaks of hemorrhagic fevers (e.g. Ebola, Marburg) and other high impact diseases with a significant risk of post-mortem transmission.", "healthBurialsEmergencyServicesTitle": "Emergency Services", "healthBurialsEmergencyServicesDetail": "Design of SDB system, including alert, response and data management, for rapid implementation of SDB programming. Provides training, equipment, logistics, supportive supervision, etc. to ensure safe and functional SDB system.", "healthBurialsPersonnel": "Personnel", "healthBurialsTotalLabel": "Total", - "healthBurialsTotalValue": "Typically 5-6 people.", + "healthBurialsTotalValue": "2-3 people, up to 7, dependent on available resources and scope of need.", "healthBurialsCompositionLabel": "Composition", - "healthBurialsCompositionValue": "Team leader, educator/trainer, logistician, PSS, IPC/WASH, finance/admin.", + "healthBurialsCompositionValue": "Minimum: Health educator/trainer, IPC/WASH – One of these would be Team Leader. Additional profiles context-dependent and may be able to provide remote support: PSS, logistician, finance/admin, Heath IM, CEA", "healthBurialsStandardComponentsLabel": "Standard Components", "healthBurialsStandardComponentsListItemOne": "SDB training kit (1)", "healthBurialsStandardComponentsListItemTwo": "SDB starter kit (2)", "healthBurialsStandardComponentsListItemThree": "SDB replenishment kit (1)", "healthBurialsStandardComponentsListItemFour": "Bodybags", "healthBurialsStandardComponentsListItemFive": "Digital Data gathering kit", - "healthBurialsStandardComponentsListItemSix": "Vehicles x 2 per SDB team", + "healthBurialsStandardComponentsListItemSix": "Vehicles x 2 per SDB team (locally supplied)", "healthBurialsSpecificationsLabel": "Specifications", "healthBurialsSpecificationsWeightLabel": "Weight", "healthBurialsSpecificationsWeightValue": "approx. 600 kg", "healthBurialsSpecificationsVolumeLabel": "Volume", "healthBurialsSpecificationsVolumeValue": "approx 3.2 CBM", "healthBurialsSpecificationsCostLabel": "Cost (indicative)", - "healthBurialsSpecificationsCostValue": "(to be confirmed)", + "healthBurialsSpecificationsCostValue": "approx. EUR 6000-7000", "healthBurialsSpecificationsNsLabel": "National societies providing this service", - "healthBurialsSpecificationsNsValue": "Canadian", + "healthBurialsSpecificationsNsValue": "Canadian RC", "healthBurialsVariationLabel": "Variation On Configuration", - "healthBurialsVariationDescription": "Number of SDB teams and kits required to be scaled based on population and geography affected by outbreak." + "healthBurialsVariationDescription": "Number of SDB teams and kits required to be scaled based on population and geography affected by outbreak, as well as capacity and resources of HNS." } } From f82f8466b6bf52020b4c317cd06954098b06e17e Mon Sep 17 00:00:00 2001 From: Szabo Zoltan Date: Wed, 6 Nov 2024 14:58:32 +0100 Subject: [PATCH 07/17] Add changeset --- .changeset/real-pears-turn.md | 5 ++ .../i18n.json | 65 +++++++++---------- .../index.tsx | 12 +--- .../i18n.json | 2 +- 4 files changed, 39 insertions(+), 45 deletions(-) create mode 100644 .changeset/real-pears-turn.md diff --git a/.changeset/real-pears-turn.md b/.changeset/real-pears-turn.md new file mode 100644 index 0000000000..b6adc8ecec --- /dev/null +++ b/.changeset/real-pears-turn.md @@ -0,0 +1,5 @@ +--- +"go-web-app": patch +--- + +Update Health Section in Catalogue of Surge Services diff --git a/app/src/views/SurgeCatalogueHealthCommunityBasedSurveillance/i18n.json b/app/src/views/SurgeCatalogueHealthCommunityBasedSurveillance/i18n.json index 6d15757831..f6850262d9 100644 --- a/app/src/views/SurgeCatalogueHealthCommunityBasedSurveillance/i18n.json +++ b/app/src/views/SurgeCatalogueHealthCommunityBasedSurveillance/i18n.json @@ -1,36 +1,33 @@ { - "namespace": "surgeCatalogueHealthCommunityBasedSurveillance", - "strings": { - "communityBasedTitle": "Community-Based Surveillance (CBS)", - "communityBasedCapacity": "Capacity", - "communityBasedDetail": "The purpose PH ERU CBS is to reduce the loss of lives by preventing or contributing to reduction of outbreaks or potential outbreaks of diseases or their negative impacts in sudden-onset disasters, protracted crisis or health emergencies/outbreaks, where there is a defined need for surveillance of diseases. PH ERU CBS supports the establishment of a CBS system for detecting and reporting of events of public health significance within a community by community members, to strengthen the response during an emergency.", - "communityBasedEmergencyServices": "Emergency Services", - "communityBasedEmergencyDetailOne": "Specific objectives: assess the need for a PH ERU CBS in the specific context; determine the configuration of the data collection, flow, protection and response, and other components of the CBS system that will be put into place; set up the data collection and analysis tools; train delegates, NS staff and volunteers who will support data collection, analysis and response; maintain ongoing analysis and use data for decision-making; ensure monitoring of data collection, analysis and response; early detection of cases of disease at community level, and appropriate preventive responses and referral, as necessary.", - "communityBasedEmergencyDetailTwo": "Activities include: assessment of needs, feasibility and capacity for response of the CBS based on initial request by NS or IFRC; design of CBS system; set up of CBS system adapted to context and need; coordination with all relevant stakeholders; training of RC volunteers in CBS methodology; depending on the situation; support epidemic control for volunteers training; development of exit strategy/plan.", - "communityBasedDesignedFor": "Designed For", - "communityBasedDesignedForDetail": "An advanced assessment team can be deployed for 1-2 weeks within 48 hours upon receiving a deployment request. If the assessment team determines that implementation of a CBS sytem is feasible, the remaining team members and equipment are deployed. Both components of the team are self-sufficient for the first month of operations, and the deployed CBS ERU module can operate for up to 4 months.", - "communityBasedPersonnel": "Personnel", - "communityBasedPersonnelListItemOne": "Advanced team: 2 people: Team lead, field epidemiologist or data/information manager", - "communityBasedPersonnelListItemTwo": "Full deployment: 5. Complete CBS deployment, as above + public health, ICT and/or logistics, finance/admin", - "communityBasedPersonnelCompositionDescription": "An advanced CBS assessment team can be deployed for 1-2 weeks within 48 hours upon receiving a deployment request. If the assessment team determines that implementation of a CBS system is feasible, the remaining team members and equipment are deployed.", - "communityBasedStandardComponentsLabel": "Standard Components", - "communityBasedStandardComponentsListItemOne": "CBS platform kit", - "communityBasedStandardComponentsListItemTwo": "Vehicles (rent or supply)", - "communityBasedSpecificationsLabel": "Specifications", - "communityBasedSpecificationsWeightLabel": "Weight", - "communityBasedSpecificationsWeightValue": "10 kg", - "communityBasedSpecificationsVolumeLabel": "Carry-on baggage", - "communityBasedSpecificationsVolumeValue": "Volume", - "communityBasedSpecificationsCostLabel": "Cost (indicative)", - "communityBasedSpecificationsCostValue": "CHF 5,000 (equipment only)", - "communityBasedSpecificationsNationLabel": "National societies providing this service:", - "communityBasedSpecificationsNationValue": "Norwegian RC", - "communityBasedSpecificationsAdditionalResources": "Additional Resources", - "communityBasedSpecificationsAdditionalResourcesListItemOne": "Community based surveillance (CBS", - "communityBasedAdditionalResources": "Additional Resources", - "communityBasedAdditionalResourcesListItemOne": "Community based surveillance (CBS) {link}", - "communityBasedAdditionalResourcesListItemOneLink": "website", - "communityBasedAdditionalResourcesListItemTwo": "Public Health ERU Community Base Surveillance {link}", - "communityBasedAdditionalResourcesListItemTwoLink": "Handbook" - } + "namespace": "surgeCatalogueHealthCommunityBasedSurveillance", + "strings": { + "communityBasedTitle": "Community-Based Surveillance (CBS)", + "communityBasedCapacity": "Capacity", + "communityBasedDetail": "The purpose PH ERU CBS is to reduce the loss of lives by preventing or contributing to reduction of outbreaks or potential outbreaks of diseases or their negative impacts in sudden-onset disasters, protracted crisis or health emergencies/outbreaks, where there is a defined need for surveillance of diseases. PH ERU CBS supports the establishment of a CBS system for detecting and reporting of events of public health significance within a community by community members, to strengthen the response during an emergency.", + "communityBasedEmergencyServices": "Emergency Services", + "communityBasedEmergencyDetailOne": "Specific objectives: assess the need for a PH ERU CBS in the specific context; determine the configuration of the data collection, flow, protection and response, and other components of the CBS system that will be put into place; set up the data collection and analysis tools; train delegates, NS staff and volunteers who will support data collection, analysis and response; maintain ongoing analysis and use data for decision-making; ensure monitoring of data collection, analysis and response; early detection of cases of disease at community level, and appropriate preventive responses and referral, as necessary.", + "communityBasedEmergencyDetailTwo": "Activities include: assessment of needs, feasibility and capacity for response of the CBS based on initial request by NS or IFRC; design of CBS system; set up of CBS system adapted to context and need; coordination with all relevant stakeholders; training of RC volunteers in CBS methodology; depending on the situation; support epidemic control for volunteers training; development of exit strategy/plan.", + "communityBasedDesignedFor": "Designed For", + "communityBasedDesignedForDetail": "An advanced assessment team can be deployed for 1-2 weeks within 48 hours upon receiving a deployment request. If the assessment team determines that implementation of a CBS sytem is feasible, the remaining team members and equipment are deployed. Both components of the team are self-sufficient for the first month of operations, and the deployed CBS ERU module can operate for up to 4 months.", + "communityBasedPersonnel": "Personnel", + "communityBasedPersonnelListItemOne": "Advanced team: 2 people: Team lead, field epidemiologist or data/information manager", + "communityBasedPersonnelListItemTwo": "Full deployment: 5. Complete CBS deployment, as above + public health, ICT and/or logistics, finance/admin", + "communityBasedStandardComponentsLabel": "Standard Components", + "communityBasedStandardComponentsListItemOne": "CBS platform kit", + "communityBasedStandardComponentsListItemTwo": "Vehicles (rent or supply)", + "communityBasedSpecificationsLabel": "Specifications", + "communityBasedSpecificationsWeightLabel": "Weight", + "communityBasedSpecificationsWeightValue": "10 kg", + "communityBasedSpecificationsVolumeLabel": "Carry-on baggage", + "communityBasedSpecificationsVolumeValue": "Volume", + "communityBasedSpecificationsNationLabel": "National societies providing this service:", + "communityBasedSpecificationsNationValue": "Norwegian RC", + "communityBasedSpecificationsAdditionalResources": "Additional Resources", + "communityBasedSpecificationsAdditionalResourcesListItemOne": "Community based surveillance (CBS", + "communityBasedAdditionalResources": "Additional Resources", + "communityBasedAdditionalResourcesListItemOne": "Community based surveillance (CBS) {link}", + "communityBasedAdditionalResourcesListItemOneLink": "website", + "communityBasedAdditionalResourcesListItemTwo": "Public Health ERU Community Base Surveillance {link}", + "communityBasedAdditionalResourcesListItemTwoLink": "Handbook" + } } diff --git a/app/src/views/SurgeCatalogueHealthCommunityBasedSurveillance/index.tsx b/app/src/views/SurgeCatalogueHealthCommunityBasedSurveillance/index.tsx index 841c1c9801..bb3e4394e2 100644 --- a/app/src/views/SurgeCatalogueHealthCommunityBasedSurveillance/index.tsx +++ b/app/src/views/SurgeCatalogueHealthCommunityBasedSurveillance/index.tsx @@ -48,9 +48,6 @@ export function Component() { )} strongLabel /> -
    - {strings.communityBasedPersonnelCompositionDescription} -
    - Date: Wed, 13 Nov 2024 17:50:13 +0545 Subject: [PATCH 08/17] fix: show ICRC presence only for partner countries --- .changeset/slow-bobcats-joke.md | 8 ++ .../Presence/index.tsx | 78 ++++++++++--------- 2 files changed, 49 insertions(+), 37 deletions(-) create mode 100644 .changeset/slow-bobcats-joke.md diff --git a/.changeset/slow-bobcats-joke.md b/.changeset/slow-bobcats-joke.md new file mode 100644 index 0000000000..d1cd423eac --- /dev/null +++ b/.changeset/slow-bobcats-joke.md @@ -0,0 +1,8 @@ +--- +"go-web-app": patch +--- + +Display ICRC Presence + +- Display ICRC presence across partner countries +- Highlight key operational countries diff --git a/app/src/views/CountryNsOverviewSupportingPartners/Presence/index.tsx b/app/src/views/CountryNsOverviewSupportingPartners/Presence/index.tsx index 20452cde1e..afc4a1ac2a 100644 --- a/app/src/views/CountryNsOverviewSupportingPartners/Presence/index.tsx +++ b/app/src/views/CountryNsOverviewSupportingPartners/Presence/index.tsx @@ -169,49 +169,53 @@ function Presence() { )}
    - + {strings.icrc} + + )} + /> + )} + withHeaderBorder + withInternalPadding + > + { + resolveToString( + strings.countryICRCConfirmedPartner, + { year }, + ) + } + {countryResponse.icrc_presence.key_operation && ( +
    - {strings.icrc} + {strings.countryICRCKeyOperations} - )} - /> - )} - withHeaderBorder - withInternalPadding - > - {resolveToString( - strings.countryICRCConfirmedPartner, - { year }, - )} - {countryResponse?.icrc_presence?.key_operation && ( -
    - - {strings.countryICRCKeyOperations} - - {resolveToString( - strings.countryICRCWithin, - { name: countryResponse?.name ?? '--' }, - )} -
    - )} - + {resolveToString( + strings.countryICRCWithin, + { name: countryResponse.name ?? '--' }, + )} +
    + )} +
    + )}
    ); } From 3c6f3312fe65a16731e0a1cc169833d004e5c347 Mon Sep 17 00:00:00 2001 From: Sameer Rai Date: Wed, 13 Nov 2024 20:21:14 +0545 Subject: [PATCH 09/17] v7.6.5-hotfix --- .changeset/cool-eggs-judge.md | 8 -------- .changeset/real-pears-turn.md | 5 ----- .changeset/slow-bobcats-joke.md | 8 -------- app/CHANGELOG.md | 13 +++++++++++++ app/package.json | 2 +- 5 files changed, 14 insertions(+), 22 deletions(-) delete mode 100644 .changeset/cool-eggs-judge.md delete mode 100644 .changeset/real-pears-turn.md delete mode 100644 .changeset/slow-bobcats-joke.md diff --git a/.changeset/cool-eggs-judge.md b/.changeset/cool-eggs-judge.md deleted file mode 100644 index 858992bb30..0000000000 --- a/.changeset/cool-eggs-judge.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"go-web-app": patch ---- - -Update labels for severity control in Imminent Risk Map. -Update navigation for the events in Imminent Risk Map. -Fix issue displayed when opening a DREF import template. -Fix submission issue when importing a DREF import file. diff --git a/.changeset/real-pears-turn.md b/.changeset/real-pears-turn.md deleted file mode 100644 index b6adc8ecec..0000000000 --- a/.changeset/real-pears-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"go-web-app": patch ---- - -Update Health Section in Catalogue of Surge Services diff --git a/.changeset/slow-bobcats-joke.md b/.changeset/slow-bobcats-joke.md deleted file mode 100644 index d1cd423eac..0000000000 --- a/.changeset/slow-bobcats-joke.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"go-web-app": patch ---- - -Display ICRC Presence - -- Display ICRC presence across partner countries -- Highlight key operational countries diff --git a/app/CHANGELOG.md b/app/CHANGELOG.md index c02e7f9a10..488191ca64 100644 --- a/app/CHANGELOG.md +++ b/app/CHANGELOG.md @@ -1,5 +1,18 @@ # go-web-app +## 7.6.5 + +### Patch Changes + +- 478e73b: Update labels for severity control in Imminent Risk Map + Update navigation for the events in Imminent Risk Map + Fix issue displayed when opening a DREF import template + Fix submission issue when importing a DREF import file +- f82f846: Update Health Section in Catalogue of Surge Services +- ade84aa: Display ICRC Presence + - Display ICRC presence across partner countries + - Highlight key operational countries + ## 7.6.4 ### Patch Changes diff --git a/app/package.json b/app/package.json index f23c9be3b5..5f78680d74 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "go-web-app", - "version": "7.6.4", + "version": "7.6.5", "type": "module", "private": true, "license": "MIT", From ecca810fcd95272a30604d10cfe7ed5a465af828 Mon Sep 17 00:00:00 2001 From: Szabo Zoltan Date: Fri, 15 Nov 2024 08:39:55 +0100 Subject: [PATCH 10/17] Replace the from-communication-copied text of CoS Health header --- .changeset/ninety-walls-film.md | 5 +++++ app/src/views/SurgeCatalogueHealth/i18n.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/ninety-walls-film.md diff --git a/.changeset/ninety-walls-film.md b/.changeset/ninety-walls-film.md new file mode 100644 index 0000000000..0b4e3e6fa9 --- /dev/null +++ b/.changeset/ninety-walls-film.md @@ -0,0 +1,5 @@ +--- +"go-web-app": patch +--- + +Replace the from-communication-copied text of CoS Health header diff --git a/app/src/views/SurgeCatalogueHealth/i18n.json b/app/src/views/SurgeCatalogueHealth/i18n.json index a180624a88..448dda3957 100644 --- a/app/src/views/SurgeCatalogueHealth/i18n.json +++ b/app/src/views/SurgeCatalogueHealth/i18n.json @@ -2,7 +2,7 @@ "namespace": "surgeCatalogueHealth", "strings": { "catalogueHealthTitle": "Health", - "healthDetails": "Together with its member National Societies, the IFRC has developed a network of skilled communications professionals to provide management, strategic and technical support and advice to emergency operations, from rapid onset disasters to protracted crises in various contexts. Through our global coordination system, our communications specialists are able to reach millions of people and diverse audiences globally using a wide-range of communication channels.", + "healthDetails": "The IFRC and its member National Societies have a network of personnel, equipment and approaches to prevent, detect and respond to health needs in emergencies, including both clinical and public health Emergency Response Units. These health response tools prevent and treat illness and improve health and dignity for communities affected by slow- and sudden-onset disasters or outbreaks. Deployable health capacities can support inter-agency health coordination, overall strategic direction for health, implementation of community- and clinic-based health interventions, and provide critical lifesaving services to communities, in support of government health systems and services.", "healthServicesTitle": "Services", "healthServicesEruClinicTitle": "Clinical - Emergency Response Unit", "healthClinical": "Clinical", From 2d5f7db8bbc4dc17e89a84c50f6b36ee08de807b Mon Sep 17 00:00:00 2001 From: Sameer Rai Date: Mon, 18 Nov 2024 16:04:27 +0545 Subject: [PATCH 11/17] fix: operational learning bug fixes --- .../components/domain/ExportButton/i18n.json | 4 +- .../components/domain/ExportButton/index.tsx | 8 ++-- .../OperationalLearning/Filters/i18n.json | 2 +- .../AllExtractsModal/Extract/i18n.json | 2 +- .../AllExtractsModal/Extract/index.tsx | 8 ++-- .../Sources/AllExtractsModal/index.tsx | 4 +- .../Sources/Emergency/index.tsx | 4 +- .../OperationalLearning/Sources/index.tsx | 4 +- app/src/views/OperationalLearning/index.tsx | 38 +++++++++---------- .../OperationalLearning/styles.module.css | 7 +--- 10 files changed, 37 insertions(+), 44 deletions(-) diff --git a/app/src/components/domain/ExportButton/i18n.json b/app/src/components/domain/ExportButton/i18n.json index 59505eeee2..10f101de88 100644 --- a/app/src/components/domain/ExportButton/i18n.json +++ b/app/src/components/domain/ExportButton/i18n.json @@ -1,8 +1,8 @@ { "namespace": "common", "strings": { - "exportTableButtonLabel": "Export", - "exportTableDownloadingButtonLabel": "Downloading... ({progress}%)", + "exportButtonLabel": "Export", + "exportDownloadingButtonLabel": "Downloading... ({progress}%)", "pendingExportLabel": "Downloading..." } } diff --git a/app/src/components/domain/ExportButton/index.tsx b/app/src/components/domain/ExportButton/index.tsx index 5d21be37f7..8f845f4ce5 100644 --- a/app/src/components/domain/ExportButton/index.tsx +++ b/app/src/components/domain/ExportButton/index.tsx @@ -29,11 +29,11 @@ function ExportButton(props: Props) { const exportButtonLabel = useMemo(() => { if (!pendingExport) { - return strings.exportTableButtonLabel; + return strings.exportButtonLabel; } if (progress) { return resolveToComponent( - strings.exportTableDownloadingButtonLabel, + strings.exportDownloadingButtonLabel, { progress: ( diff --git a/app/src/views/OperationalLearning/Sources/AllExtractsModal/index.tsx b/app/src/views/OperationalLearning/Sources/AllExtractsModal/index.tsx index c0069bbb1b..47d7e769f3 100644 --- a/app/src/views/OperationalLearning/Sources/AllExtractsModal/index.tsx +++ b/app/src/views/OperationalLearning/Sources/AllExtractsModal/index.tsx @@ -75,9 +75,9 @@ function AllExtractsModal(props: Props) { countryName: countries.find((country) => country.id === learning.appeal?.country)?.name, emergencyId: learning.appeal?.event_details?.id, emergencyName: learning.appeal?.event_details?.name, - appealDocumentURL: learning.document_url, + appealDocumentURL: learning?.document_url, extract: learning.learning_validated, - extractCreatedAt: learning.created_at, + operationStartDate: learning.appeal?.start_date, }); const opsLearningCount = opsLearningResponse?.count ?? 0; diff --git a/app/src/views/OperationalLearning/Sources/Emergency/index.tsx b/app/src/views/OperationalLearning/Sources/Emergency/index.tsx index dd63b51a1c..d15a8d0f26 100644 --- a/app/src/views/OperationalLearning/Sources/Emergency/index.tsx +++ b/app/src/views/OperationalLearning/Sources/Emergency/index.tsx @@ -6,9 +6,9 @@ import Link from '#components/Link'; import styles from './styles.module.css'; interface Props { - emergencyId?: number; + emergencyId: number | null | undefined; emergencyName: string | null | undefined; - appealDocumentURL?: string; + appealDocumentURL: string | null | undefined; appealDocumentName: string | null | undefined; } function Emergency(props: Props) { diff --git a/app/src/views/OperationalLearning/Sources/index.tsx b/app/src/views/OperationalLearning/Sources/index.tsx index 7e47513be6..f96ecc47cd 100644 --- a/app/src/views/OperationalLearning/Sources/index.tsx +++ b/app/src/views/OperationalLearning/Sources/index.tsx @@ -83,8 +83,8 @@ function Sources(props: Props) { }); const appealRendererParams = (_: number, appealDocument: AppealDocument) => ({ - emergencyId: appealDocument.appeal.event.id, - emergencyName: appealDocument.appeal.event.name, + emergencyId: appealDocument.appeal.event?.id, + emergencyName: appealDocument.appeal.event?.name, appealDocumentURL: appealDocument.document_url, appealDocumentName: appealDocument.name, }); diff --git a/app/src/views/OperationalLearning/index.tsx b/app/src/views/OperationalLearning/index.tsx index e0df28f32d..52117b780f 100644 --- a/app/src/views/OperationalLearning/index.tsx +++ b/app/src/views/OperationalLearning/index.tsx @@ -3,7 +3,6 @@ import { useMemo, useState, } from 'react'; -import { InfoIcon } from '@ifrc-go/icons'; import { Button, Chip, @@ -303,26 +302,23 @@ export function Component() { mainSectionClassName={styles.mainSection} infoContainerClassName={styles.oldDashboardInfo} info={( - <> - -
    - {resolveToComponent( - strings.disclaimerMessage, - { - link: ( - - {strings.here} - - ), - }, - )} -
    - +
    + {resolveToComponent( + strings.disclaimerMessage, + { + link: ( + + {strings.here} + + ), + }, + )} +
    )} > Date: Fri, 22 Nov 2024 14:44:33 +0545 Subject: [PATCH 12/17] fix: conditionally display view/edit options based on permissions and hide contact details --- .../LocalUnitsForm/index.tsx | 27 +++- .../LocalUnitsMap/i18n.json | 4 +- .../LocalUnitsMap/index.tsx | 6 +- .../LocalUnitTableActions/index.tsx | 5 +- .../LocalUnitsTable/index.tsx | 151 ++++++++++++------ .../NationalSocietyLocalUnits/index.tsx | 4 +- 6 files changed, 138 insertions(+), 59 deletions(-) diff --git a/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsFormModal/LocalUnitsForm/index.tsx b/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsFormModal/LocalUnitsForm/index.tsx index 70403102bd..27a55387a1 100644 --- a/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsFormModal/LocalUnitsForm/index.tsx +++ b/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsFormModal/LocalUnitsForm/index.tsx @@ -42,6 +42,7 @@ import CountrySelectInput from '#components/domain/CountrySelectInput'; import NonFieldError from '#components/NonFieldError'; import { environment } from '#config'; import useGlobalEnums from '#hooks/domain/useGlobalEnums'; +import usePermissions from '#hooks/domain/usePermissions'; import useAlert from '#hooks/useAlert'; import { getFirstTruthyString } from '#utils/common'; import { VISIBILITY_PUBLIC } from '#utils/constants'; @@ -129,10 +130,13 @@ function LocalUnitsForm(props: Props) { const alert = useAlert(); const strings = useTranslation(i18n); + const { isSuperUser, isCountryAdmin } = usePermissions(); const formFieldsContainerRef = useRef(null); const { api_visibility_choices: visibilityOptions } = useGlobalEnums(); const { countryId } = useOutletContext(); + const hasAddEditLocalUnitPermission = isCountryAdmin(Number(countryId)) || isSuperUser; + const { value, error: formError, @@ -317,7 +321,7 @@ function LocalUnitsForm(props: Props) {
    {readOnly && isDefined(actionsContainerRef.current) && ( - {(environment !== 'production') && ( + {hasAddEditLocalUnitPermission && environment !== 'production' && ( @@ -470,7 +470,7 @@ function LocalUnitsMap(props: Props) { value={localUnitAddress} /> diff --git a/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsTable/LocalUnitTableActions/index.tsx b/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsTable/LocalUnitTableActions/index.tsx index 2b19f7d223..fc1f84b520 100644 --- a/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsTable/LocalUnitTableActions/index.tsx +++ b/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsTable/LocalUnitTableActions/index.tsx @@ -28,6 +28,7 @@ export interface Props { localUnitId: number; isValidated: boolean; onActionSuccess: () => void; + hasAddEditLocalUnitPermission: boolean; } export type LocalUnitValidateResponsePostBody = GoApiResponse<'/api/v2/local-units/{id}/'>; @@ -39,6 +40,7 @@ function LocalUnitsTableActions(props: Props) { localUnitId, isValidated, onActionSuccess, + hasAddEditLocalUnitPermission, } = props; const { isCountryAdmin, isSuperUser } = usePermissions(); @@ -89,7 +91,6 @@ function LocalUnitsTableActions(props: Props) { type="button" name={localUnitId} onClick={handleViewLocalUnitClick} - disabled={!hasValidatePermission} > {strings.localUnitsView} @@ -97,7 +98,7 @@ function LocalUnitsTableActions(props: Props) { type="button" name={localUnitId} onClick={handleEditLocalUnitClick} - disabled={!hasValidatePermission} + disabled={!hasAddEditLocalUnitPermission} > {strings.localUnitsEdit} diff --git a/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsTable/index.tsx b/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsTable/index.tsx index 9886f24e6b..dfa8a08a10 100644 --- a/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsTable/index.tsx +++ b/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsTable/index.tsx @@ -19,6 +19,7 @@ import { isNotDefined, } from '@togglecorp/fujs'; +import usePermissions from '#hooks/domain/usePermissions'; import useFilterState from '#hooks/useFilterState'; import { getFirstTruthyString } from '#utils/common'; import { type CountryOutletContext } from '#utils/outletContext'; @@ -52,6 +53,8 @@ function LocalUnitsTable(props: Props) { const strings = useTranslation(i18n); const { countryResponse } = useOutletContext(); + const { isSuperUser, isCountryAdmin } = usePermissions(); + const hasAddEditLocalUnitPermission = isCountryAdmin(countryResponse?.id) || isSuperUser; const { limit, @@ -89,57 +92,111 @@ function LocalUnitsTable(props: Props) { }); const columns = useMemo( - () => ([ - createStringColumn( - 'branch_name', - strings.localUnitsTableName, - (item) => getFirstTruthyString(item.local_branch_name, item.english_branch_name), - ), - createStringColumn( - 'address', - strings.localUnitsTableAddress, - (item) => getFirstTruthyString(item.address_loc, item.address_en), - ), - createStringColumn( - 'type', - strings.localUnitsTableType, - (item) => item.type_details.name, - { columnClassName: styles.type }, - ), - createStringColumn( - 'focal', - strings.localUnitsTableFocal, - (item) => getFirstTruthyString(item.focal_person_loc, item.focal_person_en), - ), - createStringColumn( - 'phone', - strings.localUnitsTablePhoneNumber, - (item) => item.phone, - ), - createStringColumn( - 'email', - strings.localUnitsTableEmail, - (item) => item.email, - ), - createElementColumn( - 'actions', - '', - LocalUnitsTableActions, - // FIXME: this should be added to a callback - (_, item) => ({ - countryId: item.country, - localUnitId: item.id, - isValidated: item.validated, - localUnitName: getFirstTruthyString( + () => { + if (hasAddEditLocalUnitPermission) { + return [ + createStringColumn( + 'branch_name', + strings.localUnitsTableName, + (item) => getFirstTruthyString( + item.local_branch_name, + item.english_branch_name, + ), + ), + createStringColumn( + 'address', + strings.localUnitsTableAddress, + (item) => getFirstTruthyString(item.address_loc, item.address_en), + ), + createStringColumn( + 'type', + strings.localUnitsTableType, + (item) => item.type_details.name, + { columnClassName: styles.type }, + ), + createStringColumn( + 'focal', + strings.localUnitsTableFocal, + (item) => getFirstTruthyString( + item.focal_person_loc, + item.focal_person_en, + ), + ), + createStringColumn( + 'phone', + strings.localUnitsTablePhoneNumber, + (item) => item.phone, + ), + createStringColumn( + 'email', + strings.localUnitsTableEmail, + (item) => item.email, + ), + createElementColumn< + LocalUnitsTableListItem, + number, + LocalUnitsTableActionsProps + >( + 'actions', + '', + LocalUnitsTableActions, + // FIXME: this should be added to a callback + (_, item) => ({ + countryId: item.country, + localUnitId: item.id, + isValidated: item.validated, + localUnitName: getFirstTruthyString( + item.local_branch_name, + item.english_branch_name, + ), + onActionSuccess: refetchLocalUnits, + }), + { columnClassName: styles.actions }, + ), + ]; + } + return [ + createStringColumn( + 'branch_name', + strings.localUnitsTableName, + (item) => getFirstTruthyString( item.local_branch_name, item.english_branch_name, ), - onActionSuccess: refetchLocalUnits, - }), - { columnClassName: styles.actions }, - ), - ]), + ), + createStringColumn( + 'address', + strings.localUnitsTableAddress, + (item) => getFirstTruthyString(item.address_loc, item.address_en), + ), + createStringColumn( + 'type', + strings.localUnitsTableType, + (item) => item.type_details.name, + { columnClassName: styles.type }, + ), + createElementColumn( + 'actions', + '', + LocalUnitsTableActions, + // FIXME: this should be added to a callback + (_, item) => ({ + countryId: item.country, + localUnitId: item.id, + isValidated: item.validated, + localUnitName: getFirstTruthyString( + item.local_branch_name, + item.english_branch_name, + ), + onActionSuccess: refetchLocalUnits, + hasAddEditLocalUnitPermission, + }), + { columnClassName: styles.actions }, + ), + ]; + }, [ + hasAddEditLocalUnitPermission, strings.localUnitsTableAddress, strings.localUnitsTableName, strings.localUnitsTableType, diff --git a/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/index.tsx b/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/index.tsx index bdcc77c460..d43a51477f 100644 --- a/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/index.tsx +++ b/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/index.tsx @@ -111,7 +111,7 @@ function NationalSocietyLocalUnits(props: Props) { const strings = useTranslation(i18n); - const hasAddLocalUnitPermission = isCountryAdmin(countryResponse?.id) || isSuperUser; + const hasAddEditLocalUnitPermission = isCountryAdmin(countryResponse?.id) || isSuperUser; useEffect(() => { document.addEventListener('fullscreenchange', handleFullScreenChange); @@ -148,7 +148,7 @@ function NationalSocietyLocalUnits(props: Props) { /> )} // NOTE: disable local units add/edit for now - actions={hasAddLocalUnitPermission && (environment !== 'production') && ( + actions={hasAddEditLocalUnitPermission && (environment !== 'production') && (