Add deployment name to breadcrumbs in ECH#238078
Add deployment name to breadcrumbs in ECH#238078kowalczyk-krzysztof merged 21 commits intoelastic:mainfrom
Conversation
|
/ci |
|
/ci |
|
/ci |
|
Cloud deployment initiated, see credentials at: https://buildkite.com/elastic/kibana-deploy-cloud-from-pr/builds/497 |
|
Pinging @elastic/appex-sharedux (Team:SharedUX) |
Dosant
left a comment
There was a problem hiding this comment.
nice work, I'd like to consider some suggestions to attempt to unify serverless and deployment
src/core/packages/chrome/browser-internal/src/project_navigation/project_navigation_service.ts
Outdated
Show resolved
Hide resolved
src/core/packages/chrome/browser-internal/src/project_navigation/breadcrumbs.tsx
Outdated
Show resolved
Hide resolved
src/core/packages/chrome/browser-internal/src/project_navigation/project_navigation_service.ts
Outdated
Show resolved
Hide resolved
src/core/packages/chrome/browser-internal/src/project_navigation/project_navigation_service.ts
Outdated
Show resolved
Hide resolved
Dosant
left a comment
There was a problem hiding this comment.
looks good, imo, this version is cleaner!
I still think it would be nice to have a service that caches and dedupes /internal/cloud/solution requests.
if not in this PR, let's create an issue and follow up if you feel like it? Otherwise, that's fine
I'll create a follow up issue. |
|
Added follow-up issue: #240117 |
| .then((response) => { | ||
| const deploymentName = response?.resourceData?.deployment?.name; | ||
| if (deploymentName) { | ||
| (coreStart.chrome as InternalChromeStart)?.project?.setKibanaName(deploymentName); |
There was a problem hiding this comment.
This seems a bit hacky to me.
- We need to access an internal property to set a name.
- That setter is under a "project" property, but here we're specifically talking about ECH and !Serverless, thus deployments. I'm guessing this was used on Serverless only and your PR sets it on ECH too.
If the chrome plugin does not know how to set a name yet it owns the logic to set it... the setter should be available in its public API IMO. And if project property holds functionality for both ECH and Serverless perhaps we should generalise it into something that covers both. I wonder if any of these setters make sense for self-managed customers.
There was a problem hiding this comment.
the idea for InternalChromeStart was that we had to expose apis for plugins like serverless, but we didn't want anyone else to know about them :D I am also fine to move this to public type, but we really don't want other plugins to call this ever
That setter is under a "project" property, but here we're specifically talking about ECH and !Serverless, thus deployments. I'm guessing this was used on Serverless only and your PR sets it on ECH too.
This part got messed up when we added solution view to ech/hosted.
What is "project" navigation in chrome initially was build for "serverless" but now it is "serverless" + "solution view of hosted/ech" .
In theory, we could refactor this from Project to SolutionView or something like that.
In this PR we need to set breadcrumb for "solution view of ech" . We do it from cloud plugin, but cloud plugin is also run in serveless, so we don't want to override what serverless plugin has set :(
Ideally, we would have a ech plugin that runs only for ECH and another that runs only in serverless. But we don't.
There was a problem hiding this comment.
Thanks for the clarifications!
I'm fine with renaming project to solutionView in a follow-up PR.
| }; | ||
|
|
||
| const setProjectName = (projectName: string) => { | ||
| validateChromeStyle(); |
There was a problem hiding this comment.
Seems related to my other comment.
Does this mean that everybody can now set the text of the first breadcrumb?
Not saying it's necessarily a bad thing, goes in the lines of exposing the setter publicly in Chrome's API.
gsoldevila
left a comment
There was a problem hiding this comment.
Core changes LGTM (code review only)
💚 Build Succeeded
Metrics [docs]Page load bundle
History
|
Summary
This PR adds deployment name to breadcrumbs for solution views on ECH.
Closes: #235938
Testing locally
kibana.dev.ymlhttp://localhost:5601/app/cloud/onboarding?onboarding_token=test&resource_data={"deployment":{"name":"My Test Deployment","id":"test-123"}}&next=/To set different deployment name replace
My Test Deploymentin the onboarding URL with the name you want.