feat(native-filters): add optional sort metric to select filter#14346
Conversation
| const datasetId = formFilter?.dataset?.value; | ||
|
|
||
| useEffect(() => { | ||
| if (datasetId) { |
There was a problem hiding this comment.
If #14313 is merged first, that won't be necessary - metrics can be accessed in formFilter.dataset?.metrics
There was a problem hiding this comment.
Oh nice, let's get that one in first then 👍
| name="sortMetric" | ||
| options={metrics.map((metric: Metric) => ({ | ||
| value: metric.metric_name, | ||
| label: metric.metric_name, |
There was a problem hiding this comment.
one nit:
| label: metric.metric_name, | |
| label: metric.verbose_name ?? metric.metric_name, |
There was a problem hiding this comment.
Thanks @zhaoyongjie ; thanks for catching this!
Codecov Report
@@ Coverage Diff @@
## master #14346 +/- ##
==========================================
- Coverage 76.86% 76.71% -0.16%
==========================================
Files 954 954
Lines 48207 48230 +23
Branches 6008 6021 +13
==========================================
- Hits 37056 37001 -55
- Misses 10956 11034 +78
Partials 195 195
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
* feat(native-filters): add optional sort metric to select filter * use verbose name when defined * fixes * lint * disable flaky test * disable flaky test * disable flaky test (cherry picked from commit 40fb94d)
…he#14346) * feat(native-filters): add optional sort metric to select filter * use verbose name when defined * fixes * lint * disable flaky test * disable flaky test * disable flaky test
…he#14346) * feat(native-filters): add optional sort metric to select filter * use verbose name when defined * fixes * lint * disable flaky test * disable flaky test * disable flaky test

SUMMARY
Add support for sort metric to native select filter. This is a requirement to establish feature parity with Filter Box.
SCREENSHOTS
An optional field appears on the filter config modal for the select filter:


When selected, the column values are sorted by the selected metric (in this case in descending order)
TEST PLAN
Local testing + CI
ADDITIONAL INFORMATION