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: choose language link for local dev #9215

Merged
merged 1 commit into from Mar 5, 2020

Conversation

ktmud
Copy link
Member

@ktmud ktmud commented Feb 27, 2020

CATEGORY

  • Bug Fix

SUMMARY

@superset-ui/connection will add protocol and host to an "endpoint" call. e.currentTarget.href may return the full URL instead of the relative url. This sometimes results in invalid URLs for change language API calls.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

In local dev environment, change language will result in a 404 error:

Snip20200226_6

image

The result should be gone after this fix.

TEST PLAN

Change language in local dev box will work and should not throw an error in the browser console.

ADDITIONAL INFORMATION

N/A

REVIEWERS

@kristw

@codecov-io
Copy link

Codecov Report

Merging #9215 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #9215   +/-   ##
=======================================
  Coverage   58.91%   58.91%           
=======================================
  Files         372      372           
  Lines       11996    11996           
  Branches     2937     2937           
=======================================
  Hits         7068     7068           
  Misses       4750     4750           
  Partials      178      178
Impacted Files Coverage Δ
superset-frontend/src/setup/setupApp.ts 0% <ø> (ø) ⬆️

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 ca2bc8b...d29e8a3. Read the comment docs.

@willbarrett
Copy link
Member

@rusackas this looks like a nice fix, might be up your alley for a review

Copy link
Member

@nytai nytai left a comment

Choose a reason for hiding this comment

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

lgtm, assuming the urls are always consistent.

@@ -67,7 +67,7 @@ export default function setupApp() {
) {
ev.preventDefault();
SupersetClient.get({
endpoint: ev.currentTarget.href,
url: ev.currentTarget.href,
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure that the url will always be a full url instead of a relative one?

Copy link
Member Author

@ktmud ktmud Mar 3, 2020

Choose a reason for hiding this comment

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

Even if it's not, SupersetClient should still be able to handle it. fetch does accept relative URLs.

@superset-ui/connection will add protocol and host to an "endpoint" call.

`e.currentTarget.href` may return the full URL instead of the relative
url.
Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

seems legit, nice fix!

@etr2460 etr2460 merged commit b1d83ba into apache:master Mar 5, 2020
@ktmud ktmud deleted the fix-choose-lang-link branch April 12, 2020 06:49
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.36.0 labels Feb 28, 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/XS 🚢 0.36.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants