From 14c9926daeb4406ffa2061e4bb3dbfcfe1a50d97 Mon Sep 17 00:00:00 2001 From: CollinBeczak Date: Tue, 5 Sep 2023 13:54:36 -0500 Subject: [PATCH] add clear filters button --- .../WithFilteredClusteredTasks.js | 2 +- .../ReviewNearbyTasksWidget.js | 36 +++++++++++++------ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/components/HOCs/WithFilteredClusteredTasks/WithFilteredClusteredTasks.js b/src/components/HOCs/WithFilteredClusteredTasks/WithFilteredClusteredTasks.js index e1a7ca567..d03f7334f 100644 --- a/src/components/HOCs/WithFilteredClusteredTasks/WithFilteredClusteredTasks.js +++ b/src/components/HOCs/WithFilteredClusteredTasks/WithFilteredClusteredTasks.js @@ -289,7 +289,7 @@ export default function WithFilteredClusteredTasks(WrappedComponent, // These values will come in as comma-separated strings and need to be turned // into number arrays _each(["status", "reviewStatus", "metaReviewStatus", "priorities"], key => { - if (!_isUndefined(_get(criteria, `filters.${key}`))) { + if (!_isUndefined(_get(criteria, `filters.${key}`)) && !this.props.taskId) { if (typeof criteria.filters[key] === "string") { criteria.filters[key] = criteria.filters[key].split(',').map(x => _toInteger(x)) } diff --git a/src/components/Widgets/ReviewNearbyTasksWidget/ReviewNearbyTasksWidget.js b/src/components/Widgets/ReviewNearbyTasksWidget/ReviewNearbyTasksWidget.js index 37d30fc4a..9d11bf628 100644 --- a/src/components/Widgets/ReviewNearbyTasksWidget/ReviewNearbyTasksWidget.js +++ b/src/components/Widgets/ReviewNearbyTasksWidget/ReviewNearbyTasksWidget.js @@ -9,6 +9,7 @@ import bbox from '@turf/bbox' import { point, featureCollection } from '@turf/helpers' import { WidgetDataTarget, registerWidgetType } from '../../../services/Widget/Widget' +import SvgSymbol from '../../SvgSymbol/SvgSymbol' import MapPane from '../../EnhancedMap/MapPane/MapPane' import TaskClusterMap from '../../TaskClusterMap/TaskClusterMap' import TaskPropertyFilter from '../../TaskFilters/TaskPropertyFilter' @@ -189,6 +190,18 @@ export default class ReviewNearbyTasksWidget extends Component { /> ); + const clearFiltersControl = ( + + ) + return (
- {this.props.taskBundle ? ( -
-

- -

-
- ) : null} +
+ {this.props.taskBundle ? ( +
+

+ +

+
+ ) : null} + {clearFiltersControl} +
{this.props.loading ? (