refactor(site): de-MUI custom role create/edit form - #27820
Conversation
Migrate the organization custom role create/edit form off MUI onto shared site components. - Replace `TextField` with `FormField` for name and display name - Replace permission checkboxes with the shared shadcn `Checkbox` (including indeterminate) - Replace the “show advanced permissions” control with a `Switch` + `Label` - Update the toggle story to query by accessible checkbox role/name
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5a7458ff4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| checked={showAllResources} | ||
| onCheckedChange={setShowAllResources} |
There was a problem hiding this comment.
Exercise the advanced-permissions switch in a story
When a user toggles the newly migrated advanced-permissions switch, it changes both the label and the displayed resource rows, but ShowAllResources remains render-only and no play function exercises this interaction; the only interaction story covers the parent permission checkbox. Add a story that toggles this switch and asserts both states so regressions in the new Radix wiring are detected.
AGENTS.md reference: site/AGENTS.md:L9-L10
Useful? React with 👍 / 👎.
…address review feedback - Type PermissionCheckboxGroup resourceKey as RBACResource to drop the cast - Add ToggleAdvancedPermissions story exercising the advanced-permissions switch
…remove resource entries cast from render Preserve the RBACResource key type via a typedEntries helper and a typed filteredRBACResourceActions so the permission table maps without an inline cast.
…narrow resource keys with a type guard Replace the typedEntries assertion with an isRBACResource type guard so the permission table narrows Object.entries keys with a runtime check instead of a cast.
| // Object.entries widens keys to `string`; this narrows them back to the | ||
| // RBACResource union without an assertion. | ||
| function isRBACResource(resource: string): resource is RBACResource { | ||
| return resource in RBACResourceActions; | ||
| } | ||
|
|

Migrate the organization custom role create/edit form off MUI onto shared site components.
TextFieldwithFormFieldfor name and display nameCheckbox(including indeterminate)Switch+Label