diff --git a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectOverviewFilters.tsx b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectOverviewFilters.tsx index 0a2d8479a9..4ecffdfa34 100644 --- a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectOverviewFilters.tsx +++ b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectOverviewFilters.tsx @@ -44,6 +44,14 @@ export const ProjectOverviewFilters: VFC = ({ label: 'Stale', value: 'stale', }, + ...(simplifyProjectOverview + ? [ + { + label: 'Potentially stale', + value: 'potentially-stale', + }, + ] + : []), ]; const availableFilters: IFilterItem[] = [ diff --git a/src/lib/features/feature-search/feature-search-store.ts b/src/lib/features/feature-search/feature-search-store.ts index b70c33599a..4c73107e08 100644 --- a/src/lib/features/feature-search/feature-search-store.ts +++ b/src/lib/features/feature-search/feature-search-store.ts @@ -577,7 +577,7 @@ const applyStaleConditions = ( const { values, operator } = staleConditions; - if (!values.includes('potentiallyStale')) { + if (!values.includes('potentially-stale')) { applyGenericQueryParams(query, [ { ...staleConditions, @@ -591,7 +591,7 @@ const applyStaleConditions = ( const valueSet = new Set( values.filter((value) => - ['stale', 'active', 'potentiallyStale'].includes(value || ''), + ['stale', 'active', 'potentially-stale'].includes(value || ''), ), ); const allSelected = valueSet.size === 3; diff --git a/src/lib/features/feature-search/feature.search.e2e.test.ts b/src/lib/features/feature-search/feature.search.e2e.test.ts index ec46c6c3bd..ea83662252 100644 --- a/src/lib/features/feature-search/feature.search.e2e.test.ts +++ b/src/lib/features/feature-search/feature.search.e2e.test.ts @@ -1000,42 +1000,42 @@ test('should search features by potentially stale', async () => { }; // single filters work - await check('IS:potentiallyStale', ['my_feature_c']); - // (stale or !potentiallyStale) - await check('IS_NOT:potentiallyStale', [ + await check('IS:potentially-stale', ['my_feature_c']); + // (stale or !potentially-stale) + await check('IS_NOT:potentially-stale', [ 'my_feature_a', 'my_feature_b', 'my_feature_d', ]); // combo filters work - await check('IS_ANY_OF:active,potentiallyStale', [ + await check('IS_ANY_OF:active,potentially-stale', [ 'my_feature_a', 'my_feature_c', ]); - // (potentiallyStale OR stale) - await check('IS_ANY_OF:potentiallyStale,stale', [ + // (potentially-stale OR stale) + await check('IS_ANY_OF:potentially-stale, stale', [ 'my_feature_b', 'my_feature_c', 'my_feature_d', ]); - await check('IS_ANY_OF:active,potentiallyStale,stale', [ + await check('IS_ANY_OF:active,potentially-stale,stale', [ 'my_feature_a', 'my_feature_b', 'my_feature_c', 'my_feature_d', ]); - await check('IS_NONE_OF:active,potentiallyStale,stale', []); + await check('IS_NONE_OF:active,potentially-stale,stale', []); - await check('IS_NONE_OF:active,potentiallyStale', [ + await check('IS_NONE_OF:active,potentially-stale', [ 'my_feature_b', 'my_feature_d', ]); - await check('IS_NONE_OF:potentiallyStale,stale', ['my_feature_a']); + await check('IS_NONE_OF:potentially-stale,stale', ['my_feature_a']); }); test('should filter features by combined operators', async () => {