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

feat: FE: Import for Queries II #14091

Merged
merged 5 commits into from
Apr 14, 2021

Conversation

lyndsiWilliams
Copy link
Member

@lyndsiWilliams lyndsiWilliams commented Apr 12, 2021

SUMMARY

Added an import button for saved queries in the subMenu.

  • Imported object is matched against existing objects based on uuid
  • If there are conflicts in the file being imported, user is informed and can choose to overwrite or cancel the import
  • Any other underlying sources that don’t yet exist should be created.
  • User should be prompted for db credentials if needed
  • Any underlying sources that exist and conflict shouldn’t be overwritten
  • User sees a confirmation toast

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE:

import-before

AFTER:

import-after

TEST PLAN

Testing has been implemented to ensure the existence and functionality of the new import button and modal.

The following gifs demonstrate exporting a saved query then directly importing that same saved query:

  • Part 1: Export saved query, view file name to verify that we import the same file, open import model, click "Choose File"
    import-1

  • Part 2: Select saved query to import (note same file name), type "overwrite" to confirm
    import-2

  • Part 3: Click "Overwrite" then observe confirmation toast, overwritten saved query, and updated "Modified" timestamp
    import-3

ADDITIONAL INFORMATION

  • Has associated issue: https://app.clubhouse.io/preset/story/214/fe-import-query
  • 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

@lyndsiWilliams lyndsiWilliams marked this pull request as ready for review April 13, 2021 14:34
@@ -218,6 +219,16 @@ export function handleBulkDashboardExport(dashboardsToExport: Dashboard[]) {
);
}

export function handleBulkSavedQueryExport(
Copy link
Member

Choose a reason for hiding this comment

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

This and some of the changes above have already been merged, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I just pulled the changed and there was a small merge conflict but I just fixed it and have everything merged and up to date. So far so good!

@betodealmeida
Copy link
Member

Looks great, @lyndsiWilliams! Did you test the feature by importing an exported saved query, and if so can you update the test plan to include that? Thanks!

@lyndsiWilliams
Copy link
Member Author

Looks great, @lyndsiWilliams! Did you test the feature by importing an exported saved query, and if so can you update the test plan to include that? Thanks!

I've updated the test plan with gifs and more details.

@codecov
Copy link

codecov bot commented Apr 13, 2021

Codecov Report

Merging #14091 (8fcfab9) into master (6392d41) will decrease coverage by 0.16%.
The diff coverage is 80.00%.

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

@@            Coverage Diff             @@
##           master   #14091      +/-   ##
==========================================
- Coverage   79.71%   79.54%   -0.17%     
==========================================
  Files         942      942              
  Lines       47709    47729      +20     
  Branches     6009     6016       +7     
==========================================
- Hits        38029    37968      -61     
- Misses       9559     9640      +81     
  Partials      121      121              
Flag Coverage Δ
cypress 56.36% <ø> (+0.03%) ⬆️
hive ?
javascript 69.68% <80.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
superset-frontend/src/views/CRUD/types.ts 100.00% <ø> (ø)
superset-frontend/src/views/CRUD/utils.tsx 60.60% <ø> (ø)
.../src/views/CRUD/data/savedquery/SavedQueryList.tsx 74.43% <80.00%> (+0.70%) ⬆️
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset/db_engine_specs/hive.py 74.42% <0.00%> (-16.42%) ⬇️
superset/db_engine_specs/presto.py 81.79% <0.00%> (-2.31%) ⬇️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/db_engine_specs/base.py 86.99% <0.00%> (-0.45%) ⬇️
superset/connectors/sqla/models.py 88.37% <0.00%> (-0.25%) ⬇️
superset/utils/core.py 88.70% <0.00%> (-0.13%) ⬇️
... and 4 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 6392d41...8db8b7e. Read the comment docs.

@hughhhh
Copy link
Member

hughhhh commented Apr 13, 2021

/testenv up

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

@github-actions
Copy link
Contributor

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

@hughhhh
Copy link
Member

hughhhh commented Apr 14, 2021

/testenv up FEATURE_VERSIONED_EXPORT=true

@github-actions
Copy link
Contributor

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

@betodealmeida betodealmeida merged commit 36bd6d8 into apache:master Apr 14, 2021
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@lyndsiWilliams lyndsiWilliams deleted the lyndsi/import-saved-queries-fe branch October 15, 2021 01:32
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* Copied changes over

* Tests passing

* Import testing complete
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.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 size/L sqllab:saved_queries 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants