From 6cf1e046b0c0799c22505be279e92109f6cb71b2 Mon Sep 17 00:00:00 2001 From: x032205 Date: Tue, 13 May 2025 16:38:26 -0400 Subject: [PATCH 1/2] Fixed project roles not being editable in some cases --- frontend/src/hooks/api/roles/types.ts | 4 ++-- .../components/ProjectRoleModifySection.utils.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/hooks/api/roles/types.ts b/frontend/src/hooks/api/roles/types.ts index ee95e8c23..12286bf9b 100644 --- a/frontend/src/hooks/api/roles/types.ts +++ b/frontend/src/hooks/api/roles/types.ts @@ -19,7 +19,7 @@ export type TProjectRole = { id: string; createdAt: string; updatedAt: string; - description?: string; + description?: string | null; permissions: TProjectPermission[]; }; @@ -76,7 +76,7 @@ export type TDeleteOrgRoleDTO = { export type TCreateProjectRoleDTO = { projectId: string; name: string; - description?: string; + description?: string | null; slug: string; permissions: TProjectPermission[]; }; diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx index a4cf29e3f..e4b9ed302 100644 --- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx +++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx @@ -190,7 +190,7 @@ const ConditionSchema = z export const projectRoleFormSchema = z.object({ name: z.string().trim(), - description: z.string().trim().optional(), + description: z.string().trim().nullish(), slug: z .string() .trim() From 13b2f65b7eff93d7b5034bf50b4eb57f099ea2dc Mon Sep 17 00:00:00 2001 From: x032205 Date: Tue, 13 May 2025 16:51:05 -0400 Subject: [PATCH 2/2] lint fix --- .../project/RoleDetailsBySlugPage/components/RoleModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/RoleModal.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/RoleModal.tsx index e97e60edf..7a799bc84 100644 --- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/RoleModal.tsx +++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/RoleModal.tsx @@ -62,7 +62,7 @@ export const RoleModal = ({ popUp, handlePopUpToggle }: Props) => { if (role) { reset({ name: role.name, - description: role.description, + description: role.description || "", slug: role.slug }); } else {