-
Notifications
You must be signed in to change notification settings - Fork 11
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
chore: Sort select inputs in Filter Config modal alphabetically #51
chore: Sort select inputs in Filter Config modal alphabetically #51
Conversation
Codecov Report
@@ Coverage Diff @@
## dashboard-native-filters #51 +/- ##
=========================================================
Coverage 64.15% 64.15%
=========================================================
Files 461 461
Lines 28386 28386
=========================================================
Hits 18211 18211
Misses 10175 10175
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
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.
LGTM - a non-blocking thought on type used in sort.
@@ -65,7 +65,12 @@ export function ColumnSelect({ | |||
endpoint: `/api/v1/dataset/${datasetId}`, | |||
}).then( | |||
({ json: { result } }) => { | |||
return result.columns.map((col: any) => col.column_name); | |||
return result.columns | |||
.map((col: any) => col.column_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.
For the backlog: add types to the frontend for relevant backend models.
return result.columns | ||
.map((col: any) => col.column_name) | ||
.sort( | ||
(a: ColumnSelectValue['label'], b: ColumnSelectValue['label']) => |
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.
Not super strong opinion, but this might be clearer if we just use the string
type here.
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.
I was hesitating for these types here, so I like the idea for simplify them to "string", thanks.
f1420b0
to
d52a419
Compare
SUMMARY
The aim of this PR is to sort select inputs (datasource & field inputs located in Filter Config Modal) alphabetically.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
before:
after:
TEST PLAN
Verify manually:
ADDITIONAL INFORMATION
cc @villebro @suddjian