[IMP] gauge chart: allow formulas in gauge config #5181
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
[MOV] gauge: move gauge-specific panel tests
This commit moves the gauge-specific panel tests to a separate file
gauge_panel_component.test.ts
.A lot of gauge chart were also kinda duplicated: a test would test that
the input was marked as invalid when entering a wrong value, and another
test would test would test what the error message was when entering an
invalid value. Both can be done in the same test.
[IMP] gauge: allow to have swap rangeMin and rangeMax
Currently, we have an allowDispatch checking that rangeMin is lower
than rangeMax. This is fine for literal values, but with the next
commit that allow formulas values for rangeMin and rangeMax, it is
harder to check.
This commit make the runtime swap rangeMin and rangeMax if rangeMin
is greater than rangeMax. It's simpler, more powerful, and in line
with what we do for the gauge thresholds that are swapped if needed.
[REM] gauge: remove unused command result
There was a command result
GaugeLowerBiggerThanUpper
that was defined,and checked in the gauge side panel. This command result was never
returned by the allowDispatch of the gauge charts. If the lower value
is bigger than the upper value, the gauge chart swap them.
[IMP] gauge: prettify gauge chart plugin tests
This commit prettifies and improves the readability of the
gauge_chart_plugin.test.ts
file:[IMP] gauge chart: allow formulas in gauge config
This commit adds the possibility to use formulas to configure the gauge
chart min/max ranges and the threshold values.
This make it so we cannot rely on allowDispatch now to check that the
values are number, because the only implemented allowDispatch of charts
is core (so no evaluation). The panel will try to filter the non-number
values, but they could change to non-number afterwards. In that case:
Task: 4236214
review checklist