fix: default invite user modal global role to least-privilege

Pre-select "Internal User Viewer" in the Global Proxy Role dropdown
on both the standalone and embedded Invite User forms so admins don't
have to remember to pick a role, and the default lands on the least
privileged option rather than silently posting an undefined role.
This commit is contained in:
Ryan Crabbe
2026-04-15 09:52:24 -07:00
committed by Ishaan Jaffer
parent 8837138c8f
commit 3b8f651eaf
@@ -175,7 +175,14 @@ export const CreateUserButton: React.FC<CreateuserProps> = ({
// Modify the return statement to handle embedded mode
if (isEmbedded) {
return (
<Form form={form} onFinish={handleCreate} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} labelAlign="left">
<Form
form={form}
onFinish={handleCreate}
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}
labelAlign="left"
initialValues={{ user_role: "internal_user_viewer" }}
>
<Alert
message="Email invitations"
description={
@@ -257,7 +264,14 @@ export const CreateUserButton: React.FC<CreateuserProps> = ({
className="mb-4"
/>
</Space>
<Form form={form} onFinish={handleCreate} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} labelAlign="left">
<Form
form={form}
onFinish={handleCreate}
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}
labelAlign="left"
initialValues={{ user_role: "internal_user_viewer" }}
>
<Form.Item label="User Email" name="user_email">
<Input />
</Form.Item>