@@ -17,6 +17,7 @@ import {
1717 Silence ,
1818 TableColumn ,
1919 VirtualizedTable ,
20+ useActivePerspective ,
2021} from '@openshift-console/dynamic-plugin-sdk' ;
2122import {
2223 AlertingRuleChartExtension ,
@@ -81,6 +82,7 @@ const AlertsDetailsPage_: React.FC<AlertsDetailsPageProps> = ({ history, match }
8182 const { t } = useTranslation ( 'plugin__monitoring-plugin' ) ;
8283
8384 const { alertsKey, isDev } = usePerspective ( ) ;
85+ const [ perspective ] = useActivePerspective ( ) ;
8486
8587 const namespace = match . params ?. ns ;
8688 const hideGraphs = useSelector ( ( { observe } : RootState ) => ! ! observe . get ( 'hideGraphs' ) ) ;
@@ -134,6 +136,14 @@ const AlertsDetailsPage_: React.FC<AlertsDetailsPageProps> = ({ history, match }
134136 [ customExtensions , isDev ] ,
135137 ) ;
136138
139+ // Keep the default name for the admin perspective while providing specific
140+ // entrypoints for all other perspectives as wel
141+ const alertActionContextName = `alert-detail-toolbar-actions${
142+ perspective === 'admin' ? '' : '-' + perspective
143+ } `;
144+ const alertActionContext = { } ;
145+ alertActionContext [ alertActionContextName ] = { alert } ;
146+
137147 useRulesAlertsPoller ( namespace , dispatch , alertsSource ) ;
138148
139149 return (
@@ -189,7 +199,7 @@ const AlertsDetailsPage_: React.FC<AlertsDetailsPageProps> = ({ history, match }
189199 < SectionHeading text = { t ( 'Alert details' ) } />
190200 </ ToolbarItem >
191201 < ToolbarGroup alignment = { { default : 'alignRight' } } >
192- < ActionServiceProvider context = { { 'alert-detail-toolbar-actions' : { alert } } } >
202+ < ActionServiceProvider context = { alertActionContext } >
193203 { ( { actions, loaded } ) =>
194204 loaded
195205 ? actions . map ( ( action ) => {
0 commit comments