mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
f33ca9db4b
* refactor: remove pre-CO constraints list * refactor: improve constraints dropdown order * refactor: simplify prop value * refactor: add missing space around parameter names * refactor: remove constraint accordion box shadow * refactor: show operator descriptions in constraints accordion * refactor: show operator descriptions in constraints dropdown * refactor: use ConstraintAccordionList in FeatureOverviewExecution * refactor: add separators between operators in constraints dropdown * refactor: remove unnecessary comment
88 lines
1.8 KiB
TypeScript
88 lines
1.8 KiB
TypeScript
export type Operator =
|
|
| 'NOT_IN'
|
|
| 'IN'
|
|
| 'STR_ENDS_WITH'
|
|
| 'STR_STARTS_WITH'
|
|
| 'STR_CONTAINS'
|
|
| 'NUM_EQ'
|
|
| 'NUM_GT'
|
|
| 'NUM_GTE'
|
|
| 'NUM_LT'
|
|
| 'NUM_LTE'
|
|
| 'DATE_AFTER'
|
|
| 'DATE_BEFORE'
|
|
| 'SEMVER_EQ'
|
|
| 'SEMVER_GT'
|
|
| 'SEMVER_LT';
|
|
|
|
export const NOT_IN = 'NOT_IN';
|
|
export const IN = 'IN';
|
|
export const STR_ENDS_WITH = 'STR_ENDS_WITH';
|
|
export const STR_STARTS_WITH = 'STR_STARTS_WITH';
|
|
export const STR_CONTAINS = 'STR_CONTAINS';
|
|
export const NUM_EQ = 'NUM_EQ';
|
|
export const NUM_GT = 'NUM_GT';
|
|
export const NUM_GTE = 'NUM_GTE';
|
|
export const NUM_LT = 'NUM_LT';
|
|
export const NUM_LTE = 'NUM_LTE';
|
|
export const DATE_AFTER = 'DATE_AFTER';
|
|
export const DATE_BEFORE = 'DATE_BEFORE';
|
|
export const SEMVER_EQ = 'SEMVER_EQ';
|
|
export const SEMVER_GT = 'SEMVER_GT';
|
|
export const SEMVER_LT = 'SEMVER_LT';
|
|
|
|
export const allOperators: Operator[] = [
|
|
IN,
|
|
NOT_IN,
|
|
STR_CONTAINS,
|
|
STR_STARTS_WITH,
|
|
STR_ENDS_WITH,
|
|
NUM_EQ,
|
|
NUM_GT,
|
|
NUM_GTE,
|
|
NUM_LT,
|
|
NUM_LTE,
|
|
DATE_BEFORE,
|
|
DATE_AFTER,
|
|
SEMVER_EQ,
|
|
SEMVER_GT,
|
|
SEMVER_LT,
|
|
];
|
|
|
|
export const stringOperators: Operator[] = [
|
|
STR_CONTAINS,
|
|
STR_STARTS_WITH,
|
|
STR_ENDS_WITH,
|
|
];
|
|
|
|
export const inOperators: Operator[] = [IN, NOT_IN];
|
|
|
|
export const numOperators: Operator[] = [
|
|
NUM_EQ,
|
|
NUM_GT,
|
|
NUM_GTE,
|
|
NUM_LT,
|
|
NUM_LTE,
|
|
];
|
|
|
|
export const dateOperators: Operator[] = [DATE_BEFORE, DATE_AFTER];
|
|
|
|
export const semVerOperators: Operator[] = [SEMVER_EQ, SEMVER_GT, SEMVER_LT];
|
|
|
|
export const singleValueOperators: Operator[] = [
|
|
...semVerOperators,
|
|
...dateOperators,
|
|
...numOperators,
|
|
];
|
|
|
|
export const multipleValueOperators: Operator[] = [
|
|
...stringOperators,
|
|
...inOperators,
|
|
];
|
|
|
|
export const newOperators: Operator[] = [
|
|
...stringOperators,
|
|
...dateOperators,
|
|
...singleValueOperators,
|
|
];
|