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

[explore view] fix: Inline edit chart title cause unintended overwrite original query parameter #8835

Merged

Conversation

graceguo-supercat
Copy link

@graceguo-supercat graceguo-supercat commented Dec 14, 2019

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

To reproduce this issue:

  1. Add a chart to dashboard,
  2. Keep edit chart, for example, use left-side controls panel to update query.
  3. Now, click chart title and inline edit chart title. Inline editing chart title will not trigger save slice modal.
  4. Visit dashboard, you will see the original chart, both title and query are modified.

Screen Shot 2019-12-13 at 10 53 42 AM

Note

  • Currently, explore view will open Save modal for user to choose to save-as or overwrite chart.
  • When user successfully saveas (or overwritten) chart, the explore view page will be reloaded. If user chose to go to dashboard, the page will be redirected. By this way the front-end can always being sync with updated query params in slice table.
  • This PR will not change the current behavior. But if in the future we decide to use async way of saving chart parameters, we should be aware of that some components will be affected by this change. So in this PR I added some unit tests to make sure the reload and redirect behavior.

Expected behavior:
inline edit chart title should only overwrite chart title, should not change original chart with unsaved query parameters.

TEST PLAN

CI and manual test

REVIEWERS

@etr2460 @michellethomas @mistercrunch

@pull-request-size pull-request-size bot added size/L and removed size/M labels Dec 18, 2019
});
// this.props.slice hold the original slice params stored in slices table
this.props.actions
.saveSlice(this.props.slice.form_data, params)
Copy link
Member

@suddjian suddjian Dec 18, 2019

Choose a reason for hiding this comment

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

If I'm understanding the code above this correctly, this will fail on a new slice. But it looks like the new slice case is tested, so maybe the isNewSlice code isn't necessary?

Copy link
Author

@graceguo-supercat graceguo-supercat Dec 18, 2019

Choose a reason for hiding this comment

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

@suddjian Thanks so much for catching the new slice case! i fixed it and added unit test.

@codecov-io
Copy link

Codecov Report

Merging #8835 into master will increase coverage by 0.24%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8835      +/-   ##
==========================================
+ Coverage   58.73%   58.97%   +0.24%     
==========================================
  Files         359      359              
  Lines       11324    11333       +9     
  Branches     2779     2787       +8     
==========================================
+ Hits         6651     6684      +33     
+ Misses       4495     4471      -24     
  Partials      178      178
Impacted Files Coverage Δ
...sets/src/explore/components/ExploreChartHeader.jsx 71.05% <100%> (+19.62%) ⬆️
...perset/assets/src/explore/components/SaveModal.jsx 92.63% <100%> (+4.21%) ⬆️
superset/assets/src/welcome/DashboardTable.jsx 77.77% <0%> (-9.73%) ⬇️
superset/assets/src/welcome/App.jsx 0% <0%> (ø) ⬆️
superset/assets/src/components/Menu/Menu.jsx 87.5% <0%> (ø) ⬆️
superset/assets/src/components/Menu/NewMenu.jsx 100% <0%> (+40%) ⬆️
superset/assets/src/components/Menu/UserMenu.jsx 100% <0%> (+50%) ⬆️
...rset/assets/src/components/Menu/LanguagePicker.jsx 100% <0%> (+66.66%) ⬆️
... and 1 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 1719c4b...58900bb. Read the comment docs.

@graceguo-supercat graceguo-supercat merged commit cd8aa92 into apache:master Dec 19, 2019
@villebro villebro added the v0.35 label Dec 23, 2019
@dpgaspar dpgaspar removed the v0.35 label Dec 23, 2019
@graceguo-supercat graceguo-supercat deleted the gg-FixInlineEditSliceName branch February 10, 2020 04:18
@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/L 🚢 0.36.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants