-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Disable url tracking for dashboard #55818
Disable url tracking for dashboard #55818
Conversation
…b.com:Dosant/kibana into dev/state-management/global-state-dashboard
…ing-for-dashboard
…a into exclude-sub-url-tracking
…ing-for-dashboard
…ing-for-dashboard
Pinging @elastic/kibana-app (Team:KibanaApp) |
Pinging @elastic/kibana-app-arch (Team:AppArch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed and clicked around a bit. LGTM.
Left some comments.
Concerned about every app having to create each own state container to get updates from data
services, which should be improved separately. #56503
src/legacy/core_plugins/kibana/public/local_application_service/local_application_service.ts
Show resolved
Hide resolved
filters: filterManager.getGlobalFilters(), | ||
}; | ||
|
||
export const syncQuery = (queryStart: QueryStart, urlStateStorage: IKbnUrlStateStorage) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) { | ||
const { querySyncStateContainer, stop: stopQuerySyncStateContainer } = getQueryStateContainer( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we will have to add this to data
plugin as part of the api. Because with current setup, if to apply this for multiple apps: each app will create a state container, which will all the time independently orchestrate data.query
changes.
So we should add 1 state container on a data plugin, which apps could reuse and receive the updates.
cc @lizozom, I think you've mentioned something like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's even worse than that - the syncState
helper is also creating its own state container, so even the dashboard plugin alone will have two of them running while the app is mounted. +1 for exposing it once via setup contract and using it everywhere from there.
src/plugins/kibana_utils/public/state_management/url/kbn_url_tracker.ts
Outdated
Show resolved
Hide resolved
@Dosant Could you have another look? Changed some things and fixed the linting problem (there were a few things caught by the updated rules I just fixed as well while at it) |
@flash1293, reviewed and clicked around again. looks good to me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM 👍 , tested locally with chrome, works.
* * When the app is currently active, the nav link points to the configurable default url of the app. | ||
* * When the app is not active the last visited url is set to the nav link. | ||
* * When a provided observable emits a new value, the state parameter in the url of the nav link is updated | ||
* as long as the app is not active. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be a nice addon to the PRs description for giving context what sub url tracking does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point @kertal, sorry for leaving this a little cryptic. I will update to document a bit better for future readers
…ing-for-dashboard
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Move URL tracking into helper function controlled by the app plugin. The URL tracker listens to history changes and optionally to global state changes and updates the nav link url of a given app to point to the last visited page within the app.
This includes the following parts:
as long as the app is not active.
This has two parts:
kbnUrlTracker
that handles setting the nav link to the right value in the various scenariosgetQuerySyncStateContainer
helper that provides a state container pulling in the latest state from the state in data services. This one is basically a refactoring of a part of thesyncState
helper and providing just the pull-part of state syncing (without automatic state updates back into the data plugin services)