-
Notifications
You must be signed in to change notification settings - Fork 918
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
[Datasource selector] Sort datasource option list alphabetically #5719
[Datasource selector] Sort datasource option list alphabetically #5719
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5719 +/- ##
=======================================
Coverage 67.03% 67.03%
=======================================
Files 3296 3296
Lines 63339 63343 +4
Branches 10087 10087
=======================================
+ Hits 42459 42465 +6
- Misses 18430 18432 +2
+ Partials 2450 2446 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
is it possible to have backend to include sort in the query?
return { | ||
...dsGroup, | ||
options: [...dsGroup.options].sort((ds1, ds2) => { | ||
return ds1.label.localeCompare(ds2.label, undefined, { sensitivity: 'base' }); |
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.
base
was the original behavior in 2.9?
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.
It uses lodash's sortBy without any addition settings which I believe is not using 'base' as I tested that for example 'a' vs 'A' will be sorted in different groups. For index patterns it's fine as there will be no Uppercase allowed plus a list of restrictions, but since we also introduced non index pattern datasource with some different, flexible naming restrictions, I figured this way should have the better support.
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.
This looks good to me. Think we are good to merge this once we have a unit test for this
Signed-off-by: Eric <[email protected]>
Signed-off-by: Eric <[email protected]>
Signed-off-by: Eric <[email protected]>
7c6ed5e
to
91e72c3
Compare
It's possible but currently we are pulling datasources through different APIs and then consolidate them from front end. With this implementation we will need to compose different queries to include sorting for different datasources. For now I think to sort them after consolidations will be relatively easier. |
Signed-off-by: Eric <[email protected]>
* sort datasource option list in each group alphabetically * add test for sorting * remove one datasource per test --------- Signed-off-by: Eric <[email protected]> (cherry picked from commit 058dfbc) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
* sort datasource option list in each group alphabetically * add test for sorting * remove one datasource per test --------- Signed-off-by: Eric <[email protected]> (cherry picked from commit 058dfbc) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
…) (#5735) * sort datasource option list in each group alphabetically * add test for sorting * remove one datasource per test --------- Signed-off-by: Eric <[email protected]> (cherry picked from commit 058dfbc) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Anan Zhuang <[email protected]>
…) (#5734) * sort datasource option list in each group alphabetically * add test for sorting * remove one datasource per test --------- Signed-off-by: Eric <[email protected]> (cherry picked from commit 058dfbc) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…nsearch-project#5719) * sort datasource option list in each group alphabetically * add test for sorting * remove one datasource per test --------- Signed-off-by: Eric <[email protected]> Signed-off-by: yujin-emma <[email protected]>
Description
Sort datasource option list in each group alphabetically.
Issues Resolved
#5609
Screenshot
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration