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] fix the 'altered' tag false positive #5636

Closed
wants to merge 1 commit into from

Conversation

mistercrunch
Copy link
Member

The altered tag shows up in many cases where it shouldn't. First
it's common for the loaded examples to have extra keys in their
form_data, they were designed that way knowing extra keys get removed
along the way (only the form_data relevant to a particular viz type
makes it through).

Though then there was a few lines added to allow for url_params
through, but brought back the kitchen sink as it merged all other
bad keys. This also creates problems around metrics and such as
switching viz types.

As an alternative approach, I added url_params as a HiddenControl so
that it can flow using the common form_data flow.

Note that:

  • url_params will get saved with the chart metadata, but overriden on
    explore. It appears that the logic that bakes the url_params applies
    only to explore, not dashboards, meaning unless we call
    merge_request_params on the dashobard endpoint, the url_params would
    show as saved on the chart.
  • I cleaned up some dup logic in index.js
  • I can't test that very much as I don't fully understand the use case,
    it appears url_params never worked with dashboards for instance

@michellethomas @graceguo-supercat let me know what you think

The altered tag shows up in many cases where it shouldn't. First
it's common for the loaded examples to have extra keys in their
form_data, they were designed that way knowing extra keys get removed
along the way (only the form_data relevant to a particular viz type
makes it through).

Though then there was a few lines added to allow for `url_params`
through, but brought back the kitchen sink as it merged all other
bad keys. This also creates problems around metrics and such as
switching viz types.

As an alternative approach, I added `url_params` as a HiddenControl so
that it can flow using the common form_data flow.

Note that:
* `url_params` will get saved with the chart metadata, but overriden on
explore. It appears that the logic that bakes the `url_params` applies
only to explore, not dashboards, meaning unless we call
`merge_request_params` on the dashobard endpoint, the `url_params` would
show as saved on the chart.
* I cleaned up some dup logic in index.js
* I can't test that very much as I don't fully understand the use case,
it appears url_params never worked with dashboards for instance

Let me know what you think
@mistercrunch
Copy link
Member Author

Looks like @michellethomas wrote the exact same PR :)

@hajdbo
Copy link
Contributor

hajdbo commented Sep 17, 2018

PR: #5100
Commit: bf0afef

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.

2 participants