Skip to content

Commit 3e31945

Browse files
authored
Fix nits (calcom#24244)
1 parent c11814c commit 3e31945

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

  • apps/web
    • app/(use-page-wrapper)/settings/(settings-layout)/organizations/roles/_components
    • public/static/locales/en
  • packages/trpc/server/routers/viewer/pbac

apps/web/app/(use-page-wrapper)/settings/(settings-layout)/organizations/roles/_components/RoleSheet.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff 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

apps/web/public/static/locales/en/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3464,6 +3464,7 @@
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",
@@ -3502,7 +3503,7 @@
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",

packages/trpc/server/routers/viewer/pbac/_router.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const permissionStringSchema = z.custom<PermissionString>((val) => {
1919
// Schema for creating/updating roles
2020
const 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),

0 commit comments

Comments
 (0)