From 164e70b7dad69321d6cf000f7da76924e03d4c28 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Wed, 31 Jul 2024 10:30:39 +0200 Subject: [PATCH] Only load boreholes for valid feature ids --- CHANGELOG.md | 2 ++ src/client/src/commons/menu/mainView/mapView.jsx | 2 +- src/client/src/commons/table/boreholeEditorTable.jsx | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3545ce836..0ac42f2b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ - Users can now only import or add new boreholes to workgroups where they have an editor role. - Label for description quality was wrong in lithology filter and settings. - Boreholes could not be deleted in the detail view if the publication status was not `Change in progess`. +- Boreholes table loaded all boreholes instead of none when a filter combination with polygon was used that did not + return any boreholes. ## v2.1.772 - 2024-06-27 diff --git a/src/client/src/commons/menu/mainView/mapView.jsx b/src/client/src/commons/menu/mainView/mapView.jsx index 69cac78bb..0d236fcf8 100644 --- a/src/client/src/commons/menu/mainView/mapView.jsx +++ b/src/client/src/commons/menu/mainView/mapView.jsx @@ -124,7 +124,7 @@ class MapView extends React.Component { direction: direction, }); }} - featureIds={featureIds} + featureIds={filterPolygon ? featureIds : null} sort={sort} scrollPosition={this.state.tableScrollPosition} onScrollChange={position => { diff --git a/src/client/src/commons/table/boreholeEditorTable.jsx b/src/client/src/commons/table/boreholeEditorTable.jsx index b194c664a..bbe81fc26 100644 --- a/src/client/src/commons/table/boreholeEditorTable.jsx +++ b/src/client/src/commons/table/boreholeEditorTable.jsx @@ -503,7 +503,9 @@ const mapDispatchToProps = dispatch => { }); }, loadData: (page, filter = {}, feature_ids = null, orderby = null, direction = null) => { - dispatch(loadEditingBoreholes(page, 100, filter, orderby, direction, feature_ids)); + if (!(feature_ids?.length === 0)) { + dispatch(loadEditingBoreholes(page, 100, filter, orderby, direction, feature_ids)); + } }, }; };