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

fix: safe removal of empty tab with scoped filters #15650

Merged
merged 1 commit into from
Jul 13, 2021

Conversation

rusackas
Copy link
Member

SUMMARY

Fixes a bug where some tabs couldn't be deleted due to native filters that point to no-longer existing charts within the tab.

This PR fixes the acute issue, but there's room for improvement! Whenever a chart is removed, we should

  1. confirm that no filter is scoped to that missing chart any longer.
  2. (optional) if the filter no longer has ANY charts within scope, we could ask the user if they want to delete it.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
before

After:
After

TESTING INSTRUCTIONS

To repro the issue (prior to this PR):

  1. Make a dashboard
  2. Add tabs
  3. Add a chart to a tab (I just used a table)
  4. Add a native filter scoped to that chart.
  5. (Problem 1) Try to delete the tab containing the chart with the scoped filter. You get an ugly error.
  6. Remove the chart with the scoped filter, optionally saving the dash
  7. (Problem 2) Try to delete the tab again. Even with the chart gone, you still can't remove the tab.

With this PR, you should be able to remove the tab with or without the chart.

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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

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.

Lgtm!

@rusackas
Copy link
Member Author

rusackas commented Jul 13, 2021

@kgabryje if you keep a personal "rainy day" backlog, you might be a good candidate to fix the root cause... the filter seems to still be scoped to a deleted chart. That's probably not good in the long run, but doesn't seem to be a problem for now.

@codecov
Copy link

codecov bot commented Jul 13, 2021

Codecov Report

Merging #15650 (1b78ee7) into master (5d86ffe) will increase coverage by 0.04%.
The diff coverage is 83.89%.

❗ Current head 1b78ee7 differs from pull request most recent head 5f4998d. Consider uploading reports for the commit 5f4998d to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15650      +/-   ##
==========================================
+ Coverage   76.86%   76.91%   +0.04%     
==========================================
  Files         977      978       +1     
  Lines       51343    51487     +144     
  Branches     6920     6951      +31     
==========================================
+ Hits        39466    39602     +136     
- Misses      11654    11661       +7     
- Partials      223      224       +1     
Flag Coverage Δ
javascript 71.52% <83.83%> (+0.13%) ⬆️

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

Impacted Files Coverage Δ
...nd/src/explore/components/ExploreViewContainer.jsx 2.15% <0.00%> (ø)
...c/visualizations/TimeTable/TimeTableChartPlugin.js 75.00% <ø> (ø)
...c/views/CRUD/data/database/DatabaseModal/index.tsx 47.57% <14.28%> (+0.15%) ⬆️
...t-frontend/src/views/CRUD/data/query/QueryList.tsx 70.96% <37.50%> (-0.88%) ⬇️
...t-frontend/src/components/DynamicPlugins/index.tsx 37.28% <63.15%> (+18.13%) ⬆️
...-frontend/src/views/CRUD/welcome/ActivityTable.tsx 78.84% <85.71%> (+0.41%) ⬆️
...plore/components/controls/VizTypeControl/index.tsx 86.04% <86.04%> (ø)
...perset-frontend/src/addSlice/AddSliceContainer.tsx 82.05% <90.00%> (+3.26%) ⬆️
...ponents/controls/VizTypeControl/VizTypeGallery.tsx 93.57% <93.57%> (ø)
...end/src/SqlLab/components/RunQueryActionButton.tsx 65.11% <100.00%> (+0.83%) ⬆️
... and 12 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 5d86ffe...5f4998d. Read the comment docs.

@rosemarie-chiu
Copy link
Contributor

🏷 2021.27

@junlincc junlincc added #bug:blocking! Blocking issues with high priority rush! Requires immediate attention labels Jul 13, 2021
@junlincc
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

@junlincc Ephemeral environment spinning up at http://54.213.230.210:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@rusackas
Copy link
Member Author

/testenv up FEATURE_DASHBOARD_NATIVE_FILTERS=true

@github-actions
Copy link
Contributor

@rusackas Ephemeral environment spinning up at http://54.245.2.8:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@junlincc
Copy link
Member

LGTM! thanks for the quick fix! did spot a UX issue not caused by this PR, will file separately
@rosemarie-chiu wanna give a product/QA sign-off checkmark? 😉

After

Screen.Recording.2021-07-12.at.10.25.45.PM.mov

Before(unnecessary long video please skip watching lol )

Screen.Recording.2021-07-12.at.10.27.46.PM.mov
Screen.Recording.2021-07-12.at.10.29.32.PM.mov

@rosemarie-chiu
Copy link
Contributor

rosemarie-chiu commented Jul 13, 2021

Tested with multiple filter some scope to all, some scope to specific tabs. ✅ Product, QA sign off!

@rusackas rusackas merged commit 52ad779 into master Jul 13, 2021
@rusackas rusackas deleted the delete-tabs-with-scoped-filter branch July 13, 2021 05:43
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

Copy link
Contributor

@rosemarie-chiu rosemarie-chiu left a comment

Choose a reason for hiding this comment

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

Tested issue fixed. Tabs with native filter can be deleted successfully.
✅ QA Product sign off

@junlincc junlincc requested review from junlincc and removed request for junlincc July 13, 2021 05:52
henryyeh pushed a commit to preset-io/superset that referenced this pull request Jul 13, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 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 #bug:blocking! Blocking issues with high priority preset:2021.27 preset-io rush! Requires immediate attention size/XS v1.3 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants