kaneo (minimalist kanban) fork to experiment adding a tangled integration github.com/usekaneo/kaneo
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #1133 from tinsever/fix/workspace-description

fix: read workspace description from organization field

authored by

Andrej and committed by
GitHub
eb40d3f3 aeb345ee

+24 -6
+24 -6
apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace/general.tsx
··· 56 56 }; 57 57 } 58 58 59 + /** Better Auth persists description as an organization additional field (DB column), not only inside metadata. */ 60 + function getWorkspaceDescription( 61 + workspace: 62 + | { description?: string | null; metadata?: unknown } 63 + | null 64 + | undefined, 65 + ): string { 66 + if (!workspace) return ""; 67 + if (typeof workspace.description === "string") { 68 + return workspace.description; 69 + } 70 + if ( 71 + typeof workspace.metadata === "object" && 72 + workspace.metadata && 73 + "description" in workspace.metadata 74 + ) { 75 + return String( 76 + (workspace.metadata as { description?: unknown }).description ?? "", 77 + ); 78 + } 79 + return ""; 80 + } 81 + 59 82 function RouteComponent() { 60 83 const { t } = useTranslation(); 61 84 const workspaceSchema = useMemo( ··· 82 105 const { mutateAsync: updateWorkspace } = useUpdateWorkspace(); 83 106 const { mutateAsync: deleteWorkspace, isPending: isDeleting } = 84 107 useDeleteWorkspace(); 85 - const workspaceDescription = 86 - typeof workspace?.metadata === "object" && 87 - workspace?.metadata && 88 - "description" in workspace.metadata 89 - ? String(workspace.metadata.description ?? "") 90 - : ""; 108 + const workspaceDescription = getWorkspaceDescription(workspace); 91 109 92 110 const workspaceForm = useForm<WorkspaceFormValues>({ 93 111 resolver: standardSchemaResolver(workspaceSchema),