diff --git a/src/api/types.ts b/src/api/types.ts index 0e4f232..ef5a9fc 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -143,6 +143,7 @@ export interface User { name: string; email: string; is_active: boolean; + is_view_only: boolean; force_change: boolean; account_sid: string | null; account_name?: string | null; @@ -174,6 +175,7 @@ export interface UserUpdatePayload { name: string; force_change: boolean; is_active: boolean; + is_view_only: boolean; service_provider_sid: string | null; account_sid: string | null; } diff --git a/src/containers/internal/views/users/form.tsx b/src/containers/internal/views/users/form.tsx index 4a822de..1182247 100644 --- a/src/containers/internal/views/users/form.tsx +++ b/src/containers/internal/views/users/form.tsx @@ -61,6 +61,7 @@ export const UserForm = ({ user }: UserFormProps) => { const [forceChange, setForceChange] = useState(true); const [modal, setModal] = useState(false); const [accountSid, setAccountSid] = useState(""); + const [isViewOnly, setIsViewOnly] = useState(false); const handleCancel = () => { setModal(false); @@ -115,6 +116,7 @@ export const UserForm = ({ user }: UserFormProps) => { initial_password: initialPassword, force_change: forceChange, is_active: isActive, + is_view_only: isViewOnly, service_provider_sid: scope === USER_ADMIN && currentUser?.scope === USER_ADMIN ? null @@ -145,6 +147,7 @@ export const UserForm = ({ user }: UserFormProps) => { initial_password: initialPassword || null, force_change: forceChange, is_active: isActive, + is_view_only: isViewOnly, service_provider_sid: scope === USER_ADMIN && currentUser?.scope === USER_ADMIN ? null @@ -172,6 +175,7 @@ export const UserForm = ({ user }: UserFormProps) => { setName(user.data.name); setForceChange(!!user.data.force_change); setIsActive(!!user.data.is_active); + setIsViewOnly(!!user.data.is_view_only); setEmail(user.data.email); setScope(getUserScope(user.data)); if (user.data.account_sid) { @@ -253,6 +257,16 @@ export const UserForm = ({ user }: UserFormProps) => { />