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(explore): chart link is broken without localStorage #21707

Conversation

justinpark
Copy link
Member

@justinpark justinpark commented Oct 5, 2022

SUMMARY

Addition to #21422 issue

"Edit chart" from dashboard may not work if the dashboard context is not found in localStorage.
It's specially missing filterBox metadata due to the lack of exploreFormData mapping in mergeFilterBoxToFormData.

Screen Shot 2022-10-05 at 10 36 53 AM

This could happen when users either don't have localStorage enabled in there browser (unlikely) or copied the link in the different browser.

This commit fixes this issue by using the original explore formData if dashboardContextFormData is empty.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

  • Before

Notification_Center

  • After

Notification_Center

TESTING INSTRUCTIONS

  • Go to a Dashboard page
  • Delete localStorage item dashboard__explore_context
  • Go edit chart having time granularity in the dashboard

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

cc: @ktmud

result.form_data,
dashboardContextFormData,
)
: result.form_data;
Copy link
Member

Choose a reason for hiding this comment

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

Could this be merged into getFormDataWithDashboardContext? Basically make the second parameter nullable?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd rather to keep this way because using getFormDataWithDashboardContext without dashboardContent seems odd.

@codecov
Copy link

codecov bot commented Oct 5, 2022

Codecov Report

Merging #21707 (756e256) into master (7b66e0b) will not change coverage.
The diff coverage is 0.00%.

❗ Current head 756e256 differs from pull request most recent head 7af756b. Consider uploading reports for the commit 7af756b to get more accurate results

@@           Coverage Diff           @@
##           master   #21707   +/-   ##
=======================================
  Coverage   66.85%   66.85%           
=======================================
  Files        1799     1799           
  Lines       68875    68875           
  Branches     7319     7320    +1     
=======================================
  Hits        46044    46044           
  Misses      20944    20944           
  Partials     1887     1887           
Flag Coverage Δ
javascript 53.15% <0.00%> (ø)

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

Impacted Files Coverage Δ
superset-frontend/src/explore/ExplorePage.tsx 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM

@michael-s-molina michael-s-molina merged commit 35d9cb3 into apache:master Oct 7, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 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 size/S 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants