File tree Expand file tree Collapse file tree
app/(use-page-wrapper)/settings/(settings-layout)/organizations/roles/_components
packages/trpc/server/routers/viewer/pbac Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export function RoleSheet({
6565 onOpenChange,
6666 teamId,
6767 scope = Scope . Organization ,
68- isPrivate = false
68+ isPrivate = false ,
6969} : RoleSheetProps ) {
7070 const { t } = useLocale ( ) ;
7171 const router = useRouter ( ) ;
@@ -191,6 +191,7 @@ export function RoleSheet({
191191 { ...form . register ( "name" ) }
192192 placeholder = { t ( "role_name_placeholder" ) }
193193 disabled = { isSystemRole }
194+ maxLength = { 50 }
194195 />
195196 </ div >
196197 < RoleColorPicker
@@ -208,10 +209,13 @@ export function RoleSheet({
208209 < Label className = "mb-0" > { t ( "permissions" ) } </ Label >
209210 < div className = "flex items-center gap-2" >
210211 < Checkbox
212+ id = "advanced_mode_checkbox"
211213 checked = { form . watch ( "isAdvancedMode" ) }
212214 onCheckedChange = { ( checked : boolean ) => form . setValue ( "isAdvancedMode" , checked ) }
213215 />
214- < span className = "text-sm" > { t ( "advanced" ) } </ span >
216+ < label htmlFor = "advanced_mode_checkbox" className = "text-sm" >
217+ { t ( "advanced" ) }
218+ </ label >
215219 </ div >
216220 </ div >
217221 < TextField
Original file line number Diff line number Diff line change 34643464 "roles_and_permissions_description" : " Manage roles and permissions for your organization" ,
34653465 "learn_more_permissions" : " Learn more about how Permissions work" ,
34663466 "role_name" : " Role name" ,
3467+ "role_name_required" : " Role name is required" ,
34673468 "role_name_placeholder" : " e.g. Sales Team, Support Staff" ,
34683469 "role_description" : " Role description" ,
34693470 "role_description_placeholder" : " Describe what this role is for and what permissions it needs" ,
35023503 "role_created_successfully" : " Role created successfully" ,
35033504 "role_updated_successfully" : " Role updated successfully" ,
35043505 "delete_role" : " Delete role" ,
3505- "confirm_delete_role" : " Are you sure you want to delete this role? This action cannot be undone." ,
3506+ "confirm_delete_role" : " Are you sure you want to delete role: {{roleName}}. This action cannot be undone." ,
35063507 "role_deleted_successfully" : " Role deleted successfully" ,
35073508 "error_creating_role" : " Error creating role" ,
35083509 "error_updating_role" : " Error updating role" ,
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const permissionStringSchema = z.custom<PermissionString>((val) => {
1919// Schema for creating/updating roles
2020const roleInputSchema = z . object ( {
2121 teamId : z . number ( ) ,
22- name : z . string ( ) . min ( 1 ) ,
22+ name : z . string ( ) . min ( 1 ) . max ( 50 ) ,
2323 description : z . string ( ) . optional ( ) ,
2424 color : z . string ( ) . optional ( ) ,
2525 permissions : z . array ( permissionStringSchema ) ,
You can’t perform that action at this time.
0 commit comments