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

[BUG] Filters are lost when reloading page or copying url to another browser tab #5179

Closed
lbesuchet opened this issue Oct 3, 2023 · 2 comments · Fixed by #5206
Closed

[BUG] Filters are lost when reloading page or copying url to another browser tab #5179

lbesuchet opened this issue Oct 3, 2023 · 2 comments · Fixed by #5206
Assignees
Labels
bug Something isn't working data explorer Issues related to the Data Explorer project de-angular de-angularize work discover for discover reinvent v2.11.0

Comments

@lbesuchet
Copy link

Describe the bug

Filters are lost when reloading page or copying url to another browser tab.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://playground.opensearch.org/
  2. Click on Opensearch Dashboards / Discover
  3. Select any index pattern (e.g: opensearch_dashboards_sample_data_flights)
  4. Apply any filter (e.g: Carrier: OpenSearch-Air)
  5. Copy the page url and paste it to another browser tab
  6. => the filter has been lost (even if it is still visible in the url)

Expected behavior
Page is loaded with same filters as the original url

Note this works as expected when switching to the old Discover interface (not possible with playground.opensearch.org)

Dashboards Version
2.10.0

@lbesuchet lbesuchet added bug Something isn't working untriaged labels Oct 3, 2023
@wbeckler wbeckler added v2.11.0 and removed untriaged labels Oct 3, 2023
@ashwin-pc ashwin-pc added discover for discover reinvent de-angular de-angularize work labels Oct 3, 2023
@ananzh ananzh self-assigned this Oct 3, 2023
@Abilashinamdar
Copy link
Contributor

Abilashinamdar commented Oct 3, 2023

I have gone through the code to get a fix for this issue and I found that injected metadata for
UI_SETTINGS.FILTERS_PINNED_BY_DEFAULT in ui_settings.ts is false by default. Hence the filters are always pointing to appState of FilterStateStore rather than globalState of FilterStateStore.

Changing the value to true works as expected and here is the attached screenshot for the same:

Screenshot from 2023-10-04 03-45-15

@ashwin-pc @ananzh Can anyone verify if this is the correct finding, then will raise a PR for the same.

@ananzh ananzh added the data explorer Issues related to the Data Explorer project label Oct 3, 2023
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Oct 4, 2023
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Oct 4, 2023
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Oct 4, 2023
@ananzh ananzh closed this as completed in 5623cef Oct 4, 2023
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this issue Oct 4, 2023
…fresh page or paste url to a new tab (opensearch-project#5206)

Issue Resolve
opensearch-project#5179
opensearch-project#5071

Signed-off-by: ananzh <[email protected]>

(cherry picked from commit 5623cef)
Signed-off-by: Miki <[email protected]>
AMoo-Miki added a commit that referenced this issue Oct 4, 2023
* [BUG][Discover] Add onQuerySubmit to top nav and allow force update to embeddable (#5160)

* all reload to force update embeddable
* add onQuerySubmit to top nav

Issue Resolve
#5116
#5159

Signed-off-by: ananzh <[email protected]>
Co-authored-by: Miki <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>

(cherry picked from commit 7d89cca)
Signed-off-by: Miki <[email protected]>

* [Discover] A bunch of navigation fixes (#5168)

* Discover: Fixes state persistence after nav
* Fixed breadcrumbs and navigation
* fixes mobile view

---------

Signed-off-by: Ashwin P Chandran <[email protected]>

(cherry picked from commit cb6e0f0)
Signed-off-by: Miki <[email protected]>

* [BUG][Data Explorer][Discover] Automatically load solo added default index pattern (#5171)

* [BUG][Data Explorer][Discover] Automatically load solo added default index pattern

This fix ensures that when add a default index pattern, Discover will
automatically select and load its details.

Issue Resolve
#5128

---------

Signed-off-by: ananzh <[email protected]>

(cherry picked from commit 9601c6c)
Signed-off-by: Miki <[email protected]>

* [BUG][Data Explorer][Discover] Allow data grid to auto adjust size based on fetched data count (#5191)

* This PR adds a new rows state to the DiscoverCanvas component and updated it whenever
the data$ observable emitted new row data.
* The DiscoverTable component was then refactored to accept rows as a prop, making it
dependent on the parent component to provide the correct set of data. This ensures that the table
renders correctly based on the current data and doesn't rely on its internal state,
which could be outdated.

Issue Resolve
#5181

Signed-off-by: ananzh <[email protected]>

(cherry picked from commit 677fdf5)
Signed-off-by: Miki <[email protected]>

* Fixes mobile layout (#5195)

Signed-off-by: Ashwin P Chandran <[email protected]>
(cherry picked from commit 0ffd2ab)

* [BUG][Data Explorer][Discover] Allow filter and query persist when refresh page or paste url to a new tab (#5206)

Issue Resolve
#5179
#5071

Signed-off-by: ananzh <[email protected]>

(cherry picked from commit 5623cef)
Signed-off-by: Miki <[email protected]>

* fixes DataTable rendering in doscover (#5207)

Signed-off-by: Ashwin P Chandran <[email protected]>
(cherry picked from commit c70125f)

---------

Signed-off-by: ananzh <[email protected]>
Signed-off-by: Miki <[email protected]>
Signed-off-by: Ashwin P Chandran <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>
willie-hung pushed a commit to willie-hung/OpenSearch-Dashboards that referenced this issue Oct 5, 2023
SuZhou-Joe pushed a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this issue Oct 7, 2023
@jonashellmann
Copy link

@ananzh I would like to point out that this issue still exists with saved searches. Prior to finding this issue I opened #7677.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working data explorer Issues related to the Data Explorer project de-angular de-angularize work discover for discover reinvent v2.11.0
Projects
None yet
6 participants