-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Add deployment name to breadcrumbs in ECH #238078
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
Changes from all commits
98b52c9
2b866b4
14ecdf5
fddca5d
355cc81
5b78863
01cffa7
0ef47f2
d0a6c44
ad379b5
71c16eb
56a5e8e
c12c12f
ee84cb8
e5a23f6
15b0636
6ecf3cc
4489d47
3d88034
d4ca914
c41b353
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,13 +11,14 @@ import type { Logger } from '@kbn/logging'; | |
| import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; | ||
|
|
||
| import type { KibanaProductTier, KibanaSolution } from '@kbn/projects-solutions-groups'; | ||
| import type { InternalChromeStart } from '@kbn/core-chrome-browser-internal'; | ||
| import { registerCloudDeploymentMetadataAnalyticsContext } from '../common/register_cloud_deployment_id_analytics_context'; | ||
| import { getIsCloudEnabled } from '../common/is_cloud_enabled'; | ||
| import { parseDeploymentIdFromDeploymentUrl } from '../common/parse_deployment_id_from_deployment_url'; | ||
| import { ELASTICSEARCH_CONFIG_ROUTE } from '../common/constants'; | ||
| import { decodeCloudId, type DecodedCloudId } from '../common/decode_cloud_id'; | ||
| import { parseOnboardingSolution } from '../common/parse_onboarding_default_solution'; | ||
| import type { ElasticsearchConfigType } from '../common/types'; | ||
| import type { CloudDataAttributes, ElasticsearchConfigType } from '../common/types'; | ||
| import type { CloudSetup, CloudStart, PublicElasticsearchConfigType } from './types'; | ||
| import { CloudUrlsService } from './urls'; | ||
| import { getSupportUrl } from './utils'; | ||
|
|
@@ -126,6 +127,19 @@ export class CloudPlugin implements Plugin<CloudSetup, CloudStart> { | |
| public start(coreStart: CoreStart): CloudStart { | ||
| coreStart.chrome.setHelpSupportUrl(getSupportUrl(this.config)); | ||
|
|
||
| // Deployment name is only available in ECH | ||
| if (this.isCloudEnabled && !this.isServerlessEnabled) { | ||
| coreStart.http | ||
| .get<CloudDataAttributes>('/internal/cloud/solution', { version: '1' }) | ||
| .then((response) => { | ||
| const deploymentName = response?.resourceData?.deployment?.name; | ||
| if (deploymentName) { | ||
| (coreStart.chrome as InternalChromeStart)?.project?.setKibanaName(deploymentName); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems a bit hacky to me.
If the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
This part got messed up when we added solution view to ech/hosted. 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 :(
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the clarifications!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created follow-up issue: #240747 |
||
| } | ||
| }) | ||
| .catch(); | ||
| } | ||
|
|
||
| // Nest all the registered context providers under the Cloud Services Provider. | ||
| // This way, plugins only need to require Cloud's context provider to have all the enriched Cloud services. | ||
| const CloudContextProvider: FC<PropsWithChildren<unknown>> = ({ children }) => { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
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.