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: Unable to export multiple Dashboards with the same name #20383

Conversation

diegomedina248
Copy link
Contributor

SUMMARY

Users can export multiple Dashboards in a single ZIP.
However, selecting two Dashboards with the same name won’t work properly - only one is included on the export file.

This PR follows the same approach taken for the charts, and adds the dashboard id at the end of the file name.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Example:

Screen Shot 2022-06-14 at 15 55 37

TESTING INSTRUCTIONS

  1. Navigate to Dashboards.
  2. Click on + DASHBOARD.
  3. Name your dashboard - for example, Export Test.
  4. Click on SAVE.
  5. Navigate back to Dashboards.
  6. Click on + DASHBOARD.
  7. Use the same title for this Dashboard.
  8. Click on SAVE.
  9. Navigate back to Dashboards.
  10. Click on BULK SELECT.
  11. Select both Dashboards.
  12. Click on EXPORT.

Ensure two files are created under dashboards folder.

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

@codecov
Copy link

codecov bot commented Jun 14, 2022

Codecov Report

Merging #20383 (e2f00ca) into master (86f146e) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head e2f00ca differs from pull request most recent head c01877c. Consider uploading reports for the commit c01877c to get more accurate results

@@            Coverage Diff             @@
##           master   #20383      +/-   ##
==========================================
- Coverage   66.52%   66.52%   -0.01%     
==========================================
  Files        1739     1739              
  Lines       65141    65141              
  Branches     6900     6900              
==========================================
- Hits        43336    43335       -1     
- Misses      20052    20053       +1     
  Partials     1753     1753              
Flag Coverage Δ
mysql 82.29% <100.00%> (ø)
postgres 82.36% <100.00%> (ø)
python 82.44% <100.00%> (-0.01%) ⬇️
sqlite 82.09% <100.00%> (ø)
unit ?

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

Impacted Files Coverage Δ
superset/dashboards/commands/export.py 83.78% <100.00%> (ø)
superset/initialization/__init__.py 91.13% <0.00%> (-0.36%) ⬇️

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 86f146e...c01877c. Read the comment docs.

@@ -284,7 +288,7 @@ def test_export_dashboard_command_key_order(self, mock_g1, mock_g2):
@pytest.mark.usefixtures("load_world_bank_dashboard_with_slices")
@patch("superset.dashboards.commands.export.suffix")
def test_append_charts(self, mock_suffix):
"""Test that oprhaned charts are added to the dashbaord position"""
Copy link
Member

Choose a reason for hiding this comment

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

Eagle eyes! :)

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

LGTM. I'd merge it, but I would love a stamp from @betodealmeida or @eschutho to make sure there aren't some other implications (perhaps on the import side of the equation) that I'm unaware of.

Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @diegomedina248

@rusackas rusackas merged commit 3fe53f7 into apache:master Jun 15, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.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 Preset-Patch size/S 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants