1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-24 01:18:01 +02:00

chore: rename is not any of to is none of (#5544)

This commit is contained in:
Jaanus Sellin 2023-12-06 12:53:51 +02:00 committed by GitHub
parent eb43d37379
commit d9648de08d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 12 deletions

View File

@ -23,7 +23,7 @@ interface IFilterItemProps {
} }
const singularOperators = ['IS', 'IS_NOT']; 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 = { export type FilterItem = {
operator: string; operator: string;

View File

@ -10,11 +10,11 @@ export type SearchFeaturesParams = {
*/ */
query?: string; 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; 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; state?: string;
/** /**

View File

@ -43,7 +43,7 @@ export class FeatureSearchService {
parseOperatorValue = (field: string, value: string): IQueryParam | null => { parseOperatorValue = (field: string, value: string): IQueryParam | null => {
const pattern = 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); const match = value.match(pattern);
if (match) { if (match) {

View File

@ -649,7 +649,7 @@ test('should search features by project with operators', async () => {
}); });
const { body: isNotAnyBody } = await searchFeatures({ const { body: isNotAnyBody } = await searchFeatures({
project: 'IS_NOT_ANY_OF:default,project_c', project: 'IS_NONE_OF:default,project_c',
}); });
expect(isNotAnyBody).toMatchObject({ expect(isNotAnyBody).toMatchObject({
features: [{ name: 'my_feature_b' }], features: [{ name: 'my_feature_b' }],
@ -812,7 +812,7 @@ test('should search features by state with operators', async () => {
}); });
const { body: isNotAnyBody } = await filterFeaturesByState( const { body: isNotAnyBody } = await filterFeaturesByState(
'IS_NOT_ANY_OF:active, stale', 'IS_NONE_OF:active, stale',
); );
expect(isNotAnyBody).toMatchObject({ expect(isNotAnyBody).toMatchObject({
features: [], features: [],

View File

@ -1128,7 +1128,7 @@ const applyGenericQueryParams = (
query.whereIn(param.field, param.values); query.whereIn(param.field, param.values);
break; break;
case 'IS_NOT': case 'IS_NOT':
case 'IS_NOT_ANY_OF': case 'IS_NONE_OF':
query.whereNotIn(param.field, param.values); query.whereNotIn(param.field, param.values);
break; break;
case 'IS_BEFORE': case 'IS_BEFORE':

View File

@ -42,7 +42,7 @@ export type IQueryOperator =
| 'IS' | 'IS'
| 'IS_NOT' | 'IS_NOT'
| 'IS_ANY_OF' | 'IS_ANY_OF'
| 'IS_NOT_ANY_OF' | 'IS_NONE_OF'
| 'INCLUDE' | 'INCLUDE'
| 'DO_NOT_INCLUDE' | 'DO_NOT_INCLUDE'
| 'INCLUDE_ALL_OF' | 'INCLUDE_ALL_OF'

View File

@ -16,10 +16,10 @@ export const featureSearchQueryParameters = [
type: 'string', type: 'string',
example: 'IS:default', example: 'IS:default',
pattern: 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: 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', in: 'query',
}, },
{ {
@ -28,10 +28,10 @@ export const featureSearchQueryParameters = [
type: 'string', type: 'string',
example: 'IS:active', example: 'IS:active',
pattern: 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: 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', in: 'query',
}, },
{ {