Skip to content

Commit

Permalink
Added two new operators, LIKE and NOT_LIKE.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vojtěch Porteš committed Feb 3, 2020
1 parent d0dd0c6 commit 14976a0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion example/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,14 @@ export const fields: BuilderFieldProps[] = [
field: 'BLAH',
label: 'Blah',
type: 'TEXT',
operators: ['NOT_BETWEEN', 'EQUAL', 'NOT_EQUAL', 'BETWEEN'],
operators: [
'NOT_BETWEEN',
'EQUAL',
'NOT_EQUAL',
'BETWEEN',
'LIKE',
'NOT_LIKE',
],
},
{
field: 'HAS_LOW_CREDIT',
Expand Down
4 changes: 3 additions & 1 deletion src/components/Builder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export type BuilderFieldOperator =
| 'ANY_IN'
| 'NOT_IN'
| 'BETWEEN'
| 'NOT_BETWEEN';
| 'NOT_BETWEEN'
| 'LIKE'
| 'NOT_LIKE';

export type BuilderGroupValues = 'AND' | 'OR';

Expand Down
4 changes: 4 additions & 0 deletions src/constants/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export interface Strings {
NOT_IN?: string;
BETWEEN?: string;
NOT_BETWEEN?: string;
LIKE?: string;
NOT_LIKE?: string;
};
}

Expand Down Expand Up @@ -55,5 +57,7 @@ export const strings: Strings = {
NOT_IN: 'Not in',
BETWEEN: 'Between',
NOT_BETWEEN: 'Not between',
LIKE: 'Like',
NOT_LIKE: 'Not like'
},
};

0 comments on commit 14976a0

Please sign in to comment.