Skip to content

Fix issue where saved searches are not updated#14452

Merged
stacey-gammon merged 11 commits intoelastic:masterfrom
stacey-gammon:fix/update-untouched-saved-searches
Nov 2, 2017
Merged

Fix issue where saved searches are not updated#14452
stacey-gammon merged 11 commits intoelastic:masterfrom
stacey-gammon:fix/update-untouched-saved-searches

Conversation

@stacey-gammon
Copy link
Copy Markdown

@stacey-gammon stacey-gammon commented Oct 13, 2017

Release note: There has been a long standing issue where if you add a saved search to a dashboard, then go edit and save that saved search, the updates are not propagated to the dashboard. The only way, previously, to get the new changes was to remove and re-add the search from your dashboard. With this fix, that is no longer necessary. However, there is one situation when your saved search will stop updating and that is when someone has made and saved local edits to the saved search on the dashboard. For example, if you remove a column from a saved search in a dashboard panel, then save the dashboard, that search will always show that column set, even if columns are added or removed to the underlying saved search. We did it this way to still allow users to override the configuration at the dashboard level.

Fixes #9523

The issue was that we were storing the column and sort information on the panel state all the time - not just when it was explicitly overridden in a dashboard. Now, you will only lose automatic updates if a dashboard is saved with an explicit modification of columns and sort. The columns and sort are also separate, so if you simply sort, you won't see sort updates from a saved search, but you will get column modifications.

@stacey-gammon
Copy link
Copy Markdown
Author

I removed a retry that I thought should be irrelevant with the new more stabilized test code, but for some reason ran into the stale element reference. Adding debug messages to see if I can find out what is going on before putting the retry's back, as they shouldn't be needed...

02:56:45        │ debg  in displayedByCssSelector: [data-test-subj~="dashboardAddPanelButton"]
02:56:45        │ debg  filter visualization (Visualization PieChart)
02:56:45        │ debg  findByCssSelector input[placeholder="Visualizations Filter..."]
02:56:45        │ debg  clickByPartialLinkText(Visualization PieChart)
02:56:45        │ debg  find.byPartialLinkText(Visualization PieChart)
02:56:45        │ debg  Taking screenshot "/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/functional/screenshots/failure/dashboard app dashboard view edit mode create test dashboard.png"
02:56:45      └- ✖ fail: "dashboard app dashboard view edit mode create test dashboard"
02:56:45      │        [POST http://localhost:9515/session/4a893e9627955c195b475c558e79bee5/element/0.21331085789257886-12/click] stale element reference: element is not attached to the page document
02:56:45      │         (Session info: chrome=59.0.3071.115)
02:56:45      │         (Driver info: chromedriver=2.32.498513 (2c63aa53b2c658de596ed550eb5267ec5967b351),platform=Linux 4.4.0-45-generic x86_64)
02:56:45      │         at Server._post (test/functional/services/remote/verbose_remote_logging.js:15:21)
02:56:45      │         at runRequest (node_modules/leadfoot/Session.js:92:40)
02:56:45      │         at getFinalValue (node_modules/dojo/Promise.js:258:35)
02:56:45      │         at node_modules/dojo/Promise.js:272:24
02:56:45      │         at node_modules/dojo/Promise.js:156:41
02:56:45      │         at runCallbacks (node_modules/dojo/Promise.js:19:22)
02:56:45      │         at node_modules/dojo/Promise.js:103:21
02:56:45      │         at run (node_modules/dojo/Promise.js:51:33)
02:56:45      │         at node_modules/dojo/nextTick.js:35:17
02:56:45      │         at _combinedTickCallback (internal/process/next_tick.js:73:7)
02:56:45      │         at process._tickDomainCallback (internal/process/next_tick.js:128:9)

Copy link
Copy Markdown
Member

@weltenwort weltenwort left a comment

Choose a reason for hiding this comment

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

This is a lot less confusing 👍

The problem that remains though is that there is no indication if the sorting or column set has been overridden. But that's a separate discussion.

@stacey-gammon
Copy link
Copy Markdown
Author

@Bargs, if you have time to give this a look over, just take note ofhttps://github.com//issues/14674. Tests pass here incidentally because the page is reloaded. That separate bug will require new tests to specifically catch.

Copy link
Copy Markdown
Contributor

@Bargs Bargs left a comment

Choose a reason for hiding this comment

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

LGTM! Feels much more intuitive. I agree with Felix that a dirty state indicator would be nice, along with some way to easily "reset" the panel back to the saved search state. But that can certainly wait for another PR.

@stacey-gammon stacey-gammon merged commit 92964ef into elastic:master Nov 2, 2017
stacey-gammon pushed a commit to stacey-gammon/kibana that referenced this pull request Nov 2, 2017
elastic#14452)

* Add tests to catch error

* Fix test

* Don't store column and sort state in panel uiState unless explicitly overridden in a dashboard.

* add debug messages

* Elements can go stale between the find by and the click event so wrap in a retry

* fix bad merge with master
stacey-gammon pushed a commit that referenced this pull request Nov 2, 2017
#14452) (#14738)

* Add tests to catch error

* Fix test

* Don't store column and sort state in panel uiState unless explicitly overridden in a dashboard.

* add debug messages

* Elements can go stale between the find by and the click event so wrap in a retry

* fix bad merge with master
@stacey-gammon stacey-gammon changed the title Sync saved searches that don't have local modifications on a dashboard Fix issue where saved searches are not updated Nov 16, 2017
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.

Changes to Saved Search objects do not reflect in Dashboard without re-adding

3 participants