Skip to content

refactor(site): de-MUI custom role create/edit form - #27820

Merged
jakehwll merged 5 commits into
mainfrom
jakehwll/demui-create-edit-role
Aug 6, 2026
Merged

refactor(site): de-MUI custom role create/edit form#27820
jakehwll merged 5 commits into
mainfrom
jakehwll/demui-create-edit-role

Conversation

@jakehwll

@jakehwll jakehwll commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +387 to +388
checked={showAllResources}
onCheckedChange={setShowAllResources}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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
ccr99bmkkz-coder

This comment was marked as spam.

…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.
@jakehwll
jakehwll requested a review from jeremyruppel August 5, 2026 04:07
Comment on lines +181 to +186
// 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;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

@jakehwll
jakehwll merged commit db4b6dc into main Aug 6, 2026
26 checks passed
@jakehwll
jakehwll deleted the jakehwll/demui-create-edit-role branch August 6, 2026 01:14
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants