Skip to content

feat(foxy-user-invitation-form): role presets and permissions UX (FX-792) - #292

Open
pheekus wants to merge 4 commits into
mainfrom
fx-792-invitation-scopes-ux
Open

pheekus wants to merge 4 commits into
mainfrom
fx-792-invitation-scopes-ux

Conversation

@pheekus

@pheekus pheekus commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

UX improvements to the permissions part of foxy-user-invitation-form (admin layout).

Changes

Role presets

The Access level select now offers four presets next to Full, Read-only and Custom:

Preset Scope
Customer service transactions_write customers_write subscriptions_write gift_cards_write coupons_read carts_read downloadables_read shipping_settings_read stores_read
Developer stores_write templates_write customer_portal_settings_write webhooks_write integrations_write item_categories_write shipping_settings_write shipping_integrations_write taxes_write subscription_settings_write downloadables_read coupons_read gift_cards_read carts_read transactions_read customers_read subscriptions_read reporting_read
Designer templates_write customer_portal_settings_write stores_read item_categories_read
Accountant transactions_read subscriptions_read customers_read reporting_read taxes_read gift_cards_read coupons_read stores_read

Restricted granters

  • When Custom is the only option, it applies on its own and the Access level select is hidden. The scope control then shows the "choose access" error itself.
  • Matrix rows the granter can't grant at any level are hidden, unless the invitation already holds them.

Layout and labels

  • Revoke moved from the top of the form to the bottom. It shares one row with Save: Revoke on the left, Save on the right. It is no longer full width.
  • The user_invitations scope is labelled "Users and permissions" in the form and the card. The token is unchanged.

Testing

  • npm run lint: 0 errors
  • npx tsc --noEmit: pass
  • npm test: 8016 passed, 0 failed
  • Checked in Storybook at desktop and mobile width.

Refs FX-792

pheekus and others added 4 commits November 4, 2026 17:53
…er a pick

In the summary-item layout, options used `?selected`. Browsers ignore the
selected attribute once the user has picked an option, so a value set by
code after a pick left the native select on the old option. Bind
`.selected` through `live()` instead.

FX-792

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add Customer service, Developer, Designer and Accountant presets to the
  Access level select. They prefill the Custom matrix and are not saved.
  A preset is offered only when the granter can grant all of it. The
  select shows a preset's name while the scope matches it exactly.
- Move the Revoke button below the permissions, on one row with Save:
  Revoke on the left, Save on the right.
- Label the user_invitations scope "Users and permissions" in the form
  and the card.

FX-792

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… choose

- When Custom is the only Access level option, apply it without a pick
  and don't render the select. The scope control then shows the "choose
  access" error itself, since the select was what displayed it.
- Hide matrix rows the granter can't grant at any level, unless the
  invitation already holds them. An odd last row spans both columns.

FX-792

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Picking Custom while the scope still matched a role kept showing the
role's name. An explicit Custom pick now wins until another preset is
picked. Reopening an invitation still shows a matching role.

FX-792

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pheekus
pheekus requested a review from adamjudd November 4, 2026 21:58
@pheekus
pheekus marked this pull request as ready for review November 4, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant