From a2eece29400169aa38e2e3c65051f900c4849c74 Mon Sep 17 00:00:00 2001 From: tnagorra Date: Tue, 12 Nov 2024 16:23:37 +0545 Subject: [PATCH 1/3] 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 2/3] 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 3/3] 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',