From 435303ebfd730cf1bc99549a887638d76eda1d90 Mon Sep 17 00:00:00 2001 From: Vincent de Graaf Date: Mon, 25 Mar 2024 15:06:17 +0100 Subject: [PATCH] Do not render AssetList when selectableFeatures is empty array\ (#2834) --- .../Asset/Selector/DetailPanel/DetailPanel.test.tsx | 1 + .../MapSelectors/Asset/Selector/DetailPanel/DetailPanel.tsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/signals/incident/components/form/MapSelectors/Asset/Selector/DetailPanel/DetailPanel.test.tsx b/src/signals/incident/components/form/MapSelectors/Asset/Selector/DetailPanel/DetailPanel.test.tsx index 9ffab29533..b305e01e0f 100644 --- a/src/signals/incident/components/form/MapSelectors/Asset/Selector/DetailPanel/DetailPanel.test.tsx +++ b/src/signals/incident/components/form/MapSelectors/Asset/Selector/DetailPanel/DetailPanel.test.tsx @@ -127,6 +127,7 @@ describe('DetailPanel', () => { withAssetSelectContext(, { ...currentContextValue, selection: undefined, + selectableFeatures: [], }) ) diff --git a/src/signals/incident/components/form/MapSelectors/Asset/Selector/DetailPanel/DetailPanel.tsx b/src/signals/incident/components/form/MapSelectors/Asset/Selector/DetailPanel/DetailPanel.tsx index 5b03edebd2..e8d9016b10 100644 --- a/src/signals/incident/components/form/MapSelectors/Asset/Selector/DetailPanel/DetailPanel.tsx +++ b/src/signals/incident/components/form/MapSelectors/Asset/Selector/DetailPanel/DetailPanel.tsx @@ -142,7 +142,8 @@ const DetailPanel: FC = ({ language, zoomLevel }) => { /> )} - {((selection && selectionOnMap) || selectableFeatures) && ( + {((selection && selectionOnMap) || + (selectableFeatures && selectableFeatures.length > 0)) && (