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(embedded): CSV download for chart #20261

Merged
merged 31 commits into from
Jun 18, 2022

Conversation

lilykuang
Copy link
Member

SUMMARY

CSV download didn't work

  • move postForm to supersetClient
  • add guest token to postForm
  • check request form on get_guest_user_from_request for guest token

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

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 3, 2022

Codecov Report

Merging #20261 (d7974f1) into master (f53018c) will decrease coverage by 11.75%.
The diff coverage is 84.61%.

@@             Coverage Diff             @@
##           master   #20261       +/-   ##
===========================================
- Coverage   66.70%   54.94%   -11.76%     
===========================================
  Files        1739     1739               
  Lines       65148    65150        +2     
  Branches     6897     6899        +2     
===========================================
- Hits        43457    35798     -7659     
- Misses      19938    27598     +7660     
- Partials     1753     1754        +1     
Flag Coverage Δ
hive 53.69% <0.00%> (ø)
mysql ?
postgres ?
presto 53.55% <0.00%> (ø)
python 58.36% <0.00%> (-24.41%) ⬇️
sqlite ?
unit 50.53% <0.00%> (ø)

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

Impacted Files Coverage Δ
...erset-frontend/src/components/Chart/chartAction.js 55.92% <0.00%> (ø)
superset/security/manager.py 62.45% <0.00%> (-32.88%) ⬇️
...rset-ui-core/src/connection/SupersetClientClass.ts 97.82% <90.00%> (-2.18%) ⬇️
.../superset-ui-core/src/connection/SupersetClient.ts 100.00% <100.00%> (ø)
...re/components/controls/DatasourceControl/index.jsx 74.73% <100.00%> (ø)
...uperset-frontend/src/explore/exploreUtils/index.js 80.86% <100.00%> (+0.27%) ⬆️
superset/utils/dashboard_import_export.py 0.00% <0.00%> (-100.00%) ⬇️
superset/key_value/commands/upsert.py 0.00% <0.00%> (-89.59%) ⬇️
superset/key_value/commands/update.py 0.00% <0.00%> (-89.37%) ⬇️
superset/key_value/commands/delete.py 0.00% <0.00%> (-85.30%) ⬇️
... and 280 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 f53018c...d7974f1. Read the comment docs.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jun 7, 2022
@lilykuang lilykuang requested a review from suddjian June 8, 2022 22:42
@lilykuang lilykuang requested a review from a team June 10, 2022 17:00
@rusackas
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

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

@justin-tomlinson
Copy link

Just checking if I understand this pull request correctly. Currently the CSV download option is not available in 1.5.0 when embedding using the sdk. I pulled master and enabled embedding and embedded in a test page and was able to see the option to download the csv from a chart, but selecting the download raised errors in the console about the iframe not having certain permissions (allow-forms, allow popups). Does this pull request correct issue allow user of an embedded dashboard to download the csv from charts?

@lilykuang
Copy link
Member Author

@justin-tomlinson this PR will fix issue with downloading CSV but we need to add the allow-forms and allow popups permission to the SDK. I will open other PR to add these two permission to the SDK

Lily Kuang added 2 commits June 15, 2022 09:27
 into fix-embedded-csv-download

# Conflicts:
#	superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.tsx
#	superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx
Copy link
Member

@suddjian suddjian left a comment

Choose a reason for hiding this comment

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

Looks good! Requested changes on some tests which I hope will be considered before a merge, but I feel good approving this.

@lilykuang lilykuang merged commit ab9f72f into apache:master Jun 18, 2022
@lilykuang lilykuang deleted the fix-embedded-csv-download branch June 18, 2022 03:01
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

michael-s-molina pushed a commit that referenced this pull request Jun 23, 2022
* move postForm to superset client

* lint

* fix lint

* fix type

* update tests

* add tests

* add test for form submit

* add test for request form

* lint

* fix test

* fix tests

* more tests

* more tests

* test

* lint

* more test for postForm

* lint

* Update superset-frontend/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts

Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>

* update tests

* remove useless test

* make test cover happy

* make test cover happy

* make test cover happy

* make codecov happy

* make codecov happy

Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>
(cherry picked from commit ab9f72f)
@mistercrunch mistercrunch added 🍒 2.0.0 🍒 2.0.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.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-io size/L v2.0 🍒 2.0.0 🍒 2.0.1 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants