diff --git a/packages/dtos/src/project.ts b/packages/dtos/src/project.ts index 088c9a51..807a8cef 100644 --- a/packages/dtos/src/project.ts +++ b/packages/dtos/src/project.ts @@ -46,7 +46,7 @@ export type GetProjectTeamResponse = z.infer @@ -96,7 +96,7 @@ export interface ServiceListProjectsRequest { export interface ServiceAddProjectMemberRequest { projectId: string userId: string - role: string + role: 'owner' | 'editor' | 'reviewer' | 'bot' | 'unknown' } export interface ServiceListProjectMembersRequest { diff --git a/packages/dtos/src/team.ts b/packages/dtos/src/team.ts index e0099286..adeecf58 100644 --- a/packages/dtos/src/team.ts +++ b/packages/dtos/src/team.ts @@ -33,7 +33,7 @@ export const getMeResponseSchema = z.object({ id: z.string(), name: z.string(), email: z.string().optional(), - role: z.string(), + role: z.enum(['owner', 'editor', 'reviewer', 'bot', 'unknown']), image: z.string().optional(), unreadNotificationCount: z.number().optional(), }) @@ -48,7 +48,7 @@ export type UpdateMeRequest = z.infer export const userInfoSchema = z.object({ id: z.string(), name: z.string(), - role: z.string(), + role: z.enum(['owner', 'editor', 'reviewer', 'bot', 'unknown']), email: z.string().optional(), type: z.enum(['human', 'agent']).optional(), image: z.string().optional(), diff --git a/packages/webui/components/folder-tree.tsx b/packages/webui/components/folder-tree.tsx index fa37c92e..00c8e46d 100644 --- a/packages/webui/components/folder-tree.tsx +++ b/packages/webui/components/folder-tree.tsx @@ -531,7 +531,7 @@ export function FolderTree({ {!hideShares && (
diff --git a/packages/webui/routes/__root.tsx b/packages/webui/routes/__root.tsx index ca31d281..62a916b7 100644 --- a/packages/webui/routes/__root.tsx +++ b/packages/webui/routes/__root.tsx @@ -5,7 +5,6 @@ import { TopNav } from '@/ui/components/top-nav' import { HomeIcon, NotificationFillIcon, UploadCloudIcon } from '@/ui/components/ui/icons' import { Toaster } from '@/ui/components/ui/sonner' import { UploadTasks } from '@/ui/components/upload-tasks' -import { usePermissions } from '@/ui/hooks/use-permissions' import { useAuthStore } from '@/ui/stores/auth' import { useTeamContextStore } from '@/ui/stores/team-context' import { useUploadStore } from '@/ui/stores/upload' @@ -21,7 +20,6 @@ import { useEffect } from 'react' function RootComponent() { const user = useAuthStore((state) => state.user) const { uploading } = useUploadStore() - const { canEdit } = usePermissions() const pathname = useRouterState({ select: (s) => s.location.pathname }) const navigate = useNavigate() @@ -90,19 +88,17 @@ function RootComponent() { } label="Notifications" badge={badge}> - {canEdit && ( - 0} - className={uploading > 0 ? 'text-blue-500' : ''} - /> - } - label="Uploads" - > - - - )} + 0} + className={uploading > 0 ? 'text-blue-500' : ''} + /> + } + label="Uploads" + > + +
diff --git a/packages/webui/routes/signup.tsx b/packages/webui/routes/signup.tsx index 44e3ddd3..230b9a5b 100644 --- a/packages/webui/routes/signup.tsx +++ b/packages/webui/routes/signup.tsx @@ -157,7 +157,7 @@ function SignupPage() { 👋 {inviteInfo.inviterName} invited you to join{' '} - {inviteInfo.teamName || inviteInfo.projectName} as a{' '} + {inviteInfo.projectName || inviteInfo.teamName} as a{' '} {inviteInfo.role}.
diff --git a/packages/webui/routes/teams/$teamId/settings.tsx b/packages/webui/routes/teams/$teamId/settings.tsx index 1b06d64e..8553b675 100644 --- a/packages/webui/routes/teams/$teamId/settings.tsx +++ b/packages/webui/routes/teams/$teamId/settings.tsx @@ -233,21 +233,23 @@ function TeamSettingsPage() { )} - + {me?.role === 'owner' && ( + + )} -
- AI -
+ {me?.role === 'owner' && ( + <> +
+ AI +
- + - + - + - + + + )}