Refactor observability plugin breadcrumbs#102290
Conversation
Previously the observability plugin set the page title and breadcrumbs in the main app rendering component based on the `breadcrumb` property of the current route. In addition, there's a `useBreadcrumb` hook used by the UX app, exploratory view, and cases. The conflict between these was creating situations where neither would work and the breadcrumbs would just show "Kibana". Remove the breadcrumb properties from the routes and the main app breadcrumb handling and just use `useBreadcrumb` on all pages. Fixes elastic#102131.
| */ | ||
|
|
||
| import { i18n } from '@kbn/i18n'; | ||
| import React, { MouseEvent, useEffect } from 'react'; |
There was a problem hiding this comment.
Sorting imports here.
| "xpack.monitoring.updateLicenseButtonLabel": "ライセンスを更新", | ||
| "xpack.monitoring.updateLicenseTitle": "ライセンスの更新", | ||
| "xpack.monitoring.useAvailableLicenseDescription": "すでに新しいライセンスがある場合は、今すぐアップロードしてください。", | ||
| "xpack.observability.alerts.breadcrumb": "アラート", |
There was a problem hiding this comment.
@Bamieh most of these still exist but have been replaced by keys that more closely match Kibana i18n guidelines.
| href, | ||
| }; | ||
| }; | ||
| export const casesBreadcrumbs = { |
There was a problem hiding this comment.
These were moved into pages/cases/links.ts.
| expect(setTitle).toHaveBeenCalledWith(['Two', 'One', 'Observability']); | ||
| }); | ||
| }); | ||
| }); |
| defaultMessage: 'Alerts', | ||
| }), | ||
| }, | ||
| ]); |
There was a problem hiding this comment.
This looks like a good way to set breadcrumbs. Should we do something similar for APM?
Btw. I'm wondering if Kibana should provide something like this. Seems odd that every plugin reinvents the wheel.
There was a problem hiding this comment.
Agreed, if this can be moved up the hierarchy, we had this hook originally in uptime, and we moved it here, to be used in UX app and other places.
There was a problem hiding this comment.
I think we can use this mostly as-is in APM or other places (it's currently used in UX as Shahzad mentioned.)
There's ongoing discussion in elastic/observability-design#53.
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
|
@stephmilovic you're right wtf? I'll check it out. |
Previously the observability plugin set the page title and breadcrumbs in the main app rendering component based on the `breadcrumb` property of the current route. In addition, there's a `useBreadcrumb` hook used by the UX app, exploratory view, and cases. The conflict between these was creating situations where neither would work and the breadcrumbs would just show "Kibana". Remove the breadcrumb properties from the routes and the main app breadcrumb handling and just use `useBreadcrumb` on all pages. Fixes elastic#102131.
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
Previously the observability plugin set the page title and breadcrumbs in the main app rendering component based on the `breadcrumb` property of the current route. In addition, there's a `useBreadcrumb` hook used by the UX app, exploratory view, and cases. The conflict between these was creating situations where neither would work and the breadcrumbs would just show "Kibana". Remove the breadcrumb properties from the routes and the main app breadcrumb handling and just use `useBreadcrumb` on all pages. Fixes #102131. Co-authored-by: Nathan L Smith <nathan.smith@elastic.co>
…egrations-to-global-search * 'master' of github.com:elastic/kibana: (46 commits) [Lens] Add some more documentation for dynamic coloring (elastic#101369) hide not searchable results when no term (elastic#102401) [Lens] Fix Formula functional test with multiple suggestions (elastic#102378) Fix trusted apps modified by field displayed as a date field (elastic#102377) [Lens] Docs for time shift (elastic#102048) update readme of logs-metrics-ui (elastic#101968) Refactor observability plugin breadcrumbs (elastic#102290) [Index Patterns] Move rollup config to index pattern management v2 (elastic#102285) [Security Solution][Endpoint] Isolate Action should only be available to Platinum+ licenses (elastic#102374) [build] Updates Ironbank templates (elastic#102407) Update security best practices document (elastic#100814) [Enterprise Search] Set up initial KibanaPageTemplate (elastic#102170) [Reporting/Docs] Add section to troubleshooting guide to explain the StatusCodeError logs (elastic#102278) [DOCS] Updating Elastic Security Overview topic (elastic#101922) [Uptime] refactor Synthetics Integration package UI (elastic#102080) [Task Manager] Log at different levels based on the state (elastic#101751) [APM] Fixing time comparison types (elastic#101423) [RAC] Update alert documents in lifecycle rule type helper (elastic#101598) [ML] Functional tests - fix and re-activate alerting flyout test (elastic#102368) [Reporting] remove unused reference to path.data config (elastic#102267) ... # Conflicts: # x-pack/plugins/fleet/kibana.json

Previously the observability plugin set the page title and breadcrumbs in the main app rendering component based on the
breadcrumbproperty of the current route.In addition, there's a
useBreadcrumbhook used by the UX app, exploratory view, and cases.The conflict between these was creating situations where neither would work and the breadcrumbs would just show "Kibana".
Remove the breadcrumb properties from the routes and the main app breadcrumb handling and just use
useBreadcrumbon all pages.Fixes #102131.