-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(native-filters): add optional sort metric to select filter #14346
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one nit:
label: metric.metric_name, | |
label: metric.verbose_name ?? metric.metric_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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