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(Dashboard): Highlight errored filters on the left pane of the Native Filters form plus several enhancements #16940

Merged
merged 7 commits into from
Oct 8, 2021
Merged

Conversation

geido
Copy link
Member

@geido geido commented Oct 1, 2021

SUMMARY

This PR introduces several enhancements to the native filters form and some new functionalities:

  • It shows [untitled] on the left pane when no name is entered. This is consistent with other parts of the platform
  • It shows an error indication on the left pane when an error is generated on the fly or on save. This drags the attention of the user to the right filters where an action is required
  • It restructures a little bit the form using the Antdesign Form.Item wherever possible. However, the constraints of this implementation are huge and I advocate for a full refactor asap

AFTER

Video.Game.Sales.4.mp4

TESTING INSTRUCTIONS

  1. Open a Dashboard with native filters enabled
  2. Fill in the form and observe the behavior when an error is generated

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@pull-request-size pull-request-size bot added size/XL and removed size/L labels Oct 4, 2021
@geido geido changed the title chore(Dashboard): Highlight errored filters on save chore(Dashboard): Highlight errored filters on the left pane of the Native Filters form plus several enhancements Oct 4, 2021
@geido geido marked this pull request as ready for review October 4, 2021 13:45
@geido
Copy link
Member Author

geido commented Oct 4, 2021

@mihir174 @junlincc @rusackas the proposed layout with a red title and a red icon indicator is tentative. Feel free to come up with better suggestions and I'll be happy to change accordingly. Thank you!

@codecov
Copy link

codecov bot commented Oct 4, 2021

Codecov Report

Merging #16940 (301432e) into master (a782a62) will decrease coverage by 0.01%.
The diff coverage is 52.30%.

❗ Current head 301432e differs from pull request most recent head cffda9b. Consider uploading reports for the commit cffda9b to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16940      +/-   ##
==========================================
- Coverage   76.70%   76.69%   -0.02%     
==========================================
  Files        1030     1030              
  Lines       55056    55122      +66     
  Branches     7465     7485      +20     
==========================================
+ Hits        42231    42276      +45     
- Misses      12576    12596      +20     
- Partials      249      250       +1     
Flag Coverage Δ
javascript 70.90% <52.30%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...mponents/nativeFilters/FiltersConfigModal/utils.ts 70.37% <33.33%> (-0.52%) ⬇️
...onfigModal/FiltersConfigForm/FiltersConfigForm.tsx 71.60% <35.71%> (-2.23%) ⬇️
...ts/nativeFilters/FiltersConfigModal/FilterTabs.tsx 85.71% <77.77%> (-0.96%) ⬇️
...eFilters/FiltersConfigModal/FiltersConfigModal.tsx 90.16% <92.00%> (+1.59%) ⬆️
superset-frontend/src/components/Select/Select.tsx 92.25% <0.00%> (-0.30%) ⬇️
...e/components/controls/SelectAsyncControl/index.jsx
...e/components/controls/SelectAsyncControl/index.tsx 81.08% <0.00%> (ø)

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 a782a62...cffda9b. Read the comment docs.

@michael-s-molina
Copy link
Member

michael-s-molina commented Oct 4, 2021

Thanks for the feature @geido. Some points:

  • When creating a new filter, the name is "New Filter" and not "[untitled]". I liked your idea, so it should start as "[untitled]"
  • If you generate an error in a saved filter, like deleting its name, and cancel, the error shows when reopening
  • The error icon position will conflict with the drag icon that is being implemented here. Maybe position it on the right side?
  • Should we make the size of the error icon the same as the trash icon?

@geido
Copy link
Member Author

geido commented Oct 5, 2021

Hey @michael-s-molina thanks for your feedback! I implemented what you suggested above and updated the video in the description

@michael-s-molina
Copy link
Member

/testenv up FEATURE_DASHBOARD_NATIVE_FILTERS=true

@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2021

@michael-s-molina Ephemeral environment spinning up at http://52.11.166.147:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks great and I wasn't able to break anything.
1 suggestion - maybe we should disable the save button when there are errors in the form? Currently nothing happens when I click it when there are errors, but there is no indication that the button is unclickable.
image

PR approved, it's up to you if you want to implement disabled save button in this PR, in another... or not at all 🙂

@geido
Copy link
Member Author

geido commented Oct 8, 2021

That's a great suggestion. Let me work on that in a separate PR

@geido geido merged commit a6173f1 into apache:master Oct 8, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2021

Ephemeral environment shutdown and build artifacts deleted.

@geido geido deleted the chore/highlight-corrupt-filter branch October 8, 2021 14:34
@eschutho eschutho added the v1.4 label Oct 27, 2021
eschutho pushed a commit that referenced this pull request Oct 27, 2021
…ative Filters form plus several enhancements (#16940)

* Implement errored filters

* Clean up

* Handle errors on the fly

* Implement handleErroredFilters

* Reset errors

(cherry picked from commit a6173f1)
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
…ative Filters form plus several enhancements (apache#16940)

* Implement errored filters

* Clean up

* Handle errors on the fly

* Implement handleErroredFilters

* Reset errors
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
…ative Filters form plus several enhancements (apache#16940)

* Implement errored filters

* Clean up

* Handle errors on the fly

* Implement handleErroredFilters

* Reset errors
@mistercrunch mistercrunch added 🍒 1.4.0 🍒 1.4.1 🍒 1.4.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XL v1.4 🍒 1.4.0 🍒 1.4.1 🍒 1.4.2 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants