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

[dashboard fix] force refresh charts under tabs #5291

Conversation

graceguo-supercat
Copy link

@graceguo-supercat graceguo-supercat commented Jun 26, 2018

screen shot 2018-06-26 at 11 19 05 am

when user created top level tabs and place charts under it, initial page load won't fetch those charts data. But if user force refresh dashboard, currently we force refresh all charts even not visible ones. It cause js exception because some attributes are not well initialized.

updated solution: when user force refresh whole dashboard, don't fetch data for charts that haven't been rendered.

@williaster
Copy link
Contributor

@graceguo-supercat what do you think about a different fix where we simply don't fetch data for charts that haven't been rendered? that would reduce the query time as well.

@@ -202,5 +202,10 @@ export function runQuery(formData, force = false, timeout = 60, key) {
}

export function refreshChart(chart, force, timeout) {
return dispatch => dispatch(runQuery(chart.latestQueryFormData, force, timeout, chart.id));
return dispatch => {
if (Object.keys(chart.latestQueryFormData).length === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should there also be a check for whether chart.latestQueryFormData is defined or is that guaranteed to be there?

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

can we add the check JIC since there is no downside to adding it?

Copy link
Author

Choose a reason for hiding this comment

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

added.

Copy link
Contributor

@williaster williaster 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 build passes. thanks for being extra careful on the check 👍

@codecov-io
Copy link

Codecov Report

Merging #5291 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5291      +/-   ##
==========================================
- Coverage    61.3%   61.29%   -0.01%     
==========================================
  Files         368      368              
  Lines       23455    23457       +2     
  Branches     2715     2716       +1     
==========================================
  Hits        14379    14379              
- Misses       9064     9066       +2     
  Partials       12       12
Impacted Files Coverage Δ
superset/assets/src/chart/chartAction.js 50.45% <0%> (-0.93%) ⬇️

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 05a39b3...54cd99b. Read the comment docs.

@graceguo-supercat graceguo-supercat merged commit 4ee984c into apache:master Jun 27, 2018
@graceguo-supercat graceguo-supercat deleted the gg-DashFix-forceRefreshWithTabs branch June 27, 2018 00:46
graceguo-supercat pushed a commit to graceguo-supercat/superset that referenced this pull request Jun 27, 2018
hughhhh pushed a commit to lyft/incubator-superset that referenced this pull request Jul 11, 2018
hughhhh pushed a commit to lyft/incubator-superset that referenced this pull request Jul 11, 2018
timifasubaa pushed a commit to airbnb/superset-fork that referenced this pull request Jul 25, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Jul 26, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Jul 26, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Jul 26, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Jul 27, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Jul 31, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Aug 3, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Aug 3, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Aug 4, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Aug 4, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
@mistercrunch mistercrunch added 🍒 0.27.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 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 🍒 0.27.0 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants