Skip to content

Commit

Permalink
chore: rename is not any of to is none of (#5544)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaanus authored Dec 6, 2023
1 parent eb43d37 commit d9648de
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion frontend/src/component/common/FilterItem/FilterItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/openapi/models/searchFeaturesParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/features/feature-search/feature-search-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/features/feature-search/feature.search.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }],
Expand Down Expand Up @@ -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: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 4 additions & 4 deletions src/lib/openapi/spec/feature-search-query-parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
{
Expand All @@ -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',
},
{
Expand Down

0 comments on commit d9648de

Please sign in to comment.