feat: choose environment administrators on environment creation#7610
feat: choose environment administrators on environment creation#7610kyle-ssg wants to merge 21 commits into
Conversation
Adds a multi-user selector to the create project modal that lets the creator immediately grant project administrator permissions to other users. Selector is only rendered when there are organisation users who would actually benefit — organisation administrators already have full access to every project by default, and the creator is excluded. Reuses the existing UserSelect component. Refs #6838. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the user-only chip selector with a single SettingsButton-backed picker that searches across eligible users, groups, and roles in one list. Selected entries render as chips with the entity type as a sublabel, and submission fans the assignments out to the user, group, and role project-permission endpoints in parallel. Also add an optional 'description' prop to SettingsButton so help text can sit between the label/cog row and the content slot. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Render selected administrators as "User: name" / "Group: name" / "Role: name" with the type label semibold on the left, dropping the muted email/type sublabel that previously sat to the right. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the inline-modal--sm size cap (355px max-width) and set the picker content to a fixed 480px width with a 320px scroll height so the combined list of users / groups / roles has more room. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
font-weight-bold (700) was too heavy; use semibold (600) for the User/Group/Role prefix in the project admin chip. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Render an optional dropdown node between the label/cog row and the description/content. Used by CreateProject to anchor the project administrator picker under the title rather than under the chip list. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Restrict the project administrator picker to users and roles only; remove the group fetch, state, request fan-out, and UI strings. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the unified Inline picker with a Project administrators heading plus two SettingsButtons (Users, Roles), each anchoring its own picker via the SettingsButton dropdown slot. UserSelect and MyRoleSelect handle search and selection. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
OrganisationProvider registers its onSave listener once on mount, so the close function captures the initial empty adminIds/adminRoleIds and never sees the user's selections. Mirror both into refs and read from the refs when fanning out the user-permission / role-projects-permission POSTs after the project is created. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the raw _data.post calls in favour of two dedicated RTK Query
mutations:
- createProjectUserPermission (POST /projects/{id}/user-permissions/)
added to projectService.
- createProjectRolePermission (POST /organisations/{orgId}/roles/{roleId}/
projects-permissions/) added to rolePermissionService — separate from
the generic createRolePermissions endpoint so the body type can be
scoped to the project case without making project/environment
optional on the multi-level type.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ermissions The mutation operates on the project user-permissions resource, so it belongs alongside the other user-permissions endpoint rather than in projectService. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Default-destructure data || {} so a null/undefined payload from
OrganisationProvider doesn't throw.
- Mirror onSave into onSaveRef so the latest parent callback is
invoked even if it changes between renders (the listener inside
OrganisationProvider is registered once on mount).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Type props (history, onSave), state, refs, and the OrganisationProvider save payload. Import OrganisationProvider and InputGroup explicitly rather than relying on JSX globals. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…name Use Promise.allSettled when assigning project administrators so all mutations attempt regardless of individual failures, and skip navigation/onSave when any fail so the user can retry from the modal. Trim project name on submit to reject whitespace-only inputs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ment creation Lets the creator assign other users and roles as environment administrators directly from the Create Environment page. Adds dedicated RTK endpoints for environment user and role permissions, and assigns selections on save with a partial-failure toast. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Docker builds report
|
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to assign environment administrators (both users and roles) during the creation of a new environment. It adds the necessary API endpoints, hooks, request types, and UI components to support this feature. A critical bug was identified in CreateEnvironmentPage.tsx where a stale closure on organisationId inside assignEnvironmentAdmins could cause API requests to fail if the organization ID resolves after the component mounts. It is recommended to read the latest organization ID directly from AccountStore inside the function.
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
talissoncosta
left a comment
There was a problem hiding this comment.
Looks good! Thanks @kyle-ssg !
The base branch was changed.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Lets the creator assign other users and roles as environment administrators directly from the Create Environment page, rather than having to open Environment Settings → Permissions afterwards. Selections are applied on save; a partial-failure toast points to Environment Settings → Permissions for retry.
How did you test this code?