Skip to content

Commit 81858f2

Browse files
cursoragentJonasBa
andcommitted
feat(cmd-k): Add 'Open Superuser Modal' action
Add the old superuser modal action from the deprecated command palette to the new CMD-K implementation. This action allows staff users to escalate to superuser mode by opening the superuser authentication modal. The action is only shown when the user is NOT already a superuser, and is searchable via the 'superuser' keyword. Co-authored-by: Jonas <JonasBa@users.noreply.github.com>
1 parent 004c1b4 commit 81858f2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

static/app/components/commandPalette/useGlobalCommandPaletteActions.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {ProjectAvatar} from '@sentry/scraps/avatar';
66

77
import {addLoadingMessage, addSuccessMessage} from 'sentry/actionCreators/indicator';
88
import {openInviteMembersModal} from 'sentry/actionCreators/modal';
9+
import {openSudo} from 'sentry/actionCreators/sudoModal';
910
import {useCommandPaletteActionsRegister} from 'sentry/components/commandPalette/context';
1011
import type {
1112
CMDKQueryOptions,
@@ -366,6 +367,22 @@ export function useGlobalCommandPaletteActions() {
366367
'noreferrer'
367368
),
368369
},
370+
...(isActiveSuperuser()
371+
? []
372+
: [
373+
{
374+
display: {
375+
label: t('Open Superuser Modal'),
376+
icon: <IconLock locked />,
377+
},
378+
keywords: [t('superuser')],
379+
onAction: () =>
380+
openSudo({
381+
isSuperuser: true,
382+
needsReload: true,
383+
}),
384+
},
385+
]),
369386
...(isActiveSuperuser()
370387
? [
371388
{

0 commit comments

Comments
 (0)