-
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
Allow AppUpdater
to change URL for app in Nav
#56027
Comments
Pinging @elastic/kibana-platform (Team:Platform) |
Related: I will introduce this functionality for the fake apps of the local application service in #55818 |
Does this need only concerns legacy apps, or are we talking about new apps too? (For new apps, I though is was decided that plugins should use some sort of persistent storage instead of relying on
With introduction of
Implementation-wise, we are probably going to need another field than |
We discussed this, but the problem with this approach is that it doesn't support the "open in new tab" flow without breaking other things. If we use session storage in a plugin to restore the last visited url, "open in new tab" looses the current sub url state. If we use local storage, the user can't use two independent tabs without overwriting each others state and causing weird behavior.
It would be possible to work around it when it's just impacting the nav links, but it would certainly be easier if it would impact both. |
We will have to introduce this kibana/src/core/public/chrome/ui/header/nav_link.tsx Lines 67 to 78 in da54657
kibana/src/core/public/chrome/ui/header/nav_link.tsx Lines 58 to 60 in da54657
|
@flash1293 what is the urgency on that? |
That sounds right, the anchor html element in the nav bar should contain the deep url in the href attribute. It's not urgent as the apps that use this behavior are currently not actually using the application service, but an angular-integrated "local application service" providing the same API: I can simulate the new updater behavior there for now using the deprecated navlinks service |
Since the kibana-app team has designed their applications around this API existing (as @flash1293 mentioned above), I think we should try to get this in this before they finish their client-side migration. Worst case, if we don't they can copy the workaround from |
A few questions come to mind:
As we are currently navigating between NP and legacy apps, most changes of app triggers a page reload, so any in-memory state of this lastSubUrl thing would be lost. I don't know what our actual needs are on that and how this was implemented in legacy?
Out current API looks like Do we want to adapt it so that
Not sure how that would reflect on the url of the navlinks, but |
For our use case that's not necessary, the
It should also be used as a default for |
To be sure to understand, you mean the |
@pgayvallet yes, exactly. |
@pgayvallet Not sure whether it helps, but for reference: this is how the
The additional property is called |
I was going to add an optional kibana/src/core/public/application/types.ts Line 203 in 48a33ab
kibana/src/core/public/application/types.ts Line 190 in 48a33ab
That way, an application can define a default path even when calling Then, most importantly, plugins will then be able to update this Then I was going to impact the behavior of both the
kibana/src/core/public/application/types.ts Line 648 in 48a33ab
When
when kibana/src/core/public/chrome/ui/header/nav_link.tsx Lines 56 to 60 in da54657
Somethink like (naive example) let href = `${navLink.baseUrl}/${navLink.defaultPath}`; I think that would answer the need. Do you see anything I would have missed or do you have any comment? |
The legacy chrome allows legacy apps to have a "lastSubUrl" which is automatically set to the user's last location in an application.
This field allows users to easily switch back and forth between applications without losing their state. One flow that is currently supported is "open in new tab". In this case, the user gets a new tab, where the application opened opens to the last location, but all other applications are "fresh" in that tab.
Currently, legacy applications use the now deprecated
core.chrome.navLinks.update
API. This has been superceded by theappUpdater$
API. We should add support to this API for updating the deep link for a given application so that New Platform applications can avoid using this deprecated API without sacrificing functionality.Related to #55433
\cc @flash1293
The text was updated successfully, but these errors were encountered: