File tree Expand file tree Collapse file tree
web/src/components/alerting Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 "value" : {
66 "type" : " console.tab" ,
77 "properties" : {
8- "contextId" : " admin-console-observe" ,
8+ "contextId" : " admin-alerts-nav" ,
9+ "name" : " %plugin__monitoring-console-plugin~Incidents%" ,
10+ "href" : " incidents" ,
11+ "component" : {
12+ "$codeRef" : " IncidentsPage"
13+ }
14+ }
15+ }
16+ },
17+ {
18+ "op" : " add" ,
19+ "path" : " /extensions/1" ,
20+ "value" : {
21+ "type" : " console.tab" ,
22+ "properties" : {
23+ "contextId" : " virtualization-perspective-alerts-nav" ,
924 "name" : " %plugin__monitoring-console-plugin~Incidents%" ,
1025 "href" : " incidents" ,
1126 "component" : {
Original file line number Diff line number Diff line change 11import { PageSection , Title } from '@patternfly/react-core' ;
22import * as React from 'react' ;
33import { useTranslation } from 'react-i18next' ;
4-
5- import { HorizontalNav } from '@openshift-console/dynamic-plugin-sdk' ;
4+ import { HorizontalNav , useActivePerspective } from '@openshift-console/dynamic-plugin-sdk' ;
65
76const AlertsPage = React . lazy (
87 ( ) => import ( /* webpackChunkName: "AlertsPage" */ '../alerting/AlertsPage' ) ,
@@ -17,6 +16,12 @@ const AlertRulesPage = React.lazy(
1716const AlertingPage : React . FC = ( ) => {
1817 const { t } = useTranslation ( process . env . I18N_NAMESPACE ) ;
1918
19+ const [ perspective ] = useActivePerspective ( ) ;
20+
21+ // contextId allow console.tab extensions to be injected
22+ // https://github.com/openshift/console/blob/main/frontend/packages/console-dynamic-plugin-sdk/docs/console-extensions.md#consoletab
23+ const contextId = `${ perspective } -alerts-nav` ;
24+
2025 const pages = [
2126 {
2227 href : 'alerts' ,
@@ -45,7 +50,7 @@ const AlertingPage: React.FC = () => {
4550 < >
4651 < PageSection hasBodyWrapper = { false } >
4752 < Title headingLevel = "h1" > { t ( 'Alerting' ) } </ Title >
48- < HorizontalNav contextId = "admin-console-observe" pages = { pages } />
53+ < HorizontalNav contextId = { contextId } pages = { pages } />
4954 </ PageSection >
5055 </ >
5156 ) ;
You can’t perform that action at this time.
0 commit comments