Skip to content

Commit cfdb202

Browse files
authored
Merge pull request #2001 from IFRCGo/feature/update-active-operation-map
Update visible appeal types in Active Operations map
2 parents 894ec29 + 7ef5534 commit cfdb202

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

.changeset/violet-pans-speak.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"go-web-app": minor
3+
---
4+
5+
Update visible appeal types in Active Operations map
6+
7+
- Remove `Forecased Based Action` and `International Appeal` options from appeals filter
8+
- Remove Early Action Protocol Activation from legend

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,10 @@ import { useRequest } from '#utils/restRequest';
5656
import GlobalMap, { type AdminZeroFeatureProperties } from '../GlobalMap';
5757
import {
5858
APPEAL_TYPE_DREF,
59-
APPEAL_TYPE_EAP,
6059
APPEAL_TYPE_EMERGENCY,
6160
APPEAL_TYPE_MULTIPLE,
6261
basePointLayerOptions,
6362
COLOR_DREF,
64-
COLOR_EAP,
6563
COLOR_EMERGENCY_APPEAL,
6664
COLOR_MULTIPLE_TYPES,
6765
optionKeySelector,
@@ -177,14 +175,21 @@ function ActiveOperationMap(props: Props) {
177175

178176
const [scaleBy, setScaleBy] = useInputState<ScaleOption['value']>('peopleTargeted');
179177
const strings = useTranslation(i18n);
180-
const { api_appeal_type: appealTypeOptions } = useGlobalEnums();
178+
const { api_appeal_type: appealTypeOptionsRaw } = useGlobalEnums();
181179
const {
182180
response: appealResponse,
183181
} = useRequest({
184182
url: '/api/v2/appeal/',
185183
query,
186184
});
187185

186+
const appealTypeOptions = useMemo(() => (
187+
appealTypeOptionsRaw?.filter(
188+
(appealTypeOption) => appealTypeOption.key === APPEAL_TYPE_DREF
189+
|| appealTypeOption.key === APPEAL_TYPE_EMERGENCY,
190+
)
191+
), [appealTypeOptionsRaw]);
192+
188193
const countryResponse = useCountryRaw();
189194

190195
const scaleOptions: ScaleOption[] = useMemo(() => ([
@@ -206,11 +211,6 @@ function ActiveOperationMap(props: Props) {
206211
label: strings.explanationBubbleDref,
207212
color: COLOR_DREF,
208213
},
209-
{
210-
value: APPEAL_TYPE_EAP,
211-
label: strings.explanationBubbleEAP,
212-
color: COLOR_EAP,
213-
},
214214
{
215215
value: APPEAL_TYPE_MULTIPLE,
216216
label: strings.explanationBubbleMultiple,
@@ -219,7 +219,8 @@ function ActiveOperationMap(props: Props) {
219219
]), [
220220
strings.explanationBubbleEmergencyAppeal,
221221
strings.explanationBubbleDref,
222-
strings.explanationBubbleEAP,
222+
// FIXME: string to be removed
223+
// strings.explanationBubbleEAP,
223224
strings.explanationBubbleMultiple,
224225
]);
225226

0 commit comments

Comments
 (0)