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 of the explore action button bug without reload #1290

Closed
wants to merge 3 commits into from
Closed

Fix of the explore action button bug without reload #1290

wants to merge 3 commits into from

Conversation

prokh
Copy link
Contributor

@prokh prokh commented Oct 7, 2016

*Solves #1189: Download button, share button, and url shortener button stay not in sync with visualization while editing
*Syncs the data from the server response to the data in slice.
*Calls a callback to rerender buttons when data changes.

Current Situation:

  • slice.data is the bootstraped data and is never changed. It contains the initial form data.
  • slice.jsonEndpoint() calculates the json endpoint from the form, referenced by #("query").
  • When the user changes the form, even when he hits query, slice.data.json_endpoint is inconsistent with the form data and slice.jsonEndpoint().
  • The slice is passed to the React components for the json/csv/embedd. Currently, they access slice.data.json_endpoint/csv_endpoint/standalone_endpoint. Thus they are inconsistent.

There are two options:

  1. Replace in the React components slice.data.json_enpoint by slice.jsonEndpoint() and add a analogous function for csv. The former calculates the the json endpoint from the form data.
    Problem: If the user changes the form but has not updated the chart, the chart and the json data is inconsistent.
  2. Update slice.data.json_endpoint/csv_endpoint in slice.done() with the data from the server. Then rerender the React components (,which is the recommened way when the props change (setProps is deprecated)). The json/csv endpoints are consistent with the visualization.

The second option in implemented. We only update slice.data.json_endpoint/csv.endpoint/form_data/standalone_endpoint. slice.data.token/viz_name might get inconsistent.

prokh and others added 3 commits October 7, 2016 18:01
*Solves #1189: Download button, share button, and url shortener button stay not in sync with visualization while editing
*Syncs the data from the server response to the data in slice.
*Calls a callback to rerender buttons when data changes.
@prokh prokh closed this Oct 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant