Repository navigation
feat(console): lock the remaining role-gated actions instead of hiding them - #197
Merged
Merged
Conversation
…g them Extends #194's lock pattern to the actions it didn't cover: profile-form's Save, node-chain-validate's Validate, node-image-lifecycle's Stage/Activate/ Roll back, operators' request/record/complete/cancel/deny, adopt's Preview (the wizard's one entry point), root-detail's Rename, node-detail-panel's Rename/Export key/Import key/Decommission/Reboot, and the SCEP challenge and enrolment mint/revoke/approve/reject actions. Every one of these was either hidden entirely for a role that lacks it, or replaced by a disabled control or a "read-only"/"requires X level" note. They now show the kit's Button lockedReason, or RoleGate for the few that are plain table-row buttons rather than the kit's Button (operators' Deny, Complete and Cancel) -- RoleGate needed a TooltipProvider the console had never wired up for this purpose, so this adds one locally around the Operators page, plus the ResizeObserver stub its Radix Tooltip content needs under jsdom, mirroring the one the UI kit's own test setup already has. Adopt's admin gate used to replace the whole page with a one-line notice; it now renders the real wizard with its endpoint field disabled and its Preview button locked, since nothing past Preview is reachable without it anyway -- the same "no route or server behaviour changes" rule as the rest of this pass. Every test that asserted a hidden or disabled control for one of these now asserts the locked aria-disabled/lockedReason state instead, named in each with a short comment on why it moved, same as #194. No route, permission check or server-side behaviour changes here either; this is presentation only. Refs #196 Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Bugs5382
marked this pull request as ready for review
October 15, 2026 20:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Extends #194's lock pattern to the actions #196 lists that #183/#194 didn't cover:
components/profile-form.tsx: the edit form's Save (was a "Read-only -- editing profilesrequires admin level" note).
components/node-chain-validate.tsx: Validate (was a "Read-only -- your operator level cannotvalidate a certificate chain" note).
components/node-image-lifecycle.tsx: Stage, Activate and Roll back (were hidden entirely fora non-admin).
pages/operators.tsx: Request credential, Record certificate, Deny, Complete and Cancel (allhidden entirely for a non-admin).
pages/adopt.tsx: the whole wizard used to be replaced by a one-line "requires admin level"notice; it now renders the real page with the endpoint field disabled and Preview locked, since
nothing past Preview is reachable without it.
pages/root-detail.tsx: Rename (was hidden entirely for a non-admin).components/node-detail-panel.tsx: Rename, Export key, Import key, Decommission and Reboot(all five were hidden entirely for a non-admin).
components/node-scep-challenges.tsx,components/node-scep-enrollments.tsx: mint/revoke andapprove/reject (all hidden entirely for a viewer).
Every one of these now uses the kit's
ButtonlockedReasonprop, except operators.tsx's Deny,Complete and Cancel, which are plain table-row buttons rather than the kit's
Button-- those useRoleGateinstead, per #196's note.RoleGateneeded aTooltipProviderthe console had neverwired up (nothing in
apps/consoleusedTooltipbefore this), so this adds one locally aroundthe Operators page, plus the
ResizeObserverstub its Radix Tooltip content needs under jsdom,mirroring the one the UI kit's own test setup already has for the same reason.
No route, permission check or server-side behaviour changes; this is presentation only, same as
#183 and #194.
Refs #196
Verification
How this was verified
npm run lint(eslint + prettier --check): clean.npm run testacross all workspaces: 788 console + 3 api-client + 247 ui tests pass, includingthe axe check on every page and component touched here.
npm run buildacross all workspaces: tsc + vite build succeed for console, tsc succeeds for ui.node --test scripts/*.test.mjsandnode scripts/check-release-bundle.mjs apps/console/dist:release bundle clean, no dev-only markers.
docs page to update beyond the kit's existing Button/RoleGate doc comments.
Before merging: add a closing comment summarizing what was actually done in this PR
(not just the checked boxes).