Skip to content

Commit

Permalink
Merged in fix/GFW-1478_overlapping_alerts_DR (pull request #495)
Browse files Browse the repository at this point in the history
Normal: Fix/GFW-1478 overlapping alerts DR (medium)

Approved-by: Kevin Borrill
Approved-by: Ri
  • Loading branch information
Owen Evans committed Feb 17, 2023
2 parents 8f1fba3 + 3524286 commit 9137722
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/ui/Map/components/cards/AlertSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const AlertSelectionCard: FC<IProps> = props => {
setValue("overlappedSelect", undefined);
handleSelectedPointsConfirm(overlappedSelect);
}}
disabled={overlappedSelect?.length === 0}
disabled={!overlappedSelect || overlappedSelect.length === 0}
>
<FormattedMessage id="alerts.deforestation.multiple.continue" />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface IProps {
points: IPoint[];
pointStyle?: Record<any, any>;
onSquareSelect?: (ids: string[], point: mapboxgl.Point) => void;
forceHoveredSquareIds?: string[] | null;
selectedSquareIds?: string[] | null;
mapRef: MapInstance | null;
goToPoints?: boolean;
Expand All @@ -48,6 +49,7 @@ const SquareClusterMarkers: FC<IProps> = props => {
pointDataType = EPointDataTypes.Reports,
points,
onSquareSelect,
forceHoveredSquareIds,
selectedSquareIds,
mapRef,
pointStyle = defaultPointStyle,
Expand Down Expand Up @@ -85,7 +87,7 @@ const SquareClusterMarkers: FC<IProps> = props => {
id: point.id,
icon: iconGenerator(
point.type || "",
point.id === hoveredPoint,
point.id === hoveredPoint || forceHoveredSquareIds?.includes(point.id),
selectedPoints?.length
? canMultiSelect
? selectedPoints.includes(point.id)
Expand All @@ -96,7 +98,7 @@ const SquareClusterMarkers: FC<IProps> = props => {
})
)
),
[hoveredPoint, iconGenerator, points, selectedPoints, canMultiSelect]
[hoveredPoint, iconGenerator, points, selectedPoints, forceHoveredSquareIds, canMultiSelect]
);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const AreaAlertMapSource: FC<IProps> = props => {
id="alerts"
pointDataType={EPointDataTypes.Alerts}
points={alertPoints}
forceHoveredSquareIds={multipleAlertsToPick}
selectedSquareIds={selectedAlertIds}
pointStyle={{
...pointStyle,
Expand Down

0 comments on commit 9137722

Please sign in to comment.