1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-11-10 01:19:53 +01:00
unleash.unleash/frontend/src/component/common/ConstraintsList
Thomas Heartman c72f39bb4f
chore: make operator checking more ergonomic and type-ful (#9932)
This is a helper PR for a refactor I'm working on for the new constraint
inputs. In the refactoring, it's useful to have individual subtypes for
the various subgroups of operators and to be able to easily assert
whether something is X operator or not.

The only change required in the code base is a single check for
operators, which is now handled by using the new `isXOperator` functions
instead.

Yes, the operator file in constants now includes functions, but it
seemed useful to put the identification functions there instead of
somewhere unrelated. The tests are primarily to ensure that the
identifier function works, and I'd be happy to remove them if we think
it's necessary. That said, they're pretty simple unit tests, so I think
it's fine to leave them.

The main bulk of the change is: removing the explicit `: Operator[]`
typing to the various sub-sets of operators and instead adding explicit
types. Additionally, there's the new identifier functions.
2025-05-08 14:10:57 +02:00
..
ConstraintItemHeader chore: make operator checking more ergonomic and type-ful (#9932) 2025-05-08 14:10:57 +02:00
ConstraintSeparator feat: styling of AND operator in strategies (#9726) 2025-04-09 11:00:05 +03:00
StrategyEvaluationChip feat: improve constraints item on small screens (#9609) 2025-03-27 13:33:25 +01:00
StrategyEvaluationItem Feat: update variants placement (#9832) 2025-04-24 16:01:35 +02:00
ValuesList feat: improve constraints item on small screens (#9609) 2025-03-27 13:33:25 +01:00
ConstraintsList.tsx chore: Set up the basis of the new constraint editing component. (#9701) 2025-04-07 14:50:42 +02:00