From 2f3a0124737499bac3f8ef86f61892fd52e55c85 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Wed, 9 Feb 2022 14:51:07 +0100 Subject: [PATCH] change(ui) - filters - user click and other fix --- .../Widgets/CustomMetricsWidgets/CustomMetricsWidgets.tsx | 1 + .../components/SavedSearchDropdown/SavedSearchDropdown.tsx | 2 +- frontend/app/duck/search.js | 2 +- frontend/app/types/filter/newFilter.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricsWidgets.tsx b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricsWidgets.tsx index 91de93afd..fcb8eedb1 100644 --- a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricsWidgets.tsx +++ b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricsWidgets.tsx @@ -23,6 +23,7 @@ function CustomMetricsWidgets(props: Props) { <> {list.filter(item => item.active).map((item: any) => ( { diff --git a/frontend/app/components/shared/SavedSearch/components/SavedSearchDropdown/SavedSearchDropdown.tsx b/frontend/app/components/shared/SavedSearch/components/SavedSearchDropdown/SavedSearchDropdown.tsx index d90a06c30..9a3cf6ee7 100644 --- a/frontend/app/components/shared/SavedSearch/components/SavedSearchDropdown/SavedSearchDropdown.tsx +++ b/frontend/app/components/shared/SavedSearch/components/SavedSearchDropdown/SavedSearchDropdown.tsx @@ -22,7 +22,7 @@ function Row ({ name, isPublic, onClick, onClickEdit, onDelete }) { >
{name}
- { isPublic &&
}. + { isPublic &&
} {/*
*/} {/*
*/}
diff --git a/frontend/app/duck/search.js b/frontend/app/duck/search.js index a6fe1dd67..283bf9bf6 100644 --- a/frontend/app/duck/search.js +++ b/frontend/app/duck/search.js @@ -205,7 +205,7 @@ export const clearSearch = () => (dispatch, getState) => { } export const addFilter = (filter) => (dispatch, getState) => { - filter.value = filter.value && filter.value.length === 0 ? filter.value : ['']; + filter.value = Array.isArray(filter.value) ? (filter.value.length === 0 ? [""] : filter.value) : [filter.value]; const instance = getState().getIn([ 'search', 'instance']); const filters = instance.filters.push(filter); return dispatch(edit(instance.set('filters', filters))); diff --git a/frontend/app/types/filter/newFilter.js b/frontend/app/types/filter/newFilter.js index 91ebb92a7..735d46f0a 100644 --- a/frontend/app/types/filter/newFilter.js +++ b/frontend/app/types/filter/newFilter.js @@ -52,7 +52,7 @@ export const filtersMap = { [FilterKey.TTFB]: { key: FilterKey.TTFB, type: FilterType.MULTIPLE, category: FilterCategory.PERFORMANCE, label: 'Time to First Byte', operator: 'isAny', operatorOptions: filterOptions.stringOperators, source: [], icon: 'filters/ttfb', isEvent: true, hasSource: true, sourceOperator: '=', sourceType: FilterType.NUMBER, sourceOperatorOptions: filterOptions.customOperators }, [FilterKey.AVG_CPU_LOAD]: { key: FilterKey.AVG_CPU_LOAD, type: FilterType.MULTIPLE, category: FilterCategory.PERFORMANCE, label: 'Avg CPU Load', operator: 'isAny', operatorOptions: filterOptions.stringOperators, source: [], icon: 'filters/cpu-load', isEvent: true, hasSource: true, sourceOperator: '=', sourceType: FilterType.NUMBER, sourceOperatorOptions: filterOptions.customOperators }, [FilterKey.AVG_MEMORY_USAGE]: { key: FilterKey.AVG_MEMORY_USAGE, type: FilterType.MULTIPLE, category: FilterCategory.PERFORMANCE, label: 'Avg Memory Usage', operator: 'isAny', operatorOptions: filterOptions.stringOperators, source: [], icon: 'filters/memory-load', isEvent: true, hasSource: true, sourceOperator: '=', sourceType: FilterType.NUMBER, sourceOperatorOptions: filterOptions.customOperators }, - [FilterKey.FETCH_FAILED]: { key: FilterKey.FETCH_FAILED, type: FilterType.MULTIPLE, category: FilterCategory.PERFORMANCE, label: 'Fetch Failed', operator: 'isAny', operatorOptions: filterOptions.stringOperators, icon: 'filters/fetch-failed', isEvent: true }, + [FilterKey.FETCH_FAILED]: { key: FilterKey.FETCH_FAILED, type: FilterType.MULTIPLE, category: FilterCategory.PERFORMANCE, label: 'Failed Request', operator: 'isAny', operatorOptions: filterOptions.stringOperators, icon: 'filters/fetch-failed', isEvent: true }, [FilterKey.ISSUE]: { key: FilterKey.ISSUE, type: FilterType.ISSUE, category: FilterCategory.JAVASCRIPT, label: 'Issue', operator: 'is', operatorOptions: filterOptions.baseOperators, icon: 'filters/click', options: ISSUE_OPTIONS }, }