diff --git a/frontend/src/component/common/FilterItem/FilterItem.tsx b/frontend/src/component/common/FilterItem/FilterItem.tsx index 8566ff1f9817..e1927d369948 100644 --- a/frontend/src/component/common/FilterItem/FilterItem.tsx +++ b/frontend/src/component/common/FilterItem/FilterItem.tsx @@ -23,7 +23,7 @@ interface IFilterItemProps { } const singularOperators = ['IS', 'IS_NOT']; -const pluralOperators = ['IS_ANY_OF', 'IS_NOT_ANY_OF']; +const pluralOperators = ['IS_ANY_OF', 'IS_NONE_OF']; export type FilterItem = { operator: string; diff --git a/frontend/src/openapi/models/searchFeaturesParams.ts b/frontend/src/openapi/models/searchFeaturesParams.ts index 1a7a47e792d1..56e51572db20 100644 --- a/frontend/src/openapi/models/searchFeaturesParams.ts +++ b/frontend/src/openapi/models/searchFeaturesParams.ts @@ -10,11 +10,11 @@ export type SearchFeaturesParams = { */ query?: string; /** - * Id of the project where search and filter is performed. The project id can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NOT_ANY_OF. + * Id of the project where search and filter is performed. The project id can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NONE_OF. */ project?: string; /** - * The state of the feature active/stale. The state can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NOT_ANY_OF. + * The state of the feature active/stale. The state can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NONE_OF. */ state?: string; /** diff --git a/src/lib/features/feature-search/feature-search-service.ts b/src/lib/features/feature-search/feature-search-service.ts index c7f5ab822237..4e65c1ecdfee 100644 --- a/src/lib/features/feature-search/feature-search-service.ts +++ b/src/lib/features/feature-search/feature-search-service.ts @@ -43,7 +43,7 @@ export class FeatureSearchService { parseOperatorValue = (field: string, value: string): IQueryParam | null => { const pattern = - /^(IS|IS_NOT|IS_ANY_OF|IS_NOT_ANY_OF|INCLUDE|DO_NOT_INCLUDE|INCLUDE_ALL_OF|INCLUDE_ANY_OF|EXCLUDE_IF_ANY_OF|EXCLUDE_ALL|IS_BEFORE|IS_ON_OR_AFTER):(.+)$/; + /^(IS|IS_NOT|IS_ANY_OF|IS_NONE_OF|INCLUDE|DO_NOT_INCLUDE|INCLUDE_ALL_OF|INCLUDE_ANY_OF|EXCLUDE_IF_ANY_OF|EXCLUDE_ALL|IS_BEFORE|IS_ON_OR_AFTER):(.+)$/; const match = value.match(pattern); if (match) { 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 2394117c8b2a..0753b28d4aa1 100644 --- a/src/lib/features/feature-search/feature.search.e2e.test.ts +++ b/src/lib/features/feature-search/feature.search.e2e.test.ts @@ -649,7 +649,7 @@ test('should search features by project with operators', async () => { }); const { body: isNotAnyBody } = await searchFeatures({ - project: 'IS_NOT_ANY_OF:default,project_c', + project: 'IS_NONE_OF:default,project_c', }); expect(isNotAnyBody).toMatchObject({ features: [{ name: 'my_feature_b' }], @@ -812,7 +812,7 @@ test('should search features by state with operators', async () => { }); const { body: isNotAnyBody } = await filterFeaturesByState( - 'IS_NOT_ANY_OF:active, stale', + 'IS_NONE_OF:active, stale', ); expect(isNotAnyBody).toMatchObject({ features: [], diff --git a/src/lib/features/feature-toggle/feature-toggle-strategies-store.ts b/src/lib/features/feature-toggle/feature-toggle-strategies-store.ts index fcf9551e7c0f..77cb3fc51c0a 100644 --- a/src/lib/features/feature-toggle/feature-toggle-strategies-store.ts +++ b/src/lib/features/feature-toggle/feature-toggle-strategies-store.ts @@ -1128,7 +1128,7 @@ const applyGenericQueryParams = ( query.whereIn(param.field, param.values); break; case 'IS_NOT': - case 'IS_NOT_ANY_OF': + case 'IS_NONE_OF': query.whereNotIn(param.field, param.values); break; case 'IS_BEFORE': diff --git a/src/lib/features/feature-toggle/types/feature-toggle-strategies-store-type.ts b/src/lib/features/feature-toggle/types/feature-toggle-strategies-store-type.ts index ee7691e01f56..54b55c21b136 100644 --- a/src/lib/features/feature-toggle/types/feature-toggle-strategies-store-type.ts +++ b/src/lib/features/feature-toggle/types/feature-toggle-strategies-store-type.ts @@ -42,7 +42,7 @@ export type IQueryOperator = | 'IS' | 'IS_NOT' | 'IS_ANY_OF' - | 'IS_NOT_ANY_OF' + | 'IS_NONE_OF' | 'INCLUDE' | 'DO_NOT_INCLUDE' | 'INCLUDE_ALL_OF' diff --git a/src/lib/openapi/spec/feature-search-query-parameters.ts b/src/lib/openapi/spec/feature-search-query-parameters.ts index 684fd9aa9909..62b10d14a726 100644 --- a/src/lib/openapi/spec/feature-search-query-parameters.ts +++ b/src/lib/openapi/spec/feature-search-query-parameters.ts @@ -16,10 +16,10 @@ export const featureSearchQueryParameters = [ type: 'string', example: 'IS:default', pattern: - '^(IS|IS_NOT|IS_ANY_OF|IS_NOT_ANY_OF):(.*?)(,([a-zA-Z0-9_]+))*$', + '^(IS|IS_NOT|IS_ANY_OF|IS_NONE_OF):(.*?)(,([a-zA-Z0-9_]+))*$', }, description: - 'Id of the project where search and filter is performed. The project id can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NOT_ANY_OF.', + 'Id of the project where search and filter is performed. The project id can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NONE_OF.', in: 'query', }, { @@ -28,10 +28,10 @@ export const featureSearchQueryParameters = [ type: 'string', example: 'IS:active', pattern: - '^(IS|IS_NOT|IS_ANY_OF|IS_NOT_ANY_OF):(.*?)(,([a-zA-Z0-9_]+))*$', + '^(IS|IS_NOT|IS_ANY_OF|IS_NONE_OF):(.*?)(,([a-zA-Z0-9_]+))*$', }, description: - 'The state of the feature active/stale. The state can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NOT_ANY_OF.', + 'The state of the feature active/stale. The state can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NONE_OF.', in: 'query', }, {