Tweak user management form

This commit is contained in:
2025-09-01 18:55:16 -04:00
parent 7938c50762
commit a0c442d1af
2 changed files with 3 additions and 18 deletions

View File

@@ -68,13 +68,11 @@ export function PermissionSelector({
return ( return (
<div className="space-y-4"> <div className="space-y-4">
<h3 className="text-lg font-medium">Permissions</h3> <h3 className="text-lg font-medium">Permissions</h3>
<p className="text-sm text-muted-foreground mb-4">
Select the permissions you want to grant to this user
</p>
{permissionsByCategory.map(category => ( {permissionsByCategory.map(category => (
<Card key={category.category} className="mb-4"> <Card key={category.category} className="mb-4">
<CardHeader className="pb-2 flex flex-row items-center justify-between"> <CardHeader className="pb-2 flex flex-row items-center justify-between pt-2">
<CardTitle className="text-md">{category.category}</CardTitle> <CardTitle className="text-md">{category.category}</CardTitle>
<Button <Button
type="button" type="button"

View File

@@ -232,9 +232,6 @@ export function UserForm({ user, permissions, onSave, onCancel }: UserFormProps)
<div className="space-y-6"> <div className="space-y-6">
<div> <div>
<h2 className="text-2xl font-bold mb-2">{user ? "Edit User" : "Add New User"}</h2> <h2 className="text-2xl font-bold mb-2">{user ? "Edit User" : "Add New User"}</h2>
<p className="text-muted-foreground">
{user ? "Update the user's information and permissions" : "Create a new user account"}
</p>
</div> </div>
{formError && ( {formError && (
@@ -320,12 +317,6 @@ export function UserForm({ user, permissions, onSave, onCancel }: UserFormProps)
</Select> </Select>
)} )}
</FormControl> </FormControl>
<FormDescription>
{form.watch("is_admin")
? "Admin users can view all chat rooms regardless of this setting"
: "Connect this user to a Rocket Chat account to control their chat access"
}
</FormDescription>
<FormMessage /> <FormMessage />
</FormItem> </FormItem>
)} )}
@@ -344,11 +335,7 @@ export function UserForm({ user, permissions, onSave, onCancel }: UserFormProps)
placeholder={user ? "Leave blank to keep current password" : ""} placeholder={user ? "Leave blank to keep current password" : ""}
/> />
</FormControl> </FormControl>
{user && (
<FormDescription>
Leave blank to keep the current password
</FormDescription>
)}
<FormMessage /> <FormMessage />
</FormItem> </FormItem>
)} )}