Skip to content
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

Conversation

agatapst
Copy link

@agatapst agatapst commented Dec 3, 2020

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:
image
image

after:
image
image

TEST PLAN

Verify manually:

  1. Open Filter Configuration modal
  2. Add new filter (or edit existing one)
  3. Choose datasource and then field.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

cc @villebro @suddjian

@agatapst agatapst changed the title Sort select inputs in Filter Config modal alphabetically chore/Sort select inputs in Filter Config modal alphabetically Dec 3, 2020
@codecov-io
Copy link

Codecov Report

Merging #51 (f1420b0) into dashboard-native-filters (bca3b58) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@                    Coverage Diff                    @@
##           dashboard-native-filters      #51   +/-   ##
=========================================================
  Coverage                     64.15%   64.15%           
=========================================================
  Files                           461      461           
  Lines                         28386    28386           
=========================================================
  Hits                          18211    18211           
  Misses                        10175    10175           
Flag Coverage Δ
python 64.15% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bca3b58...f1420b0. Read the comment docs.

@agatapst agatapst changed the title chore/Sort select inputs in Filter Config modal alphabetically chore: Sort select inputs in Filter Config modal alphabetically Dec 3, 2020
Copy link

@villebro villebro left a 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)
Copy link

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']) =>
Copy link

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.

Copy link
Author

@agatapst agatapst Dec 4, 2020

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.

@agatapst agatapst force-pushed the native-filters/sort-select-input branch from f1420b0 to d52a419 Compare December 4, 2020 15:13
@villebro villebro merged commit 6592543 into preset-io:dashboard-native-filters Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants