Skip to content

Commit 25a1169

Browse files
authored
Merge pull request #1569 from IFRCGo/feat/cherry-pick-hotfixes-v7.6.4-v7.6.6
Cherry pick changes from hotfixes v7.6.4 - v7.6.6
2 parents dac92a0 + a48bae0 commit 25a1169

File tree

54 files changed

+773
-469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+773
-469
lines changed

.changeset/real-pears-turn.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
# go-web-app
22

3+
## 7.6.6
4+
5+
### Patch Changes
6+
7+
- 8cdc946: Hide Local unit contact details on the list view for logged in users in [#1485](https://github.com/ifRCGo/go-web-app/issues/1485)
8+
Update `tinymce-react` plugin to the latest version and enabled additional plugins, including support for lists in [#1481](https://github.com/ifRCGo/go-web-app/issues/1481)
9+
- ecca810: Replace the from-communication-copied text of CoS Health header
10+
- 7cf2514: Prioritize GDACS as the Primary Source for Imminent Risk Watch in [#1547](https://github.com/IFRCGo/go-web-app/issues/1547)
11+
- 8485076: Add Organization type and Learning type filter in Operational learning in [#1469](https://github.com/IFRCGo/go-web-app/issues/1469)
12+
- 766d98d: Auto append https:// for incomplete URLs in [#1505](https://github.com/IFRCGo/go-web-app/issues/1505)
13+
14+
## 7.6.5
15+
16+
### Patch Changes
17+
18+
- 478e73b: Update labels for severity control in Imminent Risk Map
19+
Update navigation for the events in Imminent Risk Map
20+
Fix issue displayed when opening a DREF import template
21+
Fix submission issue when importing a DREF import file
22+
- f82f846: Update Health Section in Catalogue of Surge Services
23+
- ade84aa: Display ICRC Presence
24+
- Display ICRC presence across partner countries
25+
- Highlight key operational countries
26+
27+
## 7.6.4
28+
29+
### Patch Changes
30+
31+
- d85f64d: Update Imminent Events
32+
33+
- Hide WFP ADAM temporarily from list sources
34+
- Show exposure control for cyclones from GDACS only
35+
336
## 7.6.3
437

538
### Patch Changes

app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "go-web-app",
3-
"version": "7.6.3",
3+
"version": "7.6.6",
44
"type": "module",
55
"private": true,
66
"license": "MIT",
@@ -40,7 +40,7 @@
4040
"@ifrc-go/icons": "^2.0.1",
4141
"@ifrc-go/ui": "^1.2.1",
4242
"@sentry/react": "^7.81.1",
43-
"@tinymce/tinymce-react": "^4.3.0",
43+
"@tinymce/tinymce-react": "^5.1.1",
4444
"@togglecorp/fujs": "^2.1.1",
4545
"@togglecorp/re-map": "^0.3.0",
4646
"@togglecorp/toggle-form": "^2.0.4",

app/scripts/translatte/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ yargs(hideBin(process.argv))
118118
});
119119
},
120120
async (argv) => {
121-
console.warn(argv);
122121
await applyMigrations(
123122
currentDir,
124123
argv.SOURCE_FILE as string,

app/src/components/RichTextArea/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ const editorOptions: Omit<RawEditorOptions, 'selector' | 'target'> = {
1919
menubar: false, // https://www.tiny.cloud/docs/advanced/available-toolbar-buttons
2020
statusbar: false,
2121
paste_data_images: false,
22-
plugins: ['advlist autolink code help link lists preview'],
23-
toolbar: 'formatselect | bold italic superscript link | '
22+
plugins: 'advlist autolink code help link lists preview',
23+
toolbar: 'bold italic subscript superscript link | '
2424
+ 'alignleft aligncenter alignright alignjustify | '
25-
+ 'bullist numlist outdent indent | code removeformat preview | help',
26-
contextmenu: 'formats link',
25+
+ 'bullist numlist outdent indent | code removeformat preview fullscreen | help',
26+
contextmenu: 'link',
2727
// https://www.tiny.cloud/docs/configure/content-filtering/#invalid_styles
2828
invalid_styles: { '*': 'opacity' },
2929
};
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"namespace": "exportButton",
33
"strings": {
4-
"exportTableButtonLabel": "Export",
5-
"exportTableDownloadingButtonLabel": "Downloading... ({progress}%)",
4+
"exportButtonLabel": "Export",
5+
"exportDownloadingButtonLabel": "Downloading... ({progress}%)",
66
"pendingExportLabel": "Downloading..."
77
}
88
}

app/src/components/domain/ExportButton/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ function ExportButton(props: Props) {
2929

3030
const exportButtonLabel = useMemo(() => {
3131
if (!pendingExport) {
32-
return strings.exportTableButtonLabel;
32+
return strings.exportButtonLabel;
3333
}
3434
if (progress) {
3535
return resolveToComponent(
36-
strings.exportTableDownloadingButtonLabel,
36+
strings.exportDownloadingButtonLabel,
3737
{
3838
progress: (
3939
<NumberOutput
@@ -46,8 +46,8 @@ function ExportButton(props: Props) {
4646
}
4747
return strings.pendingExportLabel;
4848
}, [
49-
strings.exportTableButtonLabel,
50-
strings.exportTableDownloadingButtonLabel,
49+
strings.exportButtonLabel,
50+
strings.exportDownloadingButtonLabel,
5151
strings.pendingExportLabel,
5252
progress,
5353
pendingExport,

app/src/components/domain/RiskImminentEventMap/LayerOptions/index.tsx

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,36 @@ function colorSelector(item: SeverityLegendItem) {
4343
interface Props {
4444
value: LayerOptionsValue;
4545
onChange: React.Dispatch<React.SetStateAction<LayerOptionsValue>>;
46+
47+
exposureAreaControlHidden?: boolean;
4648
}
4749

4850
function LayerOptions(props: Props) {
4951
const {
52+
exposureAreaControlHidden,
5053
value,
5154
onChange,
5255
} = props;
5356

5457
const setFieldValue = useSetFieldValue(onChange);
5558

5659
// FIXME: use strings
60+
// FIXME: These are hard-coded for Gdacs source.
61+
// Currently we are only showing severity control for Gdacs
5762
const severityLegendItems = useMemo<SeverityLegendItem[]>(() => ([
5863
{
5964
severity: 'green',
60-
label: 'Green',
65+
label: '60 km/h',
6166
color: COLOR_GREEN,
6267
},
6368
{
6469
severity: 'orange',
65-
label: 'Orange',
70+
label: '90 km/h',
6671
color: COLOR_ORANGE,
6772
},
6873
{
6974
severity: 'red',
70-
label: 'Red',
75+
label: '120 km/h',
7176
color: COLOR_RED,
7277
},
7378
{
@@ -92,28 +97,30 @@ function LayerOptions(props: Props) {
9297
withBackground
9398
withInvertedView
9499
/>
95-
<div className={styles.exposedAreaInputWrapper}>
96-
<Switch
97-
// FIXME: use strings
98-
label="Exposed area to tropical storm or cyclone strength wind"
99-
name="showExposedArea"
100-
value={value.showExposedArea}
101-
onChange={setFieldValue}
102-
withInvertedView
103-
/>
104-
{value.showExposedArea && (
105-
<Legend
106-
className={styles.exposedAreaLegend}
100+
{!exposureAreaControlHidden && (
101+
<div className={styles.exposedAreaInputWrapper}>
102+
<Switch
107103
// FIXME: use strings
108-
label="Severity:"
109-
items={severityLegendItems}
110-
keySelector={severitySelector}
111-
labelSelector={labelSelector}
112-
colorSelector={colorSelector}
113-
labelClassName={styles.legendLabel}
104+
label="Exposed area to tropical storm or cyclone strength wind"
105+
name="showExposedArea"
106+
value={value.showExposedArea}
107+
onChange={setFieldValue}
108+
withInvertedView
114109
/>
115-
)}
116-
</div>
110+
{value.showExposedArea && (
111+
<Legend
112+
className={styles.exposedAreaLegend}
113+
// FIXME: use strings
114+
label="Severity:"
115+
items={severityLegendItems}
116+
keySelector={severitySelector}
117+
labelSelector={labelSelector}
118+
colorSelector={colorSelector}
119+
labelClassName={styles.legendLabel}
120+
/>
121+
)}
122+
</div>
123+
)}
117124
<Switch
118125
// FIXME: use strings
119126
label="Storm track"

app/src/components/domain/RiskImminentEventMap/i18n.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"namespace": "riskImminentEventMap",
33
"strings": {
44
"riskImminentEventsMap": "Risk Imminent Events Map",
5-
"backToEventsLabel": "Back to events",
65
"emptyImminentEventMessage": "No imminent event forecasted"
76
}
87
}

app/src/components/domain/RiskImminentEventMap/index.tsx

Lines changed: 58 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import {
33
useMemo,
44
useState,
55
} from 'react';
6-
import { ChevronLeftLineIcon } from '@ifrc-go/icons';
76
import {
8-
Button,
97
Container,
108
List,
119
} from '@ifrc-go/ui';
@@ -86,8 +84,10 @@ export type EventPointFeature = GeoJSON.Feature<GeoJSON.Point, EventPointPropert
8684

8785
export interface RiskEventListItemProps<EVENT> {
8886
data: EVENT;
87+
expanded: boolean;
8988
onExpandClick: (eventId: number | string) => void;
9089
className?: string;
90+
children?: React.ReactNode;
9191
}
9292

9393
export interface RiskEventDetailProps<EVENT, EXPOSURE> {
@@ -99,7 +99,13 @@ export interface RiskEventDetailProps<EVENT, EXPOSURE> {
9999

100100
type Footprint = GeoJSON.FeatureCollection<GeoJSON.Geometry, RiskLayerProperties> | undefined;
101101

102+
// FIXME: read this from common type
103+
type ImminentEventSource = 'pdc' | 'wfpAdam' | 'gdacs' | 'meteoSwiss';
104+
102105
interface Props<EVENT, EXPOSURE, KEY extends string | number> {
106+
// FIXME: use props for configuration rather than
107+
// passing source here
108+
source: ImminentEventSource;
103109
events: EVENT[] | undefined;
104110
keySelector: (event: EVENT) => KEY;
105111
hazardTypeSelector: (event: EVENT) => HazardType | '' | undefined;
@@ -134,6 +140,7 @@ function RiskImminentEventMap<
134140
bbox,
135141
onActiveEventChange,
136142
activeEventExposurePending,
143+
source,
137144
} = props;
138145

139146
const strings = useTranslation(i18n);
@@ -238,10 +245,15 @@ function RiskImminentEventMap<
238245
(eventId: string | number | undefined) => {
239246
const eventIdSafe = eventId as KEY | undefined;
240247

241-
setActiveEventId(eventIdSafe);
242-
onActiveEventChange(eventIdSafe);
248+
if (activeEventId === eventIdSafe) {
249+
setActiveEventId(undefined);
250+
onActiveEventChange(undefined);
251+
} else {
252+
setActiveEventId(eventIdSafe);
253+
onActiveEventChange(eventIdSafe);
254+
}
243255
},
244-
[onActiveEventChange],
256+
[onActiveEventChange, activeEventId],
245257
);
246258

247259
const handlePointClick = useCallback(
@@ -253,17 +265,44 @@ function RiskImminentEventMap<
253265
[setActiveEventIdSafe],
254266
);
255267

268+
const DetailComponent = detailRenderer;
269+
256270
const eventListRendererParams = useCallback(
257271
(_: string | number, event: EVENT): RiskEventListItemProps<EVENT> => ({
258272
data: event,
259273
onExpandClick: setActiveEventIdSafe,
274+
expanded: activeEventId === keySelector(event),
260275
className: styles.riskEventListItem,
276+
children: activeEventId === keySelector(event) && (
277+
<DetailComponent
278+
data={event}
279+
exposure={activeEventExposure}
280+
pending={activeEventExposurePending}
281+
>
282+
{hazardTypeSelector(event) === 'TC' && (
283+
<LayerOptions
284+
value={layerOptions}
285+
// NOTE: Currently the information is only visible in gdacas
286+
exposureAreaControlHidden={source !== 'gdacs'}
287+
onChange={setLayerOptions}
288+
/>
289+
)}
290+
</DetailComponent>
291+
),
261292
}),
262-
[setActiveEventIdSafe],
293+
[
294+
setActiveEventIdSafe,
295+
activeEventExposure,
296+
activeEventExposurePending,
297+
layerOptions,
298+
hazardTypeSelector,
299+
DetailComponent,
300+
activeEventId,
301+
keySelector,
302+
source,
303+
],
263304
);
264305

265-
const DetailComponent = detailRenderer;
266-
267306
const [loadedIcons, setLoadedIcons] = useState<Record<string, boolean>>({});
268307

269308
const handleIconLoad = useCallback(
@@ -438,46 +477,18 @@ function RiskImminentEventMap<
438477
withInternalPadding
439478
childrenContainerClassName={styles.content}
440479
spacing="cozy"
441-
actions={isDefined(activeEventId) && (
442-
<Button
443-
name={undefined}
444-
onClick={setActiveEventIdSafe}
445-
variant="tertiary"
446-
icons={(
447-
<ChevronLeftLineIcon className={styles.icon} />
448-
)}
449-
>
450-
{strings.backToEventsLabel}
451-
</Button>
452-
)}
453480
>
454-
{isNotDefined(activeEventId) && (
455-
<List
456-
className={styles.eventList}
457-
filtered={false}
458-
pending={pending}
459-
errored={false}
460-
data={events}
461-
keySelector={keySelector}
462-
renderer={listItemRenderer}
463-
rendererParams={eventListRendererParams}
464-
emptyMessage={strings.emptyImminentEventMessage}
465-
/>
466-
)}
467-
{isDefined(activeEvent) && (
468-
<DetailComponent
469-
data={activeEvent}
470-
exposure={activeEventExposure}
471-
pending={activeEventExposurePending}
472-
>
473-
{hazardTypeSelector(activeEvent) === 'TC' && (
474-
<LayerOptions
475-
value={layerOptions}
476-
onChange={setLayerOptions}
477-
/>
478-
)}
479-
</DetailComponent>
480-
)}
481+
<List
482+
className={styles.eventList}
483+
filtered={false}
484+
pending={pending}
485+
errored={false}
486+
data={events}
487+
keySelector={keySelector}
488+
renderer={listItemRenderer}
489+
rendererParams={eventListRendererParams}
490+
emptyMessage={strings.emptyImminentEventMessage}
491+
/>
481492
</Container>
482493
</div>
483494
);

0 commit comments

Comments
 (0)