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) |
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) => { |
| npData, | ||
| }: DashboardPluginSetupDependencies | ||
| ) { | ||
| const { querySyncStateContainer, stop: stopQuerySyncStateContainer } = getQueryStateContainer( |
There was a problem hiding this comment.
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.
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! |
kertal
left a comment
There was a problem hiding this comment.
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.
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.
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:
kbnUrlTrackerthat handles setting the nav link to the right value in the various scenariosgetQuerySyncStateContainerhelper 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 thesyncStatehelper and providing just the pull-part of state syncing (without automatic state updates back into the data plugin services)