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 for save button disabled when opening spy panel #5942

Closed
wants to merge 3 commits into from

Conversation

stormpython
Copy link
Contributor

Closes #5860.

This fix will need to be backported.

Issue:

When opening the spy panel in the Visualize tab, after creating a visualization, the save button is disabled. This occurs because the initial opening of the spy panel renders the vis state as dirty. The underlying problem is that the parameter spyPerPage for the spy panel gets added to the editableVis state, but is not transferred to the actual vis state. And since there is a check here that determines whether the editableVis state and the actual vis state are equal, it returns false therefore rendering the vis state as dirty, causing the save button to be disabled.

For a more detailed explanation, see #5860.

Proposed solution:

The parameter spyPerPage should not be placed as a vis parameter since it is apart of the spy panel. The spyPerPage parameter is moved to the $scope.spy.params object from the $scope.vis.params object.

It seems that the spyPerPage parameter is not actually saved in the state across visualizations or within the same visualization. What I mean by that is, if I change the spyPerPage parameter in the UI to 25 and then close the spy panel; when I open it back up, the spyPerPage parameter is reset to 10.

screen shot 2016-01-19 at 2 56 12 pm

This behavior doesn't change with this pull request and allows me to move the parameter to the $scope.spy object without having to worry about state changes. However, I believe this should be thoroughly tested in the UI.

@w33ble
Copy link
Contributor

w33ble commented Jan 27, 2016

Sorry for the delay on this one. This seems to fix the issue and doesn't break the uiState stuff. LGTM!

@elasticsearch-bot
Copy link

Joe Fleming merged this into the following branches!

Branch Commits
master 9086f50
4.x f1d2d9f
4.4 5cc3f4f

elasticsearch-bot pushed a commit that referenced this pull request Jan 27, 2016
elasticsearch-bot pushed a commit that referenced this pull request Jan 27, 2016
@epixa epixa added v4.4.2 and removed v4.4.1 labels Feb 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Opening Spy Panel on Area Chart disables chart Save button
4 participants