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: accept headers on import #17080

Merged
merged 2 commits into from
Oct 13, 2021
Merged

Conversation

betodealmeida
Copy link
Member

@betodealmeida betodealmeida commented Oct 12, 2021

SUMMARY

When importing an asset (dashboard, chart, etc.) we should specify an Accept request header to prevent the pretty 500 page from showing up.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Screen Shot 2021-10-12 at 4 47 09 PM

After:

Screen Shot 2021-10-12 at 4 37 55 PM

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

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.

ok as is, or pending any tests you wanted to add. Fetchmock could work here.

@codecov
Copy link

codecov bot commented Oct 13, 2021

Codecov Report

Merging #17080 (82c2d5d) into master (5e85f48) will not change coverage.
The diff coverage is n/a.

❗ Current head 82c2d5d differs from pull request most recent head 398361c. Consider uploading reports for the commit 398361c to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master   #17080   +/-   ##
=======================================
  Coverage   76.88%   76.88%           
=======================================
  Files        1031     1031           
  Lines       55183    55183           
  Branches     7505     7505           
=======================================
  Hits        42430    42430           
  Misses      12501    12501           
  Partials      252      252           
Flag Coverage Δ
javascript 70.82% <ø> (ø)

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

Impacted Files Coverage Δ
superset-frontend/src/views/CRUD/hooks.ts 47.23% <ø> (ø)

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 5e85f48...398361c. Read the comment docs.

@betodealmeida betodealmeida added the need:merge The PR is ready to be merged label Oct 13, 2021
@betodealmeida betodealmeida merged commit 40e9add into apache:master Oct 13, 2021
wrapper.find(Button).at(2).simulate('click');
await waitForComponentToPaint(wrapper);
expect(fetchMock.calls(DATABASE_IMPORT_URL)[0][1]?.headers).toStrictEqual({
Accept: 'application/json',
Copy link
Member

Choose a reason for hiding this comment

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

cool!

opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* fix: accept headers on import

* Add unit test
@eschutho eschutho added the v1.4 label Nov 23, 2021
eschutho pushed a commit that referenced this pull request Nov 23, 2021
* fix: accept headers on import

* Add unit test

(cherry picked from commit 40e9add)
@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 need:merge The PR is ready to be merged size/M 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