Skip to content

Commit 0bedbe2

Browse files
Merge pull request #629 from openshift-cherrypick-robot/cherry-pick-447-to-release-4.19
[release-4.19] OU-1060: remove troubleshooting panel links from non-admin
2 parents 345d64d + 854caf6 commit 0bedbe2

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)