mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-15 01:16:22 +02:00
chore: rename is not any of to is none of (#5544)
This commit is contained in:
parent
eb43d37379
commit
d9648de08d
@ -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;
|
||||
|
@ -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;
|
||||
/**
|
||||
|
@ -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) {
|
||||
|
@ -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: [],
|
||||
|
@ -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':
|
||||
|
@ -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'
|
||||
|
@ -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',
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user