-
Notifications
You must be signed in to change notification settings - Fork 951
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] fix: Clean up sync URL subscription in Discover plugin topNav #9316
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9316 +/- ##
=======================================
Coverage 61.70% 61.71%
=======================================
Files 3816 3817 +1
Lines 91829 91841 +12
Branches 14543 14545 +2
=======================================
+ Hits 56666 56677 +11
- Misses 31507 31508 +1
Partials 3656 3656
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
src/plugins/data/public/query/state_sync/use_sync_state_with_url.test.ts
Show resolved
Hide resolved
src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: Joey Liu <[email protected]>
Signed-off-by: Joey Liu <[email protected]>
Signed-off-by: Joey Liu <[email protected]>
do you mind checking the ci failures? is the ci failing on main? |
I see the same test error in other PR, I don't think that's related to my change |
@Maosaic one comment but not blocking. I see we use Other plugins also uses OpenSearch-Dashboards/src/plugins/dashboard/public/application/utils/create_dashboard_app_state.tsx Line 131 in 4da33a1
Line 51 in 4da33a1
*visbuilder
*visualization
should we also replace those with |
…Nav (#9316) * [Discover] fix: Clean up sync URL subscription in Discover plugin topNav Signed-off-by: Joey Liu <[email protected]> * Changeset file for PR #9316 created/updated * Update unit test Signed-off-by: Joey Liu <[email protected]> * Revert save modal change Signed-off-by: Joey Liu <[email protected]> --------- Signed-off-by: Joey Liu <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 8cc5f84) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
We can, but not necessary, those are manually calling |
Description
Properly clean up sync URL subscription in Discover plugin topNav component.
Changes this PR contains:
useSyncQueryStateWithUrl
hook which automatically cancel sync URL subscription.useSyncQueryStateWithUrl
fromtopNav
component, so the URL subscription will be properly clean up when user navigate away from Discover page.RewriteSavedObjectSaveModal
as functional component.Issues Resolved
fixes #9309
Screenshot
Before
Screen.Recording.2025-01-29.at.2.56.41.PM.mp4
After
Screen.Recording.2025-01-31.at.10.43.38.AM.mp4
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration