-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Move Nav APIs to new platform #34490
Conversation
This comment has been minimized.
This comment has been minimized.
9ddf3f8
to
7269960
Compare
This comment has been minimized.
This comment has been minimized.
7269960
to
6d977bc
Compare
This comment has been minimized.
This comment has been minimized.
6d977bc
to
e55a705
Compare
This comment has been minimized.
This comment has been minimized.
1a9c0c7
to
c613334
Compare
This comment has been minimized.
This comment has been minimized.
c613334
to
9d2de07
Compare
9d2de07
to
93a0fb1
Compare
This comment has been minimized.
This comment has been minimized.
93a0fb1
to
11cdeac
Compare
This comment has been minimized.
This comment has been minimized.
34c6aac
to
3f83a08
Compare
This comment has been minimized.
This comment has been minimized.
3f83a08
to
1c5a67a
Compare
💔 Build Failed |
1c5a67a
to
23ce1ef
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm going to dig into why this is broken exactly, it may be that the Nav UI code is not reading the My idea for this going forward is to allow applications to update their status via the ApplicationService in the new platform, rather than interfacing with Chrome APIs to update links. This way, the ApplicationService can manage displaying a license page of information or redirecting to somewhere else in Kibana. |
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 great!
💔 Build Failed |
💚 Build Succeeded |
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.
Things are looking really good, but I'm pretty sure that subUrl handling is applying outside of Kibana and I'm pretty sure that wasn't the case before recently (maybe before this change)
const href = relativeToAbsolute(chrome.addBasePath(recentlyAccessed.link)); | ||
const navLink = navLinks.find(nl => href.startsWith(nl.subUrlBase)); | ||
const href = chrome.addBasePath(recentlyAccessed.link); | ||
const navLink = navLinks.find(nl => href.startsWith(nl.appUrl)); |
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 no longer finds the navLink for recently accessed items when basePath is in use, because nl.appUrl
doesn't have the basePath, but href
does.
src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx
Outdated
Show resolved
Hide resolved
@spalger I've updated this to fix the bug when there are multiple Kibana instances running under different base paths on the same domain. This requires using mostly absolute URLs as the internal representation (as it was before this change). I've also renamed |
navLink.disabled = !xpackInfo.get('features.ml.isAvailable', false); | ||
} | ||
|
||
const navLinkUpdates = { |
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.
👍 want to apply the same treatment to x-pack/plugins/graph/public/hacks/toggle_app_link_in_nav.js
?
💔 Build Failed |
💚 Build Succeeded |
Bring subUrlBase into new platform☹️
💚 Build Succeeded |
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.
LGTM!
This moves the core Nav APIs from `ui/chrome` into the `ChromeService` in the new platform. - `ChromeStart` now exposes a sub-service for reading and making limited updates to navlinks. These are powered by apps registered with the `ApplicationService` and filtered by UI Capabilities before being exposed by the `ChromeService`. - The `header-global-nav` directive now consumes navlinks from the new platform. - The `lastSubUrl` feature utilized by legacy apps has been refactored and will remain in `ui/chrome`. This feature utilizes the limited fields that `ChromeService` exposes to updates by outside code. This change is the main blocker to moving the Chrome UI to the new platform. This will be necessary to enable the new platform to control top-level routing.
This moves the core Nav APIs from `ui/chrome` into the `ChromeService` in the new platform. - `ChromeStart` now exposes a sub-service for reading and making limited updates to navlinks. These are powered by apps registered with the `ApplicationService` and filtered by UI Capabilities before being exposed by the `ChromeService`. - The `header-global-nav` directive now consumes navlinks from the new platform. - The `lastSubUrl` feature utilized by legacy apps has been refactored and will remain in `ui/chrome`. This feature utilizes the limited fields that `ChromeService` exposes to updates by outside code. This change is the main blocker to moving the Chrome UI to the new platform. This will be necessary to enable the new platform to control top-level routing.
Summary
Subpart of #18843 and #34091
This moves the core Nav APIs from
ui/chrome
into theChromeService
in the new platform.ChromeStart
now exposes a sub-service for reading and making limited updates to navlinks. These are powered by apps registered with theApplicationService
and filtered by UI Capabilities before being exposed by theChromeService
.header-global-nav
directive now consumes navlinks from the new platform.lastSubUrl
feature utilized by legacy apps has been refactored and will remain inui/chrome
. This feature utilizes the limited fields thatChromeService
exposes to updates by outside code.This change is the main blocker to moving the Chrome UI to the new platform. This will be necessary to enable the new platform to control top-level routing.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers