Skip to content

Commit 854caf6

Browse files
PeterYurkovichopenshift-cherrypick-robot
authored andcommitted
fix: remove troubleshooting panel links from non-admin perspective
1 parent 345d64d commit 854caf6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

web/src/components/alerting/AlertsDetailsPage.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ const AlertsDetailsPage_: React.FC = () => {
140140

141141
const AlertsChart = alertsChart?.[0];
142142

143+
// Keep the default name for the admin perspective while providing specific
144+
// entrypoints for all other perspectives as wel
145+
const alertActionContextName = `alert-detail-toolbar-actions${
146+
perspective === 'admin' ? '' : '-' + perspective
147+
}`;
148+
const alertActionContext = {};
149+
alertActionContext[alertActionContextName] = { alert };
150+
143151
return (
144152
<>
145153
<Helmet>
@@ -200,7 +208,7 @@ const AlertsDetailsPage_: React.FC = () => {
200208
<Title headingLevel="h2">{t('Alert details')}</Title>
201209
</ToolbarItem>
202210
<ToolbarGroup align={{ default: 'alignEnd' }}>
203-
<ActionServiceProvider context={{ 'alert-detail-toolbar-actions': { alert } }}>
211+
<ActionServiceProvider context={alertActionContext}>
204212
{({ actions, loaded }) =>
205213
loaded
206214
? actions.map((action) => {
@@ -219,7 +227,6 @@ const AlertsDetailsPage_: React.FC = () => {
219227
</ToolbarItem>
220228
);
221229
}
222-
223230
return null;
224231
})
225232
: null

0 commit comments

Comments
 (0)