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

Download button, share button, and url shortener button stay not in sync with visualization while editing #1189

Closed
prokh opened this issue Sep 24, 2016 · 1 comment
Labels
!deprecated-label:bug Deprecated label - Use #bug instead obsolete No longer relevant issue or applicable code

Comments

@prokh
Copy link
Contributor

prokh commented Sep 24, 2016

The json export button, the csv export button, the share button, and the url-shorter button are not updated when the user changes metrics, groupby, or other properties of the visualization. Thus, the user downloads or shares the wrong data. They are updated when the site is reloaded by clicking on refresh.

Steps to recreate it:

  1. Open a slice, e.g.
    /caravel/explore/table/2/?slice_name=World's+Pop+Growth&row_limit=50000&metric=sum__SP_POP_TOTL&show_bubbles=y&entity=country_code&secondary_metric=sum__SP_POP_TOTL&viz_type=area&since=1960-01-01&json=false&until=now&datasource_id=1&metrics=sum__SP_POP_TOTL&datasource_name=birth_names&country_fieldtype=cca3&granularity=year&slice_id=11&datasource_type=table&compare_lag=10&limit=25&markup_type=markdown&compare_suffix=o10Y&where=&groupby=region .
  2. Change the metric from sum__SP_POP_TOTAL to Count( ) and hit 'Query'. The visualization updates and location in the browser bar changes accordingly. The new metric is used.
  3. Download the json/csv file.
    Expected: The data uses the new "Count( )" metric.
    Actual result: The data still uses the the old metric sum__SP_POP_TOTAL metric. All other values like json_endpoint, csv_endpoint, or metric in the json data still refer to the old metric. Inspecting the link in the csv/json download button reveals that the links use the old metric. Though, the SQL-Query from the query button is correct.
  4. Refresh the page.
  5. Download json/csv and get the expected data.

The same bug applies when chart parameters are changed.

Cause

The state of the page with all the parameters for metric, group by, etc. is saved in the global variable 'slice'. When the user changes params, they are updated in 'slice'. The buttons are React Components created with the property 'slice'. However, they do not listen to updates of 'slice' and keep the initial value.

@prokh prokh changed the title Download button, share button, and url shortener button are stay not in sync with visualization while editing Download button, share button, and url shortener button stay not in sync with visualization while editing Sep 24, 2016
@ascott
Copy link
Contributor

ascott commented Sep 26, 2016

thanks for this report @prokh , i'll look into.

@kristw kristw added !deprecated-label:bug Deprecated label - Use #bug instead obsolete No longer relevant issue or applicable code labels Jan 23, 2019
@kristw kristw closed this as completed Jan 23, 2019
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 17, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 24, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 25, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!deprecated-label:bug Deprecated label - Use #bug instead obsolete No longer relevant issue or applicable code
Projects
None yet
Development

No branches or pull requests

3 participants