Skip to content

Commit 7b2a197

Browse files
shreeyash07frozenhelium
authored andcommitted
feat(active-operation): remove disaster Uncategorised from the label and map
- add filter for event and needs_confirmation for appeal response
1 parent eb0654c commit 7b2a197

7 files changed

Lines changed: 14 additions & 18 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import GlobalMap, { type AdminZeroFeatureProperties } from '../../GlobalMap';
4242
import {
4343
APPEAL_TYPE_MULTIPLE,
4444
basePointLayerOptions,
45-
DISASTER_UNCATEGORISED,
4645
optionKeySelector,
4746
optionLabelSelector,
4847
outerCircleLayerOptionsForFinancialRequirements,
@@ -138,7 +137,7 @@ function OperationMapContainer(props: Props) {
138137
));
139138
return highestSeverity[0];
140139
}
141-
if (uniqueEventList.length === 0) return DISASTER_UNCATEGORISED;
140+
if (uniqueEventList.length === 0) return undefined;
142141
return uniqueEventList[0];
143142
});
144143

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"crisisRedEmergency": "Red Emergency",
2323
"crisisOrangeEmergency": "Orange Emergency",
2424
"crisisYellowEmergency": "Yellow Emergency",
25-
"crisisUncategorisedEmergency": "Uncategorised",
2625
"explanationBubblePopulationLabel": "# of people targeted",
2726
"explanationBubbleAmountLabel": "IFRC financial requirements"
2827
}

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import Link from '#components/Link';
2727
import useGlobalEnums from '#hooks/domain/useGlobalEnums';
2828
import useFilterState from '#hooks/useFilterState';
2929
import {
30-
COLOR_BLACK,
3130
DISASTER_CATEGORY_ORANGE,
3231
DISASTER_CATEGORY_RED,
3332
DISASTER_CATEGORY_YELLOW,
@@ -49,7 +48,6 @@ import {
4948
COLOR_ORANGE_SEVERITY,
5049
COLOR_RED_SEVERITY,
5150
COLOR_YELLOW_SEVERITY,
52-
DISASTER_UNCATEGORISED,
5351
type ScaleOption,
5452
} from './utils';
5553

@@ -130,6 +128,10 @@ function ActiveOperationMap(props: Props) {
130128
dtype: filter.displacement,
131129
district: hasSomeDefinedValue(filter.district) ? filter.district : undefined,
132130
end_date__gt: now,
131+
// NOTE: Filtering only those appeals that has not been confirmed
132+
// and does not contain event
133+
has_event: true,
134+
needs_confirmation: false,
133135
start_date__gte: filter.startDateAfter,
134136
start_date__lte: filter.startDateBefore,
135137
limit,
@@ -249,11 +251,6 @@ function ActiveOperationMap(props: Props) {
249251
label: strings.crisisYellowEmergency,
250252
color: COLOR_YELLOW_SEVERITY,
251253
},
252-
{
253-
value: DISASTER_UNCATEGORISED,
254-
label: strings.crisisUncategorisedEmergency,
255-
color: COLOR_BLACK,
256-
},
257254
]);
258255
}, [strings, activeTab]);
259256

app/src/components/domain/ActiveOperationMap/utils.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,23 @@ import type {
44
} from 'mapbox-gl';
55

66
import {
7-
COLOR_BLACK,
87
COLOR_BLUE,
8+
COLOR_DREF_YELLOW,
99
COLOR_LIGHT_GREY,
1010
COLOR_ORANGE,
1111
COLOR_RED,
12-
COLOR_YELLOW,
1312
DISASTER_CATEGORY_ORANGE,
1413
DISASTER_CATEGORY_RED,
1514
DISASTER_CATEGORY_YELLOW,
1615
type DisasterCategory,
1716
} from '#utils/constants';
1817

1918
export const COLOR_EMERGENCY_APPEAL = COLOR_RED;
20-
export const COLOR_DREF = COLOR_YELLOW;
19+
export const COLOR_DREF = COLOR_DREF_YELLOW;
2120
export const COLOR_EAP = COLOR_BLUE;
2221
export const COLOR_MULTIPLE_TYPES = COLOR_ORANGE;
2322

24-
export const COLOR_YELLOW_SEVERITY = COLOR_YELLOW;
23+
export const COLOR_YELLOW_SEVERITY = COLOR_DREF_YELLOW;
2524
export const COLOR_ORANGE_SEVERITY = COLOR_ORANGE;
2625
export const COLOR_RED_SEVERITY = COLOR_RED;
2726

@@ -31,7 +30,6 @@ export const APPEAL_TYPE_EMERGENCY = 1;
3130
// const APPEAL_TYPE_INTERNATIONAL = 2; // TODO: we are not showing this?
3231
export const APPEAL_TYPE_EAP = 3;
3332
export const APPEAL_TYPE_MULTIPLE = -1;
34-
export const DISASTER_UNCATEGORISED = -1;
3533

3634
export const severityOrderMapping: Record<DisasterCategory, number> = {
3735
[DISASTER_CATEGORY_RED]: 1,
@@ -66,8 +64,6 @@ const circleColor: CirclePaint['circle-color'] = [
6664
COLOR_RED_SEVERITY,
6765
DISASTER_CATEGORY_YELLOW,
6866
COLOR_YELLOW_SEVERITY,
69-
DISASTER_UNCATEGORISED,
70-
COLOR_BLACK,
7167
COLOR_LIGHT_GREY,
7268
],
7369
COLOR_LIGHT_GREY,

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ function AppealsTable(props: Props) {
236236
ordering: orderingWithFallback,
237237
atype: filter.appeal,
238238
dtype: filter.displacement,
239+
// NOTE: Filtering those appeals that has not been confirmed and does not
240+
// contain event
241+
has_event: true,
242+
needs_confirmation: false,
239243
district: hasSomeDefinedValue(filter.district) ? filter.district : undefined,
240244
end_date__gt: withPastOperations ? undefined : now,
241245
start_date__gte: filter.startDateAfter,

app/src/utils/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export const COLOR_DARK_GREY = '#a5a5a5';
6565
export const COLOR_BLACK = '#000000';
6666
// const COLOR_LIGHT_YELLOW = '#ffd470';
6767
export const COLOR_YELLOW = '#ff9e00';
68+
export const COLOR_DREF_YELLOW = '#FFF939';
6869
export const COLOR_BLUE = '#4c5d9b';
6970
export const COLOR_LIGHT_BLUE = '#c7d3e0';
7071
export const COLOR_ORANGE = '#ff8000';

go-api

0 commit comments

Comments
 (0)