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

[Discover] "Unsaved changes" badge should appear after updating the time picker for a saved search with "Store time with saved search" setting #172288

Closed
jughosta opened this issue Nov 30, 2023 · 2 comments · Fixed by #178659
Assignees
Labels
bug Fixes for quality problems that affect the customer experience :DataDiscovery/fix-it-week Feature:Discover Discover Application impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.

Comments

@jughosta
Copy link
Contributor

Kibana version: 8.12

Describe the bug:
Updates to the time picker should trigger "Unsaved changes" badge in Discover if the saved search has "Store time with saved search" enabled.

Steps to reproduce:

  1. Save a new search with "Store time with saved search" switch on
  2. Change the time range in UI or change the refresh interval setting
  3. Notice that "Unsaved changes" badge does not appear.

If user applies other changes which do trigger the badge, then pressing "Revert changes" restores the saved search correctly including the time filter settings. The problem is only that the badge does not appear right away.

@jughosta jughosta added bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Nov 30, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@kertal kertal added the impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. label Dec 4, 2023
@kertal
Copy link
Member

kertal commented Mar 5, 2024

Some remarks, we currently don't update saved search when just the time range changes, this could be done like this

Adding

   const timeFilterSubscribe = services.timefilter.getFetch$().subscribe((next) => {
      if (savedSearchContainer.getState().timeRestore) {
        savedSearchContainer.update({});
      }
    });

After this code:

https://github.com/elastic/kibana/blob/cb19e99b382d1a8a55a46e53b21fe15eee513d3a/src/plugins/discover/public/application/main/services/discover_state.ts#L391-L390

However, reverting the change with the Unsaved changes badge didn't work on the first click, but on the second, so there's high likely more to do in this case

@flash1293 flash1293 self-assigned this Mar 8, 2024
flash1293 added a commit that referenced this issue Mar 20, 2024
…e time range is stored along with saved search (#178659)

Closes #172288

There's two parts to this:
* When updating the saved search, update the time range as well using
the current state of the services.timefilter instance
* Similar to filter updates, run an update action on the state container
if the time changes

---------

Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience :DataDiscovery/fix-it-week Feature:Discover Discover Application impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Projects
None yet
4 participants