Compare commits

...
8 Commits
Author SHA1 Message Date
yiling 6a20e06982 Release v0.3.10 2026-08-23 21:19:45 +08:00
Yiling-J b17abce2c2 fix(kanban): improve drag-drop to column bottom, remove empty drop line, and fix timeline alignment (#346) 2026-08-23 21:11:33 +08:00
Yiling-J f67e334016 feat(kanban): update task status permissions, reporter defaults, and participant access (#345)
* feat(kanban): allow editors to change task status and default reporter to creator

* fix(kanban): hide create task button for reviewers and eliminate duplicate error toast
2026-08-23 20:38:56 +08:00
yiling c1de66520e update readme image 2026-08-23 16:53:44 +08:00
Yiling-J 37e086d822 fix(webui): sidebar selection styling, kanban active state, pointer cursors, and owner dashboard (#344)
* fix(webui): update sidebar selection styling, kanban active state, and pointer cursors

* feat(webui): move dashboard to left sidebar and prevent mount animation

* fix(e2e): update create-project test to click Home button in sidebar
2026-08-23 16:39:56 +08:00
Yiling-J d21f8ca8de fix(kanban): use true thumbnail and poster for task asset previews (#343) 2026-08-23 14:36:46 +08:00
Yiling-J 6af4e7c2ec feat(kanban): resolve latest version for linked version stack assets and update demo login text (#342) 2026-08-23 11:19:48 +08:00
Yiling-J 1f2bdc8c9e feat(agentic kanban): phase 1 not-agentic kanban board (#330)
* feat(kanban): implement AI-native kanban database models, services, and REST APIs

* feat(webui): implement team kanban board and task management

* style(webui): increase kanban dialog widths and form container

* fix(webui): ensure kanban dialogs override sm:max-w-lg base class

* style(webui): set edit task dialog max width to 5xl

* chore: untrack kanban plan markdown files

* feat(webui): update kanban page layout to 2 columns and refine task activity UI

* fix(webui): constrain kanban column and board heights for vertical scrolling

* feat(kanban): unify task status transition into updateTask API and allow unconstrained human task transitions

* fix(webui): add optimistic updates to kanban drag-and-drop to eliminate flash

* refactor(webui): remove client-side search box from kanban header

* feat(kanban): redesign task dialog comments area and add attachment support

* refactor(webui): remove top status action bar from task info dialog

* fix(webui): narrow query cache predicate and add defensive guards for kanban drag optimistic update

* feat(kanban): add drag-and-drop task reordering with fractional indexing (#331)

* feat(kanban): add drag-and-drop task reordering with fractional indexing

* fix(kanban): improve card drop zones, snap indicators, and column highlight

* fix(kanban): enable card droppables only during active drag

* fix(kanban): refine hover styles and drop indicators for column boundaries

* fix(kanban): unify bottom drop indicator and fix top indicator clipping

* fix(kanban): ensure full column highlight and full coverage drop target

* minor change

* feat(kanban): allow agent tasks free drag-and-drop and enforce status change permissions (#332)

* refactor(kanban): rename task_type_agentic translation keys to task_type_agent

* feat(kanban): refactor task type enum to isAgentTask boolean (#333)

* refactor(kanban): remove phase 2 agent execution logic and streamline phase 1 kanban

* feat(kanban): add notifications and audit logging for kanban (#334)

* feat(kanban): redesign config area layout and add parent tasks multi-selector (#335)

* feat(webui): redesign kanban task dialog config area

* feat(kanban): simplify task dependencies with parent tasks multi-selector

* refactor(kanban): remove unused links routes and legacy dependency methods

* feat(kanban): connect assets and kanban tasks with many-to-many relationship (#336)

* feat(kanban): connect assets and kanban tasks with many-to-many relationship

* feat(kanban): improve asset picker layout, infinite scrolling, and breadcrumb icon styling

* fix(kanban): ensure asset picker scrollarea is scrollable with min-h-0 and shrink-0 flex styling

* fix(kanban): hide recently deleted in folder tree picker and adjust header padding

* fix(kanban): use lucide files icon instead of paperclip for linked assets

* feat(kanban): improve task deletion, goal sidebar interaction, and card styling (#337)

* feat(kanban): improve task deletion, goal sidebar interaction, and card styling

* feat(kanban): move agent task badge after priority and update to orange style

* feat(kanban): add status Compare-And-Swap (CAS) to prevent drag-and-drop race conditions (#338)

* feat(kanban): add status Compare-And-Swap (CAS) to prevent drag-and-drop race conditions

* style(kanban): rotate kanban icon 180 degrees in sidebar and top nav

* style(kanban): remove rotate-180 from SquareKanban icons

* feat(kanban): add unassigned goal record and fix all tasks count (#339)

* feat(kanban): add unassigned goal record and fix all tasks count

* feat(kanban): toggle task count with three-dot action button on goal card hover

* fix(ci): pin bun version to 1.3.14 across CI and Docker (#340)

* fix(webui): truncate goal name to max 2 lines in kanban sidebar (#341)
2026-08-23 10:28:56 +08:00
394 changed files with 34818 additions and 128 deletions
+8 -8
View File
@@ -22,9 +22,9 @@ jobs:
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
bun-version: 1.3.14
- name: Install dependencies
run: bun install
@@ -76,9 +76,9 @@ jobs:
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
bun-version: 1.3.14
- name: Install dependencies
run: bun install
@@ -118,9 +118,9 @@ jobs:
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
bun-version: 1.3.14
- name: Install dependencies
run: bun install
@@ -152,9 +152,9 @@ jobs:
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
bun-version: 1.3.14
- name: Install dependencies
run: bun install
+1 -1
View File
@@ -36,7 +36,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
bun-version: 1.3.14
- name: Setup Node.js
uses: actions/setup-node@v6
+2 -2
View File
@@ -1,6 +1,6 @@
#syntax=docker/dockerfile:1.7-labs
# Stage 1: Builder
FROM oven/bun:1 AS builder
FROM oven/bun:1.3.14 AS builder
WORKDIR /app
@@ -25,7 +25,7 @@ RUN bun run build.ts
RUN bun run scripts/extract-runtime-deps.ts
# Stage 2: Runner
FROM oven/bun:1 AS runner
FROM oven/bun:1.3.14 AS runner
# Install ffmpeg/ffprobe
COPY --from=mwader/static-ffmpeg:8.1 /ffmpeg /usr/local/bin/
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/agent-app",
"version": "0.3.9",
"version": "0.3.10",
"private": true,
"type": "module",
"bin": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/cli",
"version": "0.3.9",
"version": "0.3.10",
"private": true,
"type": "module",
"bin": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/transcode-app",
"version": "0.3.9",
"version": "0.3.10",
"private": true,
"type": "module",
"bin": {
+5 -1
View File
@@ -7,6 +7,7 @@ import { fileURLToPath } from 'url'
const currentDir = path.dirname(fileURLToPath(import.meta.url))
async function start() {
process.env.TESTCONTAINERS_RYUK_DISABLED = 'true'
console.log('Starting E2E test database container...')
await globalTestSetup()
@@ -32,4 +33,7 @@ async function start() {
await import('../src/index.ts')
}
start().catch(console.error)
start().catch((err) => {
console.error('Failed to start E2E server:', err)
process.exit(1)
})
@@ -40,8 +40,8 @@ test('owner should create a project with a cover image', async ({ owner, prisma
await expect(page).toHaveURL(/\/projects\/[^/]+/)
await expect(page.locator(`text=${projectName}`).first()).toBeVisible()
// Back on the dashboard the new project card is visible with its cover
await page.click('button[aria-label="Dashboard"]')
// Back on the home page the new project card is visible with its cover
await page.click('button[aria-label="Home"]')
await expect(page).toHaveURL(/\/teams\/[^/]+/)
await expect(page.locator(`img[alt="${projectName}"]`)).toBeVisible()
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/web-app",
"version": "0.3.9",
"version": "0.3.10",
"private": true,
"type": "module",
"dependencies": {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 KiB

After

Width:  |  Height:  |  Size: 131 KiB

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "shumai",
"version": "0.3.9",
"version": "0.3.10",
"private": true,
"type": "module",
"repository": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/agent",
"version": "0.3.9",
"version": "0.3.10",
"private": true,
"type": "module",
"main": "./src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/api",
"version": "0.3.9",
"version": "0.3.10",
"private": true,
"type": "module",
"main": "./src/index.ts",
+2
View File
@@ -25,6 +25,7 @@ import quotaRoute from './quota'
import teamRoute from './team'
import uploadRoute, { localUploadRoute } from './upload'
import versionStackRoute from './versionStack'
import kanbanRoute from './kanban'
type User = Prisma.UserGetPayload<Record<string, never>>
@@ -67,6 +68,7 @@ const apiRoute = new Hono<{ Variables: { user: User } }>()
.route('/', mcpRoute)
.route('/', watermarkTemplateRoute)
.route('/', quotaRoute)
.route('/', kanbanRoute)
app.route('/files', s3Route)
+130
View File
@@ -0,0 +1,130 @@
import { zValidator } from '@hono/zod-validator'
import { Hono } from 'hono'
import { kanbanService } from '@shumai/core/src/kanban/kanban'
import { notificationService } from '@shumai/core/src/notification/notification'
import { auditLogService } from '@shumai/core/src/auditLog/auditLog'
import {
authzService,
Permission,
ResourceType,
resolveEffectiveRole,
} from '@shumai/core/src/authz/authz'
import { createKanbanCommentSchema, postAttachmentRequestSchema, AuditAction } from '@shumai/dtos'
import type { Prisma } from '@shumai/db'
type User = Prisma.UserGetPayload<Record<string, never>>
const route = new Hono<{ Variables: { user: User } }>()
.post(
'/teams/:teamId/kanban/attachments',
zValidator('json', postAttachmentRequestSchema),
async (c) => {
const { teamId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.Team,
id: teamId,
})
const attachment = await kanbanService.createAttachment(teamId, req)
return c.json(attachment)
},
)
.post(
'/teams/:teamId/kanban/tasks/:taskId/comments',
zValidator('json', createKanbanCommentSchema),
async (c) => {
const { teamId, taskId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.KanbanTask,
id: taskId,
})
const comment = await kanbanService.addComment(taskId, user.id, req.body, req.attachments)
const task = await kanbanService.getTask(taskId)
await auditLogService.logAction({
action: AuditAction.kanban_comment_create,
teamId,
userId: user.id,
projectId: task.projectId ?? undefined,
itemId: comment.id,
})
notificationService.notifyKanbanTaskEvent({
type: 'kanban_task_comment_created',
teamId,
projectId: task.projectId,
creatorId: user.id,
kanbanTaskId: taskId,
stakeholderIds: [task.creator?.id, task.assignee?.id, task.reporter?.id],
commentMessage: req.body,
})
return c.json(comment)
},
)
.get('/teams/:teamId/kanban/tasks/:taskId/comments', async (c) => {
const { taskId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.KanbanTask,
id: taskId,
})
const comments = await kanbanService.listComments(taskId)
return c.json({ data: comments })
})
.delete('/teams/:teamId/kanban/tasks/:taskId/comments/:commentId', async (c) => {
const { teamId, taskId, commentId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.KanbanTask,
id: taskId,
})
const userRole = await resolveEffectiveRole(teamId, undefined, user.id)
const task = await kanbanService.getTask(taskId)
await kanbanService.deleteComment(taskId, commentId, user.id, userRole)
await auditLogService.logAction({
action: AuditAction.kanban_comment_delete,
teamId,
userId: user.id,
projectId: task.projectId ?? undefined,
itemId: commentId,
})
return c.json({ success: true })
})
.get('/teams/:teamId/kanban/tasks/:taskId/events', async (c) => {
const { taskId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.KanbanTask,
id: taskId,
})
const events = await kanbanService.listEvents(taskId)
return c.json({ data: events })
})
export default route
+131
View File
@@ -0,0 +1,131 @@
import { zValidator } from '@hono/zod-validator'
import { Hono } from 'hono'
import { kanbanService } from '@shumai/core/src/kanban/kanban'
import { auditLogService } from '@shumai/core/src/auditLog/auditLog'
import {
authzService,
Permission,
ResourceType,
resolveEffectiveRole,
} from '@shumai/core/src/authz/authz'
import {
createKanbanGoalSchema,
updateKanbanGoalSchema,
listKanbanGoalsRequestSchema,
AuditAction,
} from '@shumai/dtos'
import type { Prisma } from '@shumai/db'
type User = Prisma.UserGetPayload<Record<string, never>>
const route = new Hono<{ Variables: { user: User } }>()
.post('/teams/:teamId/kanban/goals', zValidator('json', createKanbanGoalSchema), async (c) => {
const { teamId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Admin,
type: ResourceType.Team,
id: teamId,
})
const role = await resolveEffectiveRole(teamId, undefined, user.id)
const goal = await kanbanService.createGoal(teamId, req, user.id, role)
await auditLogService.logAction({
action: AuditAction.kanban_goal_create,
teamId,
userId: user.id,
itemId: goal.id,
})
return c.json(goal)
})
.get(
'/teams/:teamId/kanban/goals',
zValidator('query', listKanbanGoalsRequestSchema),
async (c) => {
const { teamId } = c.req.param()
const req = c.req.valid('query')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.Team,
id: teamId,
})
const goals = await kanbanService.listGoals(teamId, req)
return c.json({ data: goals })
},
)
.get('/teams/:teamId/kanban/goals/:goalId', async (c) => {
const { goalId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.KanbanGoal,
id: goalId,
})
const goal = await kanbanService.getGoal(goalId)
return c.json(goal)
})
.patch(
'/teams/:teamId/kanban/goals/:goalId',
zValidator('json', updateKanbanGoalSchema),
async (c) => {
const { teamId, goalId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Admin,
type: ResourceType.KanbanGoal,
id: goalId,
})
const role = await resolveEffectiveRole(teamId, undefined, user.id)
const goal = await kanbanService.updateGoal(goalId, req, role)
await auditLogService.logAction({
action: AuditAction.kanban_goal_update,
teamId,
userId: user.id,
itemId: goalId,
})
return c.json(goal)
},
)
.delete('/teams/:teamId/kanban/goals/:goalId', async (c) => {
const { teamId, goalId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Admin,
type: ResourceType.KanbanGoal,
id: goalId,
})
const role = await resolveEffectiveRole(teamId, undefined, user.id)
await kanbanService.deleteGoal(goalId, role)
await auditLogService.logAction({
action: AuditAction.kanban_goal_delete,
teamId,
userId: user.id,
itemId: goalId,
})
return c.json({ ok: true })
})
export default route
+14
View File
@@ -0,0 +1,14 @@
import { Hono } from 'hono'
import type { Prisma } from '@shumai/db'
import goalsRoute from './goals'
import tasksRoute from './tasks'
import commentsRoute from './comments'
type User = Prisma.UserGetPayload<Record<string, never>>
const kanbanRoute = new Hono<{ Variables: { user: User } }>()
.route('/', goalsRoute)
.route('/', tasksRoute)
.route('/', commentsRoute)
export default kanbanRoute
+689
View File
@@ -0,0 +1,689 @@
import { describe, it, expect, vi, beforeEach } from 'vitest'
import { Hono, type Context, type Next } from 'hono'
import { kanbanService } from '@shumai/core/src/kanban/kanban'
import { auditLogService } from '@shumai/core/src/auditLog/auditLog'
import { notificationService } from '@shumai/core/src/notification/notification'
import { KanbanTaskStatus, KanbanTaskPriority } from '@shumai/db/enums'
import kanbanRoute from './index'
vi.mock('@shumai/core/src/authz/authz', () => ({
authzService: {
hasPermission: vi.fn().mockResolvedValue(undefined),
},
resolveEffectiveRole: vi.fn().mockResolvedValue('owner'),
Permission: {
Read: 'Read',
Edit: 'Edit',
Admin: 'Admin',
},
ResourceType: {
Team: 'team',
Project: 'project',
KanbanGoal: 'kanbanGoal',
KanbanTask: 'kanbanTask',
},
}))
vi.mock('@shumai/core/src/auditLog/auditLog', () => ({
auditLogService: {
logAction: vi.fn().mockResolvedValue({}),
},
}))
vi.mock('@shumai/core/src/notification/notification', () => ({
notificationService: {
notifyKanbanTaskEvent: vi.fn().mockResolvedValue(undefined),
create: vi.fn().mockResolvedValue(undefined),
},
}))
describe('Kanban API Routes', () => {
const teamId = 'team-1'
const taskId = 'task-1'
const goalId = 'goal-1'
const authMiddleware = async (c: Context, next: Next) => {
c.set('user', { id: 'user-1', name: 'Test User' })
await next()
}
let app: Hono
beforeEach(() => {
vi.clearAllMocks()
vi.mocked(auditLogService.logAction).mockResolvedValue({} as any) // eslint-disable-line @typescript-eslint/no-explicit-any
vi.mocked(notificationService.notifyKanbanTaskEvent).mockResolvedValue(undefined as any) // eslint-disable-line @typescript-eslint/no-explicit-any
app = new Hono()
app.use('*', authMiddleware)
app.route('/', kanbanRoute)
})
// --------------------------------------------------------------------------
// Goals Endpoints
// --------------------------------------------------------------------------
describe('Goals Endpoints', () => {
it('POST /teams/:teamId/kanban/goals', async () => {
const mockCreate = vi.spyOn(kanbanService, 'createGoal').mockResolvedValue({
id: goalId,
title: 'New Goal',
description: 'Goal description',
teamId,
creatorId: 'user-1',
taskCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/goals`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ title: 'New Goal', description: 'Goal description' }),
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.id).toBe(goalId)
expect(mockCreate).toHaveBeenCalledWith(
teamId,
{ title: 'New Goal', description: 'Goal description' },
'user-1',
'owner',
)
})
it('GET /teams/:teamId/kanban/goals', async () => {
const mockList = vi.spyOn(kanbanService, 'listGoals').mockResolvedValue([
{
id: goalId,
title: 'Goal 1',
teamId,
creatorId: 'user-1',
taskCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
},
])
const res = await app.request(`/teams/${teamId}/kanban/goals`)
expect(res.status).toBe(200)
const json = await res.json()
expect(json.data).toHaveLength(1)
expect(mockList).toHaveBeenCalledWith(teamId, expect.any(Object))
})
it('PATCH /teams/:teamId/kanban/goals/:goalId', async () => {
const mockUpdate = vi.spyOn(kanbanService, 'updateGoal').mockResolvedValue({
id: goalId,
title: 'Updated Goal',
teamId,
creatorId: 'user-1',
taskCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/goals/${goalId}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ title: 'Updated Goal' }),
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.title).toBe('Updated Goal')
expect(mockUpdate).toHaveBeenCalledWith(goalId, { title: 'Updated Goal' }, 'owner')
})
it('DELETE /teams/:teamId/kanban/goals/:goalId', async () => {
const mockDelete = vi.spyOn(kanbanService, 'deleteGoal').mockResolvedValue(undefined)
const res = await app.request(`/teams/${teamId}/kanban/goals/${goalId}`, {
method: 'DELETE',
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.ok).toBe(true)
expect(mockDelete).toHaveBeenCalledWith(goalId, 'owner')
})
})
// --------------------------------------------------------------------------
// Tasks Endpoints
// --------------------------------------------------------------------------
describe('Tasks Endpoints', () => {
it('POST /teams/:teamId/kanban/tasks', async () => {
const mockCreate = vi.spyOn(kanbanService, 'createTask').mockResolvedValue({
id: taskId,
title: 'New Task',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/tasks`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ title: 'New Task', isAgentTask: false }),
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.id).toBe(taskId)
expect(mockCreate).toHaveBeenCalledWith(teamId, expect.any(Object), 'user-1', 'owner')
})
it('GET /teams/:teamId/kanban/tasks (with isAgentTask and goal filters)', async () => {
const mockList = vi.spyOn(kanbanService, 'listTasks').mockResolvedValue({
data: [
{
id: taskId,
title: 'Task 1',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
},
],
pageInfo: { total: 1 },
})
const res = await app.request(
`/teams/${teamId}/kanban/tasks?isAgentTask=false&status=READY&goalId=goal-1`,
)
expect(res.status).toBe(200)
const json = await res.json()
expect(json.data).toHaveLength(1)
expect(mockList).toHaveBeenCalledWith(
teamId,
expect.objectContaining({
isAgentTask: false,
status: 'READY',
goalId: 'goal-1',
}),
)
})
it('GET /teams/:teamId/kanban/tasks/:taskId', async () => {
const mockGet = vi.spyOn(kanbanService, 'getTask').mockResolvedValue({
id: taskId,
title: 'Task 1',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
dependencies: [],
dependents: [],
assets: [],
comments: [],
events: [],
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}`)
expect(res.status).toBe(200)
const json = await res.json()
expect(json.id).toBe(taskId)
expect(mockGet).toHaveBeenCalledWith(taskId)
})
it('PATCH /teams/:teamId/kanban/tasks/:taskId', async () => {
vi.spyOn(kanbanService, 'getTask').mockResolvedValue({
id: taskId,
title: 'Old Task Title',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
dependencies: [],
dependents: [],
assets: [],
comments: [],
events: [],
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const mockUpdate = vi.spyOn(kanbanService, 'updateTask').mockResolvedValue({
id: taskId,
title: 'Updated Task Title',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.HIGH,
teamId,
creator: { id: 'user-1', name: 'User 1' },
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ priority: 'HIGH', status: 'DONE', reason: 'All done' }),
})
expect(res.status).toBe(200)
expect(mockUpdate).toHaveBeenCalledWith(
taskId,
{ priority: 'HIGH', status: 'DONE', reason: 'All done' },
'user-1',
'owner',
)
})
it('PATCH /teams/:teamId/kanban/tasks/:taskId with beforeIndex and afterIndex', async () => {
vi.spyOn(kanbanService, 'getTask').mockResolvedValue({
id: taskId,
title: 'Task 1',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
sortIndex: 'a0V',
teamId,
creator: { id: 'user-1', name: 'User 1' },
dependencies: [],
dependents: [],
assets: [],
comments: [],
events: [],
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const mockUpdate = vi.spyOn(kanbanService, 'updateTask').mockResolvedValue({
id: taskId,
title: 'Task 1',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
sortIndex: 'a0V',
teamId,
creator: { id: 'user-1', name: 'User 1' },
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ status: 'READY', beforeIndex: 'a1', afterIndex: 'a0' }),
})
expect(res.status).toBe(200)
expect(mockUpdate).toHaveBeenCalledWith(
taskId,
{ status: 'READY', beforeIndex: 'a1', afterIndex: 'a0' },
'user-1',
'owner',
)
})
it('PATCH /teams/:teamId/kanban/tasks/:taskId with fromStatus for CAS', async () => {
vi.spyOn(kanbanService, 'getTask').mockResolvedValue({
id: taskId,
title: 'Task 1',
isAgentTask: false,
status: KanbanTaskStatus.TODO,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
dependencies: [],
dependents: [],
assets: [],
comments: [],
events: [],
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const mockUpdate = vi.spyOn(kanbanService, 'updateTask').mockResolvedValue({
id: taskId,
title: 'Task 1',
isAgentTask: false,
status: KanbanTaskStatus.IN_PROGRESS,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ fromStatus: 'TODO', status: 'IN_PROGRESS' }),
})
expect(res.status).toBe(200)
expect(mockUpdate).toHaveBeenCalledWith(
taskId,
{ fromStatus: 'TODO', status: 'IN_PROGRESS' },
'user-1',
'owner',
)
})
it('DELETE /teams/:teamId/kanban/tasks/:taskId', async () => {
vi.spyOn(kanbanService, 'getTask').mockResolvedValue({
id: taskId,
title: 'Task to delete',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
dependencies: [],
dependents: [],
assets: [],
comments: [],
events: [],
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const mockDelete = vi.spyOn(kanbanService, 'deleteTask').mockResolvedValue({
id: taskId,
title: 'Task to delete',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}`, {
method: 'DELETE',
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.success).toBe(true)
expect(mockDelete).toHaveBeenCalledWith(taskId, 'user-1', 'owner')
})
it('GET /teams/:teamId/kanban/tasks/:taskId/assets', async () => {
const mockListTaskAssets = vi.spyOn(kanbanService, 'listTaskAssets').mockResolvedValue([
{
id: 'asset-1',
name: 'Video.mp4',
type: 'file',
proxyType: 'video',
thumbnailUrl: 'http://example.com/thumb.jpg',
path: '/Project/Video.mp4',
creator: { id: 'user-1', name: 'User 1' },
createdAt: new Date().toISOString(),
},
])
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}/assets`)
expect(res.status).toBe(200)
const json = await res.json()
expect(json).toHaveLength(1)
expect(json[0].name).toBe('Video.mp4')
expect(mockListTaskAssets).toHaveBeenCalledWith(taskId)
})
it('POST /teams/:teamId/kanban/tasks/:taskId/assets', async () => {
const mockLinkAssets = vi.spyOn(kanbanService, 'linkAssets').mockResolvedValue(undefined)
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}/assets`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ assetIds: ['asset-1', 'asset-2'] }),
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.success).toBe(true)
expect(mockLinkAssets).toHaveBeenCalledWith(teamId, taskId, ['asset-1', 'asset-2'])
})
it('DELETE /teams/:teamId/kanban/tasks/:taskId/assets/:assetId', async () => {
const mockUnlinkAsset = vi.spyOn(kanbanService, 'unlinkAsset').mockResolvedValue(undefined)
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}/assets/asset-1`, {
method: 'DELETE',
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.success).toBe(true)
expect(mockUnlinkAsset).toHaveBeenCalledWith(teamId, taskId, 'asset-1')
})
it('GET /teams/:teamId/kanban/assets/:assetId/tasks', async () => {
const mockListTasksForAsset = vi.spyOn(kanbanService, 'listTasksForAsset').mockResolvedValue([
{
id: taskId,
title: 'Task linked to asset',
isAgentTask: false,
status: KanbanTaskStatus.READY,
priority: KanbanTaskPriority.MEDIUM,
teamId,
creator: { id: 'user-1', name: 'User 1' },
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 1,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
},
])
const res = await app.request(`/teams/${teamId}/kanban/assets/asset-1/tasks`)
expect(res.status).toBe(200)
const json = await res.json()
expect(json.total).toBe(1)
expect(json.data).toHaveLength(1)
expect(mockListTasksForAsset).toHaveBeenCalledWith(teamId, 'asset-1')
})
it('POST /teams/:teamId/kanban/assets/:assetId/tasks', async () => {
const mockLinkAsset = vi.spyOn(kanbanService, 'linkAsset').mockResolvedValue(undefined)
const res = await app.request(`/teams/${teamId}/kanban/assets/asset-1/tasks`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ taskId }),
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.success).toBe(true)
expect(mockLinkAsset).toHaveBeenCalledWith(teamId, taskId, 'asset-1')
})
it('DELETE /teams/:teamId/kanban/assets/:assetId/tasks/:taskId', async () => {
const mockUnlinkAsset = vi.spyOn(kanbanService, 'unlinkAsset').mockResolvedValue(undefined)
const res = await app.request(`/teams/${teamId}/kanban/assets/asset-1/tasks/${taskId}`, {
method: 'DELETE',
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.success).toBe(true)
expect(mockUnlinkAsset).toHaveBeenCalledWith(teamId, taskId, 'asset-1')
})
})
// --------------------------------------------------------------------------
// Comments, Attachments & Events
// --------------------------------------------------------------------------
describe('Comments, Attachments and Events Endpoints', () => {
it('POST /teams/:teamId/kanban/attachments', async () => {
const mockAttachment = vi.spyOn(kanbanService, 'createAttachment').mockResolvedValue({
id: 'att-1',
name: 'test.png',
key: 'kanban/attachments/test.png',
sizeByte: 1024,
uploadUrl: 'http://s3/upload',
proxyType: 'image',
})
const res = await app.request(`/teams/${teamId}/kanban/attachments`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ fileName: 'test.png', size: 1024, contentType: 'image/png' }),
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.id).toBe('att-1')
expect(mockAttachment).toHaveBeenCalledWith(teamId, {
fileName: 'test.png',
size: 1024,
contentType: 'image/png',
})
})
it('POST /teams/:teamId/kanban/tasks/:taskId/comments', async () => {
const mockAdd = vi.spyOn(kanbanService, 'addComment').mockResolvedValue({
id: 'c-1',
taskId,
author: { id: 'user-1', name: 'User 1' },
body: 'Here is a note',
attachments: [],
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
})
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}/comments`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
body: 'Here is a note',
attachments: [
{
id: 'att-1',
name: 'test.png',
key: 'key-1',
sizeByte: 1024,
proxyType: 'image',
},
],
}),
})
expect(res.status).toBe(200)
expect(mockAdd).toHaveBeenCalledWith(taskId, 'user-1', 'Here is a note', [
{
id: 'att-1',
name: 'test.png',
key: 'key-1',
sizeByte: 1024,
proxyType: 'image',
},
])
})
it('DELETE /teams/:teamId/kanban/tasks/:taskId/comments/:commentId', async () => {
const mockDelete = vi.spyOn(kanbanService, 'deleteComment').mockResolvedValue()
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}/comments/c-1`, {
method: 'DELETE',
})
expect(res.status).toBe(200)
const json = await res.json()
expect(json.success).toBe(true)
expect(mockDelete).toHaveBeenCalledWith(taskId, 'c-1', 'user-1', 'owner')
})
it('GET /teams/:teamId/kanban/tasks/:taskId/comments', async () => {
const mockList = vi.spyOn(kanbanService, 'listComments').mockResolvedValue([
{
id: 'c-1',
taskId,
author: { id: 'user-1', name: 'User 1' },
body: 'Note',
attachments: [],
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
},
])
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}/comments`)
expect(res.status).toBe(200)
const json = await res.json()
expect(json.data).toHaveLength(1)
expect(mockList).toHaveBeenCalledWith(taskId)
})
it('GET /teams/:teamId/kanban/tasks/:taskId/events', async () => {
const mockEvents = vi.spyOn(kanbanService, 'listEvents').mockResolvedValue([
{
id: 'e-1',
taskId,
actor: { id: 'user-1', name: 'User 1' },
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type: 'CREATED' as any,
createdAt: new Date().toISOString(),
},
])
const res = await app.request(`/teams/${teamId}/kanban/tasks/${taskId}/events`)
expect(res.status).toBe(200)
const json = await res.json()
expect(json.data).toHaveLength(1)
expect(mockEvents).toHaveBeenCalledWith(taskId)
})
})
})
+331
View File
@@ -0,0 +1,331 @@
import { zValidator } from '@hono/zod-validator'
import { Hono } from 'hono'
import { kanbanService } from '@shumai/core/src/kanban/kanban'
import { notificationService } from '@shumai/core/src/notification/notification'
import { auditLogService } from '@shumai/core/src/auditLog/auditLog'
import {
authzService,
Permission,
ResourceType,
resolveEffectiveRole,
} from '@shumai/core/src/authz/authz'
import {
createKanbanTaskSchema,
updateKanbanTaskSchema,
listKanbanTasksRequestSchema,
linkTaskAssetsSchema,
linkAssetToTaskSchema,
AuditAction,
} from '@shumai/dtos'
import type { Prisma } from '@shumai/db'
import { HTTPException } from 'hono/http-exception'
type User = Prisma.UserGetPayload<Record<string, never>>
const route = new Hono<{ Variables: { user: User } }>()
.post('/teams/:teamId/kanban/tasks', zValidator('json', createKanbanTaskSchema), async (c) => {
const { teamId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.Team,
id: teamId,
})
const role = await resolveEffectiveRole(teamId, undefined, user.id)
if (!role) {
throw new HTTPException(403, { message: 'User is not a member of the team' })
}
const task = await kanbanService.createTask(teamId, req, user.id, role)
await auditLogService.logAction({
action: AuditAction.kanban_task_create,
teamId,
userId: user.id,
projectId: task.projectId ?? undefined,
itemId: task.id,
})
if (req.assigneeId && req.assigneeId !== user.id) {
notificationService.notifyKanbanTaskEvent({
type: 'kanban_task_assigned',
teamId,
projectId: task.projectId,
creatorId: user.id,
kanbanTaskId: task.id,
targetUserId: req.assigneeId,
})
}
if (req.reporterId && req.reporterId !== user.id && req.reporterId !== req.assigneeId) {
notificationService.notifyKanbanTaskEvent({
type: 'kanban_task_created',
teamId,
projectId: task.projectId,
creatorId: user.id,
kanbanTaskId: task.id,
targetUserId: req.reporterId,
})
}
return c.json(task)
})
.get(
'/teams/:teamId/kanban/tasks',
zValidator('query', listKanbanTasksRequestSchema),
async (c) => {
const { teamId } = c.req.param()
const req = c.req.valid('query')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.Team,
id: teamId,
})
const result = await kanbanService.listTasks(teamId, req)
return c.json(result)
},
)
.get('/teams/:teamId/kanban/tasks/:taskId', async (c) => {
const { taskId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.KanbanTask,
id: taskId,
})
const task = await kanbanService.getTask(taskId)
return c.json(task)
})
.patch(
'/teams/:teamId/kanban/tasks/:taskId',
zValidator('json', updateKanbanTaskSchema),
async (c) => {
const { teamId, taskId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Edit,
type: ResourceType.KanbanTask,
id: taskId,
})
const existing = await kanbanService.getTask(taskId)
const role = await resolveEffectiveRole(teamId, existing.projectId ?? undefined, user.id)
const task = await kanbanService.updateTask(taskId, req, user.id, role)
const hasMeaningfulChanges =
req.title !== undefined ||
req.description !== undefined ||
req.priority !== undefined ||
req.startDate !== undefined ||
req.dueDate !== undefined ||
req.goalId !== undefined ||
req.assigneeId !== undefined ||
req.reporterId !== undefined ||
req.targetFolderId !== undefined ||
(req.status !== undefined && req.status !== existing.status)
if (hasMeaningfulChanges) {
await auditLogService.logAction({
action: AuditAction.kanban_task_update,
teamId,
userId: user.id,
projectId: task.projectId ?? undefined,
itemId: task.id,
})
}
if (req.status !== undefined && req.status !== existing.status) {
notificationService.notifyKanbanTaskEvent({
type: 'kanban_task_status_updated',
teamId,
projectId: task.projectId,
creatorId: user.id,
kanbanTaskId: task.id,
stakeholderIds: [task.creator?.id, task.assignee?.id, task.reporter?.id],
})
}
if (
req.assigneeId !== undefined &&
req.assigneeId !== existing.assignee?.id &&
req.assigneeId !== null &&
req.assigneeId !== user.id
) {
notificationService.notifyKanbanTaskEvent({
type: 'kanban_task_assigned',
teamId,
projectId: task.projectId,
creatorId: user.id,
kanbanTaskId: task.id,
targetUserId: req.assigneeId,
})
}
const hasOtherDetailsChanged =
req.title !== undefined ||
req.description !== undefined ||
req.priority !== undefined ||
req.startDate !== undefined ||
req.dueDate !== undefined ||
req.goalId !== undefined ||
req.reporterId !== undefined ||
req.targetFolderId !== undefined
if (hasOtherDetailsChanged && req.status === undefined) {
notificationService.notifyKanbanTaskEvent({
type: 'kanban_task_updated',
teamId,
projectId: task.projectId,
creatorId: user.id,
kanbanTaskId: task.id,
stakeholderIds: [task.creator?.id, task.assignee?.id, task.reporter?.id],
})
}
return c.json(task)
},
)
.delete('/teams/:teamId/kanban/tasks/:taskId', async (c) => {
const { teamId, taskId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Edit,
type: ResourceType.KanbanTask,
id: taskId,
})
const existing = await kanbanService.getTask(taskId)
const role = await resolveEffectiveRole(teamId, existing.projectId ?? undefined, user.id)
notificationService.notifyKanbanTaskEvent({
type: 'kanban_task_deleted',
teamId,
projectId: existing.projectId,
creatorId: user.id,
kanbanTaskId: taskId,
stakeholderIds: [existing.creator?.id, existing.assignee?.id, existing.reporter?.id],
})
await auditLogService.logAction({
action: AuditAction.kanban_task_delete,
teamId,
userId: user.id,
projectId: existing.projectId ?? undefined,
itemId: taskId,
})
await kanbanService.deleteTask(taskId, user.id, role)
return c.json({ success: true })
})
.get('/teams/:teamId/kanban/tasks/:taskId/assets', async (c) => {
const { taskId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.KanbanTask,
id: taskId,
})
const assets = await kanbanService.listTaskAssets(taskId)
return c.json(assets)
})
.post(
'/teams/:teamId/kanban/tasks/:taskId/assets',
zValidator('json', linkTaskAssetsSchema),
async (c) => {
const { teamId, taskId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Edit,
type: ResourceType.KanbanTask,
id: taskId,
})
await kanbanService.linkAssets(teamId, taskId, req.assetIds)
return c.json({ success: true })
},
)
.delete('/teams/:teamId/kanban/tasks/:taskId/assets/:assetId', async (c) => {
const { teamId, taskId, assetId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Edit,
type: ResourceType.KanbanTask,
id: taskId,
})
await kanbanService.unlinkAsset(teamId, taskId, assetId)
return c.json({ success: true })
})
.get('/teams/:teamId/kanban/assets/:assetId/tasks', async (c) => {
const { teamId, assetId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Read,
type: ResourceType.Team,
id: teamId,
})
const tasks = await kanbanService.listTasksForAsset(teamId, assetId)
return c.json({ data: tasks, total: tasks.length })
})
.post(
'/teams/:teamId/kanban/assets/:assetId/tasks',
zValidator('json', linkAssetToTaskSchema),
async (c) => {
const { teamId, assetId } = c.req.param()
const req = c.req.valid('json')
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Edit,
type: ResourceType.KanbanTask,
id: req.taskId,
})
await kanbanService.linkAsset(teamId, req.taskId, assetId)
return c.json({ success: true })
},
)
.delete('/teams/:teamId/kanban/assets/:assetId/tasks/:taskId', async (c) => {
const { teamId, assetId, taskId } = c.req.param()
const user = c.get('user')
await authzService.hasPermission({
user,
permission: Permission.Edit,
type: ResourceType.KanbanTask,
id: taskId,
})
await kanbanService.unlinkAsset(teamId, taskId, assetId)
return c.json({ success: true })
})
export default route
+2
View File
@@ -150,6 +150,8 @@ describe('notification api', () => {
yourUploads: true,
otherUploads: false,
statusUpdates: true,
kanbanTasks: true,
kanbanComments: true,
},
)
})
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/core",
"version": "0.3.9",
"version": "0.3.10",
"private": true,
"type": "module",
"main": "./src/index.ts",
+1 -1
View File
@@ -1998,7 +1998,7 @@ describe('AssetService', () => {
expect(await prisma.asset.findUnique({ where: { id: folderA.id } })).toBeNull()
const remainingChildren = await prisma.asset.count({ where: { parentId: folderA.id } })
expect(remainingChildren).toBe(0)
})
}, 20000)
it('should delete the entire directory prefix for assets with complex keys (e.g., files/ULID/raw)', async () => {
const { project } = await setupBasicAssets()
+1 -1
View File
@@ -2131,7 +2131,7 @@ export class AssetService {
)
}
private async toPreviewInfo(asset: Asset | AssetWithIncludes): Promise<PreviewInfo | null> {
async toPreviewInfo(asset: Asset | AssetWithIncludes): Promise<PreviewInfo | null> {
if (!asset.media) return null
const proxyType = (asset.media?.proxyType || null) as 'image' | 'video' | 'audio' | 'pdf' | null
@@ -84,4 +84,36 @@ describe('AuditLogService', () => {
expect(result).toBeNull()
})
it('records kanban actions accurately', async () => {
const user = await prisma.user.create({
data: { name: 'Kanban User', email: 'kanban_user@example.com', password: 'password' },
})
const team = await prisma.team.create({
data: { name: 'Kanban Audit Team' },
})
await auditLogService.logAction({
action: AuditAction.kanban_task_create,
teamId: team.id,
userId: user.id,
itemId: 'task-123',
})
await auditLogService.logAction({
action: AuditAction.kanban_goal_create,
teamId: team.id,
userId: user.id,
itemId: 'goal-123',
})
const result = await auditLogService.listAuditLogs({
teamId: team.id,
actions: [AuditAction.kanban_task_create, AuditAction.kanban_goal_create],
})
expect(result.total).toBe(2)
expect(result.nodes.map((n) => n.action)).toContain(AuditAction.kanban_task_create)
expect(result.nodes.map((n) => n.action)).toContain(AuditAction.kanban_goal_create)
})
})
+93
View File
@@ -502,5 +502,98 @@ describe('AuthzService', () => {
}),
).rejects.toThrow('User has only project scope')
})
it('allows project-scoped and reviewer participants to edit team-level Kanban tasks', async () => {
const creator = await prisma.user.create({
data: { name: 'Owner User', email: 'owner-kanban@example.com', password: 'pass' },
})
const projectScopedUser = await prisma.user.create({
data: { name: 'Proj Member', email: 'proj-kanban@example.com', password: 'pass' },
})
const reviewerUser = await prisma.user.create({
data: { name: 'Reviewer User', email: 'rev-kanban@example.com', password: 'pass' },
})
const unassignedUser = await prisma.user.create({
data: { name: 'Unassigned User', email: 'unassigned-kanban@example.com', password: 'pass' },
})
const team = await prisma.team.create({ data: { name: 'Kanban Team' } })
const project = await prisma.project.create({ data: { name: 'Project K', teamId: team.id } })
await prisma.teamMember.create({
data: { teamId: team.id, userId: creator.id, role: 'owner', scope: 'team' },
})
const tmProj = await prisma.teamMember.create({
data: { teamId: team.id, userId: projectScopedUser.id, role: 'reviewer', scope: 'project' },
})
await prisma.projectMember.create({
data: { projectId: project.id, teamMemberId: tmProj.id, role: 'editor' },
})
await prisma.teamMember.create({
data: { teamId: team.id, userId: reviewerUser.id, role: 'reviewer', scope: 'team' },
})
await prisma.teamMember.create({
data: { teamId: team.id, userId: unassignedUser.id, role: 'reviewer', scope: 'project' },
})
// Team-level task (no projectId)
const teamTask = await prisma.kanbanTask.create({
data: {
teamId: team.id,
title: 'Team Task for Project Member',
creatorId: creator.id,
reporterId: creator.id,
assigneeId: projectScopedUser.id,
},
})
// 1. Project-scoped assignee on team task CAN edit
await expect(
authzService.hasPermission({
type: ResourceType.KanbanTask,
id: teamTask.id,
user: projectScopedUser,
permission: Permission.Edit,
}),
).resolves.toBeUndefined()
// 2. Reviewer who is reporter CAN edit
const reviewerReportedTask = await prisma.kanbanTask.create({
data: {
teamId: team.id,
title: 'Task Reported by Reviewer',
creatorId: creator.id,
reporterId: reviewerUser.id,
},
})
await expect(
authzService.hasPermission({
type: ResourceType.KanbanTask,
id: reviewerReportedTask.id,
user: reviewerUser,
permission: Permission.Edit,
}),
).resolves.toBeUndefined()
// 3. Unassigned project-scoped user CANNOT edit team task
await expect(
authzService.hasPermission({
type: ResourceType.KanbanTask,
id: teamTask.id,
user: unassignedUser,
permission: Permission.Edit,
}),
).rejects.toThrow('User has only project scope')
// 4. Unassigned reviewer CANNOT edit team task
await expect(
authzService.hasPermission({
type: ResourceType.KanbanTask,
id: teamTask.id,
user: reviewerUser,
permission: Permission.Edit,
}),
).rejects.toThrow('Permission denied')
})
})
})
+54 -1
View File
@@ -25,6 +25,8 @@ export enum ResourceType {
Comment = 'comment',
AgentSession = 'agentSession',
QuotaRule = 'quotaRule',
KanbanGoal = 'kanbanGoal',
KanbanTask = 'kanbanTask',
}
export interface AuthzRequest {
@@ -93,7 +95,18 @@ export class AuthzService {
// (project override -> team role for team-scoped members -> restricted).
const role = await resolveEffectiveRole(teamId, projectId, req.user.id)
if (role) {
return this.checkRole(role, req.permission)
try {
return this.checkRole(role, req.permission)
} catch (err) {
// If role check failed (e.g. reviewer requesting Permission.Edit on a KanbanTask where they are assignee/reporter/creator), allow it.
if (req.type === ResourceType.KanbanTask && req.permission === Permission.Edit) {
const isParticipant = await this.isKanbanTaskParticipant(req.id, req.user.id)
if (isParticipant) {
return
}
}
throw err
}
}
// No effective role: either not a team member, or a project-scoped member
@@ -108,6 +121,19 @@ export class AuthzService {
})
if (!member) throw new HTTPException(403, { message: 'User is not a member of the team' })
// If this is a KanbanTask and user is a team member, check if they are the assignee, reporter, or creator
if (req.type === ResourceType.KanbanTask) {
if (req.permission === Permission.Read) {
return
}
if (req.permission === Permission.Edit) {
const isParticipant = await this.isKanbanTaskParticipant(req.id, req.user.id)
if (isParticipant) {
return
}
}
}
// Project-scoped member on a team-level resource (no project context):
// allow Read (e.g. listing), deny Edit/Admin.
if (!projectId && req.permission === Permission.Read) {
@@ -116,6 +142,15 @@ export class AuthzService {
throw new HTTPException(403, { message: 'User has only project scope' })
}
private async isKanbanTaskParticipant(taskId: string, userId: string): Promise<boolean> {
const task = await prisma.kanbanTask.findUnique({
where: { id: taskId },
select: { creatorId: true, reporterId: true, assigneeId: true },
})
if (!task) return false
return task.creatorId === userId || task.reporterId === userId || task.assigneeId === userId
}
private async resolveContext(
type: ResourceType,
id: string,
@@ -269,6 +304,24 @@ export class AuthzService {
return { teamId: rule.teamId }
}
case ResourceType.KanbanGoal: {
const goal = await prisma.kanbanGoal.findUnique({
where: { id },
select: { teamId: true },
})
if (!goal) throw new HTTPException(404, { message: 'Kanban goal not found' })
return { teamId: goal.teamId }
}
case ResourceType.KanbanTask: {
const task = await prisma.kanbanTask.findUnique({
where: { id },
select: { teamId: true, projectId: true },
})
if (!task) throw new HTTPException(404, { message: 'Kanban task not found' })
return { teamId: task.teamId, projectId: task.projectId ?? undefined }
}
default:
throw new HTTPException(403, { message: `Unsupported resource type: ${type}` })
}
+1
View File
@@ -27,3 +27,4 @@ export * from './watermark/watermark'
export * from './gotenberg/gotenberg'
export * from './mcp/mcp-service'
export * from './quota/quota-service'
export * from './kanban/kanban'
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -419,7 +419,14 @@ describe('NotificationService', () => {
const info = await svc['toNotificationInfo'](
await prisma.notification.findUniqueOrThrow({
where: { id: n.id },
include: { creator: true, team: true, project: true, asset: true, user: true },
include: {
creator: true,
team: true,
project: true,
asset: true,
user: true,
kanbanTask: true,
},
}),
null,
)
@@ -430,4 +437,103 @@ describe('NotificationService', () => {
expect(info.asset?.originalWidth).toBe(1280)
expect(info.asset?.originalHeight).toBe(720)
})
it('notifyKanbanTaskEvent broadcasts to stakeholders excluding actor and parses mentions', async () => {
const tm = await prisma.team.create({ data: { name: 'Team Kanban' } })
const u1 = await prisma.user.create({
data: { name: 'Actor', email: `actor-${Date.now()}@example.com`, password: 'p' },
})
const u2 = await prisma.user.create({
data: { name: 'Assignee', email: `assignee-${Date.now()}@example.com`, password: 'p' },
})
const u3 = await prisma.user.create({
data: { name: 'Mentioned', email: `mentioned-${Date.now()}@example.com`, password: 'p' },
})
const task = await prisma.kanbanTask.create({
data: {
teamId: tm.id,
creatorId: u1.id,
title: 'Important task',
},
})
const svc = notificationService
await svc.notifyKanbanTaskEvent({
type: NotificationType.kanban_task_comment_created,
teamId: tm.id,
creatorId: u1.id,
kanbanTaskId: task.id,
stakeholderIds: [u1.id, u2.id],
commentMessage: `Hey <@${u3.id}> please check this`,
})
const notifications = await prisma.notification.findMany({
where: { kanbanTaskId: task.id },
orderBy: { id: 'asc' },
})
// u1 is actor, should not get notification.
// u2 is stakeholder, gets kanban_task_comment_created.
// u3 is mentioned, gets mention.
expect(notifications).toHaveLength(2)
const commentNotif = notifications.find(
(n) => n.type === NotificationType.kanban_task_comment_created,
)
expect(commentNotif?.userId).toBe(u2.id)
const mentionNotif = notifications.find((n) => n.type === NotificationType.mention)
expect(mentionNotif?.userId).toBe(u3.id)
})
it('filters kanban notifications based on user preferences', async () => {
const tm = await prisma.team.create({ data: { name: 'Team Settings' } })
const u1 = await prisma.user.create({
data: { name: 'U1', email: `u1-set-${Date.now()}@example.com`, password: 'p' },
})
await prisma.teamMember.create({
data: { teamId: tm.id, userId: u1.id, role: 'owner' },
})
const task = await prisma.kanbanTask.create({
data: { teamId: tm.id, creatorId: u1.id, title: 'Task' },
})
await prisma.notification.create({
data: {
teamId: tm.id,
type: NotificationType.kanban_task_created,
userId: u1.id,
kanbanTaskId: task.id,
},
})
await prisma.notification.create({
data: {
teamId: tm.id,
type: NotificationType.kanban_task_comment_created,
userId: u1.id,
kanbanTaskId: task.id,
},
})
const svc = notificationService
// By default both are enabled
const listDefault = await svc.list(tm.id, u1.id, {})
expect(listDefault.data).toHaveLength(2)
// Disable kanbanTasks
await userMetadataService.upsertMetadata(u1.id, tm.id, 'notification_settings', {
comments: true,
replies: true,
mentions: true,
yourUploads: false,
otherUploads: true,
statusUpdates: true,
kanbanTasks: false,
kanbanComments: true,
})
const listWithoutTasks = await svc.list(tm.id, u1.id, {})
expect(listWithoutTasks.data).toHaveLength(1)
expect(listWithoutTasks.data[0].type).toBe(NotificationType.kanban_task_comment_created)
})
})
+130 -7
View File
@@ -15,6 +15,74 @@ import { userMetadataService } from '@shumai/core/src/user-metadata/user-metadat
const mentionRegex = /<@([^>]+)>/g
export class NotificationService {
async notifyKanbanTaskEvent(params: {
type: NotificationType
teamId: string
projectId?: string | null
creatorId: string
kanbanTaskId?: string
stakeholderIds?: (string | null | undefined)[]
targetUserId?: string
commentMessage?: string
}) {
const recipients = new Set<string>()
if (params.targetUserId) {
recipients.add(params.targetUserId)
}
if (params.stakeholderIds) {
for (const id of params.stakeholderIds) {
if (id) recipients.add(id)
}
}
recipients.delete(params.creatorId)
const promises: Promise<void>[] = []
for (const recipientId of recipients) {
promises.push(
this.createAsync({
type: params.type,
teamId: params.teamId,
projectId: params.projectId ?? undefined,
creatorId: params.creatorId,
kanbanTaskId: params.kanbanTaskId,
userId: recipientId,
}),
)
}
if (params.commentMessage) {
const matches = [...params.commentMessage.matchAll(mentionRegex)]
const mentionedIds = new Set<string>()
for (const match of matches) {
if (match.length > 1) {
const userId = match[1]
if (mentionedIds.has(userId)) {
continue
}
mentionedIds.add(userId)
if (params.creatorId === userId) {
continue
}
promises.push(
this.createAsync({
type: NotificationType.mention,
teamId: params.teamId,
projectId: params.projectId ?? undefined,
creatorId: params.creatorId,
kanbanTaskId: params.kanbanTaskId,
userId: userId,
}),
)
}
}
}
await Promise.all(promises)
}
async create(req: CreateNotificationRequest) {
// Note: Do not await this, we fire and forget similarly to Go
this.createAsync(req).catch((err) => {
@@ -36,6 +104,16 @@ export class NotificationService {
}
}
// Resolve ProjectID from KanbanTaskId if missing
if (!projectId && req.kanbanTaskId) {
const task = await prisma.kanbanTask.findUnique({
where: { id: req.kanbanTaskId },
})
if (task?.projectId) {
projectId = task.projectId
}
}
// Check project notification settings
if (projectId) {
const project = await prisma.project.findUnique({
@@ -57,6 +135,7 @@ export class NotificationService {
creatorId: req.creatorId,
assetId: req.assetId,
taskId: req.taskId,
kanbanTaskId: req.kanbanTaskId,
userId: targetUserId,
},
})
@@ -71,7 +150,8 @@ export class NotificationService {
// 2. Handle Mentions for Comment/Reply types
if (
(req.type === NotificationType.comment_created ||
req.type === NotificationType.reply_created) &&
req.type === NotificationType.reply_created ||
req.type === NotificationType.kanban_task_comment_created) &&
req.commentMessage
) {
const matches = [...req.commentMessage.matchAll(mentionRegex)]
@@ -128,23 +208,25 @@ export class NotificationService {
yourUploads: false,
otherUploads: true,
statusUpdates: true,
kanbanTasks: true,
kanbanComments: true,
}
const typeConditions: Prisma.NotificationWhereInput[] = []
// 1. Comments
if (settings.comments) {
if (settings.comments ?? true) {
typeConditions.push({ type: NotificationType.comment_created, userId: null })
}
// 2. Replies
if (settings.replies) {
if (settings.replies ?? true) {
typeConditions.push({ type: NotificationType.reply_created, userId: userId })
typeConditions.push({ type: NotificationType.reply_created, userId: null })
}
// 3. Mentions
if (settings.mentions) {
if (settings.mentions ?? true) {
typeConditions.push({ type: NotificationType.mention, userId: userId })
}
@@ -161,11 +243,35 @@ export class NotificationService {
}
// 5. Status Updates
if (settings.statusUpdates) {
if (settings.statusUpdates ?? true) {
typeConditions.push({ type: NotificationType.metadata_field_updated_status })
}
// 6. Always include team/project join notifications
// 6. Kanban Tasks
if (settings.kanbanTasks ?? true) {
typeConditions.push({
type: {
in: [
NotificationType.kanban_task_created,
NotificationType.kanban_task_assigned,
NotificationType.kanban_task_status_updated,
NotificationType.kanban_task_updated,
NotificationType.kanban_task_deleted,
],
},
userId: userId,
})
}
// 7. Kanban Comments
if (settings.kanbanComments ?? true) {
typeConditions.push({
type: NotificationType.kanban_task_comment_created,
userId: userId,
})
}
// 8. Always include team/project join notifications
typeConditions.push({ type: NotificationType.new_user_join_team })
typeConditions.push({ type: NotificationType.new_user_join_project })
@@ -193,6 +299,7 @@ export class NotificationService {
{
OR: [
{ type: NotificationType.mention }, // Always allow mentions (targeted)
{ userId: userId }, // Direct targeted notifications (e.g. assigned, stakeholder)
{ projectId: { in: projectFilter } }, // Only show notifications for projects user is member of
],
},
@@ -270,6 +377,7 @@ export class NotificationService {
project: true,
asset: true,
user: true,
kanbanTask: true,
},
})
@@ -329,7 +437,14 @@ export class NotificationService {
private async toNotificationInfo(
n: Prisma.NotificationGetPayload<{
include: { creator: true; team: true; project: true; asset: true; user: true }
include: {
creator: true
team: true
project: true
asset: true
user: true
kanbanTask: true
}
}>,
lastRead: Prisma.NotificationGetPayload<Record<string, never>> | null,
): Promise<NotificationInfo> {
@@ -368,6 +483,14 @@ export class NotificationService {
}
}
if (n.kanbanTask) {
info.kanbanTask = {
id: n.kanbanTask.id,
title: n.kanbanTask.title,
status: n.kanbanTask.status,
}
}
if (n.asset) {
const a = n.asset
let previewUrl = ''
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/db",
"version": "0.3.9",
"version": "0.3.10",
"private": true,
"type": "module",
"main": "./src/index.ts",
@@ -0,0 +1,164 @@
-- CreateEnum
CREATE TYPE "KanbanTaskStatus" AS ENUM ('TODO', 'READY', 'IN_PROGRESS', 'BLOCKED', 'IN_REVIEW', 'DONE', 'CANCELLED');
-- CreateEnum
CREATE TYPE "KanbanTaskPriority" AS ENUM ('LOW', 'MEDIUM', 'HIGH', 'URGENT');
-- CreateEnum
CREATE TYPE "KanbanTaskEventType" AS ENUM ('CREATED', 'STATUS_CHANGED', 'ASSIGNED', 'UNASSIGNED', 'COMMENTED', 'CHANGES_REQUESTED', 'BLOCKED', 'UNBLOCKED', 'PRIORITY_CHANGED', 'GOAL_CHANGED', 'DEPENDENCY_ADDED', 'DEPENDENCY_REMOVED', 'CANCELLED');
-- CreateTable
CREATE TABLE "kanban_goals" (
"id" TEXT NOT NULL,
"title" TEXT NOT NULL,
"description" TEXT,
"team_id" TEXT NOT NULL,
"creator_id" TEXT,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
CONSTRAINT "kanban_goals_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "kanban_tasks" (
"id" TEXT NOT NULL,
"title" TEXT NOT NULL,
"description" TEXT,
"is_agent_task" BOOLEAN NOT NULL DEFAULT false,
"status" "KanbanTaskStatus" NOT NULL DEFAULT 'TODO',
"priority" "KanbanTaskPriority" NOT NULL DEFAULT 'MEDIUM',
"start_date" TIMESTAMP(3),
"due_date" TIMESTAMP(3),
"started_at" TIMESTAMP(3),
"completed_at" TIMESTAMP(3),
"goal_id" TEXT,
"team_id" TEXT NOT NULL,
"project_id" TEXT,
"creator_id" TEXT NOT NULL,
"reporter_id" TEXT,
"assignee_id" TEXT,
"target_folder_id" TEXT,
"sort_index" TEXT,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
CONSTRAINT "kanban_tasks_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "kanban_task_links" (
"parent_id" TEXT NOT NULL,
"child_id" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "kanban_task_links_pkey" PRIMARY KEY ("parent_id","child_id")
);
-- CreateTable
CREATE TABLE "kanban_task_comments" (
"id" TEXT NOT NULL,
"task_id" TEXT NOT NULL,
"author_id" TEXT NOT NULL,
"body" TEXT NOT NULL,
"attachments" JSONB,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
CONSTRAINT "kanban_task_comments_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "kanban_task_events" (
"id" TEXT NOT NULL,
"task_id" TEXT NOT NULL,
"actor_id" TEXT,
"type" "KanbanTaskEventType" NOT NULL,
"from_status" "KanbanTaskStatus",
"to_status" "KanbanTaskStatus",
"data" JSONB,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "kanban_task_events_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "kanban_goals_team_id_idx" ON "kanban_goals"("team_id");
-- CreateIndex
CREATE INDEX "kanban_tasks_team_id_status_idx" ON "kanban_tasks"("team_id", "status");
-- CreateIndex
CREATE INDEX "kanban_tasks_team_id_status_sort_index_idx" ON "kanban_tasks"("team_id", "status", "sort_index");
-- CreateIndex
CREATE INDEX "kanban_tasks_team_id_is_agent_task_status_idx" ON "kanban_tasks"("team_id", "is_agent_task", "status");
-- CreateIndex
CREATE INDEX "kanban_tasks_team_id_goal_id_status_idx" ON "kanban_tasks"("team_id", "goal_id", "status");
-- CreateIndex
CREATE INDEX "kanban_tasks_team_id_assignee_id_status_idx" ON "kanban_tasks"("team_id", "assignee_id", "status");
-- CreateIndex
CREATE INDEX "kanban_tasks_project_id_status_idx" ON "kanban_tasks"("project_id", "status");
-- CreateIndex
CREATE INDEX "kanban_tasks_sort_index_idx" ON "kanban_tasks"("sort_index");
-- CreateIndex
CREATE INDEX "kanban_task_links_child_id_idx" ON "kanban_task_links"("child_id");
-- CreateIndex
CREATE INDEX "kanban_task_comments_task_id_created_at_idx" ON "kanban_task_comments"("task_id", "created_at");
-- CreateIndex
CREATE INDEX "kanban_task_events_task_id_created_at_idx" ON "kanban_task_events"("task_id", "created_at");
-- CreateIndex
CREATE INDEX "kanban_task_events_actor_id_created_at_idx" ON "kanban_task_events"("actor_id", "created_at");
-- AddForeignKey
ALTER TABLE "kanban_goals" ADD CONSTRAINT "kanban_goals_team_id_fkey" FOREIGN KEY ("team_id") REFERENCES "teams"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_goals" ADD CONSTRAINT "kanban_goals_creator_id_fkey" FOREIGN KEY ("creator_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_goal_id_fkey" FOREIGN KEY ("goal_id") REFERENCES "kanban_goals"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_team_id_fkey" FOREIGN KEY ("team_id") REFERENCES "teams"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_project_id_fkey" FOREIGN KEY ("project_id") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_creator_id_fkey" FOREIGN KEY ("creator_id") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_reporter_id_fkey" FOREIGN KEY ("reporter_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_assignee_id_fkey" FOREIGN KEY ("assignee_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_tasks" ADD CONSTRAINT "kanban_tasks_target_folder_id_fkey" FOREIGN KEY ("target_folder_id") REFERENCES "assets"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_task_links" ADD CONSTRAINT "kanban_task_links_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_task_links" ADD CONSTRAINT "kanban_task_links_child_id_fkey" FOREIGN KEY ("child_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_task_comments" ADD CONSTRAINT "kanban_task_comments_task_id_fkey" FOREIGN KEY ("task_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_task_comments" ADD CONSTRAINT "kanban_task_comments_author_id_fkey" FOREIGN KEY ("author_id") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_task_events" ADD CONSTRAINT "kanban_task_events_task_id_fkey" FOREIGN KEY ("task_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_task_events" ADD CONSTRAINT "kanban_task_events_actor_id_fkey" FOREIGN KEY ("actor_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,26 @@
-- AlterEnum
-- This migration adds more than one value to an enum.
-- With PostgreSQL versions 11 and earlier, this is not possible
-- in a single migration. This can be worked around by creating
-- multiple migrations, each migration adding only one value to
-- the enum.
ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_created';
ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_assigned';
ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_status_updated';
ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_updated';
ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_deleted';
ALTER TYPE "NotificationType" ADD VALUE 'kanban_task_comment_created';
-- AlterEnum
ALTER TYPE "WorkflowTaskType" ADD VALUE 'kanban_agent_run';
-- AlterTable
ALTER TABLE "notifications" ADD COLUMN "kanban_task_id" TEXT;
-- CreateIndex
CREATE INDEX "notifications_kanban_task_id_idx" ON "notifications"("kanban_task_id");
-- AddForeignKey
ALTER TABLE "notifications" ADD CONSTRAINT "notifications_kanban_task_id_fkey" FOREIGN KEY ("kanban_task_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,10 @@
-- AlterTable: Change sort_index column collation to "C" on kanban_tasks
ALTER TABLE "kanban_tasks" ALTER COLUMN "sort_index" TYPE TEXT COLLATE "C";
-- Recreate index on sort_index with "C" collation
DROP INDEX IF EXISTS "kanban_tasks_sort_index_idx";
CREATE INDEX "kanban_tasks_sort_index_idx" ON "kanban_tasks" ("sort_index" COLLATE "C");
-- Recreate compound index with "C" collation
DROP INDEX IF EXISTS "kanban_tasks_team_id_status_sort_index_idx";
CREATE INDEX "kanban_tasks_team_id_status_sort_index_idx" ON "kanban_tasks" ("team_id", "status", "sort_index" COLLATE "C");
@@ -0,0 +1,17 @@
-- CreateTable
CREATE TABLE "kanban_task_assets" (
"task_id" TEXT NOT NULL,
"asset_id" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "kanban_task_assets_pkey" PRIMARY KEY ("task_id","asset_id")
);
-- CreateIndex
CREATE INDEX "kanban_task_assets_asset_id_idx" ON "kanban_task_assets"("asset_id");
-- AddForeignKey
ALTER TABLE "kanban_task_assets" ADD CONSTRAINT "kanban_task_assets_task_id_fkey" FOREIGN KEY ("task_id") REFERENCES "kanban_tasks"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "kanban_task_assets" ADD CONSTRAINT "kanban_task_assets_asset_id_fkey" FOREIGN KEY ("asset_id") REFERENCES "assets"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,28 @@
/*
Warnings:
- The values [CANCELLED] on the enum `KanbanTaskEventType` will be removed. If these variants are still used in the database, this will fail.
- The values [CANCELLED] on the enum `KanbanTaskStatus` will be removed. If these variants are still used in the database, this will fail.
*/
-- AlterEnum
BEGIN;
CREATE TYPE "KanbanTaskEventType_new" AS ENUM ('CREATED', 'STATUS_CHANGED', 'ASSIGNED', 'UNASSIGNED', 'COMMENTED', 'CHANGES_REQUESTED', 'BLOCKED', 'UNBLOCKED', 'PRIORITY_CHANGED', 'GOAL_CHANGED', 'DEPENDENCY_ADDED', 'DEPENDENCY_REMOVED');
ALTER TABLE "kanban_task_events" ALTER COLUMN "type" TYPE "KanbanTaskEventType_new" USING ("type"::text::"KanbanTaskEventType_new");
ALTER TYPE "KanbanTaskEventType" RENAME TO "KanbanTaskEventType_old";
ALTER TYPE "KanbanTaskEventType_new" RENAME TO "KanbanTaskEventType";
DROP TYPE "public"."KanbanTaskEventType_old";
COMMIT;
-- AlterEnum
BEGIN;
CREATE TYPE "KanbanTaskStatus_new" AS ENUM ('TODO', 'READY', 'IN_PROGRESS', 'BLOCKED', 'IN_REVIEW', 'DONE');
ALTER TABLE "public"."kanban_tasks" ALTER COLUMN "status" DROP DEFAULT;
ALTER TABLE "kanban_tasks" ALTER COLUMN "status" TYPE "KanbanTaskStatus_new" USING ("status"::text::"KanbanTaskStatus_new");
ALTER TABLE "kanban_task_events" ALTER COLUMN "from_status" TYPE "KanbanTaskStatus_new" USING ("from_status"::text::"KanbanTaskStatus_new");
ALTER TABLE "kanban_task_events" ALTER COLUMN "to_status" TYPE "KanbanTaskStatus_new" USING ("to_status"::text::"KanbanTaskStatus_new");
ALTER TYPE "KanbanTaskStatus" RENAME TO "KanbanTaskStatus_old";
ALTER TYPE "KanbanTaskStatus_new" RENAME TO "KanbanTaskStatus";
DROP TYPE "public"."KanbanTaskStatus_old";
ALTER TABLE "kanban_tasks" ALTER COLUMN "status" SET DEFAULT 'TODO';
COMMIT;
+187
View File
@@ -68,6 +68,12 @@ enum NotificationType {
metadata_field_updated_status
new_user_join_team
new_user_join_project
kanban_task_created
kanban_task_assigned
kanban_task_status_updated
kanban_task_updated
kanban_task_deleted
kanban_task_comment_created
}
enum ProjectMemberRole {
@@ -112,6 +118,7 @@ enum WorkflowTaskType {
ai_embedding
query_embedding_for_search
agent_tool_call
kanban_agent_run
}
enum WorkflowTaskStatus {
@@ -156,6 +163,37 @@ enum QuotaResourceType {
agent_tool_call_count
}
enum KanbanTaskStatus {
TODO
READY
IN_PROGRESS
BLOCKED
IN_REVIEW
DONE
}
enum KanbanTaskPriority {
LOW
MEDIUM
HIGH
URGENT
}
enum KanbanTaskEventType {
CREATED
STATUS_CHANGED
ASSIGNED
UNASSIGNED
COMMENTED
CHANGES_REQUESTED
BLOCKED
UNBLOCKED
PRIORITY_CHANGED
GOAL_CHANGED
DEPENDENCY_ADDED
DEPENDENCY_REMOVED
}
// ----------------------------------------------------------------------
// Models
// ----------------------------------------------------------------------
@@ -194,6 +232,12 @@ model User {
aiUsages AiUsage[] @relation("UserToAiUsage")
auditLogs AuditLog[] @relation("UserToAuditLog")
quotaRecords QuotaRecord[] @relation("UserToQuotaRecord")
kanbanTasksCreated KanbanTask[] @relation("KanbanTaskCreator")
kanbanTasksReported KanbanTask[] @relation("KanbanTaskReporter")
kanbanTasksAssigned KanbanTask[] @relation("KanbanTaskAssignee")
kanbanGoalsCreated KanbanGoal[] @relation("UserToKanbanGoal")
kanbanTaskComments KanbanTaskComment[]
kanbanTaskEvents KanbanTaskEvent[]
@@map("users")
}
@@ -282,6 +326,8 @@ model Team {
watermarkTemplates WatermarkTemplate[] @relation("TeamToWatermarkTemplate")
quotaRules QuotaRule[] @relation("TeamToQuotaRule")
quotaRecords QuotaRecord[] @relation("TeamToQuotaRecord")
kanbanGoals KanbanGoal[] @relation("TeamToKanbanGoal")
kanbanTasks KanbanTask[] @relation("TeamToKanbanTask")
@@map("teams")
}
@@ -367,6 +413,7 @@ model Project {
shareLinks ShareLink[] @relation("ProjectToShareLink")
collections Collection[] @relation("ProjectToCollection")
auditLogs AuditLog[] @relation("ProjectToAuditLog")
kanbanTasks KanbanTask[] @relation("ProjectToKanbanTask")
@@map("projects")
@@index([createdAt])
@@ -515,6 +562,8 @@ model Asset {
agentSessions AgentSession[] @relation("AssetToAgentSession")
watermarkFiles WatermarkFile[] @relation("AssetToWatermarkFile")
agentMd AssetAgentMd? @relation("AssetToAgentMd")
kanbanTargetTasks KanbanTask[] @relation("KanbanTaskTargetFolder")
kanbanTasks KanbanTaskAsset[]
@@map("assets")
@@index([type])
@@ -691,11 +740,15 @@ model Notification {
taskId String? @map("task_id")
task Task? @relation("TaskToNotification", fields: [taskId], references: [id])
kanbanTaskId String? @map("kanban_task_id")
kanbanTask KanbanTask? @relation("KanbanTaskToNotification", fields: [kanbanTaskId], references: [id], onDelete: Cascade)
userId String? @map("user_id")
user User? @relation("UserToNotification", fields: [userId], references: [id])
readByMembers TeamMember? @relation("TeamMemberToLastReadNotification")
@@index([kanbanTaskId])
@@map("notifications")
}
@@ -1087,4 +1140,138 @@ model QuotaRecord {
@@map("quota_records")
}
model KanbanGoal {
id String @id @default(ulid())
title String
description String? @db.Text
teamId String @map("team_id")
team Team @relation("TeamToKanbanGoal", fields: [teamId], references: [id], onDelete: Cascade)
creatorId String? @map("creator_id")
creator User? @relation("UserToKanbanGoal", fields: [creatorId], references: [id], onDelete: SetNull)
tasks KanbanTask[]
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@index([teamId])
@@map("kanban_goals")
}
model KanbanTask {
id String @id @default(ulid())
title String
description String? @db.Text
isAgentTask Boolean @default(false) @map("is_agent_task")
status KanbanTaskStatus @default(TODO)
priority KanbanTaskPriority @default(MEDIUM)
startDate DateTime? @map("start_date")
dueDate DateTime? @map("due_date")
startedAt DateTime? @map("started_at")
completedAt DateTime? @map("completed_at")
goalId String? @map("goal_id")
goal KanbanGoal? @relation(fields: [goalId], references: [id], onDelete: SetNull)
teamId String @map("team_id")
team Team @relation("TeamToKanbanTask", fields: [teamId], references: [id], onDelete: Cascade)
projectId String? @map("project_id")
project Project? @relation("ProjectToKanbanTask", fields: [projectId], references: [id], onDelete: Cascade)
creatorId String @map("creator_id")
creator User @relation("KanbanTaskCreator", fields: [creatorId], references: [id])
reporterId String? @map("reporter_id")
reporter User? @relation("KanbanTaskReporter", fields: [reporterId], references: [id])
assigneeId String? @map("assignee_id")
assignee User? @relation("KanbanTaskAssignee", fields: [assigneeId], references: [id])
targetFolderId String? @map("target_folder_id")
targetFolder Asset? @relation("KanbanTaskTargetFolder", fields: [targetFolderId], references: [id], onDelete: SetNull)
dependencies KanbanTaskLink[] @relation("ChildLinks")
dependents KanbanTaskLink[] @relation("ParentLinks")
assets KanbanTaskAsset[]
comments KanbanTaskComment[]
events KanbanTaskEvent[]
notifications Notification[] @relation("KanbanTaskToNotification")
sortIndex String? @map("sort_index")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@index([teamId, status])
@@index([teamId, status, sortIndex])
@@index([teamId, isAgentTask, status])
@@index([teamId, goalId, status])
@@index([teamId, assigneeId, status])
@@index([projectId, status])
@@index([sortIndex])
@@map("kanban_tasks")
}
model KanbanTaskLink {
parentId String @map("parent_id")
childId String @map("child_id")
parent KanbanTask @relation("ParentLinks", fields: [parentId], references: [id], onDelete: Cascade)
child KanbanTask @relation("ChildLinks", fields: [childId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at")
@@id([parentId, childId])
@@index([childId])
@@map("kanban_task_links")
}
model KanbanTaskAsset {
taskId String @map("task_id")
assetId String @map("asset_id")
task KanbanTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
asset Asset @relation(fields: [assetId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at")
@@id([taskId, assetId])
@@index([assetId])
@@map("kanban_task_assets")
}
model KanbanTaskComment {
id String @id @default(ulid())
taskId String @map("task_id")
task KanbanTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
authorId String @map("author_id")
author User @relation(fields: [authorId], references: [id])
body String @db.Text
/// [KanbanCommentAttachmentList]
attachments Json?
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@index([taskId, createdAt])
@@map("kanban_task_comments")
}
model KanbanTaskEvent {
id String @id @default(ulid())
taskId String @map("task_id")
task KanbanTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
actorId String? @map("actor_id")
actor User? @relation(fields: [actorId], references: [id])
type KanbanTaskEventType
fromStatus KanbanTaskStatus? @map("from_status")
toStatus KanbanTaskStatus? @map("to_status")
/// [KanbanEventPayload]
data Json?
createdAt DateTime @default(now()) @map("created_at")
@@index([taskId, createdAt])
@@index([actorId, createdAt])
@@map("kanban_task_events")
}
+30
View File
@@ -237,3 +237,33 @@ export type QuotaRule = Prisma.QuotaRuleModel
*
*/
export type QuotaRecord = Prisma.QuotaRecordModel
/**
* Model KanbanGoal
*
*/
export type KanbanGoal = Prisma.KanbanGoalModel
/**
* Model KanbanTask
*
*/
export type KanbanTask = Prisma.KanbanTaskModel
/**
* Model KanbanTaskLink
*
*/
export type KanbanTaskLink = Prisma.KanbanTaskLinkModel
/**
* Model KanbanTaskAsset
*
*/
export type KanbanTaskAsset = Prisma.KanbanTaskAssetModel
/**
* Model KanbanTaskComment
*
*/
export type KanbanTaskComment = Prisma.KanbanTaskCommentModel
/**
* Model KanbanTaskEvent
*
*/
export type KanbanTaskEvent = Prisma.KanbanTaskEventModel
+30
View File
@@ -261,3 +261,33 @@ export type QuotaRule = Prisma.QuotaRuleModel
*
*/
export type QuotaRecord = Prisma.QuotaRecordModel
/**
* Model KanbanGoal
*
*/
export type KanbanGoal = Prisma.KanbanGoalModel
/**
* Model KanbanTask
*
*/
export type KanbanTask = Prisma.KanbanTaskModel
/**
* Model KanbanTaskLink
*
*/
export type KanbanTaskLink = Prisma.KanbanTaskLinkModel
/**
* Model KanbanTaskAsset
*
*/
export type KanbanTaskAsset = Prisma.KanbanTaskAssetModel
/**
* Model KanbanTaskComment
*
*/
export type KanbanTaskComment = Prisma.KanbanTaskCommentModel
/**
* Model KanbanTaskEvent
*
*/
export type KanbanTaskEvent = Prisma.KanbanTaskEventModel
+136
View File
@@ -816,6 +816,74 @@ export type EnumQuotaPeriodWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedEnumQuotaPeriodFilter<$PrismaModel>
}
export type EnumKanbanTaskStatusFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskStatusFilter<$PrismaModel> | $Enums.KanbanTaskStatus
}
export type EnumKanbanTaskPriorityFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskPriority | Prisma.EnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskPriorityFilter<$PrismaModel> | $Enums.KanbanTaskPriority
}
export type EnumKanbanTaskStatusWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskStatusWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskStatus
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskStatusFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskStatusFilter<$PrismaModel>
}
export type EnumKanbanTaskPriorityWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskPriority | Prisma.EnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskPriorityWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskPriority
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskPriorityFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskPriorityFilter<$PrismaModel>
}
export type EnumKanbanTaskEventTypeFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskEventType | Prisma.EnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskEventTypeFilter<$PrismaModel> | $Enums.KanbanTaskEventType
}
export type EnumKanbanTaskStatusNullableFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
not?: Prisma.NestedEnumKanbanTaskStatusNullableFilter<$PrismaModel> | $Enums.KanbanTaskStatus | null
}
export type EnumKanbanTaskEventTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskEventType | Prisma.EnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskEventTypeWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskEventType
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskEventTypeFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskEventTypeFilter<$PrismaModel>
}
export type EnumKanbanTaskStatusNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
not?: Prisma.NestedEnumKanbanTaskStatusNullableWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskStatus | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskStatusNullableFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskStatusNullableFilter<$PrismaModel>
}
export type NestedStringFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
@@ -1553,4 +1621,72 @@ export type NestedEnumQuotaPeriodWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedEnumQuotaPeriodFilter<$PrismaModel>
}
export type NestedEnumKanbanTaskStatusFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskStatusFilter<$PrismaModel> | $Enums.KanbanTaskStatus
}
export type NestedEnumKanbanTaskPriorityFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskPriority | Prisma.EnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskPriorityFilter<$PrismaModel> | $Enums.KanbanTaskPriority
}
export type NestedEnumKanbanTaskStatusWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskStatusWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskStatus
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskStatusFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskStatusFilter<$PrismaModel>
}
export type NestedEnumKanbanTaskPriorityWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskPriority | Prisma.EnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskPriority[] | Prisma.ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskPriorityWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskPriority
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskPriorityFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskPriorityFilter<$PrismaModel>
}
export type NestedEnumKanbanTaskEventTypeFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskEventType | Prisma.EnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskEventTypeFilter<$PrismaModel> | $Enums.KanbanTaskEventType
}
export type NestedEnumKanbanTaskStatusNullableFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
not?: Prisma.NestedEnumKanbanTaskStatusNullableFilter<$PrismaModel> | $Enums.KanbanTaskStatus | null
}
export type NestedEnumKanbanTaskEventTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskEventType | Prisma.EnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
in?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
notIn?: $Enums.KanbanTaskEventType[] | Prisma.ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumKanbanTaskEventTypeWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskEventType
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskEventTypeFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskEventTypeFilter<$PrismaModel>
}
export type NestedEnumKanbanTaskStatusNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.KanbanTaskStatus | Prisma.EnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
in?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
notIn?: $Enums.KanbanTaskStatus[] | Prisma.ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> | null
not?: Prisma.NestedEnumKanbanTaskStatusNullableWithAggregatesFilter<$PrismaModel> | $Enums.KanbanTaskStatus | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedEnumKanbanTaskStatusNullableFilter<$PrismaModel>
_max?: Prisma.NestedEnumKanbanTaskStatusNullableFilter<$PrismaModel>
}
+49 -2
View File
@@ -75,7 +75,13 @@ export const NotificationType = {
successful_file_uploaded: 'successful_file_uploaded',
metadata_field_updated_status: 'metadata_field_updated_status',
new_user_join_team: 'new_user_join_team',
new_user_join_project: 'new_user_join_project'
new_user_join_project: 'new_user_join_project',
kanban_task_created: 'kanban_task_created',
kanban_task_assigned: 'kanban_task_assigned',
kanban_task_status_updated: 'kanban_task_status_updated',
kanban_task_updated: 'kanban_task_updated',
kanban_task_deleted: 'kanban_task_deleted',
kanban_task_comment_created: 'kanban_task_comment_created'
} as const
export type NotificationType = (typeof NotificationType)[keyof typeof NotificationType]
@@ -137,7 +143,8 @@ export const WorkflowTaskType = {
chat: 'chat',
ai_embedding: 'ai_embedding',
query_embedding_for_search: 'query_embedding_for_search',
agent_tool_call: 'agent_tool_call'
agent_tool_call: 'agent_tool_call',
kanban_agent_run: 'kanban_agent_run'
} as const
export type WorkflowTaskType = (typeof WorkflowTaskType)[keyof typeof WorkflowTaskType]
@@ -203,6 +210,46 @@ export const QuotaResourceType = {
export type QuotaResourceType = (typeof QuotaResourceType)[keyof typeof QuotaResourceType]
export const KanbanTaskStatus = {
TODO: 'TODO',
READY: 'READY',
IN_PROGRESS: 'IN_PROGRESS',
BLOCKED: 'BLOCKED',
IN_REVIEW: 'IN_REVIEW',
DONE: 'DONE'
} as const
export type KanbanTaskStatus = (typeof KanbanTaskStatus)[keyof typeof KanbanTaskStatus]
export const KanbanTaskPriority = {
LOW: 'LOW',
MEDIUM: 'MEDIUM',
HIGH: 'HIGH',
URGENT: 'URGENT'
} as const
export type KanbanTaskPriority = (typeof KanbanTaskPriority)[keyof typeof KanbanTaskPriority]
export const KanbanTaskEventType = {
CREATED: 'CREATED',
STATUS_CHANGED: 'STATUS_CHANGED',
ASSIGNED: 'ASSIGNED',
UNASSIGNED: 'UNASSIGNED',
COMMENTED: 'COMMENTED',
CHANGES_REQUESTED: 'CHANGES_REQUESTED',
BLOCKED: 'BLOCKED',
UNBLOCKED: 'UNBLOCKED',
PRIORITY_CHANGED: 'PRIORITY_CHANGED',
GOAL_CHANGED: 'GOAL_CHANGED',
DEPENDENCY_ADDED: 'DEPENDENCY_ADDED',
DEPENDENCY_REMOVED: 'DEPENDENCY_REMOVED'
} as const
export type KanbanTaskEventType = (typeof KanbanTaskEventType)[keyof typeof KanbanTaskEventType]
export const AgentType = {
chat: 'chat',
autofill: 'autofill',
File diff suppressed because one or more lines are too long
+585 -2
View File
@@ -427,7 +427,13 @@ export const ModelName = {
AiUsage: 'AiUsage',
AuditLog: 'AuditLog',
QuotaRule: 'QuotaRule',
QuotaRecord: 'QuotaRecord'
QuotaRecord: 'QuotaRecord',
KanbanGoal: 'KanbanGoal',
KanbanTask: 'KanbanTask',
KanbanTaskLink: 'KanbanTaskLink',
KanbanTaskAsset: 'KanbanTaskAsset',
KanbanTaskComment: 'KanbanTaskComment',
KanbanTaskEvent: 'KanbanTaskEvent'
} as const
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
@@ -443,7 +449,7 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
omit: GlobalOmitOptions
}
meta: {
modelProps: "user" | "session" | "account" | "verification" | "authToken" | "team" | "sandbox" | "skill" | "teamMember" | "project" | "projectMember" | "shareLink" | "watermarkConfig" | "watermarkTemplate" | "watermarkFile" | "asset" | "storageKey" | "assetMetadataValue" | "assetAgentMd" | "assetComment" | "assetCommentAttachment" | "assetEmbedding" | "invite" | "metadataField" | "notification" | "systemSettings" | "task" | "workflowTask" | "agent" | "agentSkill" | "mcpServer" | "agentMcpServer" | "mcpServerCredential" | "agentSession" | "agentSessionEntry" | "userMetadata" | "model" | "provider" | "collection" | "apiToken" | "aiUsage" | "auditLog" | "quotaRule" | "quotaRecord"
modelProps: "user" | "session" | "account" | "verification" | "authToken" | "team" | "sandbox" | "skill" | "teamMember" | "project" | "projectMember" | "shareLink" | "watermarkConfig" | "watermarkTemplate" | "watermarkFile" | "asset" | "storageKey" | "assetMetadataValue" | "assetAgentMd" | "assetComment" | "assetCommentAttachment" | "assetEmbedding" | "invite" | "metadataField" | "notification" | "systemSettings" | "task" | "workflowTask" | "agent" | "agentSkill" | "mcpServer" | "agentMcpServer" | "mcpServerCredential" | "agentSession" | "agentSessionEntry" | "userMetadata" | "model" | "provider" | "collection" | "apiToken" | "aiUsage" | "auditLog" | "quotaRule" | "quotaRecord" | "kanbanGoal" | "kanbanTask" | "kanbanTaskLink" | "kanbanTaskAsset" | "kanbanTaskComment" | "kanbanTaskEvent"
txIsolationLevel: TransactionIsolationLevel
}
model: {
@@ -3703,6 +3709,450 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
}
}
}
KanbanGoal: {
payload: Prisma.$KanbanGoalPayload<ExtArgs>
fields: Prisma.KanbanGoalFieldRefs
operations: {
findUnique: {
args: Prisma.KanbanGoalFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload> | null
}
findUniqueOrThrow: {
args: Prisma.KanbanGoalFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>
}
findFirst: {
args: Prisma.KanbanGoalFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload> | null
}
findFirstOrThrow: {
args: Prisma.KanbanGoalFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>
}
findMany: {
args: Prisma.KanbanGoalFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>[]
}
create: {
args: Prisma.KanbanGoalCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>
}
createMany: {
args: Prisma.KanbanGoalCreateManyArgs<ExtArgs>
result: BatchPayload
}
createManyAndReturn: {
args: Prisma.KanbanGoalCreateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>[]
}
delete: {
args: Prisma.KanbanGoalDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>
}
update: {
args: Prisma.KanbanGoalUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>
}
deleteMany: {
args: Prisma.KanbanGoalDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.KanbanGoalUpdateManyArgs<ExtArgs>
result: BatchPayload
}
updateManyAndReturn: {
args: Prisma.KanbanGoalUpdateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>[]
}
upsert: {
args: Prisma.KanbanGoalUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanGoalPayload>
}
aggregate: {
args: Prisma.KanbanGoalAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateKanbanGoal>
}
groupBy: {
args: Prisma.KanbanGoalGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanGoalGroupByOutputType>[]
}
count: {
args: Prisma.KanbanGoalCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanGoalCountAggregateOutputType> | number
}
}
}
KanbanTask: {
payload: Prisma.$KanbanTaskPayload<ExtArgs>
fields: Prisma.KanbanTaskFieldRefs
operations: {
findUnique: {
args: Prisma.KanbanTaskFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload> | null
}
findUniqueOrThrow: {
args: Prisma.KanbanTaskFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>
}
findFirst: {
args: Prisma.KanbanTaskFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload> | null
}
findFirstOrThrow: {
args: Prisma.KanbanTaskFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>
}
findMany: {
args: Prisma.KanbanTaskFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>[]
}
create: {
args: Prisma.KanbanTaskCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>
}
createMany: {
args: Prisma.KanbanTaskCreateManyArgs<ExtArgs>
result: BatchPayload
}
createManyAndReturn: {
args: Prisma.KanbanTaskCreateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>[]
}
delete: {
args: Prisma.KanbanTaskDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>
}
update: {
args: Prisma.KanbanTaskUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>
}
deleteMany: {
args: Prisma.KanbanTaskDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.KanbanTaskUpdateManyArgs<ExtArgs>
result: BatchPayload
}
updateManyAndReturn: {
args: Prisma.KanbanTaskUpdateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>[]
}
upsert: {
args: Prisma.KanbanTaskUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskPayload>
}
aggregate: {
args: Prisma.KanbanTaskAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateKanbanTask>
}
groupBy: {
args: Prisma.KanbanTaskGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskGroupByOutputType>[]
}
count: {
args: Prisma.KanbanTaskCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskCountAggregateOutputType> | number
}
}
}
KanbanTaskLink: {
payload: Prisma.$KanbanTaskLinkPayload<ExtArgs>
fields: Prisma.KanbanTaskLinkFieldRefs
operations: {
findUnique: {
args: Prisma.KanbanTaskLinkFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload> | null
}
findUniqueOrThrow: {
args: Prisma.KanbanTaskLinkFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>
}
findFirst: {
args: Prisma.KanbanTaskLinkFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload> | null
}
findFirstOrThrow: {
args: Prisma.KanbanTaskLinkFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>
}
findMany: {
args: Prisma.KanbanTaskLinkFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>[]
}
create: {
args: Prisma.KanbanTaskLinkCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>
}
createMany: {
args: Prisma.KanbanTaskLinkCreateManyArgs<ExtArgs>
result: BatchPayload
}
createManyAndReturn: {
args: Prisma.KanbanTaskLinkCreateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>[]
}
delete: {
args: Prisma.KanbanTaskLinkDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>
}
update: {
args: Prisma.KanbanTaskLinkUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>
}
deleteMany: {
args: Prisma.KanbanTaskLinkDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.KanbanTaskLinkUpdateManyArgs<ExtArgs>
result: BatchPayload
}
updateManyAndReturn: {
args: Prisma.KanbanTaskLinkUpdateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>[]
}
upsert: {
args: Prisma.KanbanTaskLinkUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskLinkPayload>
}
aggregate: {
args: Prisma.KanbanTaskLinkAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateKanbanTaskLink>
}
groupBy: {
args: Prisma.KanbanTaskLinkGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskLinkGroupByOutputType>[]
}
count: {
args: Prisma.KanbanTaskLinkCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskLinkCountAggregateOutputType> | number
}
}
}
KanbanTaskAsset: {
payload: Prisma.$KanbanTaskAssetPayload<ExtArgs>
fields: Prisma.KanbanTaskAssetFieldRefs
operations: {
findUnique: {
args: Prisma.KanbanTaskAssetFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload> | null
}
findUniqueOrThrow: {
args: Prisma.KanbanTaskAssetFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>
}
findFirst: {
args: Prisma.KanbanTaskAssetFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload> | null
}
findFirstOrThrow: {
args: Prisma.KanbanTaskAssetFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>
}
findMany: {
args: Prisma.KanbanTaskAssetFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>[]
}
create: {
args: Prisma.KanbanTaskAssetCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>
}
createMany: {
args: Prisma.KanbanTaskAssetCreateManyArgs<ExtArgs>
result: BatchPayload
}
createManyAndReturn: {
args: Prisma.KanbanTaskAssetCreateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>[]
}
delete: {
args: Prisma.KanbanTaskAssetDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>
}
update: {
args: Prisma.KanbanTaskAssetUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>
}
deleteMany: {
args: Prisma.KanbanTaskAssetDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.KanbanTaskAssetUpdateManyArgs<ExtArgs>
result: BatchPayload
}
updateManyAndReturn: {
args: Prisma.KanbanTaskAssetUpdateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>[]
}
upsert: {
args: Prisma.KanbanTaskAssetUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskAssetPayload>
}
aggregate: {
args: Prisma.KanbanTaskAssetAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateKanbanTaskAsset>
}
groupBy: {
args: Prisma.KanbanTaskAssetGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskAssetGroupByOutputType>[]
}
count: {
args: Prisma.KanbanTaskAssetCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskAssetCountAggregateOutputType> | number
}
}
}
KanbanTaskComment: {
payload: Prisma.$KanbanTaskCommentPayload<ExtArgs>
fields: Prisma.KanbanTaskCommentFieldRefs
operations: {
findUnique: {
args: Prisma.KanbanTaskCommentFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload> | null
}
findUniqueOrThrow: {
args: Prisma.KanbanTaskCommentFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>
}
findFirst: {
args: Prisma.KanbanTaskCommentFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload> | null
}
findFirstOrThrow: {
args: Prisma.KanbanTaskCommentFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>
}
findMany: {
args: Prisma.KanbanTaskCommentFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>[]
}
create: {
args: Prisma.KanbanTaskCommentCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>
}
createMany: {
args: Prisma.KanbanTaskCommentCreateManyArgs<ExtArgs>
result: BatchPayload
}
createManyAndReturn: {
args: Prisma.KanbanTaskCommentCreateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>[]
}
delete: {
args: Prisma.KanbanTaskCommentDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>
}
update: {
args: Prisma.KanbanTaskCommentUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>
}
deleteMany: {
args: Prisma.KanbanTaskCommentDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.KanbanTaskCommentUpdateManyArgs<ExtArgs>
result: BatchPayload
}
updateManyAndReturn: {
args: Prisma.KanbanTaskCommentUpdateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>[]
}
upsert: {
args: Prisma.KanbanTaskCommentUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskCommentPayload>
}
aggregate: {
args: Prisma.KanbanTaskCommentAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateKanbanTaskComment>
}
groupBy: {
args: Prisma.KanbanTaskCommentGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskCommentGroupByOutputType>[]
}
count: {
args: Prisma.KanbanTaskCommentCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskCommentCountAggregateOutputType> | number
}
}
}
KanbanTaskEvent: {
payload: Prisma.$KanbanTaskEventPayload<ExtArgs>
fields: Prisma.KanbanTaskEventFieldRefs
operations: {
findUnique: {
args: Prisma.KanbanTaskEventFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload> | null
}
findUniqueOrThrow: {
args: Prisma.KanbanTaskEventFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>
}
findFirst: {
args: Prisma.KanbanTaskEventFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload> | null
}
findFirstOrThrow: {
args: Prisma.KanbanTaskEventFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>
}
findMany: {
args: Prisma.KanbanTaskEventFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>[]
}
create: {
args: Prisma.KanbanTaskEventCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>
}
createMany: {
args: Prisma.KanbanTaskEventCreateManyArgs<ExtArgs>
result: BatchPayload
}
createManyAndReturn: {
args: Prisma.KanbanTaskEventCreateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>[]
}
delete: {
args: Prisma.KanbanTaskEventDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>
}
update: {
args: Prisma.KanbanTaskEventUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>
}
deleteMany: {
args: Prisma.KanbanTaskEventDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.KanbanTaskEventUpdateManyArgs<ExtArgs>
result: BatchPayload
}
updateManyAndReturn: {
args: Prisma.KanbanTaskEventUpdateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>[]
}
upsert: {
args: Prisma.KanbanTaskEventUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$KanbanTaskEventPayload>
}
aggregate: {
args: Prisma.KanbanTaskEventAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateKanbanTaskEvent>
}
groupBy: {
args: Prisma.KanbanTaskEventGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskEventGroupByOutputType>[]
}
count: {
args: Prisma.KanbanTaskEventCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.KanbanTaskEventCountAggregateOutputType> | number
}
}
}
}
} & {
other: {
@@ -4095,6 +4545,7 @@ export const NotificationScalarFieldEnum = {
creatorId: 'creatorId',
assetId: 'assetId',
taskId: 'taskId',
kanbanTaskId: 'kanbanTaskId',
userId: 'userId'
} as const
@@ -4383,6 +4834,90 @@ export const QuotaRecordScalarFieldEnum = {
export type QuotaRecordScalarFieldEnum = (typeof QuotaRecordScalarFieldEnum)[keyof typeof QuotaRecordScalarFieldEnum]
export const KanbanGoalScalarFieldEnum = {
id: 'id',
title: 'title',
description: 'description',
teamId: 'teamId',
creatorId: 'creatorId',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type KanbanGoalScalarFieldEnum = (typeof KanbanGoalScalarFieldEnum)[keyof typeof KanbanGoalScalarFieldEnum]
export const KanbanTaskScalarFieldEnum = {
id: 'id',
title: 'title',
description: 'description',
isAgentTask: 'isAgentTask',
status: 'status',
priority: 'priority',
startDate: 'startDate',
dueDate: 'dueDate',
startedAt: 'startedAt',
completedAt: 'completedAt',
goalId: 'goalId',
teamId: 'teamId',
projectId: 'projectId',
creatorId: 'creatorId',
reporterId: 'reporterId',
assigneeId: 'assigneeId',
targetFolderId: 'targetFolderId',
sortIndex: 'sortIndex',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type KanbanTaskScalarFieldEnum = (typeof KanbanTaskScalarFieldEnum)[keyof typeof KanbanTaskScalarFieldEnum]
export const KanbanTaskLinkScalarFieldEnum = {
parentId: 'parentId',
childId: 'childId',
createdAt: 'createdAt'
} as const
export type KanbanTaskLinkScalarFieldEnum = (typeof KanbanTaskLinkScalarFieldEnum)[keyof typeof KanbanTaskLinkScalarFieldEnum]
export const KanbanTaskAssetScalarFieldEnum = {
taskId: 'taskId',
assetId: 'assetId',
createdAt: 'createdAt'
} as const
export type KanbanTaskAssetScalarFieldEnum = (typeof KanbanTaskAssetScalarFieldEnum)[keyof typeof KanbanTaskAssetScalarFieldEnum]
export const KanbanTaskCommentScalarFieldEnum = {
id: 'id',
taskId: 'taskId',
authorId: 'authorId',
body: 'body',
attachments: 'attachments',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type KanbanTaskCommentScalarFieldEnum = (typeof KanbanTaskCommentScalarFieldEnum)[keyof typeof KanbanTaskCommentScalarFieldEnum]
export const KanbanTaskEventScalarFieldEnum = {
id: 'id',
taskId: 'taskId',
actorId: 'actorId',
type: 'type',
fromStatus: 'fromStatus',
toStatus: 'toStatus',
data: 'data',
createdAt: 'createdAt'
} as const
export type KanbanTaskEventScalarFieldEnum = (typeof KanbanTaskEventScalarFieldEnum)[keyof typeof KanbanTaskEventScalarFieldEnum]
export const SortOrder = {
asc: 'asc',
desc: 'desc'
@@ -4835,6 +5370,48 @@ export type EnumQuotaPeriodFieldRefInput<$PrismaModel> = FieldRefInputType<$Pris
export type ListEnumQuotaPeriodFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'QuotaPeriod[]'>
/**
* Reference to a field of type 'KanbanTaskStatus'
*/
export type EnumKanbanTaskStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'KanbanTaskStatus'>
/**
* Reference to a field of type 'KanbanTaskStatus[]'
*/
export type ListEnumKanbanTaskStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'KanbanTaskStatus[]'>
/**
* Reference to a field of type 'KanbanTaskPriority'
*/
export type EnumKanbanTaskPriorityFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'KanbanTaskPriority'>
/**
* Reference to a field of type 'KanbanTaskPriority[]'
*/
export type ListEnumKanbanTaskPriorityFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'KanbanTaskPriority[]'>
/**
* Reference to a field of type 'KanbanTaskEventType'
*/
export type EnumKanbanTaskEventTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'KanbanTaskEventType'>
/**
* Reference to a field of type 'KanbanTaskEventType[]'
*/
export type ListEnumKanbanTaskEventTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'KanbanTaskEventType[]'>
/**
* Batch Payload for updateMany & deleteMany & createMany
*/
@@ -4989,6 +5566,12 @@ export type GlobalOmitConfig = {
auditLog?: Prisma.AuditLogOmit
quotaRule?: Prisma.QuotaRuleOmit
quotaRecord?: Prisma.QuotaRecordOmit
kanbanGoal?: Prisma.KanbanGoalOmit
kanbanTask?: Prisma.KanbanTaskOmit
kanbanTaskLink?: Prisma.KanbanTaskLinkOmit
kanbanTaskAsset?: Prisma.KanbanTaskAssetOmit
kanbanTaskComment?: Prisma.KanbanTaskCommentOmit
kanbanTaskEvent?: Prisma.KanbanTaskEventOmit
}
/* Types for Logging */
@@ -94,7 +94,13 @@ export const ModelName = {
AiUsage: 'AiUsage',
AuditLog: 'AuditLog',
QuotaRule: 'QuotaRule',
QuotaRecord: 'QuotaRecord'
QuotaRecord: 'QuotaRecord',
KanbanGoal: 'KanbanGoal',
KanbanTask: 'KanbanTask',
KanbanTaskLink: 'KanbanTaskLink',
KanbanTaskAsset: 'KanbanTaskAsset',
KanbanTaskComment: 'KanbanTaskComment',
KanbanTaskEvent: 'KanbanTaskEvent'
} as const
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
@@ -466,6 +472,7 @@ export const NotificationScalarFieldEnum = {
creatorId: 'creatorId',
assetId: 'assetId',
taskId: 'taskId',
kanbanTaskId: 'kanbanTaskId',
userId: 'userId'
} as const
@@ -754,6 +761,90 @@ export const QuotaRecordScalarFieldEnum = {
export type QuotaRecordScalarFieldEnum = (typeof QuotaRecordScalarFieldEnum)[keyof typeof QuotaRecordScalarFieldEnum]
export const KanbanGoalScalarFieldEnum = {
id: 'id',
title: 'title',
description: 'description',
teamId: 'teamId',
creatorId: 'creatorId',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type KanbanGoalScalarFieldEnum = (typeof KanbanGoalScalarFieldEnum)[keyof typeof KanbanGoalScalarFieldEnum]
export const KanbanTaskScalarFieldEnum = {
id: 'id',
title: 'title',
description: 'description',
isAgentTask: 'isAgentTask',
status: 'status',
priority: 'priority',
startDate: 'startDate',
dueDate: 'dueDate',
startedAt: 'startedAt',
completedAt: 'completedAt',
goalId: 'goalId',
teamId: 'teamId',
projectId: 'projectId',
creatorId: 'creatorId',
reporterId: 'reporterId',
assigneeId: 'assigneeId',
targetFolderId: 'targetFolderId',
sortIndex: 'sortIndex',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type KanbanTaskScalarFieldEnum = (typeof KanbanTaskScalarFieldEnum)[keyof typeof KanbanTaskScalarFieldEnum]
export const KanbanTaskLinkScalarFieldEnum = {
parentId: 'parentId',
childId: 'childId',
createdAt: 'createdAt'
} as const
export type KanbanTaskLinkScalarFieldEnum = (typeof KanbanTaskLinkScalarFieldEnum)[keyof typeof KanbanTaskLinkScalarFieldEnum]
export const KanbanTaskAssetScalarFieldEnum = {
taskId: 'taskId',
assetId: 'assetId',
createdAt: 'createdAt'
} as const
export type KanbanTaskAssetScalarFieldEnum = (typeof KanbanTaskAssetScalarFieldEnum)[keyof typeof KanbanTaskAssetScalarFieldEnum]
export const KanbanTaskCommentScalarFieldEnum = {
id: 'id',
taskId: 'taskId',
authorId: 'authorId',
body: 'body',
attachments: 'attachments',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type KanbanTaskCommentScalarFieldEnum = (typeof KanbanTaskCommentScalarFieldEnum)[keyof typeof KanbanTaskCommentScalarFieldEnum]
export const KanbanTaskEventScalarFieldEnum = {
id: 'id',
taskId: 'taskId',
actorId: 'actorId',
type: 'type',
fromStatus: 'fromStatus',
toStatus: 'toStatus',
data: 'data',
createdAt: 'createdAt'
} as const
export type KanbanTaskEventScalarFieldEnum = (typeof KanbanTaskEventScalarFieldEnum)[keyof typeof KanbanTaskEventScalarFieldEnum]
export const SortOrder = {
asc: 'asc',
desc: 'desc'
+6
View File
@@ -52,4 +52,10 @@ export type * from './models/AiUsage.ts'
export type * from './models/AuditLog.ts'
export type * from './models/QuotaRule.ts'
export type * from './models/QuotaRecord.ts'
export type * from './models/KanbanGoal.ts'
export type * from './models/KanbanTask.ts'
export type * from './models/KanbanTaskLink.ts'
export type * from './models/KanbanTaskAsset.ts'
export type * from './models/KanbanTaskComment.ts'
export type * from './models/KanbanTaskEvent.ts'
export type * from './commonInputTypes.ts'
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+249 -1
View File
@@ -36,6 +36,7 @@ export type NotificationMinAggregateOutputType = {
creatorId: string | null
assetId: string | null
taskId: string | null
kanbanTaskId: string | null
userId: string | null
}
@@ -49,6 +50,7 @@ export type NotificationMaxAggregateOutputType = {
creatorId: string | null
assetId: string | null
taskId: string | null
kanbanTaskId: string | null
userId: string | null
}
@@ -62,6 +64,7 @@ export type NotificationCountAggregateOutputType = {
creatorId: number
assetId: number
taskId: number
kanbanTaskId: number
userId: number
_all: number
}
@@ -77,6 +80,7 @@ export type NotificationMinAggregateInputType = {
creatorId?: true
assetId?: true
taskId?: true
kanbanTaskId?: true
userId?: true
}
@@ -90,6 +94,7 @@ export type NotificationMaxAggregateInputType = {
creatorId?: true
assetId?: true
taskId?: true
kanbanTaskId?: true
userId?: true
}
@@ -103,6 +108,7 @@ export type NotificationCountAggregateInputType = {
creatorId?: true
assetId?: true
taskId?: true
kanbanTaskId?: true
userId?: true
_all?: true
}
@@ -189,6 +195,7 @@ export type NotificationGroupByOutputType = {
creatorId: string | null
assetId: string | null
taskId: string | null
kanbanTaskId: string | null
userId: string | null
_count: NotificationCountAggregateOutputType | null
_min: NotificationMinAggregateOutputType | null
@@ -223,12 +230,14 @@ export type NotificationWhereInput = {
creatorId?: Prisma.StringNullableFilter<"Notification"> | string | null
assetId?: Prisma.StringNullableFilter<"Notification"> | string | null
taskId?: Prisma.StringNullableFilter<"Notification"> | string | null
kanbanTaskId?: Prisma.StringNullableFilter<"Notification"> | string | null
userId?: Prisma.StringNullableFilter<"Notification"> | string | null
team?: Prisma.XOR<Prisma.TeamScalarRelationFilter, Prisma.TeamWhereInput>
project?: Prisma.XOR<Prisma.ProjectNullableScalarRelationFilter, Prisma.ProjectWhereInput> | null
creator?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
asset?: Prisma.XOR<Prisma.AssetNullableScalarRelationFilter, Prisma.AssetWhereInput> | null
task?: Prisma.XOR<Prisma.TaskNullableScalarRelationFilter, Prisma.TaskWhereInput> | null
kanbanTask?: Prisma.XOR<Prisma.KanbanTaskNullableScalarRelationFilter, Prisma.KanbanTaskWhereInput> | null
user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
readByMembers?: Prisma.XOR<Prisma.TeamMemberNullableScalarRelationFilter, Prisma.TeamMemberWhereInput> | null
}
@@ -243,12 +252,14 @@ export type NotificationOrderByWithRelationInput = {
creatorId?: Prisma.SortOrderInput | Prisma.SortOrder
assetId?: Prisma.SortOrderInput | Prisma.SortOrder
taskId?: Prisma.SortOrderInput | Prisma.SortOrder
kanbanTaskId?: Prisma.SortOrderInput | Prisma.SortOrder
userId?: Prisma.SortOrderInput | Prisma.SortOrder
team?: Prisma.TeamOrderByWithRelationInput
project?: Prisma.ProjectOrderByWithRelationInput
creator?: Prisma.UserOrderByWithRelationInput
asset?: Prisma.AssetOrderByWithRelationInput
task?: Prisma.TaskOrderByWithRelationInput
kanbanTask?: Prisma.KanbanTaskOrderByWithRelationInput
user?: Prisma.UserOrderByWithRelationInput
readByMembers?: Prisma.TeamMemberOrderByWithRelationInput
}
@@ -266,12 +277,14 @@ export type NotificationWhereUniqueInput = Prisma.AtLeast<{
creatorId?: Prisma.StringNullableFilter<"Notification"> | string | null
assetId?: Prisma.StringNullableFilter<"Notification"> | string | null
taskId?: Prisma.StringNullableFilter<"Notification"> | string | null
kanbanTaskId?: Prisma.StringNullableFilter<"Notification"> | string | null
userId?: Prisma.StringNullableFilter<"Notification"> | string | null
team?: Prisma.XOR<Prisma.TeamScalarRelationFilter, Prisma.TeamWhereInput>
project?: Prisma.XOR<Prisma.ProjectNullableScalarRelationFilter, Prisma.ProjectWhereInput> | null
creator?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
asset?: Prisma.XOR<Prisma.AssetNullableScalarRelationFilter, Prisma.AssetWhereInput> | null
task?: Prisma.XOR<Prisma.TaskNullableScalarRelationFilter, Prisma.TaskWhereInput> | null
kanbanTask?: Prisma.XOR<Prisma.KanbanTaskNullableScalarRelationFilter, Prisma.KanbanTaskWhereInput> | null
user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
readByMembers?: Prisma.XOR<Prisma.TeamMemberNullableScalarRelationFilter, Prisma.TeamMemberWhereInput> | null
}, "id">
@@ -286,6 +299,7 @@ export type NotificationOrderByWithAggregationInput = {
creatorId?: Prisma.SortOrderInput | Prisma.SortOrder
assetId?: Prisma.SortOrderInput | Prisma.SortOrder
taskId?: Prisma.SortOrderInput | Prisma.SortOrder
kanbanTaskId?: Prisma.SortOrderInput | Prisma.SortOrder
userId?: Prisma.SortOrderInput | Prisma.SortOrder
_count?: Prisma.NotificationCountOrderByAggregateInput
_max?: Prisma.NotificationMaxOrderByAggregateInput
@@ -305,6 +319,7 @@ export type NotificationScalarWhereWithAggregatesInput = {
creatorId?: Prisma.StringNullableWithAggregatesFilter<"Notification"> | string | null
assetId?: Prisma.StringNullableWithAggregatesFilter<"Notification"> | string | null
taskId?: Prisma.StringNullableWithAggregatesFilter<"Notification"> | string | null
kanbanTaskId?: Prisma.StringNullableWithAggregatesFilter<"Notification"> | string | null
userId?: Prisma.StringNullableWithAggregatesFilter<"Notification"> | string | null
}
@@ -318,6 +333,7 @@ export type NotificationCreateInput = {
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
@@ -332,6 +348,7 @@ export type NotificationUncheckedCreateInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
@@ -346,6 +363,7 @@ export type NotificationUpdateInput = {
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -360,6 +378,7 @@ export type NotificationUncheckedUpdateInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -374,6 +393,7 @@ export type NotificationCreateManyInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
}
@@ -394,6 +414,7 @@ export type NotificationUncheckedUpdateManyInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
@@ -422,6 +443,7 @@ export type NotificationCountOrderByAggregateInput = {
creatorId?: Prisma.SortOrder
assetId?: Prisma.SortOrder
taskId?: Prisma.SortOrder
kanbanTaskId?: Prisma.SortOrder
userId?: Prisma.SortOrder
}
@@ -435,6 +457,7 @@ export type NotificationMaxOrderByAggregateInput = {
creatorId?: Prisma.SortOrder
assetId?: Prisma.SortOrder
taskId?: Prisma.SortOrder
kanbanTaskId?: Prisma.SortOrder
userId?: Prisma.SortOrder
}
@@ -448,6 +471,7 @@ export type NotificationMinOrderByAggregateInput = {
creatorId?: Prisma.SortOrder
assetId?: Prisma.SortOrder
taskId?: Prisma.SortOrder
kanbanTaskId?: Prisma.SortOrder
userId?: Prisma.SortOrder
}
@@ -723,6 +747,48 @@ export type NotificationUncheckedUpdateManyWithoutTaskNestedInput = {
deleteMany?: Prisma.NotificationScalarWhereInput | Prisma.NotificationScalarWhereInput[]
}
export type NotificationCreateNestedManyWithoutKanbanTaskInput = {
create?: Prisma.XOR<Prisma.NotificationCreateWithoutKanbanTaskInput, Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput> | Prisma.NotificationCreateWithoutKanbanTaskInput[] | Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput[]
connectOrCreate?: Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput | Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput[]
createMany?: Prisma.NotificationCreateManyKanbanTaskInputEnvelope
connect?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
}
export type NotificationUncheckedCreateNestedManyWithoutKanbanTaskInput = {
create?: Prisma.XOR<Prisma.NotificationCreateWithoutKanbanTaskInput, Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput> | Prisma.NotificationCreateWithoutKanbanTaskInput[] | Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput[]
connectOrCreate?: Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput | Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput[]
createMany?: Prisma.NotificationCreateManyKanbanTaskInputEnvelope
connect?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
}
export type NotificationUpdateManyWithoutKanbanTaskNestedInput = {
create?: Prisma.XOR<Prisma.NotificationCreateWithoutKanbanTaskInput, Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput> | Prisma.NotificationCreateWithoutKanbanTaskInput[] | Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput[]
connectOrCreate?: Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput | Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput[]
upsert?: Prisma.NotificationUpsertWithWhereUniqueWithoutKanbanTaskInput | Prisma.NotificationUpsertWithWhereUniqueWithoutKanbanTaskInput[]
createMany?: Prisma.NotificationCreateManyKanbanTaskInputEnvelope
set?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
disconnect?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
delete?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
connect?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
update?: Prisma.NotificationUpdateWithWhereUniqueWithoutKanbanTaskInput | Prisma.NotificationUpdateWithWhereUniqueWithoutKanbanTaskInput[]
updateMany?: Prisma.NotificationUpdateManyWithWhereWithoutKanbanTaskInput | Prisma.NotificationUpdateManyWithWhereWithoutKanbanTaskInput[]
deleteMany?: Prisma.NotificationScalarWhereInput | Prisma.NotificationScalarWhereInput[]
}
export type NotificationUncheckedUpdateManyWithoutKanbanTaskNestedInput = {
create?: Prisma.XOR<Prisma.NotificationCreateWithoutKanbanTaskInput, Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput> | Prisma.NotificationCreateWithoutKanbanTaskInput[] | Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput[]
connectOrCreate?: Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput | Prisma.NotificationCreateOrConnectWithoutKanbanTaskInput[]
upsert?: Prisma.NotificationUpsertWithWhereUniqueWithoutKanbanTaskInput | Prisma.NotificationUpsertWithWhereUniqueWithoutKanbanTaskInput[]
createMany?: Prisma.NotificationCreateManyKanbanTaskInputEnvelope
set?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
disconnect?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
delete?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
connect?: Prisma.NotificationWhereUniqueInput | Prisma.NotificationWhereUniqueInput[]
update?: Prisma.NotificationUpdateWithWhereUniqueWithoutKanbanTaskInput | Prisma.NotificationUpdateWithWhereUniqueWithoutKanbanTaskInput[]
updateMany?: Prisma.NotificationUpdateManyWithWhereWithoutKanbanTaskInput | Prisma.NotificationUpdateManyWithWhereWithoutKanbanTaskInput[]
deleteMany?: Prisma.NotificationScalarWhereInput | Prisma.NotificationScalarWhereInput[]
}
export type NotificationCreateWithoutCreatorInput = {
id?: string
type?: $Enums.NotificationType | null
@@ -732,6 +798,7 @@ export type NotificationCreateWithoutCreatorInput = {
project?: Prisma.ProjectCreateNestedOneWithoutNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
@@ -745,6 +812,7 @@ export type NotificationUncheckedCreateWithoutCreatorInput = {
projectId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
@@ -769,6 +837,7 @@ export type NotificationCreateWithoutUserInput = {
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
@@ -782,6 +851,7 @@ export type NotificationUncheckedCreateWithoutUserInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
@@ -824,6 +894,7 @@ export type NotificationScalarWhereInput = {
creatorId?: Prisma.StringNullableFilter<"Notification"> | string | null
assetId?: Prisma.StringNullableFilter<"Notification"> | string | null
taskId?: Prisma.StringNullableFilter<"Notification"> | string | null
kanbanTaskId?: Prisma.StringNullableFilter<"Notification"> | string | null
userId?: Prisma.StringNullableFilter<"Notification"> | string | null
}
@@ -852,6 +923,7 @@ export type NotificationCreateWithoutTeamInput = {
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
@@ -865,6 +937,7 @@ export type NotificationUncheckedCreateWithoutTeamInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
@@ -905,6 +978,7 @@ export type NotificationCreateWithoutReadByMembersInput = {
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
}
@@ -918,6 +992,7 @@ export type NotificationUncheckedCreateWithoutReadByMembersInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
}
@@ -947,6 +1022,7 @@ export type NotificationUpdateWithoutReadByMembersInput = {
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
}
@@ -960,6 +1036,7 @@ export type NotificationUncheckedUpdateWithoutReadByMembersInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
@@ -972,6 +1049,7 @@ export type NotificationCreateWithoutProjectInput = {
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
@@ -985,6 +1063,7 @@ export type NotificationUncheckedCreateWithoutProjectInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
@@ -1024,6 +1103,7 @@ export type NotificationCreateWithoutAssetInput = {
project?: Prisma.ProjectCreateNestedOneWithoutNotificationsInput
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
@@ -1037,6 +1117,7 @@ export type NotificationUncheckedCreateWithoutAssetInput = {
projectId?: string | null
creatorId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
@@ -1076,6 +1157,7 @@ export type NotificationCreateWithoutTaskInput = {
project?: Prisma.ProjectCreateNestedOneWithoutNotificationsInput
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
kanbanTask?: Prisma.KanbanTaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
@@ -1089,6 +1171,7 @@ export type NotificationUncheckedCreateWithoutTaskInput = {
projectId?: string | null
creatorId?: string | null
assetId?: string | null
kanbanTaskId?: string | null
userId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
@@ -1119,6 +1202,60 @@ export type NotificationUpdateManyWithWhereWithoutTaskInput = {
data: Prisma.XOR<Prisma.NotificationUpdateManyMutationInput, Prisma.NotificationUncheckedUpdateManyWithoutTaskInput>
}
export type NotificationCreateWithoutKanbanTaskInput = {
id?: string
type?: $Enums.NotificationType | null
createdAt?: Date | string
updatedAt?: Date | string
team: Prisma.TeamCreateNestedOneWithoutNotificationsInput
project?: Prisma.ProjectCreateNestedOneWithoutNotificationsInput
creator?: Prisma.UserCreateNestedOneWithoutCreatedNotificationsInput
asset?: Prisma.AssetCreateNestedOneWithoutNotificationsInput
task?: Prisma.TaskCreateNestedOneWithoutNotificationsInput
user?: Prisma.UserCreateNestedOneWithoutNotificationsInput
readByMembers?: Prisma.TeamMemberCreateNestedOneWithoutLastReadNotificationInput
}
export type NotificationUncheckedCreateWithoutKanbanTaskInput = {
id?: string
type?: $Enums.NotificationType | null
createdAt?: Date | string
updatedAt?: Date | string
teamId: string
projectId?: string | null
creatorId?: string | null
assetId?: string | null
taskId?: string | null
userId?: string | null
readByMembers?: Prisma.TeamMemberUncheckedCreateNestedOneWithoutLastReadNotificationInput
}
export type NotificationCreateOrConnectWithoutKanbanTaskInput = {
where: Prisma.NotificationWhereUniqueInput
create: Prisma.XOR<Prisma.NotificationCreateWithoutKanbanTaskInput, Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput>
}
export type NotificationCreateManyKanbanTaskInputEnvelope = {
data: Prisma.NotificationCreateManyKanbanTaskInput | Prisma.NotificationCreateManyKanbanTaskInput[]
skipDuplicates?: boolean
}
export type NotificationUpsertWithWhereUniqueWithoutKanbanTaskInput = {
where: Prisma.NotificationWhereUniqueInput
update: Prisma.XOR<Prisma.NotificationUpdateWithoutKanbanTaskInput, Prisma.NotificationUncheckedUpdateWithoutKanbanTaskInput>
create: Prisma.XOR<Prisma.NotificationCreateWithoutKanbanTaskInput, Prisma.NotificationUncheckedCreateWithoutKanbanTaskInput>
}
export type NotificationUpdateWithWhereUniqueWithoutKanbanTaskInput = {
where: Prisma.NotificationWhereUniqueInput
data: Prisma.XOR<Prisma.NotificationUpdateWithoutKanbanTaskInput, Prisma.NotificationUncheckedUpdateWithoutKanbanTaskInput>
}
export type NotificationUpdateManyWithWhereWithoutKanbanTaskInput = {
where: Prisma.NotificationScalarWhereInput
data: Prisma.XOR<Prisma.NotificationUpdateManyMutationInput, Prisma.NotificationUncheckedUpdateManyWithoutKanbanTaskInput>
}
export type NotificationCreateManyCreatorInput = {
id?: string
type?: $Enums.NotificationType | null
@@ -1128,6 +1265,7 @@ export type NotificationCreateManyCreatorInput = {
projectId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
}
@@ -1141,6 +1279,7 @@ export type NotificationCreateManyUserInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
}
export type NotificationUpdateWithoutCreatorInput = {
@@ -1152,6 +1291,7 @@ export type NotificationUpdateWithoutCreatorInput = {
project?: Prisma.ProjectUpdateOneWithoutNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1165,6 +1305,7 @@ export type NotificationUncheckedUpdateWithoutCreatorInput = {
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1178,6 +1319,7 @@ export type NotificationUncheckedUpdateManyWithoutCreatorInput = {
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
@@ -1191,6 +1333,7 @@ export type NotificationUpdateWithoutUserInput = {
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1204,6 +1347,7 @@ export type NotificationUncheckedUpdateWithoutUserInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1217,6 +1361,7 @@ export type NotificationUncheckedUpdateManyWithoutUserInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
export type NotificationCreateManyTeamInput = {
@@ -1228,6 +1373,7 @@ export type NotificationCreateManyTeamInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
}
@@ -1240,6 +1386,7 @@ export type NotificationUpdateWithoutTeamInput = {
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1253,6 +1400,7 @@ export type NotificationUncheckedUpdateWithoutTeamInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1266,6 +1414,7 @@ export type NotificationUncheckedUpdateManyWithoutTeamInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
@@ -1278,6 +1427,7 @@ export type NotificationCreateManyProjectInput = {
creatorId?: string | null
assetId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
}
@@ -1290,6 +1440,7 @@ export type NotificationUpdateWithoutProjectInput = {
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1303,6 +1454,7 @@ export type NotificationUncheckedUpdateWithoutProjectInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1316,6 +1468,7 @@ export type NotificationUncheckedUpdateManyWithoutProjectInput = {
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
@@ -1328,6 +1481,7 @@ export type NotificationCreateManyAssetInput = {
projectId?: string | null
creatorId?: string | null
taskId?: string | null
kanbanTaskId?: string | null
userId?: string | null
}
@@ -1340,6 +1494,7 @@ export type NotificationUpdateWithoutAssetInput = {
project?: Prisma.ProjectUpdateOneWithoutNotificationsNestedInput
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1353,6 +1508,7 @@ export type NotificationUncheckedUpdateWithoutAssetInput = {
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1366,6 +1522,7 @@ export type NotificationUncheckedUpdateManyWithoutAssetInput = {
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
@@ -1378,6 +1535,7 @@ export type NotificationCreateManyTaskInput = {
projectId?: string | null
creatorId?: string | null
assetId?: string | null
kanbanTaskId?: string | null
userId?: string | null
}
@@ -1390,6 +1548,7 @@ export type NotificationUpdateWithoutTaskInput = {
project?: Prisma.ProjectUpdateOneWithoutNotificationsNestedInput
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
kanbanTask?: Prisma.KanbanTaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1403,6 +1562,7 @@ export type NotificationUncheckedUpdateWithoutTaskInput = {
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
@@ -1416,6 +1576,61 @@ export type NotificationUncheckedUpdateManyWithoutTaskInput = {
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
kanbanTaskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
export type NotificationCreateManyKanbanTaskInput = {
id?: string
type?: $Enums.NotificationType | null
createdAt?: Date | string
updatedAt?: Date | string
teamId: string
projectId?: string | null
creatorId?: string | null
assetId?: string | null
taskId?: string | null
userId?: string | null
}
export type NotificationUpdateWithoutKanbanTaskInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
type?: Prisma.NullableEnumNotificationTypeFieldUpdateOperationsInput | $Enums.NotificationType | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
team?: Prisma.TeamUpdateOneRequiredWithoutNotificationsNestedInput
project?: Prisma.ProjectUpdateOneWithoutNotificationsNestedInput
creator?: Prisma.UserUpdateOneWithoutCreatedNotificationsNestedInput
asset?: Prisma.AssetUpdateOneWithoutNotificationsNestedInput
task?: Prisma.TaskUpdateOneWithoutNotificationsNestedInput
user?: Prisma.UserUpdateOneWithoutNotificationsNestedInput
readByMembers?: Prisma.TeamMemberUpdateOneWithoutLastReadNotificationNestedInput
}
export type NotificationUncheckedUpdateWithoutKanbanTaskInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
type?: Prisma.NullableEnumNotificationTypeFieldUpdateOperationsInput | $Enums.NotificationType | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
teamId?: Prisma.StringFieldUpdateOperationsInput | string
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
readByMembers?: Prisma.TeamMemberUncheckedUpdateOneWithoutLastReadNotificationNestedInput
}
export type NotificationUncheckedUpdateManyWithoutKanbanTaskInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
type?: Prisma.NullableEnumNotificationTypeFieldUpdateOperationsInput | $Enums.NotificationType | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
teamId?: Prisma.StringFieldUpdateOperationsInput | string
projectId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
assetId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
taskId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}
@@ -1431,12 +1646,14 @@ export type NotificationSelect<ExtArgs extends runtime.Types.Extensions.Internal
creatorId?: boolean
assetId?: boolean
taskId?: boolean
kanbanTaskId?: boolean
userId?: boolean
team?: boolean | Prisma.TeamDefaultArgs<ExtArgs>
project?: boolean | Prisma.Notification$projectArgs<ExtArgs>
creator?: boolean | Prisma.Notification$creatorArgs<ExtArgs>
asset?: boolean | Prisma.Notification$assetArgs<ExtArgs>
task?: boolean | Prisma.Notification$taskArgs<ExtArgs>
kanbanTask?: boolean | Prisma.Notification$kanbanTaskArgs<ExtArgs>
user?: boolean | Prisma.Notification$userArgs<ExtArgs>
readByMembers?: boolean | Prisma.Notification$readByMembersArgs<ExtArgs>
}, ExtArgs["result"]["notification"]>
@@ -1451,12 +1668,14 @@ export type NotificationSelectCreateManyAndReturn<ExtArgs extends runtime.Types.
creatorId?: boolean
assetId?: boolean
taskId?: boolean
kanbanTaskId?: boolean
userId?: boolean
team?: boolean | Prisma.TeamDefaultArgs<ExtArgs>
project?: boolean | Prisma.Notification$projectArgs<ExtArgs>
creator?: boolean | Prisma.Notification$creatorArgs<ExtArgs>
asset?: boolean | Prisma.Notification$assetArgs<ExtArgs>
task?: boolean | Prisma.Notification$taskArgs<ExtArgs>
kanbanTask?: boolean | Prisma.Notification$kanbanTaskArgs<ExtArgs>
user?: boolean | Prisma.Notification$userArgs<ExtArgs>
}, ExtArgs["result"]["notification"]>
@@ -1470,12 +1689,14 @@ export type NotificationSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.
creatorId?: boolean
assetId?: boolean
taskId?: boolean
kanbanTaskId?: boolean
userId?: boolean
team?: boolean | Prisma.TeamDefaultArgs<ExtArgs>
project?: boolean | Prisma.Notification$projectArgs<ExtArgs>
creator?: boolean | Prisma.Notification$creatorArgs<ExtArgs>
asset?: boolean | Prisma.Notification$assetArgs<ExtArgs>
task?: boolean | Prisma.Notification$taskArgs<ExtArgs>
kanbanTask?: boolean | Prisma.Notification$kanbanTaskArgs<ExtArgs>
user?: boolean | Prisma.Notification$userArgs<ExtArgs>
}, ExtArgs["result"]["notification"]>
@@ -1489,16 +1710,18 @@ export type NotificationSelectScalar = {
creatorId?: boolean
assetId?: boolean
taskId?: boolean
kanbanTaskId?: boolean
userId?: boolean
}
export type NotificationOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "type" | "createdAt" | "updatedAt" | "teamId" | "projectId" | "creatorId" | "assetId" | "taskId" | "userId", ExtArgs["result"]["notification"]>
export type NotificationOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "type" | "createdAt" | "updatedAt" | "teamId" | "projectId" | "creatorId" | "assetId" | "taskId" | "kanbanTaskId" | "userId", ExtArgs["result"]["notification"]>
export type NotificationInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
team?: boolean | Prisma.TeamDefaultArgs<ExtArgs>
project?: boolean | Prisma.Notification$projectArgs<ExtArgs>
creator?: boolean | Prisma.Notification$creatorArgs<ExtArgs>
asset?: boolean | Prisma.Notification$assetArgs<ExtArgs>
task?: boolean | Prisma.Notification$taskArgs<ExtArgs>
kanbanTask?: boolean | Prisma.Notification$kanbanTaskArgs<ExtArgs>
user?: boolean | Prisma.Notification$userArgs<ExtArgs>
readByMembers?: boolean | Prisma.Notification$readByMembersArgs<ExtArgs>
}
@@ -1508,6 +1731,7 @@ export type NotificationIncludeCreateManyAndReturn<ExtArgs extends runtime.Types
creator?: boolean | Prisma.Notification$creatorArgs<ExtArgs>
asset?: boolean | Prisma.Notification$assetArgs<ExtArgs>
task?: boolean | Prisma.Notification$taskArgs<ExtArgs>
kanbanTask?: boolean | Prisma.Notification$kanbanTaskArgs<ExtArgs>
user?: boolean | Prisma.Notification$userArgs<ExtArgs>
}
export type NotificationIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
@@ -1516,6 +1740,7 @@ export type NotificationIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types
creator?: boolean | Prisma.Notification$creatorArgs<ExtArgs>
asset?: boolean | Prisma.Notification$assetArgs<ExtArgs>
task?: boolean | Prisma.Notification$taskArgs<ExtArgs>
kanbanTask?: boolean | Prisma.Notification$kanbanTaskArgs<ExtArgs>
user?: boolean | Prisma.Notification$userArgs<ExtArgs>
}
@@ -1527,6 +1752,7 @@ export type $NotificationPayload<ExtArgs extends runtime.Types.Extensions.Intern
creator: Prisma.$UserPayload<ExtArgs> | null
asset: Prisma.$AssetPayload<ExtArgs> | null
task: Prisma.$TaskPayload<ExtArgs> | null
kanbanTask: Prisma.$KanbanTaskPayload<ExtArgs> | null
user: Prisma.$UserPayload<ExtArgs> | null
readByMembers: Prisma.$TeamMemberPayload<ExtArgs> | null
}
@@ -1540,6 +1766,7 @@ export type $NotificationPayload<ExtArgs extends runtime.Types.Extensions.Intern
creatorId: string | null
assetId: string | null
taskId: string | null
kanbanTaskId: string | null
userId: string | null
}, ExtArgs["result"]["notification"]>
composites: {}
@@ -1940,6 +2167,7 @@ export interface Prisma__NotificationClient<T, Null = never, ExtArgs extends run
creator<T extends Prisma.Notification$creatorArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Notification$creatorArgs<ExtArgs>>): Prisma.Prisma__UserClient<runtime.Types.Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
asset<T extends Prisma.Notification$assetArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Notification$assetArgs<ExtArgs>>): Prisma.Prisma__AssetClient<runtime.Types.Result.GetResult<Prisma.$AssetPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
task<T extends Prisma.Notification$taskArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Notification$taskArgs<ExtArgs>>): Prisma.Prisma__TaskClient<runtime.Types.Result.GetResult<Prisma.$TaskPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
kanbanTask<T extends Prisma.Notification$kanbanTaskArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Notification$kanbanTaskArgs<ExtArgs>>): Prisma.Prisma__KanbanTaskClient<runtime.Types.Result.GetResult<Prisma.$KanbanTaskPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
user<T extends Prisma.Notification$userArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Notification$userArgs<ExtArgs>>): Prisma.Prisma__UserClient<runtime.Types.Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
readByMembers<T extends Prisma.Notification$readByMembersArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Notification$readByMembersArgs<ExtArgs>>): Prisma.Prisma__TeamMemberClient<runtime.Types.Result.GetResult<Prisma.$TeamMemberPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
/**
@@ -1980,6 +2208,7 @@ export interface NotificationFieldRefs {
readonly creatorId: Prisma.FieldRef<"Notification", 'String'>
readonly assetId: Prisma.FieldRef<"Notification", 'String'>
readonly taskId: Prisma.FieldRef<"Notification", 'String'>
readonly kanbanTaskId: Prisma.FieldRef<"Notification", 'String'>
readonly userId: Prisma.FieldRef<"Notification", 'String'>
}
@@ -2457,6 +2686,25 @@ export type Notification$taskArgs<ExtArgs extends runtime.Types.Extensions.Inter
where?: Prisma.TaskWhereInput
}
/**
* Notification.kanbanTask
*/
export type Notification$kanbanTaskArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the KanbanTask
*/
select?: Prisma.KanbanTaskSelect<ExtArgs> | null
/**
* Omit specific fields from the KanbanTask
*/
omit?: Prisma.KanbanTaskOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.KanbanTaskInclude<ExtArgs> | null
where?: Prisma.KanbanTaskWhereInput
}
/**
* Notification.user
*/
+204
View File
@@ -231,6 +231,7 @@ export type ProjectWhereInput = {
shareLinks?: Prisma.ShareLinkListRelationFilter
collections?: Prisma.CollectionListRelationFilter
auditLogs?: Prisma.AuditLogListRelationFilter
kanbanTasks?: Prisma.KanbanTaskListRelationFilter
}
export type ProjectOrderByWithRelationInput = {
@@ -255,6 +256,7 @@ export type ProjectOrderByWithRelationInput = {
shareLinks?: Prisma.ShareLinkOrderByRelationAggregateInput
collections?: Prisma.CollectionOrderByRelationAggregateInput
auditLogs?: Prisma.AuditLogOrderByRelationAggregateInput
kanbanTasks?: Prisma.KanbanTaskOrderByRelationAggregateInput
}
export type ProjectWhereUniqueInput = Prisma.AtLeast<{
@@ -282,6 +284,7 @@ export type ProjectWhereUniqueInput = Prisma.AtLeast<{
shareLinks?: Prisma.ShareLinkListRelationFilter
collections?: Prisma.CollectionListRelationFilter
auditLogs?: Prisma.AuditLogListRelationFilter
kanbanTasks?: Prisma.KanbanTaskListRelationFilter
}, "id" | "rootFolderId" | "shareRootId">
export type ProjectOrderByWithAggregationInput = {
@@ -335,6 +338,7 @@ export type ProjectCreateInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateInput = {
@@ -356,6 +360,7 @@ export type ProjectUncheckedCreateInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectUpdateInput = {
@@ -377,6 +382,7 @@ export type ProjectUpdateInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateInput = {
@@ -398,6 +404,7 @@ export type ProjectUncheckedUpdateInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateManyInput = {
@@ -721,6 +728,22 @@ export type ProjectUpdateOneWithoutAuditLogsNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.ProjectUpdateToOneWithWhereWithoutAuditLogsInput, Prisma.ProjectUpdateWithoutAuditLogsInput>, Prisma.ProjectUncheckedUpdateWithoutAuditLogsInput>
}
export type ProjectCreateNestedOneWithoutKanbanTasksInput = {
create?: Prisma.XOR<Prisma.ProjectCreateWithoutKanbanTasksInput, Prisma.ProjectUncheckedCreateWithoutKanbanTasksInput>
connectOrCreate?: Prisma.ProjectCreateOrConnectWithoutKanbanTasksInput
connect?: Prisma.ProjectWhereUniqueInput
}
export type ProjectUpdateOneWithoutKanbanTasksNestedInput = {
create?: Prisma.XOR<Prisma.ProjectCreateWithoutKanbanTasksInput, Prisma.ProjectUncheckedCreateWithoutKanbanTasksInput>
connectOrCreate?: Prisma.ProjectCreateOrConnectWithoutKanbanTasksInput
upsert?: Prisma.ProjectUpsertWithoutKanbanTasksInput
disconnect?: Prisma.ProjectWhereInput | boolean
delete?: Prisma.ProjectWhereInput | boolean
connect?: Prisma.ProjectWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.ProjectUpdateToOneWithWhereWithoutKanbanTasksInput, Prisma.ProjectUpdateWithoutKanbanTasksInput>, Prisma.ProjectUncheckedUpdateWithoutKanbanTasksInput>
}
export type ProjectCreateWithoutTeamInput = {
id?: string
name: string
@@ -739,6 +762,7 @@ export type ProjectCreateWithoutTeamInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutTeamInput = {
@@ -759,6 +783,7 @@ export type ProjectUncheckedCreateWithoutTeamInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutTeamInput = {
@@ -821,6 +846,7 @@ export type ProjectCreateWithoutMembersInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutMembersInput = {
@@ -841,6 +867,7 @@ export type ProjectUncheckedCreateWithoutMembersInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutMembersInput = {
@@ -877,6 +904,7 @@ export type ProjectUpdateWithoutMembersInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutMembersInput = {
@@ -897,6 +925,7 @@ export type ProjectUncheckedUpdateWithoutMembersInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutShareLinksInput = {
@@ -917,6 +946,7 @@ export type ProjectCreateWithoutShareLinksInput = {
notifications?: Prisma.NotificationCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutShareLinksInput = {
@@ -937,6 +967,7 @@ export type ProjectUncheckedCreateWithoutShareLinksInput = {
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutShareLinksInput = {
@@ -973,6 +1004,7 @@ export type ProjectUpdateWithoutShareLinksInput = {
notifications?: Prisma.NotificationUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutShareLinksInput = {
@@ -993,6 +1025,7 @@ export type ProjectUncheckedUpdateWithoutShareLinksInput = {
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutAssetsInput = {
@@ -1013,6 +1046,7 @@ export type ProjectCreateWithoutAssetsInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutAssetsInput = {
@@ -1033,6 +1067,7 @@ export type ProjectUncheckedCreateWithoutAssetsInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutAssetsInput = {
@@ -1058,6 +1093,7 @@ export type ProjectCreateWithoutRootFolderInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutRootFolderInput = {
@@ -1078,6 +1114,7 @@ export type ProjectUncheckedCreateWithoutRootFolderInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutRootFolderInput = {
@@ -1103,6 +1140,7 @@ export type ProjectCreateWithoutShareRootInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutShareRootInput = {
@@ -1123,6 +1161,7 @@ export type ProjectUncheckedCreateWithoutShareRootInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutShareRootInput = {
@@ -1159,6 +1198,7 @@ export type ProjectUpdateWithoutAssetsInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutAssetsInput = {
@@ -1179,6 +1219,7 @@ export type ProjectUncheckedUpdateWithoutAssetsInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectUpsertWithoutRootFolderInput = {
@@ -1210,6 +1251,7 @@ export type ProjectUpdateWithoutRootFolderInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutRootFolderInput = {
@@ -1230,6 +1272,7 @@ export type ProjectUncheckedUpdateWithoutRootFolderInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectUpsertWithoutShareRootInput = {
@@ -1261,6 +1304,7 @@ export type ProjectUpdateWithoutShareRootInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutShareRootInput = {
@@ -1281,6 +1325,7 @@ export type ProjectUncheckedUpdateWithoutShareRootInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutInvitesInput = {
@@ -1301,6 +1346,7 @@ export type ProjectCreateWithoutInvitesInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutInvitesInput = {
@@ -1321,6 +1367,7 @@ export type ProjectUncheckedCreateWithoutInvitesInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutInvitesInput = {
@@ -1357,6 +1404,7 @@ export type ProjectUpdateWithoutInvitesInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutInvitesInput = {
@@ -1377,6 +1425,7 @@ export type ProjectUncheckedUpdateWithoutInvitesInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutMetadataFieldsInput = {
@@ -1397,6 +1446,7 @@ export type ProjectCreateWithoutMetadataFieldsInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutMetadataFieldsInput = {
@@ -1417,6 +1467,7 @@ export type ProjectUncheckedCreateWithoutMetadataFieldsInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutMetadataFieldsInput = {
@@ -1453,6 +1504,7 @@ export type ProjectUpdateWithoutMetadataFieldsInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutMetadataFieldsInput = {
@@ -1473,6 +1525,7 @@ export type ProjectUncheckedUpdateWithoutMetadataFieldsInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutNotificationsInput = {
@@ -1493,6 +1546,7 @@ export type ProjectCreateWithoutNotificationsInput = {
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutNotificationsInput = {
@@ -1513,6 +1567,7 @@ export type ProjectUncheckedCreateWithoutNotificationsInput = {
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutNotificationsInput = {
@@ -1549,6 +1604,7 @@ export type ProjectUpdateWithoutNotificationsInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutNotificationsInput = {
@@ -1569,6 +1625,7 @@ export type ProjectUncheckedUpdateWithoutNotificationsInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutCollectionsInput = {
@@ -1589,6 +1646,7 @@ export type ProjectCreateWithoutCollectionsInput = {
notifications?: Prisma.NotificationCreateNestedManyWithoutProjectInput
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutCollectionsInput = {
@@ -1609,6 +1667,7 @@ export type ProjectUncheckedCreateWithoutCollectionsInput = {
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutProjectInput
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutCollectionsInput = {
@@ -1645,6 +1704,7 @@ export type ProjectUpdateWithoutCollectionsInput = {
notifications?: Prisma.NotificationUpdateManyWithoutProjectNestedInput
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutCollectionsInput = {
@@ -1665,6 +1725,7 @@ export type ProjectUncheckedUpdateWithoutCollectionsInput = {
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutProjectNestedInput
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutAuditLogsInput = {
@@ -1685,6 +1746,7 @@ export type ProjectCreateWithoutAuditLogsInput = {
notifications?: Prisma.NotificationCreateNestedManyWithoutProjectInput
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutAuditLogsInput = {
@@ -1705,6 +1767,7 @@ export type ProjectUncheckedCreateWithoutAuditLogsInput = {
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutProjectInput
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutAuditLogsInput = {
@@ -1741,6 +1804,7 @@ export type ProjectUpdateWithoutAuditLogsInput = {
notifications?: Prisma.NotificationUpdateManyWithoutProjectNestedInput
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutAuditLogsInput = {
@@ -1761,6 +1825,107 @@ export type ProjectUncheckedUpdateWithoutAuditLogsInput = {
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutProjectNestedInput
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateWithoutKanbanTasksInput = {
id?: string
name: string
coverImageKey?: string | null
metadataOverrides?:PrismaJson.MetadataOverrides | Prisma.NullableJsonNullValueInput
enableNotification?: boolean
createdAt?: Date | string
updatedAt?: Date | string
team: Prisma.TeamCreateNestedOneWithoutProjectsInput
rootFolder?: Prisma.AssetCreateNestedOneWithoutProjectRootFolderInput
shareRoot?: Prisma.AssetCreateNestedOneWithoutProjectShareRootInput
members?: Prisma.ProjectMemberCreateNestedManyWithoutProjectInput
assets?: Prisma.AssetCreateNestedManyWithoutProjectInput
metadataFields?: Prisma.MetadataFieldCreateNestedManyWithoutProjectInput
invites?: Prisma.InviteCreateNestedManyWithoutProjectInput
notifications?: Prisma.NotificationCreateNestedManyWithoutProjectInput
shareLinks?: Prisma.ShareLinkCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutProjectInput
}
export type ProjectUncheckedCreateWithoutKanbanTasksInput = {
id?: string
name: string
coverImageKey?: string | null
metadataOverrides?:PrismaJson.MetadataOverrides | Prisma.NullableJsonNullValueInput
enableNotification?: boolean
createdAt?: Date | string
updatedAt?: Date | string
teamId: string
rootFolderId?: string | null
shareRootId?: string | null
members?: Prisma.ProjectMemberUncheckedCreateNestedManyWithoutProjectInput
assets?: Prisma.AssetUncheckedCreateNestedManyWithoutProjectInput
metadataFields?: Prisma.MetadataFieldUncheckedCreateNestedManyWithoutProjectInput
invites?: Prisma.InviteUncheckedCreateNestedManyWithoutProjectInput
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutProjectInput
shareLinks?: Prisma.ShareLinkUncheckedCreateNestedManyWithoutProjectInput
collections?: Prisma.CollectionUncheckedCreateNestedManyWithoutProjectInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutProjectInput
}
export type ProjectCreateOrConnectWithoutKanbanTasksInput = {
where: Prisma.ProjectWhereUniqueInput
create: Prisma.XOR<Prisma.ProjectCreateWithoutKanbanTasksInput, Prisma.ProjectUncheckedCreateWithoutKanbanTasksInput>
}
export type ProjectUpsertWithoutKanbanTasksInput = {
update: Prisma.XOR<Prisma.ProjectUpdateWithoutKanbanTasksInput, Prisma.ProjectUncheckedUpdateWithoutKanbanTasksInput>
create: Prisma.XOR<Prisma.ProjectCreateWithoutKanbanTasksInput, Prisma.ProjectUncheckedCreateWithoutKanbanTasksInput>
where?: Prisma.ProjectWhereInput
}
export type ProjectUpdateToOneWithWhereWithoutKanbanTasksInput = {
where?: Prisma.ProjectWhereInput
data: Prisma.XOR<Prisma.ProjectUpdateWithoutKanbanTasksInput, Prisma.ProjectUncheckedUpdateWithoutKanbanTasksInput>
}
export type ProjectUpdateWithoutKanbanTasksInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
coverImageKey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
metadataOverrides?:PrismaJson.MetadataOverrides | Prisma.NullableJsonNullValueInput
enableNotification?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
team?: Prisma.TeamUpdateOneRequiredWithoutProjectsNestedInput
rootFolder?: Prisma.AssetUpdateOneWithoutProjectRootFolderNestedInput
shareRoot?: Prisma.AssetUpdateOneWithoutProjectShareRootNestedInput
members?: Prisma.ProjectMemberUpdateManyWithoutProjectNestedInput
assets?: Prisma.AssetUpdateManyWithoutProjectNestedInput
metadataFields?: Prisma.MetadataFieldUpdateManyWithoutProjectNestedInput
invites?: Prisma.InviteUpdateManyWithoutProjectNestedInput
notifications?: Prisma.NotificationUpdateManyWithoutProjectNestedInput
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutKanbanTasksInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
coverImageKey?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
metadataOverrides?:PrismaJson.MetadataOverrides | Prisma.NullableJsonNullValueInput
enableNotification?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
teamId?: Prisma.StringFieldUpdateOperationsInput | string
rootFolderId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
shareRootId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
members?: Prisma.ProjectMemberUncheckedUpdateManyWithoutProjectNestedInput
assets?: Prisma.AssetUncheckedUpdateManyWithoutProjectNestedInput
metadataFields?: Prisma.MetadataFieldUncheckedUpdateManyWithoutProjectNestedInput
invites?: Prisma.InviteUncheckedUpdateManyWithoutProjectNestedInput
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutProjectNestedInput
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectCreateManyTeamInput = {
@@ -1793,6 +1958,7 @@ export type ProjectUpdateWithoutTeamInput = {
shareLinks?: Prisma.ShareLinkUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateWithoutTeamInput = {
@@ -1813,6 +1979,7 @@ export type ProjectUncheckedUpdateWithoutTeamInput = {
shareLinks?: Prisma.ShareLinkUncheckedUpdateManyWithoutProjectNestedInput
collections?: Prisma.CollectionUncheckedUpdateManyWithoutProjectNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutProjectNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutProjectNestedInput
}
export type ProjectUncheckedUpdateManyWithoutTeamInput = {
@@ -1841,6 +2008,7 @@ export type ProjectCountOutputType = {
shareLinks: number
collections: number
auditLogs: number
kanbanTasks: number
}
export type ProjectCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
@@ -1852,6 +2020,7 @@ export type ProjectCountOutputTypeSelect<ExtArgs extends runtime.Types.Extension
shareLinks?: boolean | ProjectCountOutputTypeCountShareLinksArgs
collections?: boolean | ProjectCountOutputTypeCountCollectionsArgs
auditLogs?: boolean | ProjectCountOutputTypeCountAuditLogsArgs
kanbanTasks?: boolean | ProjectCountOutputTypeCountKanbanTasksArgs
}
/**
@@ -1920,6 +2089,13 @@ export type ProjectCountOutputTypeCountAuditLogsArgs<ExtArgs extends runtime.Typ
where?: Prisma.AuditLogWhereInput
}
/**
* ProjectCountOutputType without action
*/
export type ProjectCountOutputTypeCountKanbanTasksArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.KanbanTaskWhereInput
}
export type ProjectSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
@@ -1943,6 +2119,7 @@ export type ProjectSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
shareLinks?: boolean | Prisma.Project$shareLinksArgs<ExtArgs>
collections?: boolean | Prisma.Project$collectionsArgs<ExtArgs>
auditLogs?: boolean | Prisma.Project$auditLogsArgs<ExtArgs>
kanbanTasks?: boolean | Prisma.Project$kanbanTasksArgs<ExtArgs>
_count?: boolean | Prisma.ProjectCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["project"]>
@@ -2004,6 +2181,7 @@ export type ProjectInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs
shareLinks?: boolean | Prisma.Project$shareLinksArgs<ExtArgs>
collections?: boolean | Prisma.Project$collectionsArgs<ExtArgs>
auditLogs?: boolean | Prisma.Project$auditLogsArgs<ExtArgs>
kanbanTasks?: boolean | Prisma.Project$kanbanTasksArgs<ExtArgs>
_count?: boolean | Prisma.ProjectCountOutputTypeDefaultArgs<ExtArgs>
}
export type ProjectIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
@@ -2031,6 +2209,7 @@ export type $ProjectPayload<ExtArgs extends runtime.Types.Extensions.InternalArg
shareLinks: Prisma.$ShareLinkPayload<ExtArgs>[]
collections: Prisma.$CollectionPayload<ExtArgs>[]
auditLogs: Prisma.$AuditLogPayload<ExtArgs>[]
kanbanTasks: Prisma.$KanbanTaskPayload<ExtArgs>[]
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: string
@@ -2451,6 +2630,7 @@ export interface Prisma__ProjectClient<T, Null = never, ExtArgs extends runtime.
shareLinks<T extends Prisma.Project$shareLinksArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Project$shareLinksArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ShareLinkPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
collections<T extends Prisma.Project$collectionsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Project$collectionsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$CollectionPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
auditLogs<T extends Prisma.Project$auditLogsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Project$auditLogsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AuditLogPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
kanbanTasks<T extends Prisma.Project$kanbanTasksArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Project$kanbanTasksArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$KanbanTaskPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
@@ -3120,6 +3300,30 @@ export type Project$auditLogsArgs<ExtArgs extends runtime.Types.Extensions.Inter
distinct?: Prisma.AuditLogScalarFieldEnum | Prisma.AuditLogScalarFieldEnum[]
}
/**
* Project.kanbanTasks
*/
export type Project$kanbanTasksArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the KanbanTask
*/
select?: Prisma.KanbanTaskSelect<ExtArgs> | null
/**
* Omit specific fields from the KanbanTask
*/
omit?: Prisma.KanbanTaskOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.KanbanTaskInclude<ExtArgs> | null
where?: Prisma.KanbanTaskWhereInput
orderBy?: Prisma.KanbanTaskOrderByWithRelationInput | Prisma.KanbanTaskOrderByWithRelationInput[]
cursor?: Prisma.KanbanTaskWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.KanbanTaskScalarFieldEnum | Prisma.KanbanTaskScalarFieldEnum[]
}
/**
* Project without action
*/
+492
View File
@@ -205,6 +205,8 @@ export type TeamWhereInput = {
watermarkTemplates?: Prisma.WatermarkTemplateListRelationFilter
quotaRules?: Prisma.QuotaRuleListRelationFilter
quotaRecords?: Prisma.QuotaRecordListRelationFilter
kanbanGoals?: Prisma.KanbanGoalListRelationFilter
kanbanTasks?: Prisma.KanbanTaskListRelationFilter
}
export type TeamOrderByWithRelationInput = {
@@ -231,6 +233,8 @@ export type TeamOrderByWithRelationInput = {
watermarkTemplates?: Prisma.WatermarkTemplateOrderByRelationAggregateInput
quotaRules?: Prisma.QuotaRuleOrderByRelationAggregateInput
quotaRecords?: Prisma.QuotaRecordOrderByRelationAggregateInput
kanbanGoals?: Prisma.KanbanGoalOrderByRelationAggregateInput
kanbanTasks?: Prisma.KanbanTaskOrderByRelationAggregateInput
}
export type TeamWhereUniqueInput = Prisma.AtLeast<{
@@ -260,6 +264,8 @@ export type TeamWhereUniqueInput = Prisma.AtLeast<{
watermarkTemplates?: Prisma.WatermarkTemplateListRelationFilter
quotaRules?: Prisma.QuotaRuleListRelationFilter
quotaRecords?: Prisma.QuotaRecordListRelationFilter
kanbanGoals?: Prisma.KanbanGoalListRelationFilter
kanbanTasks?: Prisma.KanbanTaskListRelationFilter
}, "id" | "rootFolderId">
export type TeamOrderByWithAggregationInput = {
@@ -309,6 +315,8 @@ export type TeamCreateInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateInput = {
@@ -334,6 +342,8 @@ export type TeamUncheckedCreateInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamUpdateInput = {
@@ -359,6 +369,8 @@ export type TeamUpdateInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateInput = {
@@ -384,6 +396,8 @@ export type TeamUncheckedUpdateInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateManyInput = {
@@ -707,6 +721,34 @@ export type TeamUpdateOneRequiredWithoutQuotaRecordsNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.TeamUpdateToOneWithWhereWithoutQuotaRecordsInput, Prisma.TeamUpdateWithoutQuotaRecordsInput>, Prisma.TeamUncheckedUpdateWithoutQuotaRecordsInput>
}
export type TeamCreateNestedOneWithoutKanbanGoalsInput = {
create?: Prisma.XOR<Prisma.TeamCreateWithoutKanbanGoalsInput, Prisma.TeamUncheckedCreateWithoutKanbanGoalsInput>
connectOrCreate?: Prisma.TeamCreateOrConnectWithoutKanbanGoalsInput
connect?: Prisma.TeamWhereUniqueInput
}
export type TeamUpdateOneRequiredWithoutKanbanGoalsNestedInput = {
create?: Prisma.XOR<Prisma.TeamCreateWithoutKanbanGoalsInput, Prisma.TeamUncheckedCreateWithoutKanbanGoalsInput>
connectOrCreate?: Prisma.TeamCreateOrConnectWithoutKanbanGoalsInput
upsert?: Prisma.TeamUpsertWithoutKanbanGoalsInput
connect?: Prisma.TeamWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.TeamUpdateToOneWithWhereWithoutKanbanGoalsInput, Prisma.TeamUpdateWithoutKanbanGoalsInput>, Prisma.TeamUncheckedUpdateWithoutKanbanGoalsInput>
}
export type TeamCreateNestedOneWithoutKanbanTasksInput = {
create?: Prisma.XOR<Prisma.TeamCreateWithoutKanbanTasksInput, Prisma.TeamUncheckedCreateWithoutKanbanTasksInput>
connectOrCreate?: Prisma.TeamCreateOrConnectWithoutKanbanTasksInput
connect?: Prisma.TeamWhereUniqueInput
}
export type TeamUpdateOneRequiredWithoutKanbanTasksNestedInput = {
create?: Prisma.XOR<Prisma.TeamCreateWithoutKanbanTasksInput, Prisma.TeamUncheckedCreateWithoutKanbanTasksInput>
connectOrCreate?: Prisma.TeamCreateOrConnectWithoutKanbanTasksInput
upsert?: Prisma.TeamUpsertWithoutKanbanTasksInput
connect?: Prisma.TeamWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.TeamUpdateToOneWithWhereWithoutKanbanTasksInput, Prisma.TeamUpdateWithoutKanbanTasksInput>, Prisma.TeamUncheckedUpdateWithoutKanbanTasksInput>
}
export type TeamCreateWithoutSandboxInput = {
id?: string
name: string
@@ -729,6 +771,8 @@ export type TeamCreateWithoutSandboxInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutSandboxInput = {
@@ -753,6 +797,8 @@ export type TeamUncheckedCreateWithoutSandboxInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutSandboxInput = {
@@ -793,6 +839,8 @@ export type TeamUpdateWithoutSandboxInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutSandboxInput = {
@@ -817,6 +865,8 @@ export type TeamUncheckedUpdateWithoutSandboxInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutSkillsInput = {
@@ -841,6 +891,8 @@ export type TeamCreateWithoutSkillsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutSkillsInput = {
@@ -865,6 +917,8 @@ export type TeamUncheckedCreateWithoutSkillsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutSkillsInput = {
@@ -905,6 +959,8 @@ export type TeamUpdateWithoutSkillsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutSkillsInput = {
@@ -929,6 +985,8 @@ export type TeamUncheckedUpdateWithoutSkillsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutMembersInput = {
@@ -953,6 +1011,8 @@ export type TeamCreateWithoutMembersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutMembersInput = {
@@ -977,6 +1037,8 @@ export type TeamUncheckedCreateWithoutMembersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutMembersInput = {
@@ -1017,6 +1079,8 @@ export type TeamUpdateWithoutMembersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutMembersInput = {
@@ -1041,6 +1105,8 @@ export type TeamUncheckedUpdateWithoutMembersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutProjectsInput = {
@@ -1065,6 +1131,8 @@ export type TeamCreateWithoutProjectsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutProjectsInput = {
@@ -1089,6 +1157,8 @@ export type TeamUncheckedCreateWithoutProjectsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutProjectsInput = {
@@ -1129,6 +1199,8 @@ export type TeamUpdateWithoutProjectsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutProjectsInput = {
@@ -1153,6 +1225,8 @@ export type TeamUncheckedUpdateWithoutProjectsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutWatermarkTemplatesInput = {
@@ -1177,6 +1251,8 @@ export type TeamCreateWithoutWatermarkTemplatesInput = {
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutWatermarkTemplatesInput = {
@@ -1201,6 +1277,8 @@ export type TeamUncheckedCreateWithoutWatermarkTemplatesInput = {
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutWatermarkTemplatesInput = {
@@ -1241,6 +1319,8 @@ export type TeamUpdateWithoutWatermarkTemplatesInput = {
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutWatermarkTemplatesInput = {
@@ -1265,6 +1345,8 @@ export type TeamUncheckedUpdateWithoutWatermarkTemplatesInput = {
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutRootFolderInput = {
@@ -1289,6 +1371,8 @@ export type TeamCreateWithoutRootFolderInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutRootFolderInput = {
@@ -1313,6 +1397,8 @@ export type TeamUncheckedCreateWithoutRootFolderInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutRootFolderInput = {
@@ -1353,6 +1439,8 @@ export type TeamUpdateWithoutRootFolderInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutRootFolderInput = {
@@ -1377,6 +1465,8 @@ export type TeamUncheckedUpdateWithoutRootFolderInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutInvitesInput = {
@@ -1401,6 +1491,8 @@ export type TeamCreateWithoutInvitesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutInvitesInput = {
@@ -1425,6 +1517,8 @@ export type TeamUncheckedCreateWithoutInvitesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutInvitesInput = {
@@ -1465,6 +1559,8 @@ export type TeamUpdateWithoutInvitesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutInvitesInput = {
@@ -1489,6 +1585,8 @@ export type TeamUncheckedUpdateWithoutInvitesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutMetadataFieldsInput = {
@@ -1513,6 +1611,8 @@ export type TeamCreateWithoutMetadataFieldsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutMetadataFieldsInput = {
@@ -1537,6 +1637,8 @@ export type TeamUncheckedCreateWithoutMetadataFieldsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutMetadataFieldsInput = {
@@ -1577,6 +1679,8 @@ export type TeamUpdateWithoutMetadataFieldsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutMetadataFieldsInput = {
@@ -1601,6 +1705,8 @@ export type TeamUncheckedUpdateWithoutMetadataFieldsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutNotificationsInput = {
@@ -1625,6 +1731,8 @@ export type TeamCreateWithoutNotificationsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutNotificationsInput = {
@@ -1649,6 +1757,8 @@ export type TeamUncheckedCreateWithoutNotificationsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutNotificationsInput = {
@@ -1689,6 +1799,8 @@ export type TeamUpdateWithoutNotificationsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutNotificationsInput = {
@@ -1713,6 +1825,8 @@ export type TeamUncheckedUpdateWithoutNotificationsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutAgentsInput = {
@@ -1737,6 +1851,8 @@ export type TeamCreateWithoutAgentsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutAgentsInput = {
@@ -1761,6 +1877,8 @@ export type TeamUncheckedCreateWithoutAgentsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutAgentsInput = {
@@ -1801,6 +1919,8 @@ export type TeamUpdateWithoutAgentsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutAgentsInput = {
@@ -1825,6 +1945,8 @@ export type TeamUncheckedUpdateWithoutAgentsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutMcpServersInput = {
@@ -1849,6 +1971,8 @@ export type TeamCreateWithoutMcpServersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutMcpServersInput = {
@@ -1873,6 +1997,8 @@ export type TeamUncheckedCreateWithoutMcpServersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutMcpServersInput = {
@@ -1913,6 +2039,8 @@ export type TeamUpdateWithoutMcpServersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutMcpServersInput = {
@@ -1937,6 +2065,8 @@ export type TeamUncheckedUpdateWithoutMcpServersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutUserMetadataInput = {
@@ -1961,6 +2091,8 @@ export type TeamCreateWithoutUserMetadataInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutUserMetadataInput = {
@@ -1985,6 +2117,8 @@ export type TeamUncheckedCreateWithoutUserMetadataInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutUserMetadataInput = {
@@ -2025,6 +2159,8 @@ export type TeamUpdateWithoutUserMetadataInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutUserMetadataInput = {
@@ -2049,6 +2185,8 @@ export type TeamUncheckedUpdateWithoutUserMetadataInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutProvidersInput = {
@@ -2073,6 +2211,8 @@ export type TeamCreateWithoutProvidersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutProvidersInput = {
@@ -2097,6 +2237,8 @@ export type TeamUncheckedCreateWithoutProvidersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutProvidersInput = {
@@ -2137,6 +2279,8 @@ export type TeamUpdateWithoutProvidersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutProvidersInput = {
@@ -2161,6 +2305,8 @@ export type TeamUncheckedUpdateWithoutProvidersInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutAiUsagesInput = {
@@ -2185,6 +2331,8 @@ export type TeamCreateWithoutAiUsagesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutAiUsagesInput = {
@@ -2209,6 +2357,8 @@ export type TeamUncheckedCreateWithoutAiUsagesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutAiUsagesInput = {
@@ -2249,6 +2399,8 @@ export type TeamUpdateWithoutAiUsagesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutAiUsagesInput = {
@@ -2273,6 +2425,8 @@ export type TeamUncheckedUpdateWithoutAiUsagesInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutAuditLogsInput = {
@@ -2297,6 +2451,8 @@ export type TeamCreateWithoutAuditLogsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutAuditLogsInput = {
@@ -2321,6 +2477,8 @@ export type TeamUncheckedCreateWithoutAuditLogsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutAuditLogsInput = {
@@ -2361,6 +2519,8 @@ export type TeamUpdateWithoutAuditLogsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutAuditLogsInput = {
@@ -2385,6 +2545,8 @@ export type TeamUncheckedUpdateWithoutAuditLogsInput = {
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutQuotaRulesInput = {
@@ -2409,6 +2571,8 @@ export type TeamCreateWithoutQuotaRulesInput = {
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutQuotaRulesInput = {
@@ -2433,6 +2597,8 @@ export type TeamUncheckedCreateWithoutQuotaRulesInput = {
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutQuotaRulesInput = {
@@ -2473,6 +2639,8 @@ export type TeamUpdateWithoutQuotaRulesInput = {
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutQuotaRulesInput = {
@@ -2497,6 +2665,8 @@ export type TeamUncheckedUpdateWithoutQuotaRulesInput = {
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutQuotaRecordsInput = {
@@ -2521,6 +2691,8 @@ export type TeamCreateWithoutQuotaRecordsInput = {
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutQuotaRecordsInput = {
@@ -2545,6 +2717,8 @@ export type TeamUncheckedCreateWithoutQuotaRecordsInput = {
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutQuotaRecordsInput = {
@@ -2585,6 +2759,8 @@ export type TeamUpdateWithoutQuotaRecordsInput = {
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutQuotaRecordsInput = {
@@ -2609,6 +2785,248 @@ export type TeamUncheckedUpdateWithoutQuotaRecordsInput = {
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutKanbanGoalsInput = {
id?: string
name: string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Date | string
updatedAt?: Date | string
rootFolder?: Prisma.AssetCreateNestedOneWithoutTeamRootFolderInput
members?: Prisma.TeamMemberCreateNestedManyWithoutTeamInput
projects?: Prisma.ProjectCreateNestedManyWithoutTeamInput
metadataFields?: Prisma.MetadataFieldCreateNestedManyWithoutTeamInput
invites?: Prisma.InviteCreateNestedManyWithoutTeamInput
notifications?: Prisma.NotificationCreateNestedManyWithoutTeamInput
userMetadata?: Prisma.UserMetadataCreateNestedManyWithoutTeamInput
providers?: Prisma.ProviderCreateNestedManyWithoutTeamInput
skills?: Prisma.SkillCreateNestedManyWithoutTeamInput
mcpServers?: Prisma.McpServerCreateNestedManyWithoutTeamInput
sandbox?: Prisma.SandboxCreateNestedOneWithoutTeamInput
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutKanbanGoalsInput = {
id?: string
name: string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Date | string
updatedAt?: Date | string
rootFolderId?: string | null
members?: Prisma.TeamMemberUncheckedCreateNestedManyWithoutTeamInput
projects?: Prisma.ProjectUncheckedCreateNestedManyWithoutTeamInput
metadataFields?: Prisma.MetadataFieldUncheckedCreateNestedManyWithoutTeamInput
invites?: Prisma.InviteUncheckedCreateNestedManyWithoutTeamInput
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutTeamInput
userMetadata?: Prisma.UserMetadataUncheckedCreateNestedManyWithoutTeamInput
providers?: Prisma.ProviderUncheckedCreateNestedManyWithoutTeamInput
skills?: Prisma.SkillUncheckedCreateNestedManyWithoutTeamInput
mcpServers?: Prisma.McpServerUncheckedCreateNestedManyWithoutTeamInput
sandbox?: Prisma.SandboxUncheckedCreateNestedOneWithoutTeamInput
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanTasks?: Prisma.KanbanTaskUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutKanbanGoalsInput = {
where: Prisma.TeamWhereUniqueInput
create: Prisma.XOR<Prisma.TeamCreateWithoutKanbanGoalsInput, Prisma.TeamUncheckedCreateWithoutKanbanGoalsInput>
}
export type TeamUpsertWithoutKanbanGoalsInput = {
update: Prisma.XOR<Prisma.TeamUpdateWithoutKanbanGoalsInput, Prisma.TeamUncheckedUpdateWithoutKanbanGoalsInput>
create: Prisma.XOR<Prisma.TeamCreateWithoutKanbanGoalsInput, Prisma.TeamUncheckedCreateWithoutKanbanGoalsInput>
where?: Prisma.TeamWhereInput
}
export type TeamUpdateToOneWithWhereWithoutKanbanGoalsInput = {
where?: Prisma.TeamWhereInput
data: Prisma.XOR<Prisma.TeamUpdateWithoutKanbanGoalsInput, Prisma.TeamUncheckedUpdateWithoutKanbanGoalsInput>
}
export type TeamUpdateWithoutKanbanGoalsInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
rootFolder?: Prisma.AssetUpdateOneWithoutTeamRootFolderNestedInput
members?: Prisma.TeamMemberUpdateManyWithoutTeamNestedInput
projects?: Prisma.ProjectUpdateManyWithoutTeamNestedInput
metadataFields?: Prisma.MetadataFieldUpdateManyWithoutTeamNestedInput
invites?: Prisma.InviteUpdateManyWithoutTeamNestedInput
notifications?: Prisma.NotificationUpdateManyWithoutTeamNestedInput
userMetadata?: Prisma.UserMetadataUpdateManyWithoutTeamNestedInput
providers?: Prisma.ProviderUpdateManyWithoutTeamNestedInput
skills?: Prisma.SkillUpdateManyWithoutTeamNestedInput
mcpServers?: Prisma.McpServerUpdateManyWithoutTeamNestedInput
sandbox?: Prisma.SandboxUpdateOneWithoutTeamNestedInput
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutKanbanGoalsInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
rootFolderId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
members?: Prisma.TeamMemberUncheckedUpdateManyWithoutTeamNestedInput
projects?: Prisma.ProjectUncheckedUpdateManyWithoutTeamNestedInput
metadataFields?: Prisma.MetadataFieldUncheckedUpdateManyWithoutTeamNestedInput
invites?: Prisma.InviteUncheckedUpdateManyWithoutTeamNestedInput
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutTeamNestedInput
userMetadata?: Prisma.UserMetadataUncheckedUpdateManyWithoutTeamNestedInput
providers?: Prisma.ProviderUncheckedUpdateManyWithoutTeamNestedInput
skills?: Prisma.SkillUncheckedUpdateManyWithoutTeamNestedInput
mcpServers?: Prisma.McpServerUncheckedUpdateManyWithoutTeamNestedInput
sandbox?: Prisma.SandboxUncheckedUpdateOneWithoutTeamNestedInput
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanTasks?: Prisma.KanbanTaskUncheckedUpdateManyWithoutTeamNestedInput
}
export type TeamCreateWithoutKanbanTasksInput = {
id?: string
name: string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Date | string
updatedAt?: Date | string
rootFolder?: Prisma.AssetCreateNestedOneWithoutTeamRootFolderInput
members?: Prisma.TeamMemberCreateNestedManyWithoutTeamInput
projects?: Prisma.ProjectCreateNestedManyWithoutTeamInput
metadataFields?: Prisma.MetadataFieldCreateNestedManyWithoutTeamInput
invites?: Prisma.InviteCreateNestedManyWithoutTeamInput
notifications?: Prisma.NotificationCreateNestedManyWithoutTeamInput
userMetadata?: Prisma.UserMetadataCreateNestedManyWithoutTeamInput
providers?: Prisma.ProviderCreateNestedManyWithoutTeamInput
skills?: Prisma.SkillCreateNestedManyWithoutTeamInput
mcpServers?: Prisma.McpServerCreateNestedManyWithoutTeamInput
sandbox?: Prisma.SandboxCreateNestedOneWithoutTeamInput
agents?: Prisma.AgentCreateNestedManyWithoutTeamInput
aiUsages?: Prisma.AiUsageCreateNestedManyWithoutTeamInput
auditLogs?: Prisma.AuditLogCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalCreateNestedManyWithoutTeamInput
}
export type TeamUncheckedCreateWithoutKanbanTasksInput = {
id?: string
name: string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Date | string
updatedAt?: Date | string
rootFolderId?: string | null
members?: Prisma.TeamMemberUncheckedCreateNestedManyWithoutTeamInput
projects?: Prisma.ProjectUncheckedCreateNestedManyWithoutTeamInput
metadataFields?: Prisma.MetadataFieldUncheckedCreateNestedManyWithoutTeamInput
invites?: Prisma.InviteUncheckedCreateNestedManyWithoutTeamInput
notifications?: Prisma.NotificationUncheckedCreateNestedManyWithoutTeamInput
userMetadata?: Prisma.UserMetadataUncheckedCreateNestedManyWithoutTeamInput
providers?: Prisma.ProviderUncheckedCreateNestedManyWithoutTeamInput
skills?: Prisma.SkillUncheckedCreateNestedManyWithoutTeamInput
mcpServers?: Prisma.McpServerUncheckedCreateNestedManyWithoutTeamInput
sandbox?: Prisma.SandboxUncheckedCreateNestedOneWithoutTeamInput
agents?: Prisma.AgentUncheckedCreateNestedManyWithoutTeamInput
aiUsages?: Prisma.AiUsageUncheckedCreateNestedManyWithoutTeamInput
auditLogs?: Prisma.AuditLogUncheckedCreateNestedManyWithoutTeamInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedCreateNestedManyWithoutTeamInput
quotaRules?: Prisma.QuotaRuleUncheckedCreateNestedManyWithoutTeamInput
quotaRecords?: Prisma.QuotaRecordUncheckedCreateNestedManyWithoutTeamInput
kanbanGoals?: Prisma.KanbanGoalUncheckedCreateNestedManyWithoutTeamInput
}
export type TeamCreateOrConnectWithoutKanbanTasksInput = {
where: Prisma.TeamWhereUniqueInput
create: Prisma.XOR<Prisma.TeamCreateWithoutKanbanTasksInput, Prisma.TeamUncheckedCreateWithoutKanbanTasksInput>
}
export type TeamUpsertWithoutKanbanTasksInput = {
update: Prisma.XOR<Prisma.TeamUpdateWithoutKanbanTasksInput, Prisma.TeamUncheckedUpdateWithoutKanbanTasksInput>
create: Prisma.XOR<Prisma.TeamCreateWithoutKanbanTasksInput, Prisma.TeamUncheckedCreateWithoutKanbanTasksInput>
where?: Prisma.TeamWhereInput
}
export type TeamUpdateToOneWithWhereWithoutKanbanTasksInput = {
where?: Prisma.TeamWhereInput
data: Prisma.XOR<Prisma.TeamUpdateWithoutKanbanTasksInput, Prisma.TeamUncheckedUpdateWithoutKanbanTasksInput>
}
export type TeamUpdateWithoutKanbanTasksInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
rootFolder?: Prisma.AssetUpdateOneWithoutTeamRootFolderNestedInput
members?: Prisma.TeamMemberUpdateManyWithoutTeamNestedInput
projects?: Prisma.ProjectUpdateManyWithoutTeamNestedInput
metadataFields?: Prisma.MetadataFieldUpdateManyWithoutTeamNestedInput
invites?: Prisma.InviteUpdateManyWithoutTeamNestedInput
notifications?: Prisma.NotificationUpdateManyWithoutTeamNestedInput
userMetadata?: Prisma.UserMetadataUpdateManyWithoutTeamNestedInput
providers?: Prisma.ProviderUpdateManyWithoutTeamNestedInput
skills?: Prisma.SkillUpdateManyWithoutTeamNestedInput
mcpServers?: Prisma.McpServerUpdateManyWithoutTeamNestedInput
sandbox?: Prisma.SandboxUpdateOneWithoutTeamNestedInput
agents?: Prisma.AgentUpdateManyWithoutTeamNestedInput
aiUsages?: Prisma.AiUsageUpdateManyWithoutTeamNestedInput
auditLogs?: Prisma.AuditLogUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUpdateManyWithoutTeamNestedInput
}
export type TeamUncheckedUpdateWithoutKanbanTasksInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
settings?:PrismaJson.Settings | Prisma.NullableJsonNullValueInput
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
rootFolderId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
members?: Prisma.TeamMemberUncheckedUpdateManyWithoutTeamNestedInput
projects?: Prisma.ProjectUncheckedUpdateManyWithoutTeamNestedInput
metadataFields?: Prisma.MetadataFieldUncheckedUpdateManyWithoutTeamNestedInput
invites?: Prisma.InviteUncheckedUpdateManyWithoutTeamNestedInput
notifications?: Prisma.NotificationUncheckedUpdateManyWithoutTeamNestedInput
userMetadata?: Prisma.UserMetadataUncheckedUpdateManyWithoutTeamNestedInput
providers?: Prisma.ProviderUncheckedUpdateManyWithoutTeamNestedInput
skills?: Prisma.SkillUncheckedUpdateManyWithoutTeamNestedInput
mcpServers?: Prisma.McpServerUncheckedUpdateManyWithoutTeamNestedInput
sandbox?: Prisma.SandboxUncheckedUpdateOneWithoutTeamNestedInput
agents?: Prisma.AgentUncheckedUpdateManyWithoutTeamNestedInput
aiUsages?: Prisma.AiUsageUncheckedUpdateManyWithoutTeamNestedInput
auditLogs?: Prisma.AuditLogUncheckedUpdateManyWithoutTeamNestedInput
watermarkTemplates?: Prisma.WatermarkTemplateUncheckedUpdateManyWithoutTeamNestedInput
quotaRules?: Prisma.QuotaRuleUncheckedUpdateManyWithoutTeamNestedInput
quotaRecords?: Prisma.QuotaRecordUncheckedUpdateManyWithoutTeamNestedInput
kanbanGoals?: Prisma.KanbanGoalUncheckedUpdateManyWithoutTeamNestedInput
}
@@ -2632,6 +3050,8 @@ export type TeamCountOutputType = {
watermarkTemplates: number
quotaRules: number
quotaRecords: number
kanbanGoals: number
kanbanTasks: number
}
export type TeamCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
@@ -2650,6 +3070,8 @@ export type TeamCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.I
watermarkTemplates?: boolean | TeamCountOutputTypeCountWatermarkTemplatesArgs
quotaRules?: boolean | TeamCountOutputTypeCountQuotaRulesArgs
quotaRecords?: boolean | TeamCountOutputTypeCountQuotaRecordsArgs
kanbanGoals?: boolean | TeamCountOutputTypeCountKanbanGoalsArgs
kanbanTasks?: boolean | TeamCountOutputTypeCountKanbanTasksArgs
}
/**
@@ -2767,6 +3189,20 @@ export type TeamCountOutputTypeCountQuotaRecordsArgs<ExtArgs extends runtime.Typ
where?: Prisma.QuotaRecordWhereInput
}
/**
* TeamCountOutputType without action
*/
export type TeamCountOutputTypeCountKanbanGoalsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.KanbanGoalWhereInput
}
/**
* TeamCountOutputType without action
*/
export type TeamCountOutputTypeCountKanbanTasksArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.KanbanTaskWhereInput
}
export type TeamSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
@@ -2792,6 +3228,8 @@ export type TeamSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = r
watermarkTemplates?: boolean | Prisma.Team$watermarkTemplatesArgs<ExtArgs>
quotaRules?: boolean | Prisma.Team$quotaRulesArgs<ExtArgs>
quotaRecords?: boolean | Prisma.Team$quotaRecordsArgs<ExtArgs>
kanbanGoals?: boolean | Prisma.Team$kanbanGoalsArgs<ExtArgs>
kanbanTasks?: boolean | Prisma.Team$kanbanTasksArgs<ExtArgs>
_count?: boolean | Prisma.TeamCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["team"]>
@@ -2843,6 +3281,8 @@ export type TeamInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs =
watermarkTemplates?: boolean | Prisma.Team$watermarkTemplatesArgs<ExtArgs>
quotaRules?: boolean | Prisma.Team$quotaRulesArgs<ExtArgs>
quotaRecords?: boolean | Prisma.Team$quotaRecordsArgs<ExtArgs>
kanbanGoals?: boolean | Prisma.Team$kanbanGoalsArgs<ExtArgs>
kanbanTasks?: boolean | Prisma.Team$kanbanTasksArgs<ExtArgs>
_count?: boolean | Prisma.TeamCountOutputTypeDefaultArgs<ExtArgs>
}
export type TeamIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
@@ -2872,6 +3312,8 @@ export type $TeamPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs =
watermarkTemplates: Prisma.$WatermarkTemplatePayload<ExtArgs>[]
quotaRules: Prisma.$QuotaRulePayload<ExtArgs>[]
quotaRecords: Prisma.$QuotaRecordPayload<ExtArgs>[]
kanbanGoals: Prisma.$KanbanGoalPayload<ExtArgs>[]
kanbanTasks: Prisma.$KanbanTaskPayload<ExtArgs>[]
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: string
@@ -3294,6 +3736,8 @@ export interface Prisma__TeamClient<T, Null = never, ExtArgs extends runtime.Typ
watermarkTemplates<T extends Prisma.Team$watermarkTemplatesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Team$watermarkTemplatesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$WatermarkTemplatePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
quotaRules<T extends Prisma.Team$quotaRulesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Team$quotaRulesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$QuotaRulePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
quotaRecords<T extends Prisma.Team$quotaRecordsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Team$quotaRecordsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$QuotaRecordPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
kanbanGoals<T extends Prisma.Team$kanbanGoalsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Team$kanbanGoalsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$KanbanGoalPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
kanbanTasks<T extends Prisma.Team$kanbanTasksArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Team$kanbanTasksArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$KanbanTaskPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
@@ -4127,6 +4571,54 @@ export type Team$quotaRecordsArgs<ExtArgs extends runtime.Types.Extensions.Inter
distinct?: Prisma.QuotaRecordScalarFieldEnum | Prisma.QuotaRecordScalarFieldEnum[]
}
/**
* Team.kanbanGoals
*/
export type Team$kanbanGoalsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the KanbanGoal
*/
select?: Prisma.KanbanGoalSelect<ExtArgs> | null
/**
* Omit specific fields from the KanbanGoal
*/
omit?: Prisma.KanbanGoalOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.KanbanGoalInclude<ExtArgs> | null
where?: Prisma.KanbanGoalWhereInput
orderBy?: Prisma.KanbanGoalOrderByWithRelationInput | Prisma.KanbanGoalOrderByWithRelationInput[]
cursor?: Prisma.KanbanGoalWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.KanbanGoalScalarFieldEnum | Prisma.KanbanGoalScalarFieldEnum[]
}
/**
* Team.kanbanTasks
*/
export type Team$kanbanTasksArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the KanbanTask
*/
select?: Prisma.KanbanTaskSelect<ExtArgs> | null
/**
* Omit specific fields from the KanbanTask
*/
omit?: Prisma.KanbanTaskOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.KanbanTaskInclude<ExtArgs> | null
where?: Prisma.KanbanTaskWhereInput
orderBy?: Prisma.KanbanTaskOrderByWithRelationInput | Prisma.KanbanTaskOrderByWithRelationInput[]
cursor?: Prisma.KanbanTaskWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.KanbanTaskScalarFieldEnum | Prisma.KanbanTaskScalarFieldEnum[]
}
/**
* Team without action
*/
File diff suppressed because it is too large Load Diff
+31
View File
@@ -431,5 +431,36 @@ declare global {
// ----------------------------------------------------------------------
export type QuotaResourceData = Record<string, unknown>
export type QuotaUserIds = string[]
// ----------------------------------------------------------------------
// Kanban Types
// ----------------------------------------------------------------------
export type KanbanBlockReasonKind = 'NEEDS_INPUT' | 'CAPABILITY' | 'DEPENDENCY' | 'TRANSIENT'
export interface KanbanAssetSummary {
id: string
type?: string
name?: string
description?: string
}
export interface KanbanEventPayload {
summary?: string
blockReason?: string
blockKind?: KanbanBlockReasonKind
assets?: KanbanAssetSummary[]
reason?: string
[key: string]: unknown
}
export interface KanbanCommentAttachment {
id: string
name: string
key: string
sizeByte: number
contentType?: string | null
proxyType?: 'image' | 'video' | 'audio' | 'pdf' | null
}
export type KanbanCommentAttachmentList = KanbanCommentAttachment[]
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/dtos",
"version": "0.3.9",
"version": "0.3.10",
"private": true,
"type": "module",
"main": "./src/index.ts",
+10
View File
@@ -53,6 +53,16 @@ export enum AuditAction {
quota_policy_create = 'quota_policy_create',
quota_policy_update = 'quota_policy_update',
quota_policy_delete = 'quota_policy_delete',
kanban_goal_create = 'kanban_goal_create',
kanban_goal_update = 'kanban_goal_update',
kanban_goal_delete = 'kanban_goal_delete',
kanban_task_create = 'kanban_task_create',
kanban_task_update = 'kanban_task_update',
kanban_task_delete = 'kanban_task_delete',
kanban_comment_create = 'kanban_comment_create',
kanban_comment_delete = 'kanban_comment_delete',
kanban_dependency_add = 'kanban_dependency_add',
kanban_dependency_remove = 'kanban_dependency_remove',
}
export const auditLogSchema = z.object({
+1
View File
@@ -23,3 +23,4 @@ export * from './chat'
export * from './auditLog'
export * from './watermark'
export * from './quota'
export * from './kanban'
+62
View File
@@ -0,0 +1,62 @@
import { z } from 'zod'
import { kanbanUserInfoSchema } from './event'
export const kanbanAttachmentPayloadSchema = z.object({
id: z.string(),
name: z.string(),
key: z.string(),
sizeByte: z.number(),
contentType: z.string().nullable().optional(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
})
export type KanbanAttachmentPayload = z.infer<typeof kanbanAttachmentPayloadSchema>
export const kanbanAttachmentInfoSchema = z.object({
id: z.string(),
name: z.string(),
sizeByte: z.number(),
contentType: z.string().nullable().optional(),
url: z.string(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
})
export type KanbanAttachmentInfo = z.infer<typeof kanbanAttachmentInfoSchema>
export const postKanbanAttachmentResponseSchema = z.object({
id: z.string(),
name: z.string(),
key: z.string(),
sizeByte: z.number(),
contentType: z.string().nullable().optional(),
uploadUrl: z.string(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
})
export type PostKanbanAttachmentResponse = z.infer<typeof postKanbanAttachmentResponseSchema>
export const createKanbanCommentSchema = z
.object({
body: z.string().default(''),
attachments: z.array(kanbanAttachmentPayloadSchema).optional(),
})
.refine(
(data) => data.body.trim().length > 0 || (data.attachments && data.attachments.length > 0),
{
message: 'Comment body or attachments required',
},
)
export type CreateKanbanCommentRequest = z.infer<typeof createKanbanCommentSchema>
export const kanbanCommentInfoSchema = z.object({
id: z.string(),
taskId: z.string(),
author: kanbanUserInfoSchema,
body: z.string(),
attachments: z.array(kanbanAttachmentInfoSchema).default([]),
createdAt: z.union([z.string(), z.date()]),
updatedAt: z.union([z.string(), z.date()]),
})
export type KanbanCommentInfo = z.infer<typeof kanbanCommentInfoSchema>
export const listKanbanCommentsResponseSchema = z.object({
data: z.array(kanbanCommentInfoSchema),
})
export type ListKanbanCommentsResponse = z.infer<typeof listKanbanCommentsResponseSchema>
+46
View File
@@ -0,0 +1,46 @@
import { z } from 'zod'
import { KanbanTaskEventType, KanbanTaskStatus } from '@shumai/db/enums'
export const kanbanUserInfoSchema = z.object({
id: z.string(),
name: z.string(),
image: z.string().optional(),
})
export type KanbanUserInfo = z.infer<typeof kanbanUserInfoSchema>
export const kanbanEventPayloadSchema = z
.object({
summary: z.string().optional(),
blockReason: z.string().optional(),
blockKind: z.string().optional(),
reason: z.string().optional(),
assets: z
.array(
z.object({
id: z.string(),
type: z.string().optional(),
name: z.string().optional(),
description: z.string().optional(),
}),
)
.optional(),
})
.passthrough()
export type KanbanEventPayload = z.infer<typeof kanbanEventPayloadSchema>
export const kanbanEventInfoSchema = z.object({
id: z.string(),
taskId: z.string(),
actor: kanbanUserInfoSchema.nullable().optional(),
type: z.nativeEnum(KanbanTaskEventType),
fromStatus: z.nativeEnum(KanbanTaskStatus).nullable().optional(),
toStatus: z.nativeEnum(KanbanTaskStatus).nullable().optional(),
data: kanbanEventPayloadSchema.nullable().optional(),
createdAt: z.union([z.string(), z.date()]),
})
export type KanbanEventInfo = z.infer<typeof kanbanEventInfoSchema>
export const listKanbanEventsResponseSchema = z.object({
data: z.array(kanbanEventInfoSchema),
})
export type ListKanbanEventsResponse = z.infer<typeof listKanbanEventsResponseSchema>
+37
View File
@@ -0,0 +1,37 @@
import { z } from 'zod'
export const UNASSIGNED_GOAL_ID = 'unassigned'
export const createKanbanGoalSchema = z.object({
title: z.string().min(1),
description: z.string().optional(),
})
export type CreateKanbanGoalRequest = z.infer<typeof createKanbanGoalSchema>
export const updateKanbanGoalSchema = z.object({
title: z.string().min(1).optional(),
description: z.string().nullable().optional(),
})
export type UpdateKanbanGoalRequest = z.infer<typeof updateKanbanGoalSchema>
export const kanbanGoalInfoSchema = z.object({
id: z.string(),
title: z.string(),
description: z.string().nullable().optional(),
teamId: z.string(),
creatorId: z.string().nullable().optional(),
taskCount: z.number().optional(),
createdAt: z.union([z.string(), z.date()]),
updatedAt: z.union([z.string(), z.date()]),
})
export type KanbanGoalInfo = z.infer<typeof kanbanGoalInfoSchema>
export const listKanbanGoalsRequestSchema = z.object({
// Filter or search params can be added here
})
export type ListKanbanGoalsRequest = z.infer<typeof listKanbanGoalsRequestSchema>
export const listKanbanGoalsResponseSchema = z.object({
data: z.array(kanbanGoalInfoSchema),
})
export type ListKanbanGoalsResponse = z.infer<typeof listKanbanGoalsResponseSchema>
+4
View File
@@ -0,0 +1,4 @@
export * from './goal'
export * from './comment'
export * from './event'
export * from './task'
+164
View File
@@ -0,0 +1,164 @@
import { z } from 'zod'
import { KanbanTaskStatus, KanbanTaskPriority, KanbanTaskEventType } from '@shumai/db/enums'
import { paginationPageInfoSchema, paginationParamsSchema } from '../pagination'
import { kanbanUserInfoSchema, kanbanEventInfoSchema } from './event'
import { kanbanCommentInfoSchema } from './comment'
export { KanbanTaskStatus, KanbanTaskPriority, KanbanTaskEventType }
export const createKanbanTaskSchema = z.object({
title: z.string().min(1),
description: z.string().optional(),
isAgentTask: z.boolean().optional(),
priority: z.nativeEnum(KanbanTaskPriority).optional(),
startDate: z.union([z.string(), z.date()]).optional(),
dueDate: z.union([z.string(), z.date()]).optional(),
goalId: z.string().optional(),
projectId: z.string().optional(),
reporterId: z.string().optional(),
assigneeId: z.string().optional(),
targetFolderId: z.string().optional(),
parentIds: z.array(z.string()).optional(),
assetIds: z.array(z.string()).optional(),
})
export type CreateKanbanTaskRequest = z.infer<typeof createKanbanTaskSchema>
export const updateKanbanTaskSchema = z.object({
fromStatus: z.nativeEnum(KanbanTaskStatus).optional(),
title: z.string().min(1).optional(),
description: z.string().nullable().optional(),
status: z.nativeEnum(KanbanTaskStatus).optional(),
reason: z.string().optional(),
priority: z.nativeEnum(KanbanTaskPriority).optional(),
startDate: z.union([z.string(), z.date()]).nullable().optional(),
dueDate: z.union([z.string(), z.date()]).nullable().optional(),
goalId: z.string().nullable().optional(),
projectId: z.string().nullable().optional(),
reporterId: z.string().nullable().optional(),
assigneeId: z.string().nullable().optional(),
targetFolderId: z.string().nullable().optional(),
beforeIndex: z.string().optional(),
afterIndex: z.string().optional(),
parentIds: z.array(z.string()).optional(),
assetIds: z.array(z.string()).optional(),
})
export type UpdateKanbanTaskRequest = z.infer<typeof updateKanbanTaskSchema>
export const listKanbanTasksRequestSchema = z
.object({
status: z.nativeEnum(KanbanTaskStatus).optional(),
isAgentTask: z
.union([z.boolean(), z.string()])
.transform((v) => v === true || v === 'true')
.optional(),
goalId: z.string().optional(),
projectId: z.string().optional(),
priority: z.nativeEnum(KanbanTaskPriority).optional(),
assigneeId: z.string().optional(),
reporterId: z.string().optional(),
})
.merge(paginationParamsSchema)
export type ListKanbanTasksRequest = z.infer<typeof listKanbanTasksRequestSchema>
export const kanbanStatusEventInfoSchema = z.object({
id: z.string(),
type: z.nativeEnum(KanbanTaskEventType),
actor: kanbanUserInfoSchema.nullable().optional(),
summary: z.string().optional(),
blockReason: z.string().optional(),
blockKind: z.string().optional(),
reason: z.string().optional(),
createdAt: z.union([z.string(), z.date()]),
})
export type KanbanStatusEventInfo = z.infer<typeof kanbanStatusEventInfoSchema>
export const kanbanTaskGoalSummarySchema = z.object({
id: z.string(),
title: z.string(),
})
export type KanbanTaskGoalSummary = z.infer<typeof kanbanTaskGoalSummarySchema>
export const kanbanTaskSummarySchema = z.object({
id: z.string(),
title: z.string(),
isAgentTask: z.boolean(),
status: z.nativeEnum(KanbanTaskStatus),
priority: z.nativeEnum(KanbanTaskPriority),
sortIndex: z.string().nullable().optional(),
})
export type KanbanTaskSummary = z.infer<typeof kanbanTaskSummarySchema>
export const kanbanTaskAssetInfoSchema = z.object({
id: z.string(),
name: z.string(),
type: z.string(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
thumbnailUrl: z.string().nullable().optional(),
path: z.string(),
creator: kanbanUserInfoSchema.nullable().optional(),
sizeByte: z.number().optional(),
fileCount: z.number().optional(),
projectId: z.string().nullable().optional(),
createdAt: z.union([z.string(), z.date()]),
})
export type KanbanTaskAssetInfo = z.infer<typeof kanbanTaskAssetInfoSchema>
export const kanbanTaskInfoSchema = z.object({
id: z.string(),
title: z.string(),
description: z.string().nullable().optional(),
isAgentTask: z.boolean(),
status: z.nativeEnum(KanbanTaskStatus),
priority: z.nativeEnum(KanbanTaskPriority),
startDate: z.union([z.string(), z.date()]).nullable().optional(),
dueDate: z.union([z.string(), z.date()]).nullable().optional(),
startedAt: z.union([z.string(), z.date()]).nullable().optional(),
completedAt: z.union([z.string(), z.date()]).nullable().optional(),
teamId: z.string(),
projectId: z.string().nullable().optional(),
sortIndex: z.string().nullable().optional(),
creator: kanbanUserInfoSchema,
reporter: kanbanUserInfoSchema.nullable().optional(),
assignee: kanbanUserInfoSchema.nullable().optional(),
goal: kanbanTaskGoalSummarySchema.nullable().optional(),
targetFolderId: z.string().nullable().optional(),
latestStatusEvent: kanbanStatusEventInfoSchema.nullable().optional(),
commentCount: z.number().default(0),
dependencyCount: z.number().default(0),
dependentCount: z.number().default(0),
assetCount: z.number().default(0),
createdAt: z.union([z.string(), z.date()]),
updatedAt: z.union([z.string(), z.date()]),
})
export type KanbanTaskInfo = z.infer<typeof kanbanTaskInfoSchema>
export const kanbanTaskDetailSchema = kanbanTaskInfoSchema.extend({
dependencies: z.array(kanbanTaskSummarySchema),
dependents: z.array(kanbanTaskSummarySchema),
assets: z.array(kanbanTaskAssetInfoSchema),
comments: z.array(kanbanCommentInfoSchema),
events: z.array(kanbanEventInfoSchema),
})
export type KanbanTaskDetail = z.infer<typeof kanbanTaskDetailSchema>
export const listKanbanTasksResponseSchema = z.object({
data: z.array(kanbanTaskInfoSchema),
pageInfo: paginationPageInfoSchema,
})
export type ListKanbanTasksResponse = z.infer<typeof listKanbanTasksResponseSchema>
export const linkAssetToTaskSchema = z.object({
taskId: z.string(),
})
export type LinkAssetToTaskRequest = z.infer<typeof linkAssetToTaskSchema>
export const linkTaskAssetsSchema = z.object({
assetIds: z.array(z.string()),
})
export type LinkTaskAssetsRequest = z.infer<typeof linkTaskAssetsSchema>
export const listAssetTasksResponseSchema = z.object({
data: z.array(kanbanTaskInfoSchema),
total: z.number(),
})
export type ListAssetTasksResponse = z.infer<typeof listAssetTasksResponseSchema>
+12
View File
@@ -28,6 +28,14 @@ export const assetPreviewSchema = z.object({
export type AssetPreview = z.infer<typeof assetPreviewSchema>
export const kanbanTaskPreviewSchema = z.object({
id: z.string().optional(),
title: z.string().optional(),
status: z.string().optional(),
})
export type KanbanTaskPreview = z.infer<typeof kanbanTaskPreviewSchema>
export const notificationInfoSchema = z.object({
id: z.string().optional(),
creator: teamUserInfoSchema.optional(),
@@ -35,6 +43,7 @@ export const notificationInfoSchema = z.object({
team: entityInfoSchema.optional(),
project: entityInfoSchema.optional(),
asset: assetPreviewSchema.optional(),
kanbanTask: kanbanTaskPreviewSchema.optional(),
user: teamUserInfoSchema.optional(),
createdAt: z.string().optional(),
isRead: z.boolean().optional(),
@@ -67,6 +76,7 @@ export interface CreateNotificationRequest {
creatorId?: string
assetId?: string
taskId?: string
kanbanTaskId?: string
userId?: string
commentMessage?: string // For parsing mentions
}
@@ -84,6 +94,8 @@ export const notificationSettingsSchema = z.object({
yourUploads: z.boolean().default(false),
otherUploads: z.boolean().default(true),
statusUpdates: z.boolean().default(true),
kanbanTasks: z.boolean().default(true),
kanbanComments: z.boolean().default(true),
})
export type NotificationSettings = z.infer<typeof notificationSettingsSchema>
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/e2e",
"version": "0.3.9",
"version": "0.3.10",
"private": true,
"type": "module",
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/tableprinter",
"version": "0.3.9",
"version": "0.3.10",
"private": true,
"type": "module",
"main": "./src/index.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@shumai/transcode",
"version": "0.3.9",
"version": "0.3.10",
"private": true,
"type": "module",
"main": "./src/index.ts",
-7
View File
@@ -1,7 +1,6 @@
import { hc } from 'hono/client'
import type { AppType } from '@shumai/api'
import { useAuthStore } from '@/ui/stores/auth'
import { toast } from 'sonner'
const customFetch = async (input: RequestInfo | URL, init?: RequestInit) => {
const response = await fetch(input, init)
@@ -20,12 +19,6 @@ const customFetch = async (input: RequestInfo | URL, init?: RequestInit) => {
}
}
if (response.status === 403) {
toast.error('You do not have permission. Please contact the team admin.', {
id: 'forbidden-error',
})
}
return response
}
@@ -0,0 +1,86 @@
// @vitest-environment happy-dom
import React from 'react'
import { cleanup, render, screen } from '@testing-library/react'
import { afterEach, describe, expect, it, vi } from 'vitest'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { BreadcrumbNav } from './breadcrumb-nav'
// Mock tanstack router Link
vi.mock('@tanstack/react-router', () => ({
Link: ({ children, to, ...props }: { children: React.ReactNode; to: string }) => (
<a href={to} {...props}>
{children}
</a>
),
useNavigate: () => vi.fn(),
useMatch: () => false,
}))
describe('BreadcrumbNav component', () => {
const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: false,
},
},
})
afterEach(() => {
cleanup()
})
const baseProps = {
teamId: 'team-1',
projectId: 'proj-1',
projectName: 'Demo Project',
ancestorFolders: [],
currentAsset: {
id: 'asset-1',
name: 'Folder A',
type: 'folder' as const,
},
isRootFolder: false,
isRightSidebarCollapsed: false,
onRightSidebarToggle: vi.fn(),
}
it('renders SquareKanban task link button for non-root folder', () => {
render(
<QueryClientProvider client={queryClient}>
<BreadcrumbNav {...baseProps} />
</QueryClientProvider>,
)
expect(screen.getByTitle(/Linked Tasks|关联任务/i)).toBeDefined()
})
it('hides SquareKanban task link button on project root folder', () => {
render(
<QueryClientProvider client={queryClient}>
<BreadcrumbNav {...baseProps} isRootFolder={true} />
</QueryClientProvider>,
)
expect(screen.queryByTitle(/Linked Tasks|关联任务/i)).toBeNull()
})
it('hides SquareKanban task link button for public share view', () => {
render(
<QueryClientProvider client={queryClient}>
<BreadcrumbNav {...baseProps} isPublic={true} />
</QueryClientProvider>,
)
expect(screen.queryByTitle(/Linked Tasks|关联任务/i)).toBeNull()
})
it('hides SquareKanban task link button on Recently Deleted view', () => {
render(
<QueryClientProvider client={queryClient}>
<BreadcrumbNav {...baseProps} currentAsset={{ name: 'Recently Deleted', type: 'folder' }} />
</QueryClientProvider>,
)
expect(screen.queryByTitle(/Linked Tasks|关联任务/i)).toBeNull()
})
})
@@ -1,5 +1,6 @@
import { client } from '@/ui/api/client'
import { Badge } from '@/ui/components/ui/badge'
import { Button } from '@/ui/components/ui/button'
import {
DropdownMenu,
DropdownMenuContent,
@@ -30,6 +31,7 @@ import { cn } from '@/ui/lib/utils'
import { m } from '@/ui/paraglide/messages.js'
import type { AncestorFolder } from '@shumai/dtos'
import { Link, useNavigate } from '@tanstack/react-router'
import { useQuery } from '@tanstack/react-query'
import {
Bot,
Check,
@@ -39,9 +41,11 @@ import {
History,
LayoutGrid,
List,
SquareKanban,
} from 'lucide-react'
import { useState } from 'react'
import { ManageVersionsDialog } from './manage-versions-dialog'
import { AssetLinkedTasksDialog } from './kanban/asset-linked-tasks-dialog'
interface BreadcrumbNavProps {
teamId: string
@@ -49,6 +53,7 @@ interface BreadcrumbNavProps {
projectName: string
ancestorFolders: AncestorFolder[]
currentAsset: {
id?: string
name?: string
type: 'file' | 'folder'
version?: number
@@ -123,6 +128,33 @@ export function BreadcrumbNav({
const navigate = useNavigate()
const { canEdit } = usePermissions(projectId)
const [isManageVersionsOpen, setIsManageVersionsOpen] = useState(false)
const [isLinkedTasksOpen, setIsLinkedTasksOpen] = useState(false)
const targetAssetId = fileId || currentAsset.id
const isRecentlyDeleted = currentAsset.name === 'Recently Deleted'
const isCollection = currentAsset.name === 'All Collections'
const showKanbanLink =
!isPublic &&
!isRootFolder &&
!isRecentlyDeleted &&
!isCollection &&
!compareMode &&
!!targetAssetId
const { data: linkedTasksData } = useQuery({
queryKey: ['teams', teamId, 'kanban', 'assets', targetAssetId, 'tasks'],
queryFn: async () => {
if (!teamId || !targetAssetId) return { data: [], total: 0 }
const res = await client.api.teams[':teamId'].kanban.assets[':assetId'].tasks.$get({
param: { teamId, assetId: targetAssetId },
})
if (!res.ok) return { data: [], total: 0 }
return (await res.json()) as { data: Array<{ id: string }>; total: number }
},
enabled: !!teamId && !!targetAssetId && showKanbanLink,
})
const linkedTaskCount = linkedTasksData?.total ?? linkedTasksData?.data?.length ?? 0
const isChatbotDisabled = false
@@ -399,6 +431,33 @@ export function BreadcrumbNav({
</div>
) : null}
{showKanbanLink && (
<Button
variant="ghost"
size="sm"
className="h-7 px-2 text-xs gap-1.5 text-muted-foreground hover:text-foreground hover:bg-muted ml-1 cursor-pointer"
onClick={() => setIsLinkedTasksOpen(true)}
title={m.linked_tasks()}
>
<SquareKanban className="w-4 h-4" />
{linkedTaskCount > 0 && (
<span className="inline-flex items-center justify-center px-1.5 py-0.2 text-[10px] font-semibold rounded-full bg-muted-foreground/15 text-foreground">
{linkedTaskCount}
</span>
)}
</Button>
)}
{showKanbanLink && isLinkedTasksOpen && targetAssetId && (
<AssetLinkedTasksDialog
teamId={teamId}
assetId={targetAssetId}
assetName={currentAsset.name}
isOpen={isLinkedTasksOpen}
onClose={() => setIsLinkedTasksOpen(false)}
/>
)}
{fileId && versions && versions.length > 0 && (
<ManageVersionsDialog
open={isManageVersionsOpen}
+29 -25
View File
@@ -10,6 +10,7 @@ interface DualSidebarItemProps {
badge?: React.ReactNode
children?: React.ReactNode
onItemClick?: () => void
active?: boolean
}
// A declarative component that holds props for a sidebar item. It doesn't render anything itself.
@@ -103,32 +104,35 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
<div className="absolute bottom-0 w-full h-[70dvh] bg-linear-to-t from-sidebar-primary/10 to-transparent"></div>
{/* Level 1: Icon Bar */}
<nav className="w-16 bg-card border-r border-sidebar-border flex flex-col items-center pb-4 pt-0 space-y-2 flex-shrink-0">
<div className="flex-1 w-full flex flex-col items-center space-y-5 pt-1">
<div className="flex-1 w-full flex flex-col items-center gap-5 pt-1">
<TooltipProvider>
{sidebarItems.map((item, index) => (
<Tooltip key={item.props.label}>
<TooltipTrigger asChild>
<Button
variant="ghost"
size="icon-lg"
onClick={() => handleItemClick(index)}
aria-label={item.props.label}
aria-expanded={activeItem === index}
className={`relative w-12 h-12 [&_svg:not([class*='size-'])]:size-6 transition-all duration-200 ${
activeItem === index
? 'bg-sidebar-primary text-sidebar-primary-foreground shadow-lg hover:bg-sidebar-primary hover:text-sidebar-primary-foreground'
: 'text-sidebar-foreground/60 hover:text-sidebar-foreground hover:bg-sidebar-accent'
}`}
>
{item.props.icon}
{item.props.badge}
</Button>
</TooltipTrigger>
<TooltipContent side="right">
<p>{item.props.label}</p>
</TooltipContent>
</Tooltip>
))}
{sidebarItems.map((item, index) => {
const isItemActive = Boolean(item.props.active || activeItem === index)
return (
<Tooltip key={item.props.label}>
<TooltipTrigger asChild>
<Button
variant="ghost"
size="icon-lg"
onClick={() => handleItemClick(index)}
aria-label={item.props.label}
aria-expanded={activeItem === index}
className={`relative w-12 h-12 [&_svg:not([class*='size-'])]:size-6 transition-colors duration-200 ${
isItemActive
? 'text-sidebar-primary hover:bg-sidebar-accent hover:text-sidebar-primary'
: 'text-sidebar-foreground/60 hover:text-sidebar-foreground hover:bg-sidebar-accent'
}`}
>
{item.props.icon}
{item.props.badge}
</Button>
</TooltipTrigger>
<TooltipContent side="right">
<p>{item.props.label}</p>
</TooltipContent>
</Tooltip>
)
})}
</TooltipProvider>
</div>
<div className="mt-auto w-full flex flex-col items-center pb-2">
@@ -164,8 +164,8 @@ export default function FileSystemManager({
currentAsset: isRecentlyDeleted
? { name: 'Recently Deleted', type: 'folder' }
: isCollection
? { name: collection.name, type: 'folder' }
: { name: folderInfo?.name, type: 'folder' },
? { id: collection.id, name: collection.name, type: 'folder' }
: { id: folderInfo?.id || assetId, name: folderInfo?.name, type: 'folder' },
isRootFolder: !isRecentlyDeleted && !isCollection && assetId === rootFolderId,
onFolderClick: (id: string) => {
navigate({
+3 -1
View File
@@ -73,6 +73,7 @@ interface FolderTreeProps {
selectedFolderId?: string
hideCollections?: boolean
hideShares?: boolean
hideRecentlyDeleted?: boolean
ancestorFolders?: AncestorFolder[]
}
@@ -86,6 +87,7 @@ export function FolderTree({
selectedFolderId,
hideCollections,
hideShares,
hideRecentlyDeleted,
ancestorFolders,
}: FolderTreeProps) {
const navigate = useNavigate()
@@ -513,7 +515,7 @@ export function FolderTree({
ancestorFolders={ancestorFolders}
/>
{canEdit && (
{canEdit && !hideRecentlyDeleted && (
<div
className={cn(
'group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
@@ -0,0 +1,345 @@
import { useState, useMemo } from 'react'
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
import { client } from '@/ui/api/client'
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/ui/components/ui/dialog'
import { Button } from '@/ui/components/ui/button'
import { Input } from '@/ui/components/ui/input'
import { Popover, PopoverContent, PopoverTrigger } from '@/ui/components/ui/popover'
import { ScrollArea } from '@/ui/components/ui/scroll-area'
import { Avatar, AvatarFallback, AvatarImage } from '@/ui/components/ui/avatar'
import { m } from '@/ui/paraglide/messages.js'
import { KanbanTaskStatus, type KanbanTaskInfo } from '@shumai/dtos'
import {
getStatusBadgeColor,
getStatusLabel,
getPriorityBadgeColor,
getPriorityLabel,
} from './kanban-types'
import { EditTaskDialog } from './edit-task-dialog/edit-task-dialog'
import { SquareKanban, Plus, X, Search, Loader2, Bot } from 'lucide-react'
import { cn } from '@/ui/lib/utils'
import { toast } from 'sonner'
interface AssetLinkedTasksDialogProps {
teamId: string
assetId: string
assetName?: string
isOpen: boolean
onClose: () => void
}
const SELECTABLE_STATUSES: KanbanTaskStatus[] = [
KanbanTaskStatus.TODO,
KanbanTaskStatus.READY,
KanbanTaskStatus.IN_PROGRESS,
KanbanTaskStatus.IN_REVIEW,
KanbanTaskStatus.DONE,
KanbanTaskStatus.BLOCKED,
]
export function AssetLinkedTasksDialog({
teamId,
assetId,
assetName,
isOpen,
onClose,
}: AssetLinkedTasksDialogProps) {
const queryClient = useQueryClient()
const [editingTaskId, setEditingTaskId] = useState<string | null>(null)
const [isLinkSelectorOpen, setIsLinkSelectorOpen] = useState(false)
const [selectedStatus, setSelectedStatus] = useState<KanbanTaskStatus>(KanbanTaskStatus.TODO)
const [searchQuery, setSearchQuery] = useState('')
// 1. Fetch tasks currently linked to this asset
const { data: linkedTasksData, isLoading: isLoadingLinked } = useQuery({
queryKey: ['teams', teamId, 'kanban', 'assets', assetId, 'tasks'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].kanban.assets[':assetId'].tasks.$get({
param: { teamId, assetId },
})
if (!res.ok) throw new Error('Failed to fetch linked tasks')
return (await res.json()) as { data: KanbanTaskInfo[]; total: number }
},
enabled: !!teamId && !!assetId && isOpen,
})
const linkedTasks = linkedTasksData?.data || []
const linkedTaskIds = useMemo(() => new Set(linkedTasks.map((t) => t.id)), [linkedTasks])
// 2. Fetch tasks for link picker
const { data: statusTasksData, isLoading: isLoadingStatusTasks } = useQuery({
queryKey: ['teams', teamId, 'kanban', 'tasks', 'status', selectedStatus],
queryFn: async () => {
const res = await client.api.teams[':teamId'].kanban.tasks.$get({
param: { teamId },
query: { status: selectedStatus, first: '100' },
})
if (!res.ok) return { data: [] }
return (await res.json()) as { data: KanbanTaskInfo[] }
},
enabled: !!teamId && isLinkSelectorOpen && isOpen,
})
const availableTasks = statusTasksData?.data || []
const filteredAvailableTasks = useMemo(() => {
const query = searchQuery.trim().toLowerCase()
return availableTasks.filter((t) => {
if (linkedTaskIds.has(t.id)) return false
if (!query) return true
return t.title.toLowerCase().includes(query)
})
}, [availableTasks, linkedTaskIds, searchQuery])
// 3. Mutations
const linkTaskMutation = useMutation({
mutationFn: async (taskId: string) => {
const res = await client.api.teams[':teamId'].kanban.assets[':assetId'].tasks.$post({
param: { teamId, assetId },
json: { taskId },
})
if (!res.ok) throw new Error('Failed to link task')
return await res.json()
},
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: ['teams', teamId, 'kanban', 'assets', assetId, 'tasks'],
})
queryClient.invalidateQueries({
queryKey: ['teams', teamId, 'kanban'],
})
toast.success(m.asset_linked())
},
})
const unlinkTaskMutation = useMutation({
mutationFn: async (taskId: string) => {
const res = await client.api.teams[':teamId'].kanban.assets[':assetId'].tasks[
':taskId'
].$delete({
param: { teamId, assetId, taskId },
})
if (!res.ok) throw new Error('Failed to unlink task')
return await res.json()
},
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: ['teams', teamId, 'kanban', 'assets', assetId, 'tasks'],
})
queryClient.invalidateQueries({
queryKey: ['teams', teamId, 'kanban'],
})
toast.success(m.asset_unlinked())
},
})
return (
<>
<Dialog open={isOpen} onOpenChange={(open) => !open && onClose()}>
<DialogContent className="sm:max-w-2xl flex flex-col h-[520px] p-0 overflow-hidden">
{/* Header */}
<DialogHeader className="p-4 border-b flex flex-row items-center justify-between space-y-0 shrink-0">
<div className="flex items-center gap-2 min-w-0 pr-4">
<SquareKanban className="w-5 h-5 text-primary shrink-0" />
<div className="min-w-0">
<DialogTitle className="text-sm font-semibold truncate">
{m.linked_tasks()}
</DialogTitle>
{assetName && (
<p className="text-xs text-muted-foreground truncate mt-0.5">{assetName}</p>
)}
</div>
</div>
</DialogHeader>
{/* Linked Tasks List */}
<div className="flex-1 min-h-0 flex flex-col overflow-hidden bg-background">
<ScrollArea className="flex-1 min-h-0 p-4 [&>div>div]:block!">
{isLoadingLinked ? (
<div className="flex items-center justify-center p-12">
<Loader2 className="w-6 h-6 animate-spin text-muted-foreground" />
</div>
) : linkedTasks.length === 0 ? (
<div className="flex flex-col items-center justify-center p-12 text-center text-xs text-muted-foreground gap-2">
<SquareKanban className="w-8 h-8 opacity-30" />
<p>{m.no_linked_tasks()}</p>
</div>
) : (
<div className="space-y-2">
{linkedTasks.map((task) => (
<div
key={task.id}
onClick={() => setEditingTaskId(task.id)}
className="flex items-center justify-between gap-3 p-2.5 rounded-lg border border-border/60 bg-muted/20 hover:bg-muted/50 cursor-pointer transition-all hover:border-border"
>
{/* Left: Status, Priority, Title */}
<div className="flex items-center gap-2 min-w-0 flex-1">
{task.isAgentTask && (
<span className="p-1 rounded bg-orange-500/15 text-orange-600 dark:text-orange-400 shrink-0">
<Bot className="w-3.5 h-3.5" />
</span>
)}
<span
className={cn(
'text-[10px] px-1.5 py-0.5 rounded border uppercase font-medium shrink-0',
getStatusBadgeColor(task.status),
)}
>
{getStatusLabel(task.status)}
</span>
<span
className={cn(
'text-[10px] px-1.5 py-0.5 rounded border uppercase font-medium shrink-0',
getPriorityBadgeColor(task.priority),
)}
>
{getPriorityLabel(task.priority)}
</span>
<span className="text-xs font-medium text-foreground truncate flex-1">
{task.title}
</span>
</div>
{/* Right: Assignee & Unlink Button */}
<div className="flex items-center gap-2 shrink-0">
{task.assignee && (
<div
className="flex items-center gap-1 text-[11px] text-muted-foreground"
title={task.assignee.name}
>
<Avatar className="w-4 h-4 text-[9px]">
<AvatarImage src={task.assignee.image || undefined} />
<AvatarFallback>
{task.assignee.name.slice(0, 1).toUpperCase()}
</AvatarFallback>
</Avatar>
<span className="hidden sm:inline text-[11px] max-w-[70px] truncate">
{task.assignee.name}
</span>
</div>
)}
<Button
type="button"
variant="ghost"
size="sm"
className="h-6 w-6 p-0 text-muted-foreground hover:text-destructive hover:bg-destructive/10"
onClick={(e) => {
e.stopPropagation()
unlinkTaskMutation.mutate(task.id)
}}
title={m.unlink_task()}
>
<X className="w-3.5 h-3.5" />
</Button>
</div>
</div>
))}
</div>
)}
</ScrollArea>
</div>
{/* Bottom Action: Link to Task Popover */}
<div className="p-3 px-4 border-t bg-muted/10 flex items-center justify-between shrink-0">
<Popover open={isLinkSelectorOpen} onOpenChange={setIsLinkSelectorOpen}>
<PopoverTrigger asChild>
<Button variant="outline" size="sm" className="gap-1.5 text-xs h-8">
<Plus className="w-3.5 h-3.5" />
<span>{m.link_to_task()}</span>
</Button>
</PopoverTrigger>
<PopoverContent className="w-80 sm:w-96 p-0" align="start">
{/* Search Bar */}
<div className="p-2 border-b">
<div className="relative">
<Search className="w-3.5 h-3.5 absolute left-2.5 top-2.5 text-muted-foreground" />
<Input
placeholder={m.search_tasks()}
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
className="pl-8 h-8 text-xs bg-muted/30"
autoFocus
/>
</div>
</div>
{/* Status Tabs */}
<div className="flex border-b overflow-x-auto p-1 gap-1 bg-muted/20">
{SELECTABLE_STATUSES.map((status) => (
<button
key={status}
type="button"
onClick={() => setSelectedStatus(status)}
className={cn(
'px-2 py-1 text-[11px] font-medium rounded transition-colors whitespace-nowrap',
selectedStatus === status
? 'bg-background shadow-xs text-foreground font-semibold'
: 'text-muted-foreground hover:text-foreground hover:bg-muted/50',
)}
>
{getStatusLabel(status)}
</button>
))}
</div>
{/* Task List */}
<ScrollArea className="h-56">
{isLoadingStatusTasks ? (
<div className="flex items-center justify-center p-6 text-xs text-muted-foreground">
<Loader2 className="w-4 h-4 animate-spin mr-1.5" />
<span>{m.loading()}</span>
</div>
) : filteredAvailableTasks.length === 0 ? (
<div className="p-6 text-center text-xs text-muted-foreground">
{m.no_matching_tasks()}
</div>
) : (
<div className="p-1 space-y-0.5">
{filteredAvailableTasks.map((t) => (
<button
key={t.id}
type="button"
onClick={() => {
linkTaskMutation.mutate(t.id)
setIsLinkSelectorOpen(false)
}}
className="w-full text-left p-2 rounded hover:bg-muted/60 transition-colors flex items-center justify-between gap-2 text-xs group"
>
<span className="truncate flex-1 font-medium text-foreground">
{t.title}
</span>
<span
className={cn(
'text-[10px] px-1.5 py-0.5 rounded border uppercase shrink-0',
getStatusBadgeColor(t.status),
)}
>
{getStatusLabel(t.status)}
</span>
</button>
))}
</div>
)}
</ScrollArea>
</PopoverContent>
</Popover>
<Button variant="ghost" size="sm" onClick={onClose} className="text-xs h-8">
{m.close()}
</Button>
</div>
</DialogContent>
</Dialog>
{/* Task Edit Dialog when a linked task is clicked */}
{editingTaskId && (
<EditTaskDialog
teamId={teamId}
taskId={editingTaskId}
isOpen={true}
onClose={() => setEditingTaskId(null)}
/>
)}
</>
)
}
@@ -0,0 +1,431 @@
import { client } from '@/ui/api/client'
import { FolderTree } from '@/ui/components/folder-tree'
import { Button } from '@/ui/components/ui/button'
import { Checkbox } from '@/ui/components/ui/checkbox'
import {
Dialog,
DialogContent,
DialogFooter,
DialogHeader,
DialogTitle,
} from '@/ui/components/ui/dialog'
import { ScrollArea } from '@/ui/components/ui/scroll-area'
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from '@/ui/components/ui/select'
import { formatSize } from '@/ui/lib/format'
import { m } from '@/ui/paraglide/messages.js'
import type {
AssetInfo,
AssetInfoPaginatedList,
KanbanTaskAssetInfo,
ProjectInfo,
} from '@shumai/dtos'
import { useInfiniteQuery, useQuery } from '@tanstack/react-query'
import { Check, File, Folder, Loader2, Plus } from 'lucide-react'
import { useEffect, useMemo, useState } from 'react'
import { useInView } from 'react-intersection-observer'
interface AssetPickerDialogProps {
teamId: string
initialProjectId?: string | null
excludeAssetIds?: string[]
isOpen: boolean
onClose: () => void
onConfirm: (selectedAssets: KanbanTaskAssetInfo[]) => void
}
export function AssetPickerDialog({
teamId,
initialProjectId,
excludeAssetIds = [],
isOpen,
onClose,
onConfirm,
}: AssetPickerDialogProps) {
const [selectedProjectId, setSelectedProjectId] = useState<string>(initialProjectId || '')
const [selectedFolder, setSelectedFolder] = useState<AssetInfo | null>(null)
const [selectedAssets, setSelectedAssets] = useState<Map<string, KanbanTaskAssetInfo>>(new Map())
// Fetch all projects in the team
const { data: projectsData, isLoading: isLoadingProjects } = useQuery({
queryKey: ['teams', teamId, 'projects'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].projects.$get({
param: { teamId },
query: { first: '100' },
})
if (!res.ok) throw new Error('Failed to fetch projects')
return (await res.json()) as unknown as { data: ProjectInfo[] }
},
enabled: !!teamId && isOpen,
})
const projects = projectsData?.data || []
const activeProjectId = selectedProjectId || (projects[0]?.id ?? '')
const selectedProject = projects.find((p) => p.id === activeProjectId)
const activeFolderId = selectedFolder?.id || selectedProject?.rootFolder || ''
const isRootFolder = activeFolderId === selectedProject?.rootFolder
// Fetch subfolders inside active folder with infinite pagination
const {
data: foldersData,
fetchNextPage: fetchNextFolders,
hasNextPage: hasNextFolders,
isFetchingNextPage: isFetchingNextFolders,
isLoading: isLoadingFolders,
} = useInfiniteQuery<AssetInfoPaginatedList>({
queryKey: ['folders', activeFolderId, 'children', 'folder', 'picker'],
queryFn: async ({ pageParam }) => {
const res = await client.api.folders[':folderId'].children.$get({
param: { folderId: activeFolderId },
query: { assetType: 'folder', after: pageParam as string, first: '20' },
})
if (!res.ok) throw new Error('Failed to fetch folders')
return (await res.json()) as unknown as AssetInfoPaginatedList
},
initialPageParam: '',
getNextPageParam: (lastPage) => lastPage.pageInfo?.cursor || undefined,
enabled: !!activeFolderId && isOpen,
})
// Fetch files inside active folder with infinite pagination
const {
data: filesData,
fetchNextPage: fetchNextFiles,
hasNextPage: hasNextFiles,
isFetchingNextPage: isFetchingNextFiles,
isLoading: isLoadingFiles,
} = useInfiniteQuery<AssetInfoPaginatedList>({
queryKey: ['folders', activeFolderId, 'children', 'file', 'picker'],
queryFn: async ({ pageParam }) => {
const res = await client.api.folders[':folderId'].children.$get({
param: { folderId: activeFolderId },
query: { assetType: 'file', after: pageParam as string, first: '20' },
})
if (!res.ok) throw new Error('Failed to fetch files')
return (await res.json()) as unknown as AssetInfoPaginatedList
},
initialPageParam: '',
getNextPageParam: (lastPage) => lastPage.pageInfo?.cursor || undefined,
enabled: !!activeFolderId && isOpen,
})
const { ref: loadMoreRef, inView } = useInView()
useEffect(() => {
if (inView) {
if (hasNextFolders && !isFetchingNextFolders) {
fetchNextFolders()
} else if (hasNextFiles && !isFetchingNextFiles) {
fetchNextFiles()
}
}
}, [
inView,
hasNextFolders,
isFetchingNextFolders,
fetchNextFolders,
hasNextFiles,
isFetchingNextFiles,
fetchNextFiles,
])
const isLoadingChildren = (isLoadingFolders && !foldersData) || (isLoadingFiles && !filesData)
const isFetchingMore = isFetchingNextFolders || isFetchingNextFiles
const children = useMemo(() => {
const folders = foldersData?.pages.flatMap((page) => page.data ?? []) ?? []
const files = filesData?.pages.flatMap((page) => page.data ?? []) ?? []
return [...folders, ...files]
}, [foldersData, filesData])
const toggleSelectAsset = (asset: AssetInfo) => {
const next = new Map(selectedAssets)
if (next.has(asset.id)) {
next.delete(asset.id)
} else {
const path = selectedProject
? `/${[selectedProject.name, ...(asset.ancestorFolders || []).map((a) => a.name)].filter(Boolean).join('/')}`
: '/'
next.set(asset.id, {
id: asset.id,
name: asset.name,
type: asset.type as 'file' | 'folder' | 'root' | 'version_stack',
proxyType: asset.proxyType ?? null,
thumbnailUrl: asset.preview?.thumbnailUrl ?? null,
path,
creator: asset.creator
? {
id: asset.creator.id,
name: asset.creator.name,
image: asset.creator.image ?? undefined,
}
: null,
sizeByte: asset.sizeByte ?? 0,
fileCount: asset.fileCount ?? null,
projectId: asset.projectId ?? selectedProject?.id ?? null,
createdAt: asset.createdAt ?? new Date().toISOString(),
})
}
setSelectedAssets(next)
}
const toggleSelectCurrentFolder = () => {
if (!selectedFolder || isRootFolder) return
const next = new Map(selectedAssets)
if (next.has(selectedFolder.id)) {
next.delete(selectedFolder.id)
} else {
const path = selectedProject
? `/${[selectedProject.name, ...(selectedFolder.ancestorFolders || []).map((a) => a.name)].filter(Boolean).join('/')}`
: '/'
next.set(selectedFolder.id, {
id: selectedFolder.id,
name: selectedFolder.name,
type: 'folder',
proxyType: null,
thumbnailUrl: null,
path,
creator: selectedFolder.creator
? {
id: selectedFolder.creator.id,
name: selectedFolder.creator.name,
image: selectedFolder.creator.image ?? undefined,
}
: null,
sizeByte: selectedFolder.sizeByte ?? 0,
fileCount: selectedFolder.fileCount ?? null,
projectId: selectedFolder.projectId ?? selectedProject?.id ?? null,
createdAt: selectedFolder.createdAt ?? new Date().toISOString(),
})
}
setSelectedAssets(next)
}
const handleConfirm = () => {
onConfirm(Array.from(selectedAssets.values()))
onClose()
}
return (
<Dialog
open={isOpen}
onOpenChange={(open) => {
if (!open) onClose()
}}
>
<DialogContent className="sm:max-w-4xl flex flex-col h-[650px] p-0 overflow-hidden gap-1">
<DialogHeader className="px-4 py-3 border-b shrink-0">
<div className="flex items-center gap-2">
<Folder className="w-5 h-5 text-primary" />
<DialogTitle>{m.select_assets()}</DialogTitle>
</div>
</DialogHeader>
{/* Second Row Toolbar: Project Selector with Hint Text */}
<div className="flex items-center gap-2.5 px-4 py-1.5 border-b bg-transparent shrink-0">
<span className="text-xs font-medium text-muted-foreground whitespace-nowrap">
{m.current_project_label()}:
</span>
<div className="w-64">
<Select
value={activeProjectId}
onValueChange={(val) => {
setSelectedProjectId(val)
setSelectedFolder(null)
}}
>
<SelectTrigger className="h-8 text-xs bg-background">
<SelectValue placeholder={m.select_project()} />
</SelectTrigger>
<SelectContent>
{projects.map((p) => (
<SelectItem key={p.id} value={p.id} className="text-xs">
{p.name}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
</div>
{/* Main 2-Pane Content */}
<div className="flex-1 min-h-0 flex overflow-hidden">
{/* Left Pane: Folder Tree */}
<div className="w-1/3 min-h-0 border-r bg-sidebar/30 flex flex-col overflow-hidden">
<ScrollArea className="flex-1 min-h-0 [&>div>div]:block!">
{selectedProject && selectedProject.rootFolder ? (
<div className="p-2">
<FolderTree
teamId={teamId}
projectId={selectedProject.id}
projectName={selectedProject.name}
rootFolderId={selectedProject.rootFolder}
onSelect={(folder) => setSelectedFolder(folder)}
selectedFolderId={activeFolderId}
hideCollections
hideShares
hideRecentlyDeleted
/>
</div>
) : (
<div className="flex items-center justify-center h-full p-6 text-xs text-muted-foreground">
{isLoadingProjects ? (
<Loader2 className="w-5 h-5 animate-spin text-muted-foreground" />
) : (
m.no_project_selected()
)}
</div>
)}
</ScrollArea>
</div>
{/* Right Pane: Asset List */}
<div className="flex-1 min-h-0 flex flex-col overflow-hidden bg-background">
{/* Top folder action / status banner */}
<div className="p-2.5 px-4 border-b flex items-center justify-between bg-muted/20 shrink-0">
<div className="flex items-center gap-2 text-xs font-medium truncate">
<Folder className="w-4 h-4 text-muted-foreground shrink-0" />
<span className="truncate">
{selectedFolder ? selectedFolder.name : selectedProject?.name || ''}
</span>
{isRootFolder && (
<span className="text-[10px] text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded">
Root
</span>
)}
</div>
{/* Select Current Folder button (disabled if root folder) */}
{!isRootFolder && selectedFolder && (
<Button
size="sm"
variant={selectedAssets.has(selectedFolder.id) ? 'secondary' : 'outline'}
className="h-7 text-xs gap-1.5"
onClick={toggleSelectCurrentFolder}
disabled={excludeAssetIds.includes(selectedFolder.id)}
>
{selectedAssets.has(selectedFolder.id) ? (
<>
<Check className="w-3.5 h-3.5 text-primary" />
{m.saved()}
</>
) : (
<>
<Plus className="w-3.5 h-3.5" />
{m.select_current_folder()}
</>
)}
</Button>
)}
</div>
{/* List of files & folders inside current directory */}
<ScrollArea className="flex-1 min-h-0 [&>div>div]:block!">
{isLoadingChildren ? (
<div className="flex items-center justify-center p-12">
<Loader2 className="w-6 h-6 animate-spin text-muted-foreground" />
</div>
) : children.length === 0 ? (
<div className="flex flex-col items-center justify-center p-12 text-center text-xs text-muted-foreground gap-2">
<Folder className="w-8 h-8 opacity-30" />
<p>{m.no_assets_in_folder()}</p>
</div>
) : (
<div className="divide-y divide-border/40">
{children.map((asset) => {
const isExcluded = excludeAssetIds.includes(asset.id)
const isSelected = selectedAssets.has(asset.id)
const isFolder = asset.type === 'folder'
return (
<div
key={asset.id}
onClick={() => {
if (!isExcluded) toggleSelectAsset(asset)
}}
className={`flex items-center gap-3 px-4 py-2.5 hover:bg-muted/40 cursor-pointer transition-colors ${
isSelected ? 'bg-primary/5' : ''
} ${isExcluded ? 'opacity-50 cursor-not-allowed' : ''}`}
>
<Checkbox
checked={isSelected}
disabled={isExcluded}
onCheckedChange={() => {
if (!isExcluded) toggleSelectAsset(asset)
}}
onClick={(e) => e.stopPropagation()}
/>
{/* Thumbnail / Icon */}
<div className="w-9 h-9 rounded bg-muted/60 border shrink-0 flex items-center justify-center overflow-hidden">
{asset.preview?.thumbnailUrl ? (
<img
src={asset.preview.thumbnailUrl}
alt={asset.name}
className="w-full h-full object-cover"
/>
) : isFolder ? (
<Folder className="w-5 h-5 text-primary fill-primary/20" />
) : (
<File className="w-5 h-5 text-muted-foreground" />
)}
</div>
{/* Details */}
<div className="flex-1 min-w-0">
<p className="text-xs font-medium truncate text-foreground">
{asset.name}
</p>
<p className="text-[11px] text-muted-foreground truncate">
{isFolder
? `${asset.fileCount ?? 0} items`
: formatSize(asset.sizeByte || 0)}
{asset.creator?.name ? ` • ${asset.creator.name}` : ''}
</p>
</div>
</div>
)
})}
{/* Infinite scroll sentinel & bottom loading spinner */}
<div ref={loadMoreRef} className="h-1" />
{isFetchingMore && (
<div className="flex items-center justify-center p-3">
<Loader2 className="w-4 h-4 animate-spin text-muted-foreground" />
</div>
)}
</div>
)}
</ScrollArea>
</div>
</div>
{/* Footer */}
<DialogFooter className="p-3 px-4 border-t flex items-center justify-between sm:justify-between bg-muted/10 shrink-0">
<div className="text-xs text-muted-foreground">
{selectedAssets.size > 0 &&
m.n_assets_selected({
count: selectedAssets.size,
})}
</div>
<div className="flex items-center gap-2">
<Button variant="outline" size="sm" onClick={onClose}>
{m.cancel()}
</Button>
<Button size="sm" onClick={handleConfirm} disabled={selectedAssets.size === 0}>
{m.add_assets()}
</Button>
</div>
</DialogFooter>
</DialogContent>
</Dialog>
)
}
@@ -0,0 +1,100 @@
import { useQuery } from '@tanstack/react-query'
import { client } from '@/ui/api/client'
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/ui/components/ui/dialog'
import { m } from '@/ui/paraglide/messages.js'
import { Loader2, Bot } from 'lucide-react'
import type { KanbanTaskDetail } from '@shumai/dtos'
import { cn } from '@/ui/lib/utils'
import { getStatusBadgeColor, getStatusLabel } from '../kanban-types'
import { TaskInfoForm } from './task-info-form'
import { TaskActivityPane } from './task-activity-pane'
interface EditTaskDialogProps {
teamId: string
taskId: string | null
isOpen: boolean
onClose: () => void
canEdit?: boolean
}
export function EditTaskDialog({
teamId,
taskId,
isOpen,
onClose,
canEdit = true,
}: EditTaskDialogProps) {
const {
data: task,
isLoading,
error,
} = useQuery({
queryKey: ['teams', teamId, 'kanban', 'task', taskId],
queryFn: async () => {
if (!taskId) return null
const res = await client.api.teams[':teamId'].kanban.tasks[':taskId'].$get({
param: { teamId, taskId },
})
if (!res.ok) throw new Error('Failed to fetch task details')
return (await res.json()) as KanbanTaskDetail
},
enabled: !!teamId && !!taskId && isOpen,
})
return (
<Dialog open={isOpen} onOpenChange={(open) => !open && onClose()}>
<DialogContent className="sm:max-w-5xl w-[95vw] h-[88vh] p-0 gap-0 flex flex-col overflow-hidden bg-background">
<DialogHeader className="px-5 py-3 border-b border-border/70 flex flex-row items-center justify-between space-y-0 shrink-0 bg-card/80">
<div className="flex items-center gap-2 min-w-0 pr-4">
{task?.isAgentTask && (
<span className="inline-flex items-center gap-1 px-2 py-0.5 rounded text-[11px] font-semibold bg-orange-500/15 text-orange-600 dark:text-orange-400 border border-orange-500/30 shrink-0">
<Bot className="w-3.5 h-3.5" />
<span>{m.task_type_agent()}</span>
</span>
)}
{task?.status && (
<span
className={cn(
'px-2 py-0.5 rounded text-[11px] font-medium border uppercase shrink-0',
getStatusBadgeColor(task.status),
)}
>
{getStatusLabel(task.status)}
</span>
)}
<DialogTitle className="text-sm font-semibold truncate text-foreground">
{task?.title || m.edit_task()}
</DialogTitle>
</div>
</DialogHeader>
{/* 2-Columns Body: Left 2/3, Right 1/3 */}
<div className="flex-1 flex flex-col md:flex-row overflow-hidden">
{isLoading ? (
<div className="flex-1 flex items-center justify-center p-12">
<Loader2 className="w-8 h-8 animate-spin text-muted-foreground" />
</div>
) : error || !task ? (
<div className="flex-1 flex items-center justify-center p-12 text-xs text-muted-foreground">
{m.file_not_found()}
</div>
) : (
<>
{/* Left Column (2/3 width) */}
<div className="flex-1 md:w-2/3 h-full overflow-hidden flex flex-col">
<TaskInfoForm teamId={teamId} task={task} canEdit={canEdit} />
</div>
{/* Right Column (1/3 width) */}
<div className="md:w-1/3 h-full overflow-hidden flex flex-col">
<TaskActivityPane teamId={teamId} task={task} />
</div>
</>
)}
</div>
</DialogContent>
</Dialog>
)
}
@@ -0,0 +1,53 @@
import { useState } from 'react'
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/ui/components/ui/tabs'
import { m } from '@/ui/paraglide/messages.js'
import { TaskCommentThread } from './task-comment-thread'
import { TaskEventTimeline } from './task-event-timeline'
import type { KanbanTaskDetail } from '@shumai/dtos'
interface TaskActivityPaneProps {
teamId: string
task: KanbanTaskDetail
}
export function TaskActivityPane({ teamId, task }: TaskActivityPaneProps) {
const [activeTab, setActiveTab] = useState<'comments' | 'activity'>('comments')
return (
<div className="flex flex-col h-full bg-sidebar/30 border-l border-border/60 overflow-hidden">
<Tabs
value={activeTab}
onValueChange={(val) => setActiveTab(val as 'comments' | 'activity')}
className="flex flex-col h-full"
>
<div className="px-3 pt-2.5 pb-1 border-b border-border/60 bg-card/50 shrink-0">
<TabsList className="w-full grid grid-cols-2 h-8 bg-muted/60">
<TabsTrigger value="comments" className="text-xs h-7">
<span>{m.comments()}</span>
{task.comments.length > 0 && (
<span className="text-[10px] font-mono text-muted-foreground ml-1">
({task.comments.length})
</span>
)}
</TabsTrigger>
<TabsTrigger value="activity" className="text-xs h-7">
<span>{m.activity()}</span>
</TabsTrigger>
</TabsList>
</div>
<div className="flex-1 overflow-hidden">
<TabsContent
value="comments"
className="h-full m-0 data-[state=active]:flex data-[state=active]:flex-col"
>
<TaskCommentThread teamId={teamId} taskId={task.id} initialComments={task.comments} />
</TabsContent>
<TabsContent value="activity" className="h-full m-0 data-[state=active]:block">
<TaskEventTimeline teamId={teamId} taskId={task.id} initialEvents={task.events} />
</TabsContent>
</div>
</Tabs>
</div>
)
}
@@ -0,0 +1,230 @@
import React, { useState } from 'react'
import { format } from 'date-fns'
import Markdown from 'react-markdown'
import { Download, FileText, MoreHorizontal, Trash2 } from 'lucide-react'
import { useMutation, useQueryClient } from '@tanstack/react-query'
import { client } from '@/ui/api/client'
import { m } from '@/ui/paraglide/messages.js'
import { toast } from 'sonner'
import { Avatar, AvatarFallback, AvatarImage } from '@/ui/components/ui/avatar'
import { Button } from '@/ui/components/ui/button'
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from '@/ui/components/ui/dropdown-menu'
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
} from '@/ui/components/ui/alert-dialog'
import { formatSize } from '@/ui/lib/format'
import type { KanbanAttachmentInfo, KanbanCommentInfo } from '@shumai/dtos'
interface TaskCommentCardProps {
teamId: string
taskId: string
comment: KanbanCommentInfo
currentUserId?: string
isOwnerOrAdmin?: boolean
onViewAttachment?: (attachment: KanbanAttachmentInfo) => void
}
export function TaskCommentCard({
teamId,
taskId,
comment,
currentUserId,
isOwnerOrAdmin,
onViewAttachment,
}: TaskCommentCardProps) {
const queryClient = useQueryClient()
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false)
const canDelete = isOwnerOrAdmin || comment.author.id === currentUserId
const { mutate: deleteComment, isPending: isDeleting } = useMutation({
mutationFn: async () => {
const res = await client.api.teams[':teamId'].kanban.tasks[':taskId'].comments[
':commentId'
].$delete({
param: { teamId, taskId, commentId: comment.id },
})
if (!res.ok) {
const err = await res.json().catch(() => ({ message: m.error() }))
throw new Error((err as { message?: string }).message || m.error())
}
return await res.json()
},
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: ['teams', teamId, 'kanban', 'tasks', taskId, 'comments'],
})
queryClient.invalidateQueries({
queryKey: ['teams', teamId, 'kanban', 'task', taskId],
})
queryClient.invalidateQueries({
queryKey: ['teams', teamId, 'kanban', 'tasks'],
})
toast.success('Comment deleted')
setIsDeleteDialogOpen(false)
},
onError: (err) => {
toast.error(err.message)
},
})
const authorInitials = (comment.author.name || 'U')
.split(' ')
.map((n) => n[0])
.slice(0, 2)
.join('')
.toUpperCase()
return (
<div className="relative flex gap-3 p-3 rounded-xl border border-transparent bg-foreground/[0.03] dark:bg-foreground/[0.08] hover:bg-foreground/[0.06] dark:hover:bg-foreground/[0.12] transition-colors group">
{/* Left Avatar */}
<Avatar className="w-7 h-7 shrink-0 mt-0.5 border border-border">
{comment.author.image && (
<AvatarImage src={comment.author.image} alt={comment.author.name} />
)}
<AvatarFallback className="text-[10px] font-medium bg-muted text-muted-foreground">
{authorInitials}
</AvatarFallback>
</Avatar>
{/* Main Content Area */}
<div className="flex-1 min-w-0 space-y-1.5">
{/* Header: Author + Timestamp + Actions */}
<div className="flex items-center justify-between gap-2">
<div className="flex items-center gap-2 min-w-0">
<span className="font-semibold text-xs text-foreground truncate">
{comment.author.name}
</span>
<span className="text-[10px] text-muted-foreground shrink-0 font-mono">
{format(new Date(comment.createdAt), 'MMM d, h:mm a')}
</span>
</div>
{canDelete && (
<div className="opacity-0 group-hover:opacity-100 transition-opacity">
<DropdownMenu modal={false}>
<DropdownMenuTrigger asChild>
<Button size="icon-xs" variant="ghost" className="h-5 w-5 text-muted-foreground">
<MoreHorizontal className="h-3.5 w-3.5" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
className="text-destructive focus:text-destructive cursor-pointer text-xs"
onClick={() => setIsDeleteDialogOpen(true)}
>
<Trash2 className="mr-1.5 h-3.5 w-3.5" />
<span>{m.delete()}</span>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
)}
</div>
{/* Markdown Comment Body */}
{comment.body && (
<div className="text-xs leading-relaxed prose prose-xs dark:prose-invert max-w-none break-words text-foreground/90 font-sans">
<Markdown>{comment.body}</Markdown>
</div>
)}
{/* Attachments Section */}
{comment.attachments && comment.attachments.length > 0 && (
<div className="flex flex-wrap gap-2 pt-1.5">
{comment.attachments.map((att) => {
const isImage = att.proxyType === 'image' || att.contentType?.startsWith('image/')
return (
<div
key={att.id}
className="relative group/att rounded-lg border border-border bg-card overflow-hidden transition-all duration-200"
>
{isImage ? (
<div
className="w-40 h-28 relative cursor-pointer overflow-hidden bg-muted/40"
onClick={() => onViewAttachment?.(att)}
>
<img
src={att.url}
alt={att.name}
className="w-full h-full object-cover group-hover/att:scale-105 transition-transform duration-200"
/>
<a
href={att.url}
download={att.name}
target="_blank"
rel="noreferrer"
className="absolute right-1.5 bottom-1.5 bg-black/60 hover:bg-black/80 text-white p-1 rounded-md opacity-0 group-hover/att:opacity-100 transition-opacity shadow-xs"
onClick={(e) => e.stopPropagation()}
title="Download"
>
<Download className="w-3.5 h-3.5" />
</a>
</div>
) : (
<div className="flex items-center gap-2.5 p-2.5 max-w-[240px] bg-card hover:bg-muted/40 transition-colors">
<FileText className="w-7 h-7 text-primary/80 shrink-0" />
<div className="min-w-0 flex-1">
<p
className="text-xs font-medium text-foreground truncate"
title={att.name}
>
{att.name}
</p>
<p className="text-[10px] text-muted-foreground font-mono">
{formatSize(att.sizeByte)}
</p>
</div>
<a
href={att.url}
download={att.name}
target="_blank"
rel="noreferrer"
className="p-1 text-muted-foreground hover:text-foreground shrink-0 rounded-md hover:bg-muted transition-colors"
title="Download"
>
<Download className="w-3.5 h-3.5" />
</a>
</div>
)}
</div>
)
})}
</div>
)}
</div>
{/* Delete Confirmation Alert Dialog */}
<AlertDialog open={isDeleteDialogOpen} onOpenChange={setIsDeleteDialogOpen}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>{m.delete_comment_confirm()}</AlertDialogTitle>
<AlertDialogDescription>{m.delete_comment_description()}</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel disabled={isDeleting}>{m.cancel()}</AlertDialogCancel>
<AlertDialogAction
className="bg-destructive hover:bg-destructive/90 text-white"
disabled={isDeleting}
onClick={() => deleteComment()}
>
{m.delete()}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
</div>
)
}
@@ -0,0 +1,370 @@
import React, { useState, useRef, useEffect } from 'react'
import { Paperclip, ArrowUp, X, Loader2, FileText, Image as ImageIcon } from 'lucide-react'
import { useMutation } from '@tanstack/react-query'
import { client } from '@/ui/api/client'
import { m } from '@/ui/paraglide/messages.js'
import { toast } from 'sonner'
import { Button } from '@/ui/components/ui/button'
import { Avatar, AvatarFallback, AvatarImage } from '@/ui/components/ui/avatar'
import { formatSize } from '@/ui/lib/format'
import { useMemberStore, type MemberInfo } from '@/ui/stores/members'
import type {
KanbanAttachmentPayload,
PostAttachmentRequest,
PostKanbanAttachmentResponse,
} from '@shumai/dtos'
interface UploadingFile {
id: string
file: File
isUploading: boolean
payload?: KanbanAttachmentPayload
error?: string
}
interface TaskCommentInputProps {
teamId: string
onSendMessage: (text: string, attachments?: KanbanAttachmentPayload[]) => Promise<void> | void
isSubmitting?: boolean
}
export function TaskCommentInput({ teamId, onSendMessage, isSubmitting }: TaskCommentInputProps) {
const [text, setText] = useState('')
const [uploadingFiles, setUploadingFiles] = useState<UploadingFile[]>([])
const [showMentionList, setShowMentionList] = useState(false)
const [mentionQuery, setMentionQuery] = useState('')
const [highlightedIndex, setHighlightedIndex] = useState(0)
const textareaRef = useRef<HTMLTextAreaElement>(null)
const fileInputRef = useRef<HTMLInputElement>(null)
const mentionListRef = useRef<HTMLDivElement>(null)
const { members, fetchMembers } = useMemberStore()
useEffect(() => {
if (teamId) {
fetchMembers(teamId, true, true)
}
}, [teamId, fetchMembers])
const { mutateAsync: getUploadUrl } = useMutation({
mutationFn: async (data: PostAttachmentRequest) => {
const res = await client.api.teams[':teamId'].kanban.attachments.$post({
param: { teamId },
json: data,
})
if (!res.ok) throw new Error('Failed to get attachment upload url')
return (await res.json()) as PostKanbanAttachmentResponse
},
})
// Auto-resize textarea
const handleTextChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
const val = e.target.value
setText(val)
if (textareaRef.current) {
textareaRef.current.style.height = 'auto'
textareaRef.current.style.height = `${Math.min(textareaRef.current.scrollHeight, 160)}px`
}
// Mention detection
const cursorPos = e.target.selectionStart || 0
const textBeforeCursor = val.slice(0, cursorPos)
const lastAtPos = textBeforeCursor.lastIndexOf('@')
if (lastAtPos !== -1) {
const isStartOfLine = lastAtPos === 0
const charBeforeAt = textBeforeCursor[lastAtPos - 1]
const hasSpaceBefore = isStartOfLine || /\s/.test(charBeforeAt)
if (hasSpaceBefore) {
const query = textBeforeCursor.slice(lastAtPos + 1)
if (!/\s/.test(query)) {
setMentionQuery(query)
setShowMentionList(true)
return
}
}
}
setShowMentionList(false)
}
const filteredMembers = members.filter((m) =>
m.name?.toLowerCase().includes(mentionQuery.toLowerCase()),
)
useEffect(() => {
setHighlightedIndex(0)
}, [mentionQuery, showMentionList])
const handleSelectMention = (member: MemberInfo) => {
if (!textareaRef.current) return
const cursorPos = textareaRef.current.selectionStart || 0
const textBeforeCursor = text.slice(0, cursorPos)
const textAfterCursor = text.slice(cursorPos)
const lastAtPos = textBeforeCursor.lastIndexOf('@')
if (lastAtPos !== -1) {
const newText = `${text.slice(0, lastAtPos)}@${member.name} ${textAfterCursor}`
setText(newText)
setShowMentionList(false)
setTimeout(() => {
if (textareaRef.current) {
textareaRef.current.focus()
const newCursorPos = lastAtPos + member.name.length + 2
textareaRef.current.setSelectionRange(newCursorPos, newCursorPos)
}
}, 0)
}
}
const handleFileSelect = async (e: React.ChangeEvent<HTMLInputElement>) => {
const files = Array.from(e.target.files || [])
if (files.length === 0) return
const newUploading: UploadingFile[] = files.map((file) => ({
id: `${Date.now()}-${file.name}-${Math.random()}`,
file,
isUploading: true,
}))
setUploadingFiles((prev) => [...prev, ...newUploading])
for (const uf of newUploading) {
try {
const res = await getUploadUrl({
fileName: uf.file.name,
size: uf.file.size,
contentType: uf.file.type || 'application/octet-stream',
})
// Direct upload to S3
const uploadRes = await fetch(res.uploadUrl, {
method: 'PUT',
body: uf.file,
headers: {
'Content-Type': uf.file.type || 'application/octet-stream',
},
})
if (!uploadRes.ok) {
throw new Error('Failed to upload file to storage')
}
setUploadingFiles((prev) =>
prev.map((item) =>
item.id === uf.id
? {
...item,
isUploading: false,
payload: {
id: res.id,
name: res.name,
key: res.key,
sizeByte: res.sizeByte,
contentType: res.contentType,
proxyType: res.proxyType,
},
}
: item,
),
)
} catch (err: unknown) {
const message = err instanceof Error ? err.message : 'Upload failed'
toast.error(`${uf.file.name}: ${message}`)
setUploadingFiles((prev) =>
prev.map((item) =>
item.id === uf.id ? { ...item, isUploading: false, error: message } : item,
),
)
}
}
if (fileInputRef.current) {
fileInputRef.current.value = ''
}
}
const removeFile = (id: string) => {
setUploadingFiles((prev) => prev.filter((f) => f.id !== id))
}
const isUploadingAny = uploadingFiles.some((f) => f.isUploading)
const successfulAttachments = uploadingFiles
.map((f) => f.payload)
.filter((p): p is KanbanAttachmentPayload => !!p)
const canSend = (text.trim().length > 0 || successfulAttachments.length > 0) && !isUploadingAny
const handleSend = async () => {
if (!canSend || isSubmitting) return
try {
await onSendMessage(
text.trim(),
successfulAttachments.length > 0 ? successfulAttachments : undefined,
)
setText('')
setUploadingFiles([])
if (textareaRef.current) {
textareaRef.current.style.height = 'auto'
}
} catch {
// Error handled by parent
}
}
const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
if (showMentionList && filteredMembers.length > 0) {
if (e.key === 'ArrowDown') {
e.preventDefault()
setHighlightedIndex((prev) => (prev + 1) % filteredMembers.length)
return
}
if (e.key === 'ArrowUp') {
e.preventDefault()
setHighlightedIndex((prev) => (prev - 1 + filteredMembers.length) % filteredMembers.length)
return
}
if (e.key === 'Enter' || e.key === 'Tab') {
e.preventDefault()
const selected = filteredMembers[highlightedIndex]
if (selected) handleSelectMention(selected)
return
}
if (e.key === 'Escape') {
setShowMentionList(false)
return
}
}
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) {
e.preventDefault()
handleSend()
}
}
return (
<div className="relative flex flex-col w-full border border-border focus-within:border-foreground/40 bg-card rounded-2xl p-2.5 shadow-2xs transition-all">
{/* Mention Popup */}
{showMentionList && filteredMembers.length > 0 && (
<div
ref={mentionListRef}
className="absolute bottom-full left-0 mb-2 w-64 max-h-48 overflow-y-auto rounded-xl border border-border bg-popover p-1 shadow-lg z-50"
>
{filteredMembers.map((member, idx) => (
<button
key={member.id}
type="button"
onClick={() => handleSelectMention(member)}
className={`w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs transition-colors text-left ${
idx === highlightedIndex
? 'bg-primary text-primary-foreground font-medium'
: 'hover:bg-muted text-foreground'
}`}
>
<Avatar className="w-5 h-5">
{member.image && <AvatarImage src={member.image} />}
<AvatarFallback className="text-[9px]">
{member.name?.slice(0, 2).toUpperCase()}
</AvatarFallback>
</Avatar>
<span className="truncate">{member.name}</span>
</button>
))}
</div>
)}
{/* Uploading / Attached Files Preview */}
{uploadingFiles.length > 0 && (
<div className="flex flex-wrap gap-1.5 pb-2 mb-1.5 border-b border-border/50">
{uploadingFiles.map((uf) => {
const isImage = uf.file.type.startsWith('image/')
return (
<div
key={uf.id}
className="flex items-center gap-1.5 pl-2 pr-1.5 py-1 rounded-lg bg-muted/60 border border-border text-xs max-w-[200px]"
>
{uf.isUploading ? (
<Loader2 className="w-3.5 h-3.5 animate-spin text-primary shrink-0" />
) : isImage ? (
<ImageIcon className="w-3.5 h-3.5 text-primary shrink-0" />
) : (
<FileText className="w-3.5 h-3.5 text-muted-foreground shrink-0" />
)}
<div className="min-w-0 flex-1 truncate">
<span className="truncate block font-medium text-[11px]">{uf.file.name}</span>
<span className="text-[9px] text-muted-foreground font-mono">
{formatSize(uf.file.size)}
</span>
</div>
<button
type="button"
onClick={() => removeFile(uf.id)}
className="p-0.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted shrink-0"
>
<X className="w-3 h-3" />
</button>
</div>
)
})}
</div>
)}
{/* Text Area */}
<textarea
ref={textareaRef}
value={text}
onChange={handleTextChange}
onKeyDown={handleKeyDown}
placeholder={m.comment_placeholder()}
rows={1}
className="w-full min-h-[44px] max-h-[160px] bg-transparent border-0 focus:outline-hidden focus-visible:ring-0 resize-none text-xs text-foreground placeholder:text-muted-foreground/70 p-1 font-sans leading-relaxed"
/>
{/* Footer Controls: Attachment Button + Send Button */}
<div className="flex items-center justify-between pt-1 mt-1 border-t border-border/40">
<div className="flex items-center gap-1">
<input
ref={fileInputRef}
type="file"
multiple
className="hidden"
onChange={handleFileSelect}
/>
<Button
type="button"
variant="ghost"
size="icon-xs"
onClick={() => fileInputRef.current?.click()}
className="h-7 w-7 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted"
title="Attach files"
disabled={isSubmitting}
>
<Paperclip className="w-3.5 h-3.5" />
</Button>
<span className="text-[10px] text-muted-foreground/60 hidden sm:inline pl-1">
Cmd+Enter to send
</span>
</div>
<Button
type="button"
size="icon-xs"
onClick={handleSend}
disabled={!canSend || isSubmitting}
className="h-7 w-7 rounded-full shadow-xs bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-40 transition-all shrink-0"
title="Send comment"
>
{isSubmitting || isUploadingAny ? (
<Loader2 className="w-3.5 h-3.5 animate-spin" />
) : (
<ArrowUp className="w-3.5 h-3.5 stroke-[2.5]" />
)}
</Button>
</div>
</div>
)
}
@@ -0,0 +1,161 @@
import { useState } from 'react'
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import { client } from '@/ui/api/client'
import { m } from '@/ui/paraglide/messages.js'
import { ScrollArea } from '@/ui/components/ui/scroll-area'
import { toast } from 'sonner'
import { Loader2, MessageSquare, X } from 'lucide-react'
import { TaskCommentCard } from './task-comment-card'
import { TaskCommentInput } from './task-comment-input'
import type { KanbanAttachmentInfo, KanbanAttachmentPayload, KanbanCommentInfo } from '@shumai/dtos'
interface TaskCommentThreadProps {
teamId: string
taskId: string
initialComments?: KanbanCommentInfo[]
}
export function TaskCommentThread({ teamId, taskId, initialComments }: TaskCommentThreadProps) {
const queryClient = useQueryClient()
const [viewingAttachment, setViewingAttachment] = useState<KanbanAttachmentInfo | null>(null)
// Query Current User Info
const { data: me } = useQuery({
queryKey: ['teams', teamId, 'me'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].me.$get({
param: { teamId },
})
if (!res.ok) throw new Error('Failed to fetch me')
return await res.json()
},
enabled: !!teamId,
})
const isOwnerOrAdmin = me?.role?.toLowerCase() === 'owner' || me?.role?.toLowerCase() === 'editor'
// Query Comments
const { data: commentsData, isLoading } = useQuery({
queryKey: ['teams', teamId, 'kanban', 'tasks', taskId, 'comments'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].kanban.tasks[':taskId'].comments.$get({
param: { teamId, taskId },
})
if (!res.ok) throw new Error('Failed to fetch comments')
return (await res.json()) as { data: KanbanCommentInfo[] }
},
initialData: initialComments ? { data: initialComments } : undefined,
enabled: !!teamId && !!taskId,
refetchInterval: 4000,
})
const comments = commentsData?.data || []
// Add Comment Mutation
const { mutateAsync: addComment, isPending: isAdding } = useMutation({
mutationFn: async ({
body,
attachments,
}: {
body: string
attachments?: KanbanAttachmentPayload[]
}) => {
const res = await client.api.teams[':teamId'].kanban.tasks[':taskId'].comments.$post({
param: { teamId, taskId },
json: { body, attachments },
})
if (!res.ok) {
const err = await res.json().catch(() => ({ message: m.error() }))
throw new Error((err as { message?: string }).message || m.error())
}
return await res.json()
},
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: ['teams', teamId, 'kanban', 'tasks', taskId, 'comments'],
})
queryClient.invalidateQueries({
queryKey: ['teams', teamId, 'kanban', 'task', taskId],
})
queryClient.invalidateQueries({
queryKey: ['teams', teamId, 'kanban', 'tasks'],
})
},
onError: (err) => {
toast.error(err.message)
},
})
const handleSendMessage = async (text: string, attachments?: KanbanAttachmentPayload[]) => {
await addComment({ body: text, attachments })
}
return (
<div className="flex flex-col h-full overflow-hidden bg-background">
{/* Lightbox / Full-screen Attachment Viewer */}
{viewingAttachment && (
<div
className="fixed inset-0 z-50 bg-black/90 flex flex-col items-center justify-center p-4 animate-in fade-in duration-150"
onClick={() => setViewingAttachment(null)}
>
<button
type="button"
onClick={() => setViewingAttachment(null)}
className="absolute top-4 right-4 text-white/80 hover:text-white bg-white/10 hover:bg-white/20 rounded-full p-2 transition-colors z-50 cursor-pointer"
title="Close"
>
<X className="w-6 h-6" />
</button>
<div className="w-full h-full flex items-center justify-center p-2">
<img
src={viewingAttachment.url}
alt={viewingAttachment.name}
className="max-w-full max-h-[85vh] object-contain rounded-lg shadow-2xl"
onClick={(e) => e.stopPropagation()}
/>
</div>
</div>
)}
{/* Comments List */}
<ScrollArea className="flex-1 p-3.5">
<div className="space-y-3 pr-1 pb-2">
{isLoading ? (
<div className="flex items-center justify-center py-12">
<Loader2 className="w-6 h-6 animate-spin text-muted-foreground" />
</div>
) : comments.length === 0 ? (
<div className="flex flex-col items-center justify-center py-16 text-center text-xs text-muted-foreground/80 space-y-2">
<div className="w-10 h-10 rounded-full bg-muted/60 flex items-center justify-center">
<MessageSquare className="w-5 h-5 opacity-40" />
</div>
<p className="font-medium">{m.no_comments_yet()}</p>
</div>
) : (
comments.map((comment) => (
<TaskCommentCard
key={comment.id}
teamId={teamId}
taskId={taskId}
comment={comment}
currentUserId={me?.id}
isOwnerOrAdmin={isOwnerOrAdmin}
onViewAttachment={(att) => setViewingAttachment(att)}
/>
))
)}
</div>
</ScrollArea>
{/* Composer Input Box */}
<div className="p-3 border-t border-border/60 bg-card/60 shrink-0">
<TaskCommentInput
teamId={teamId}
onSendMessage={handleSendMessage}
isSubmitting={isAdding}
/>
</div>
</div>
)
}
@@ -0,0 +1,104 @@
import { useQuery } from '@tanstack/react-query'
import { client } from '@/ui/api/client'
import { m } from '@/ui/paraglide/messages.js'
import { ScrollArea } from '@/ui/components/ui/scroll-area'
import { KanbanTaskEventType, type KanbanEventInfo } from '@shumai/dtos'
import { getStatusLabel } from '../kanban-types'
import { format } from 'date-fns'
import { Loader2 } from 'lucide-react'
interface TaskEventTimelineProps {
teamId: string
taskId: string
initialEvents?: KanbanEventInfo[]
}
function getEventDescription(event: KanbanEventInfo): string {
const data = event.data || {}
switch (event.type) {
case KanbanTaskEventType.CREATED:
return 'Created task'
case KanbanTaskEventType.STATUS_CHANGED:
return `Changed status from ${event.fromStatus ? getStatusLabel(event.fromStatus) : 'None'} to ${event.toStatus ? getStatusLabel(event.toStatus) : 'None'}`
case KanbanTaskEventType.ASSIGNED:
return 'Assigned task'
case KanbanTaskEventType.UNASSIGNED:
return 'Unassigned task'
case KanbanTaskEventType.PRIORITY_CHANGED:
return `Changed priority to ${String(data.to || '')}`
case KanbanTaskEventType.GOAL_CHANGED:
return 'Updated goal association'
case KanbanTaskEventType.DEPENDENCY_ADDED:
return 'Added prerequisite dependency'
case KanbanTaskEventType.DEPENDENCY_REMOVED:
return 'Removed prerequisite dependency'
case KanbanTaskEventType.CHANGES_REQUESTED:
return `Requested changes: "${String(data.reason || '')}"`
case KanbanTaskEventType.BLOCKED:
return `Task blocked: "${String(data.reason || data.blockReason || '')}"`
case KanbanTaskEventType.UNBLOCKED:
return 'Task unblocked'
case KanbanTaskEventType.COMMENTED:
return 'Added a comment'
default:
return event.type
}
}
export function TaskEventTimeline({ teamId, taskId, initialEvents }: TaskEventTimelineProps) {
const { data: eventsData, isLoading } = useQuery({
queryKey: ['teams', teamId, 'kanban', 'tasks', taskId, 'events'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].kanban.tasks[':taskId'].events.$get({
param: { teamId, taskId },
})
if (!res.ok) throw new Error('Failed to fetch events')
return (await res.json()) as { data: KanbanEventInfo[] }
},
initialData: initialEvents ? { data: initialEvents } : undefined,
enabled: !!teamId && !!taskId,
})
const events = eventsData?.data || []
return (
<ScrollArea className="h-full p-3">
<div className="space-y-4 pr-2">
{/* Audit Event Stream */}
<div className="space-y-2">
{isLoading ? (
<div className="flex items-center justify-center py-6">
<Loader2 className="w-4 h-4 animate-spin text-muted-foreground" />
</div>
) : events.length === 0 ? (
<div className="py-6 text-center text-xs text-muted-foreground">
{m.no_activity_yet()}
</div>
) : (
<div className="relative pl-5 space-y-3 before:absolute before:left-[4px] before:top-2 before:bottom-2 before:w-[2px] before:bg-border/60">
{events.map((event) => (
<div key={event.id} className="relative flex items-start gap-2 text-xs">
<div className="absolute -left-5 top-[3px] w-2.5 h-2.5 rounded-full bg-background border-2 border-primary shrink-0" />
<div className="flex-1 min-w-0">
<div className="flex items-center justify-between gap-1">
<span className="font-medium text-foreground truncate">
{event.actor?.name || 'System'}
</span>
<span className="text-[10px] text-muted-foreground font-mono shrink-0">
{format(new Date(event.createdAt), 'MM/dd HH:mm')}
</span>
</div>
<p className="text-[11px] text-muted-foreground leading-snug mt-0.5">
{getEventDescription(event)}
</p>
</div>
</div>
))}
</div>
)}
</div>
</div>
</ScrollArea>
)
}
@@ -0,0 +1,469 @@
import { useEffect, useRef, useState } from 'react'
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import { client } from '@/ui/api/client'
import { m } from '@/ui/paraglide/messages.js'
import { Button } from '@/ui/components/ui/button'
import { Input } from '@/ui/components/ui/input'
import { Textarea } from '@/ui/components/ui/textarea'
import { Label } from '@/ui/components/ui/label'
import { Switch } from '@/ui/components/ui/switch'
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from '@/ui/components/ui/select'
import { Avatar, AvatarFallback, AvatarImage } from '@/ui/components/ui/avatar'
import { ScrollArea } from '@/ui/components/ui/scroll-area'
import { DateTimePicker } from '@/ui/components/datetime-picker'
import { toast } from 'sonner'
import {
KanbanTaskPriority,
type KanbanTaskDetail,
type KanbanGoalInfo,
type AgentInfo,
type KanbanTaskAssetInfo,
type UpdateKanbanTaskRequest,
UNASSIGNED_GOAL_ID,
} from '@shumai/dtos'
import { getPriorityBadgeColor, getPriorityLabel } from '../kanban-types'
import { TaskParentSelector } from '../task-parent-selector'
import { TaskRelatedAssets } from '../task-related-assets'
import { TaskTargetFolderDialog } from './task-target-folder-dialog'
import { Bot, Folder, Target, Loader2 } from 'lucide-react'
import { cn } from '@/ui/lib/utils'
interface TaskInfoFormProps {
teamId: string
task: KanbanTaskDetail
canEdit?: boolean
}
export function TaskInfoForm({ teamId, task, canEdit = true }: TaskInfoFormProps) {
const queryClient = useQueryClient()
// Local state for debounced text inputs
const [title, setTitle] = useState(task.title)
const [description, setDescription] = useState(task.description || '')
const [isFolderPickerOpen, setIsFolderPickerOpen] = useState(false)
const [targetFolderName, setTargetFolderName] = useState<string | null>(null)
const debounceTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)
// Sync with prop changes if task id changed
useEffect(() => {
setTitle(task.title)
setDescription(task.description || '')
}, [task.id, task.title, task.description])
// Queries for selectors
const { data: members = [] } = useQuery({
queryKey: ['teams', teamId, 'members', 'human'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].members.$get({
param: { teamId },
query: { includeAgents: 'false' },
})
if (!res.ok) return []
const data = await res.json()
return Array.isArray(data) ? data : []
},
enabled: !!teamId,
})
const { data: agents = [] } = useQuery({
queryKey: ['teams', teamId, 'agents'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].agents.$get({
param: { teamId },
})
if (!res.ok) return []
return ((await res.json()) as AgentInfo[]) || []
},
enabled: !!teamId,
})
const { data: goalsData } = useQuery({
queryKey: ['teams', teamId, 'kanban', 'goals'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].kanban.goals.$get({
param: { teamId },
query: {},
})
if (!res.ok) return { data: [] }
return (await res.json()) as { data: KanbanGoalInfo[] }
},
enabled: !!teamId,
})
const goals = goalsData?.data || []
// Auto-save update mutation
const { mutate: updateTask, isPending: isUpdating } = useMutation({
mutationFn: async (patch: UpdateKanbanTaskRequest) => {
const res = await client.api.teams[':teamId'].kanban.tasks[':taskId'].$patch({
param: { teamId, taskId: task.id },
json: patch,
})
if (!res.ok) {
const err = await res.json().catch(() => ({ message: m.error() }))
throw new Error((err as { message?: string }).message || m.error())
}
return await res.json()
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'task', task.id] })
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'tasks'] })
},
onError: (err) => {
toast.error(err.message)
},
})
const { mutate: linkAssets } = useMutation({
mutationFn: async (newAssets: KanbanTaskAssetInfo[]) => {
const res = await client.api.teams[':teamId'].kanban.tasks[':taskId'].assets.$post({
param: { teamId, taskId: task.id },
json: { assetIds: newAssets.map((a) => a.id) },
})
if (!res.ok) throw new Error('Failed to link assets')
return await res.json()
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'task', task.id] })
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'tasks'] })
toast.success(m.asset_linked())
},
onError: (err) => {
toast.error(err.message)
},
})
const { mutate: unlinkAsset } = useMutation({
mutationFn: async (assetId: string) => {
const res = await client.api.teams[':teamId'].kanban.tasks[':taskId'].assets[
':assetId'
].$delete({
param: { teamId, taskId: task.id, assetId },
})
if (!res.ok) throw new Error('Failed to unlink asset')
return await res.json()
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'task', task.id] })
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'tasks'] })
toast.success(m.asset_unlinked())
},
onError: (err) => {
toast.error(err.message)
},
})
// Debounced auto-save handler for text fields
const handleTextChange = (field: 'title' | 'description', value: string) => {
if (field === 'title') setTitle(value)
if (field === 'description') setDescription(value)
if (debounceTimerRef.current) {
clearTimeout(debounceTimerRef.current)
}
debounceTimerRef.current = setTimeout(() => {
if (field === 'title' && value.trim() && value.trim() !== task.title) {
updateTask({ title: value.trim() })
} else if (field === 'description' && value !== (task.description || '')) {
updateTask({ description: value.trim() || null })
}
}, 600)
}
const isAgentic = task.isAgentTask
return (
<ScrollArea className="h-full p-5">
<div className="space-y-6 w-full pr-3">
{/* Title Input */}
<div className="space-y-1.5">
<div className="flex items-center justify-between">
<Label
htmlFor="task-title"
className="text-xs font-semibold text-muted-foreground uppercase tracking-wider"
>
{m.task_title()}
</Label>
{isUpdating && (
<span className="flex items-center gap-1 text-[11px] text-muted-foreground animate-pulse">
<Loader2 className="w-3 h-3 animate-spin" />
{m.saving()}
</span>
)}
</div>
<Input
id="task-title"
value={title}
onChange={(e) => handleTextChange('title', e.target.value)}
disabled={!canEdit}
className="text-base font-semibold h-10 bg-background"
placeholder={m.task_title_placeholder()}
/>
</div>
{/* Description Textarea */}
<div className="space-y-1.5">
<Label
htmlFor="task-description"
className="text-xs font-semibold text-muted-foreground uppercase tracking-wider"
>
{m.task_description()}
</Label>
<Textarea
id="task-description"
value={description}
onChange={(e) => handleTextChange('description', e.target.value)}
disabled={!canEdit}
rows={5}
className="text-xs leading-relaxed bg-background"
placeholder={m.task_description_placeholder()}
/>
</div>
{/* Properties Grid */}
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4 p-4 rounded-lg bg-muted/20 border border-border/60">
{/* Row 1: Agent Task Switch (Read-Only) */}
<div className="sm:col-span-2 flex items-center justify-between space-x-2 rounded-md border border-border/60 bg-background/50 px-3 py-2 h-14">
<div className="space-y-0.5 min-w-0 pr-2">
<Label className="text-xs font-medium text-muted-foreground flex items-center gap-1.5">
<Bot className="w-3.5 h-3.5 text-orange-500" />
<span>{m.task_type_agent()}</span>
</Label>
<p className="text-[11px] text-muted-foreground/80 line-clamp-1">
{m.task_type_agent_desc()}
</p>
</div>
<Switch checked={task.isAgentTask} disabled={true} />
</div>
{/* Row 2: Priority Selector and Goal Selector */}
<div className="space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">{m.task_priority()}</Label>
<Select
value={task.priority}
onValueChange={(val) => updateTask({ priority: val as KanbanTaskPriority })}
disabled={!canEdit}
>
<SelectTrigger className="w-full h-8 text-xs bg-background">
<SelectValue />
</SelectTrigger>
<SelectContent>
{Object.values(KanbanTaskPriority).map((p) => (
<SelectItem key={p} value={p}>
<span
className={cn(
'px-1.5 py-0.5 rounded text-[10px] uppercase font-medium',
getPriorityBadgeColor(p),
)}
>
{getPriorityLabel(p)}
</span>
</SelectItem>
))}
</SelectContent>
</Select>
</div>
<div className="space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">{m.goals()}</Label>
<Select
value={task.goal?.id || 'none'}
onValueChange={(val) => updateTask({ goalId: val === 'none' ? null : val })}
disabled={!canEdit}
>
<SelectTrigger className="w-full h-8 text-xs bg-background">
<SelectValue placeholder={m.no_folder_selected()} />
</SelectTrigger>
<SelectContent>
<SelectItem value="none">
<span className="text-muted-foreground italic">None</span>
</SelectItem>
{goals
.filter((g) => g.id !== UNASSIGNED_GOAL_ID)
.map((g) => (
<SelectItem key={g.id} value={g.id}>
<div className="flex items-center gap-2">
<Target className="w-3.5 h-3.5 text-primary" />
<span>{g.title}</span>
</div>
</SelectItem>
))}
</SelectContent>
</Select>
</div>
{/* Row 3: Assignee Selector and Reporter Selector */}
<div className="space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">
{isAgentic ? m.select_agent() : m.assignee()}
</Label>
<Select
value={task.assignee?.id || 'none'}
onValueChange={(val) => updateTask({ assigneeId: val === 'none' ? null : val })}
disabled={!canEdit}
>
<SelectTrigger className="w-full h-8 text-xs bg-background">
<SelectValue placeholder={m.unassigned()} />
</SelectTrigger>
<SelectContent>
<SelectItem value="none">
<span className="text-muted-foreground italic">{m.unassigned()}</span>
</SelectItem>
{isAgentic
? agents.map((a) => (
<SelectItem key={a.id} value={a.id}>
<div className="flex items-center gap-2">
<Bot className="w-3.5 h-3.5 text-purple-500" />
<span>{a.name}</span>
</div>
</SelectItem>
))
: members.map((mItem) => (
<SelectItem key={mItem.id} value={mItem.id}>
<div className="flex items-center gap-2">
<Avatar size="sm" className="w-4 h-4">
<AvatarImage src={mItem.image} />
<AvatarFallback className="text-[8px]">
{mItem.name.slice(0, 2).toUpperCase()}
</AvatarFallback>
</Avatar>
<span>{mItem.name}</span>
</div>
</SelectItem>
))}
</SelectContent>
</Select>
</div>
<div className="space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">{m.reporter()}</Label>
<Select
value={task.reporter?.id || 'none'}
onValueChange={(val) => updateTask({ reporterId: val === 'none' ? null : val })}
disabled={!canEdit}
>
<SelectTrigger className="w-full h-8 text-xs bg-background">
<SelectValue placeholder={m.unassigned()} />
</SelectTrigger>
<SelectContent>
<SelectItem value="none">
<span className="text-muted-foreground italic">{m.unassigned()}</span>
</SelectItem>
{members.map((mItem) => (
<SelectItem key={mItem.id} value={mItem.id}>
<div className="flex items-center gap-2">
<Avatar size="sm" className="w-4 h-4">
<AvatarImage src={mItem.image} />
<AvatarFallback className="text-[8px]">
{mItem.name.slice(0, 2).toUpperCase()}
</AvatarFallback>
</Avatar>
<span>{mItem.name}</span>
</div>
</SelectItem>
))}
</SelectContent>
</Select>
</div>
{/* Row 4: Target Folder Selector (only for agent task) */}
{isAgentic && (
<div className="sm:col-span-2 space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">
{m.target_folder()}
</Label>
<div className="flex items-center gap-2">
<Button
type="button"
variant="outline"
size="sm"
onClick={() => setIsFolderPickerOpen(true)}
disabled={!canEdit}
className="w-full justify-start h-8 text-xs bg-background truncate font-normal"
>
<Folder className="w-3.5 h-3.5 mr-2 text-primary shrink-0" />
<span className="truncate">
{targetFolderName ||
(task.targetFolderId ? 'Selected Folder' : m.select_target_folder())}
</span>
</Button>
</div>
</div>
)}
{/* Row 5: Start Date and Due Date */}
<div className="space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">{m.start_date()}</Label>
<DateTimePicker
value={task.startDate ? new Date(task.startDate) : undefined}
onChange={(date) => updateTask({ startDate: date ? date.toISOString() : null })}
disabled={!canEdit}
placeholder={m.start_date()}
className="h-8 text-xs bg-background"
/>
</div>
<div className="space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">{m.due_date()}</Label>
<DateTimePicker
value={task.dueDate ? new Date(task.dueDate) : undefined}
onChange={(date) => updateTask({ dueDate: date ? date.toISOString() : null })}
disabled={!canEdit}
placeholder={m.due_date()}
className="h-8 text-xs bg-background"
/>
</div>
{/* Row 6: Parent Tasks */}
<div className="sm:col-span-2 space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">{m.parent_tasks()}</Label>
<TaskParentSelector
teamId={teamId}
currentTaskId={task.id}
excludeTaskIds={task.dependents.map((d) => d.id)}
value={task.dependencies.map((d) => d.id)}
knownTasks={[...task.dependencies, ...task.dependents]}
onChange={(parentIds) => updateTask({ parentIds })}
canEdit={canEdit}
/>
</div>
{/* Row 7: Related Assets */}
<div className="sm:col-span-2 pt-1">
<TaskRelatedAssets
teamId={teamId}
projectId={task.projectId}
assets={task.assets || []}
onAddAssets={(newAssets) => linkAssets(newAssets)}
onRemoveAsset={(assetId) => unlinkAsset(assetId)}
disabled={!canEdit}
/>
</div>
</div>
</div>
{/* Target Folder Dialog */}
{isFolderPickerOpen && (
<TaskTargetFolderDialog
teamId={teamId}
currentProjectId={task.projectId}
currentTargetFolderId={task.targetFolderId}
isOpen={isFolderPickerOpen}
onClose={() => setIsFolderPickerOpen(false)}
onSelect={(projId, foldId, foldName) => {
setTargetFolderName(foldName || 'Selected Folder')
updateTask({ projectId: projId, targetFolderId: foldId })
}}
/>
)}
</ScrollArea>
)
}
@@ -0,0 +1,151 @@
import { useState } from 'react'
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
DialogFooter,
} from '@/ui/components/ui/dialog'
import { Button } from '@/ui/components/ui/button'
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from '@/ui/components/ui/select'
import { useQuery } from '@tanstack/react-query'
import { client } from '@/ui/api/client'
import { FolderTree } from '@/ui/components/folder-tree'
import { ScrollArea } from '@/ui/components/ui/scroll-area'
import { m } from '@/ui/paraglide/messages.js'
import type { AssetInfo, ProjectInfo } from '@shumai/dtos'
import { Loader2, Folder } from 'lucide-react'
interface TaskTargetFolderDialogProps {
teamId: string
currentProjectId?: string | null
currentTargetFolderId?: string | null
isOpen: boolean
onClose: () => void
onSelect: (projectId: string, folderId: string, folderName?: string) => void
}
export function TaskTargetFolderDialog({
teamId,
currentProjectId,
currentTargetFolderId,
isOpen,
onClose,
onSelect,
}: TaskTargetFolderDialogProps) {
const [selectedProjectId, setSelectedProjectId] = useState<string>(currentProjectId || '')
const [selectedFolder, setSelectedFolder] = useState<AssetInfo | null>(null)
const { data: projectsData, isLoading: isLoadingProjects } = useQuery({
queryKey: ['teams', teamId, 'projects'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].projects.$get({
param: { teamId },
query: { first: '100' },
})
if (!res.ok) throw new Error('Failed to fetch projects')
return (await res.json()) as unknown as { data: ProjectInfo[] }
},
enabled: !!teamId && isOpen,
})
const projects = projectsData?.data || []
const activeProjectId = selectedProjectId || (projects[0]?.id ?? '')
const selectedProject = projects.find((p) => p.id === activeProjectId)
const handleConfirm = () => {
if (!activeProjectId) return
const folderId = selectedFolder?.id || selectedProject?.rootFolder
if (folderId) {
onSelect(activeProjectId, folderId, selectedFolder?.name || selectedProject?.name)
onClose()
}
}
return (
<Dialog open={isOpen} onOpenChange={(open) => !open && onClose()}>
<DialogContent className="sm:max-w-2xl flex flex-col h-[580px]">
<DialogHeader>
<div className="flex items-center gap-2">
<Folder className="w-5 h-5 text-primary" />
<DialogTitle>{m.select_target_folder()}</DialogTitle>
</div>
</DialogHeader>
<div className="flex flex-col gap-3 flex-1 overflow-hidden py-2">
{/* Project Select */}
<div className="space-y-1.5">
<label className="text-xs font-medium text-muted-foreground">
{m.select_project()}
</label>
<Select
value={activeProjectId}
onValueChange={(val) => {
setSelectedProjectId(val)
setSelectedFolder(null)
}}
>
<SelectTrigger className="h-9">
<SelectValue placeholder={m.select_project()} />
</SelectTrigger>
<SelectContent>
{projects.map((p) => (
<SelectItem key={p.id} value={p.id}>
{p.name}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
{/* Folder Tree Scroll Area */}
<div className="space-y-1.5 flex-1 flex flex-col overflow-hidden">
<label className="text-xs font-medium text-muted-foreground">{m.target_folder()}</label>
<div className="border rounded-md flex-1 overflow-hidden bg-sidebar/50">
<ScrollArea className="h-full">
{selectedProject && selectedProject.rootFolder ? (
<FolderTree
teamId={teamId}
projectId={selectedProject.id}
projectName={selectedProject.name}
rootFolderId={selectedProject.rootFolder}
onSelect={setSelectedFolder}
selectedFolderId={
selectedFolder?.id || currentTargetFolderId || selectedProject.rootFolder
}
hideCollections
hideShares
hideRecentlyDeleted
/>
) : (
<div className="flex items-center justify-center h-full p-6 text-xs text-muted-foreground">
{isLoadingProjects ? (
<Loader2 className="w-5 h-5 animate-spin text-muted-foreground" />
) : (
m.no_project_selected()
)}
</div>
)}
</ScrollArea>
</div>
</div>
</div>
<DialogFooter>
<Button variant="outline" onClick={onClose}>
{m.cancel()}
</Button>
<Button onClick={handleConfirm} disabled={!activeProjectId}>
{m.confirm()}
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
)
}
@@ -0,0 +1,363 @@
import { useState } from 'react'
import { DragDropProvider, KeyboardSensor, PointerSensor, type DragEndEvent } from '@dnd-kit/react'
import { PointerActivationConstraints } from '@dnd-kit/dom'
import { useMutation, useQueryClient, type InfiniteData } from '@tanstack/react-query'
import { client } from '@/ui/api/client'
import { toast } from 'sonner'
import { m } from '@/ui/paraglide/messages.js'
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
} from '@/ui/components/ui/alert-dialog'
import { Loader2 } from 'lucide-react'
import { KanbanTaskStatus, type KanbanTaskInfo, type ListKanbanTasksResponse } from '@shumai/dtos'
import { KANBAN_STATUS_COLUMNS } from './kanban-types'
import { KanbanColumn } from './kanban-column'
interface KanbanBoardProps {
teamId: string
selectedGoalId: string | null
scope: 'team' | 'my'
currentUserId?: string
currentUserRole?: string
onTaskClick: (task: KanbanTaskInfo) => void
onCreateTaskInColumn: (status: KanbanTaskStatus) => void
}
export function KanbanBoard({
teamId,
selectedGoalId,
scope,
currentUserId,
currentUserRole,
onTaskClick,
onCreateTaskInColumn,
}: KanbanBoardProps) {
const queryClient = useQueryClient()
const [taskToDelete, setTaskToDelete] = useState<KanbanTaskInfo | null>(null)
const { mutate: deleteTask, isPending: isDeleting } = useMutation({
mutationFn: async (taskId: string) => {
const res = await client.api.teams[':teamId'].kanban.tasks[':taskId'].$delete({
param: { teamId, taskId },
})
if (!res.ok) {
const err = await res.json().catch(() => ({ message: m.error() }))
throw new Error((err as { message?: string }).message || m.error())
}
return await res.json()
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'tasks'] })
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'goals'] })
toast.success(m.task_deleted())
setTaskToDelete(null)
},
onError: (err) => {
toast.error(err.message)
},
})
// Unified Update Mutation with Optimistic Updates
const { mutate: updateTask } = useMutation({
mutationFn: async ({
taskId,
fromStatus,
status,
reason,
beforeIndex,
afterIndex,
}: {
taskId: string
fromStatus?: KanbanTaskStatus
status: KanbanTaskStatus
reason?: string
beforeIndex?: string
afterIndex?: string
targetTaskId?: string
position?: 'before' | 'after'
}) => {
const res = await client.api.teams[':teamId'].kanban.tasks[':taskId'].$patch({
param: { teamId, taskId },
json: { fromStatus, status, reason, beforeIndex, afterIndex },
})
if (!res.ok) {
const err = await res.json().catch(() => ({ message: m.error() }))
throw new Error((err as { message?: string }).message || m.error())
}
return await res.json()
},
onMutate: async ({ taskId, status, targetTaskId, position }) => {
// Cancel any outgoing refetches so they don't overwrite optimistic update
await queryClient.cancelQueries({ queryKey: ['teams', teamId, 'kanban', 'tasks'] })
// Snapshot previous state
const previousQueries = queryClient.getQueriesData({
queryKey: ['teams', teamId, 'kanban', 'tasks'],
})
let movedTask: KanbanTaskInfo | null = null
// Helper to check if a query is a Kanban column infinite query
const isColumnQuery = (queryKey: readonly unknown[]) => {
return (
queryKey[0] === 'teams' &&
queryKey[1] === teamId &&
queryKey[2] === 'kanban' &&
queryKey[3] === 'tasks' &&
typeof queryKey[4] === 'object' &&
queryKey[4] !== null &&
'status' in queryKey[4]
)
}
// 1. Remove task from current column in cache and save it
queryClient.setQueriesData<InfiniteData<ListKanbanTasksResponse>>(
{
predicate: (query) => isColumnQuery(query.queryKey),
},
(oldData) => {
if (!oldData || !Array.isArray(oldData.pages)) return oldData
let found = false
const newPages = oldData.pages.map((page) => {
if (!page || !Array.isArray(page.data)) return page
const task = page.data.find((t) => t.id === taskId)
if (task) {
movedTask = { ...task, status }
found = true
return {
...page,
data: page.data.filter((t) => t.id !== taskId),
pageInfo: {
...page.pageInfo,
total: Math.max(0, (page.pageInfo?.total ?? page.data.length) - 1),
},
}
}
return page
})
return found ? { ...oldData, pages: newPages } : oldData
},
)
// 2. Insert task into destination column cache at target position
if (movedTask) {
const taskToAdd = movedTask
queryClient.setQueriesData<InfiniteData<ListKanbanTasksResponse>>(
{
predicate: (query) => {
if (!isColumnQuery(query.queryKey)) return false
const filter = query.queryKey[4] as { status?: KanbanTaskStatus } | undefined
return filter?.status === status
},
},
(oldData) => {
if (!oldData || !Array.isArray(oldData.pages)) return oldData
const allItems = oldData.pages
.flatMap((page) => page?.data ?? [])
.filter((t) => t.id !== taskId)
let insertIndex = allItems.length
if (targetTaskId) {
const idx = allItems.findIndex((t) => t.id === targetTaskId)
if (idx !== -1) {
insertIndex = position === 'before' ? idx : idx + 1
}
}
allItems.splice(insertIndex, 0, taskToAdd)
let pointer = 0
const newPages = oldData.pages.map((page, pageIdx) => {
const pageSize = page?.data ? page.data.length : 0
const takeSize =
pageIdx === 0 && pageSize === 0
? 1
: pageIdx === oldData.pages.length - 1
? allItems.length - pointer
: pageSize
const pageData = allItems.slice(pointer, pointer + takeSize)
pointer += takeSize
return {
...page,
data: pageData,
pageInfo: {
...page?.pageInfo,
total: (page?.pageInfo?.total ?? 0) + 1,
},
}
})
if (pointer < allItems.length && newPages.length > 0) {
const lastPageIndex = newPages.length - 1
newPages[lastPageIndex] = {
...newPages[lastPageIndex],
data: [...(newPages[lastPageIndex]?.data ?? []), ...allItems.slice(pointer)],
}
}
return {
...oldData,
pages: newPages,
}
},
)
}
return { previousQueries }
},
onError: (err, _variables, context) => {
if (context?.previousQueries) {
for (const [queryKey, data] of context.previousQueries) {
queryClient.setQueryData(queryKey, data)
}
}
toast.error(err.message)
},
onSettled: () => {
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'tasks'] })
},
})
const handleDragEnd = (event: DragEndEvent) => {
if (event.canceled) return
const { source, target } = event.operation
if (!source || !target) return
const sourceData = source.data as { type?: string; task?: KanbanTaskInfo } | undefined
if (sourceData?.type !== 'kanban_task' || !sourceData.task) return
const task = sourceData.task
// Check status change permission
const isOwner = currentUserRole?.toLowerCase() === 'owner'
const isEditor = currentUserRole?.toLowerCase() === 'editor'
const isReporter = task.reporter?.id === currentUserId || task.creator?.id === currentUserId
const isAssignee = task.assignee?.id === currentUserId
if (!isOwner && !isEditor && !isReporter && !isAssignee) {
toast.error(m.cannot_change_task_status_permission())
return
}
const targetData = target.data as
| { type?: 'reorder'; task?: KanbanTaskInfo; position?: 'before' | 'after' }
| { type?: 'kanban_column'; status?: KanbanTaskStatus; lastTask?: KanbanTaskInfo }
| undefined
if (!targetData) return
if (targetData.type === 'reorder' && targetData.task && targetData.position) {
const targetTask = targetData.task
const toStatus = targetTask.status
if (task.id === targetTask.id) return
const beforeIndex =
targetData.position === 'before' ? (targetTask.sortIndex ?? undefined) : undefined
const afterIndex =
targetData.position === 'after' ? (targetTask.sortIndex ?? undefined) : undefined
updateTask({
taskId: task.id,
fromStatus: task.status,
status: toStatus,
beforeIndex,
afterIndex,
targetTaskId: targetTask.id,
position: targetData.position,
})
return
}
if (targetData.type === 'kanban_column' && targetData.status) {
const toStatus = targetData.status
const lastTask = targetData.lastTask
if (lastTask) {
if (task.id === lastTask.id) {
if (task.status === toStatus) return
updateTask({ taskId: task.id, fromStatus: task.status, status: toStatus })
return
}
updateTask({
taskId: task.id,
fromStatus: task.status,
status: toStatus,
afterIndex: lastTask.sortIndex ?? undefined,
targetTaskId: lastTask.id,
position: 'after',
})
return
}
if (task.status === toStatus) return
updateTask({ taskId: task.id, fromStatus: task.status, status: toStatus })
}
}
return (
<DragDropProvider
sensors={[
PointerSensor.configure({
activationConstraints: [new PointerActivationConstraints.Distance({ value: 8 })],
}),
KeyboardSensor,
]}
onDragEnd={handleDragEnd}
>
<div className="flex-1 min-h-0 overflow-x-auto overflow-y-hidden p-4 bg-background/50">
<div className="flex gap-4 h-full min-w-max pb-2">
{KANBAN_STATUS_COLUMNS.map((status) => (
<KanbanColumn
key={status}
teamId={teamId}
status={status}
selectedGoalId={selectedGoalId}
scope={scope}
currentUserId={currentUserId}
currentUserRole={currentUserRole}
onTaskClick={onTaskClick}
onDeleteTask={(task) => setTaskToDelete(task)}
onCreateTaskInColumn={onCreateTaskInColumn}
/>
))}
</div>
</div>
{/* Delete Task Confirmation */}
{taskToDelete && (
<AlertDialog open={!!taskToDelete} onOpenChange={(open) => !open && setTaskToDelete(null)}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>{m.delete_task()}</AlertDialogTitle>
<AlertDialogDescription>
{m.delete_task_confirm({ title: taskToDelete.title })}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel disabled={isDeleting}>{m.cancel()}</AlertDialogCancel>
<AlertDialogAction
onClick={() => deleteTask(taskToDelete.id)}
disabled={isDeleting}
className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
>
{isDeleting && <Loader2 className="w-4 h-4 mr-1.5 animate-spin" />}
{m.delete()}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
)}
</DragDropProvider>
)
}
@@ -0,0 +1,311 @@
import { useDraggable, useDroppable, useDragOperation } from '@dnd-kit/react'
import { cn } from '@/ui/lib/utils'
import { m } from '@/ui/paraglide/messages.js'
import { Avatar, AvatarFallback, AvatarImage } from '@/ui/components/ui/avatar'
import { Button } from '@/ui/components/ui/button'
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from '@/ui/components/ui/dropdown-menu'
import { KanbanTaskStatus, type KanbanTaskInfo } from '@shumai/dtos'
import { getPriorityBadgeColor, getPriorityLabel } from './kanban-types'
import {
Bot,
Calendar,
Link2,
MessageSquare,
Files,
AlertTriangle,
Target,
Sparkles,
MoreHorizontal,
Trash2,
} from 'lucide-react'
import { format, isPast } from 'date-fns'
interface KanbanCardProps {
task: KanbanTaskInfo
onClick: (task: KanbanTaskInfo) => void
onDelete?: (task: KanbanTaskInfo) => void
disabled?: boolean
isFirst?: boolean
isLast?: boolean
showBottomIndicator?: boolean
currentUserId?: string
currentUserRole?: string
}
export function KanbanCard({
task,
onClick,
onDelete,
disabled,
isFirst,
isLast,
showBottomIndicator,
currentUserId,
currentUserRole,
}: KanbanCardProps) {
const { source } = useDragOperation()
const isDraggingAny = !!source
const isOwner = currentUserRole?.toLowerCase() === 'owner'
const isEditor = currentUserRole?.toLowerCase() === 'editor'
const isCreator = !!currentUserId && task.creator?.id === currentUserId
const isReporter = task.reporter?.id === currentUserId || isCreator
const isAssignee = task.assignee?.id === currentUserId
const canChangeStatus = isOwner || isEditor || isReporter || isAssignee
const canDelete = isCreator || isOwner || isReporter
const isDragDisabled = disabled || !canChangeStatus
const { ref: setDraggableRef, isDragging } = useDraggable({
id: task.id,
data: {
type: 'kanban_task',
task,
},
disabled: isDragDisabled,
})
const { ref: setTopDroppableRef, isDropTarget: isTopOver } = useDroppable({
id: `reorder-before-${task.id}`,
data: {
type: 'reorder',
task,
position: 'before',
},
disabled: isDragging || disabled,
})
const { ref: setBottomDroppableRef, isDropTarget: isBottomOver } = useDroppable({
id: `reorder-after-${task.id}`,
data: {
type: 'reorder',
task,
position: 'after',
},
disabled: isDragging || disabled,
})
const isAgentic = task.isAgentTask
const isBlocked = task.status === KanbanTaskStatus.BLOCKED
const isOverdue = task.dueDate
? isPast(new Date(task.dueDate)) && task.status !== KanbanTaskStatus.DONE
: false
return (
<div className="relative">
{/* Top 50% Droppable Zone (reorder before this card) */}
<div
ref={setTopDroppableRef}
className={cn(
'absolute left-0 right-0 z-20',
isFirst ? '-top-6 h-[calc(50%+24px)]' : '-top-1 h-[calc(50%+4px)]',
isDraggingAny && !isDragging ? 'pointer-events-auto' : 'pointer-events-none',
)}
/>
{/* Bottom 50% Droppable Zone (reorder after this card) */}
<div
ref={setBottomDroppableRef}
className={cn(
'absolute bottom-0 left-0 right-0 z-20',
isLast ? '-bottom-6 h-[calc(50%+24px)]' : 'h-1/2',
isDraggingAny && !isDragging ? 'pointer-events-auto' : 'pointer-events-none',
)}
/>
{/* Top Reorder Drop Indicator Line */}
{isTopOver && !isDragging && (
<div className="absolute -top-1.5 left-0 right-0 h-[3px] rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary),0.6)] z-30 pointer-events-none" />
)}
{/* Bottom Reorder Drop Indicator Line */}
{(isBottomOver || showBottomIndicator) && !isDragging && (
<div className="absolute -bottom-1.5 left-0 right-0 h-[3px] rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary),0.6)] z-30 pointer-events-none" />
)}
{/* Task Card Body */}
<div
ref={setDraggableRef}
onClick={() => onClick(task)}
className={cn(
'group relative flex flex-col gap-2 p-3 rounded-lg border text-card-foreground transition-all duration-200 cursor-pointer select-none',
isDragging && 'opacity-40 scale-95 shadow-lg ring-2 ring-primary',
!isDragging && 'hover:shadow-md',
'border-border/80 bg-card hover:border-primary/50 shadow-2xs',
// Blocked warning state
isBlocked && 'border-red-500/60 bg-red-500/[0.03] ring-1 ring-red-500/20',
)}
>
{/* Top Header Row: Goal Tag & Badges */}
<div className="flex items-center justify-between gap-1.5 min-w-0">
<div className="flex items-center gap-1.5 min-w-0 flex-1">
{/* Priority Badge */}
<span
className={cn(
'px-1.5 py-0.5 rounded text-[10px] font-medium border uppercase tracking-wider shrink-0',
getPriorityBadgeColor(task.priority),
)}
>
{getPriorityLabel(task.priority)}
</span>
{/* Task Type Badge (Agent Task only) */}
{isAgentic && (
<span className="inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-semibold bg-orange-500/15 text-orange-600 dark:text-orange-400 border border-orange-500/30 shrink-0">
<Bot className="w-3 h-3" />
<span>{m.task_type_agent()}</span>
</span>
)}
{/* Goal Tag */}
{task.goal && (
<span className="inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-muted text-muted-foreground border border-border/70 truncate max-w-[130px]">
<Target className="w-2.5 h-2.5 shrink-0" />
<span className="truncate">{task.goal.title}</span>
</span>
)}
</div>
<div className="flex items-center gap-1 shrink-0">
{/* Three Dot Action Menu (for Task Creator & Team Owner) */}
{canDelete && (
<div
className="opacity-0 group-hover:opacity-100 [&:has([data-state=open])]:opacity-100 focus-within:opacity-100 transition-opacity flex items-center"
onClick={(e) => e.stopPropagation()}
>
<DropdownMenu modal={false}>
<DropdownMenuTrigger asChild>
<Button
variant="ghost"
size="icon-xs"
className="h-5 w-5 p-0 text-muted-foreground hover:text-foreground"
>
<MoreHorizontal className="w-3.5 h-3.5" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-32">
<DropdownMenuItem
className="text-destructive focus:text-destructive focus:bg-destructive/10"
onClick={() => onDelete?.(task)}
>
<Trash2 className="w-3.5 h-3.5 mr-2" />
{m.delete()}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
)}
</div>
</div>
{/* Task Title */}
<h4 className="text-xs font-semibold leading-snug line-clamp-2 text-foreground break-words">
{task.title}
</h4>
{/* Blocked Reason Banner */}
{isBlocked && (
<div className="flex items-start gap-1.5 p-1.5 rounded bg-red-500/10 border border-red-500/20 text-[11px] text-red-600 dark:text-red-400">
<AlertTriangle className="w-3.5 h-3.5 shrink-0 mt-0.5" />
<span className="line-clamp-2 break-words">
{task.latestStatusEvent?.blockReason ||
task.latestStatusEvent?.reason ||
task.latestStatusEvent?.summary ||
m.status_blocked()}
</span>
</div>
)}
{/* Review Feedback Banner */}
{task.status === KanbanTaskStatus.IN_REVIEW && task.latestStatusEvent?.summary && (
<div className="flex items-start gap-1.5 p-1.5 rounded bg-purple-500/10 border border-purple-500/20 text-[11px] text-purple-600 dark:text-purple-400">
<Sparkles className="w-3.5 h-3.5 shrink-0 mt-0.5" />
<span className="line-clamp-2 break-words">{task.latestStatusEvent.summary}</span>
</div>
)}
{/* Card Footer: Assignee & Metadata Badges */}
<div className="flex items-center justify-between gap-2 pt-1 mt-auto border-t border-border/40 text-[11px] text-muted-foreground">
{/* Assignee */}
<div className="flex items-center gap-1.5 min-w-0">
{task.assignee ? (
<>
{isAgentic ? (
<div className="w-5 h-5 rounded-full bg-orange-500/15 border border-orange-500/30 flex items-center justify-center shrink-0">
<Bot className="w-3 h-3 text-orange-600 dark:text-orange-400" />
</div>
) : (
<Avatar size="sm" className="w-5 h-5 border border-border">
<AvatarImage src={task.assignee.image} />
<AvatarFallback className="text-[9px]">
{task.assignee.name.slice(0, 2).toUpperCase()}
</AvatarFallback>
</Avatar>
)}
<span className="truncate text-xs font-medium text-foreground/80 max-w-[90px]">
{task.assignee.name}
</span>
</>
) : (
<span className="text-[11px] italic text-muted-foreground/60">{m.unassigned()}</span>
)}
</div>
{/* Right side stats: Due Date, Dependencies, Comments */}
<div className="flex items-center gap-2 shrink-0">
{/* Due Date */}
{task.dueDate && (
<div
className={cn(
'flex items-center gap-1 text-[10px] font-mono',
isOverdue ? 'text-red-500 font-semibold' : 'text-muted-foreground',
)}
title={format(new Date(task.dueDate), 'yyyy/MM/dd HH:mm')}
>
<Calendar className="w-3 h-3" />
<span>{format(new Date(task.dueDate), 'MM/dd')}</span>
</div>
)}
{/* Linked assets count */}
{task.assetCount > 0 && (
<div
className="flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground"
title={m.linked_assets_count({ count: task.assetCount })}
>
<Files className="w-3 h-3" />
<span>{task.assetCount}</span>
</div>
)}
{/* Dependencies count */}
{task.dependencyCount > 0 && (
<div
className="flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground"
title={`${task.dependencyCount} dependencies`}
>
<Link2 className="w-3 h-3" />
<span>{task.dependencyCount}</span>
</div>
)}
{/* Comments count */}
{task.commentCount > 0 && (
<div
className="flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground"
title={`${task.commentCount} comments`}
>
<MessageSquare className="w-3 h-3" />
<span>{task.commentCount}</span>
</div>
)}
</div>
</div>
</div>
</div>
)
}
@@ -0,0 +1,182 @@
import { useEffect, useMemo } from 'react'
import { useInfiniteQuery } from '@tanstack/react-query'
import { useDroppable, useDragOperation } from '@dnd-kit/react'
import { useInView } from 'react-intersection-observer'
import { client } from '@/ui/api/client'
import { cn } from '@/ui/lib/utils'
import { m } from '@/ui/paraglide/messages.js'
import { Button } from '@/ui/components/ui/button'
import { ScrollArea } from '@/ui/components/ui/scroll-area'
import { KanbanTaskStatus, type KanbanTaskInfo, type ListKanbanTasksResponse } from '@shumai/dtos'
import { getStatusColor, getStatusLabel } from './kanban-types'
import { KanbanCard } from './kanban-card'
import { Plus, Loader2 } from 'lucide-react'
interface KanbanColumnProps {
teamId: string
status: KanbanTaskStatus
selectedGoalId: string | null
scope: 'team' | 'my'
currentUserId?: string
currentUserRole?: string
onTaskClick: (task: KanbanTaskInfo) => void
onDeleteTask?: (task: KanbanTaskInfo) => void
onCreateTaskInColumn: (status: KanbanTaskStatus) => void
}
export function KanbanColumn({
teamId,
status,
selectedGoalId,
scope,
currentUserId,
currentUserRole,
onTaskClick,
onDeleteTask,
onCreateTaskInColumn,
}: KanbanColumnProps) {
const isOwnerOrEditor =
currentUserRole?.toLowerCase() === 'owner' || currentUserRole?.toLowerCase() === 'editor'
const assigneeId = scope === 'my' ? currentUserId : undefined
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading } = useInfiniteQuery({
queryKey: ['teams', teamId, 'kanban', 'tasks', { status, goalId: selectedGoalId, assigneeId }],
queryFn: async ({ pageParam = '' }) => {
const res = await client.api.teams[':teamId'].kanban.tasks.$get({
param: { teamId },
query: {
status,
goalId: selectedGoalId || undefined,
assigneeId: assigneeId || undefined,
first: '20',
after: (pageParam as string) || undefined,
},
})
if (!res.ok) throw new Error('Failed to fetch column tasks')
return (await res.json()) as unknown as ListKanbanTasksResponse
},
initialPageParam: '',
getNextPageParam: (lastPage) => lastPage.pageInfo?.cursor || undefined,
refetchInterval: 5000,
enabled: !!teamId,
})
const { ref: loadMoreRef, inView } = useInView({
threshold: 0.1,
})
useEffect(() => {
if (inView && hasNextPage && !isFetchingNextPage) {
fetchNextPage()
}
}, [inView, hasNextPage, isFetchingNextPage, fetchNextPage])
const allTasks = useMemo(() => {
return data?.pages?.flatMap((page) => (Array.isArray(page?.data) ? page.data : [])) || []
}, [data])
const { source, target } = useDragOperation()
const lastVisibleTask = allTasks.filter((t) => t.id !== source?.id).at(-1)
const { ref: setDroppableRef, isDropTarget } = useDroppable({
id: status,
data: {
type: 'kanban_column',
status,
lastTask: lastVisibleTask,
},
})
const isDraggingTask = source?.data?.type === 'kanban_task'
const isOverThisColumn =
isDraggingTask &&
(isDropTarget ||
(target?.data?.type === 'kanban_column' && target.data.status === status) ||
(target?.data?.type === 'reorder' &&
(target.data.task as KanbanTaskInfo | undefined)?.status === status))
const isOverColumnEmptySpace =
isDraggingTask && target?.data?.type === 'kanban_column' && target.data.status === status
const totalCount = data?.pages?.[0]?.pageInfo?.total ?? allTasks.length
const statusColor = getStatusColor(status)
return (
<div
ref={setDroppableRef}
className={cn(
'flex flex-col h-full max-h-full w-80 md:w-84 shrink-0 rounded-xl bg-card/60 border border-border/70 shadow-xs transition-colors duration-200 overflow-hidden select-none',
isOverThisColumn && 'ring-2 ring-primary/60 bg-primary/[0.03] border-primary/40',
)}
>
{/* Column Header */}
<div className="h-11 px-3.5 flex items-center justify-between border-b border-border/60 bg-card/80 shrink-0">
<div className="flex items-center gap-2 min-w-0">
<div className={cn('w-2.5 h-2.5 rounded-full shrink-0', statusColor.dot)} />
<h3 className="text-xs font-bold tracking-wide uppercase text-foreground/90 truncate">
{getStatusLabel(status)}
</h3>
</div>
<div className="flex items-center gap-1 shrink-0">
<span className="text-[11px] font-mono px-2 py-0.5 rounded-full bg-muted font-medium text-muted-foreground">
{totalCount}
</span>
</div>
</div>
{/* Column Task Cards Body */}
<ScrollArea className="flex-1 min-h-0 [&>div>div]:block!">
<div className="p-2.5 space-y-2.5 min-h-full flex flex-col">
{isLoading ? (
<div className="flex items-center justify-center py-10">
<Loader2 className="w-5 h-5 animate-spin text-muted-foreground" />
</div>
) : allTasks.length === 0 ? (
<div className="flex flex-col items-center justify-center py-10 px-4 text-center">
<p className="text-xs text-muted-foreground/70">{m.no_tasks_in_column()}</p>
</div>
) : (
allTasks.map((task, index) => (
<KanbanCard
key={task.id}
task={task}
onClick={onTaskClick}
onDelete={onDeleteTask}
isFirst={index === 0}
isLast={index === allTasks.length - 1}
showBottomIndicator={isOverColumnEmptySpace && task.id === lastVisibleTask?.id}
currentUserId={currentUserId}
currentUserRole={currentUserRole}
/>
))
)}
{/* Infinite Scroll Sentinel */}
<div ref={loadMoreRef} className="h-2" />
{isFetchingNextPage && (
<div className="flex justify-center py-2">
<Loader2 className="w-4 h-4 animate-spin text-muted-foreground" />
</div>
)}
</div>
</ScrollArea>
{/* Fixed Column Footer: + Create Task */}
{isOwnerOrEditor && (
<div className="p-2 border-t border-border/50 bg-card/90 shrink-0">
<Button
variant="ghost"
size="sm"
onClick={() => onCreateTaskInColumn(status)}
className="w-full justify-center h-8 text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted/80 border border-dashed border-border/80"
>
<Plus className="w-3.5 h-3.5 mr-1.5" />
<span>{m.create_task()}</span>
</Button>
</div>
)}
</div>
)
}
@@ -0,0 +1,160 @@
import { useEffect, useState } from 'react'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
} from '@/ui/components/ui/dialog'
import { Button } from '@/ui/components/ui/button'
import { Input } from '@/ui/components/ui/input'
import { Textarea } from '@/ui/components/ui/textarea'
import { Label } from '@/ui/components/ui/label'
import { client } from '@/ui/api/client'
import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { m } from '@/ui/paraglide/messages.js'
import type { KanbanGoalInfo } from '@shumai/dtos'
import { Loader2 } from 'lucide-react'
interface KanbanCreateGoalDialogProps {
teamId: string
isOpen: boolean
onClose: () => void
goalToEdit?: KanbanGoalInfo | null
}
export function KanbanCreateGoalDialog({
teamId,
isOpen,
onClose,
goalToEdit,
}: KanbanCreateGoalDialogProps) {
const queryClient = useQueryClient()
const [title, setTitle] = useState('')
const [description, setDescription] = useState('')
useEffect(() => {
if (goalToEdit) {
setTitle(goalToEdit.title)
setDescription(goalToEdit.description || '')
} else {
setTitle('')
setDescription('')
}
}, [goalToEdit, isOpen])
const { mutate: createGoal, isPending: isCreating } = useMutation({
mutationFn: async () => {
const res = await client.api.teams[':teamId'].kanban.goals.$post({
param: { teamId },
json: {
title: title.trim(),
description: description.trim() || undefined,
},
})
if (!res.ok) {
const err = await res.json().catch(() => ({ message: m.error() }))
throw new Error((err as { message?: string }).message || m.error())
}
return await res.json()
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'goals'] })
toast.success(m.goal_created())
onClose()
},
onError: (err) => {
toast.error(err.message)
},
})
const { mutate: updateGoal, isPending: isUpdating } = useMutation({
mutationFn: async () => {
if (!goalToEdit) return
const res = await client.api.teams[':teamId'].kanban.goals[':goalId'].$patch({
param: { teamId, goalId: goalToEdit.id },
json: {
title: title.trim(),
description: description.trim() || null,
},
})
if (!res.ok) {
const err = await res.json().catch(() => ({ message: m.error() }))
throw new Error((err as { message?: string }).message || m.error())
}
return await res.json()
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'goals'] })
toast.success(m.goal_updated())
onClose()
},
onError: (err) => {
toast.error(err.message)
},
})
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault()
if (!title.trim()) return
if (goalToEdit) {
updateGoal()
} else {
createGoal()
}
}
const isLoading = isCreating || isUpdating
return (
<Dialog open={isOpen} onOpenChange={(open) => !open && onClose()}>
<DialogContent className="sm:max-w-xl">
<form onSubmit={handleSubmit} className="space-y-4">
<DialogHeader>
<DialogTitle>{goalToEdit ? m.edit_goal() : m.create_goal()}</DialogTitle>
<DialogDescription>
{goalToEdit ? m.edit_goal() : m.create_first_goal()}
</DialogDescription>
</DialogHeader>
<div className="space-y-3 py-2">
<div className="space-y-1.5">
<Label htmlFor="goal-title">{m.goal_title()}</Label>
<Input
id="goal-title"
value={title}
onChange={(e) => setTitle(e.target.value)}
placeholder={m.goal_title_placeholder()}
required
autoFocus
/>
</div>
<div className="space-y-1.5">
<Label htmlFor="goal-description">{m.goal_description()}</Label>
<Textarea
id="goal-description"
value={description}
onChange={(e) => setDescription(e.target.value)}
placeholder={m.goal_description_placeholder()}
rows={3}
/>
</div>
</div>
<DialogFooter>
<Button type="button" variant="outline" onClick={onClose} disabled={isLoading}>
{m.cancel()}
</Button>
<Button type="submit" disabled={!title.trim() || isLoading}>
{isLoading && <Loader2 className="w-4 h-4 mr-1.5 animate-spin" />}
{goalToEdit ? m.save_changes() : m.create()}
</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
)
}
@@ -0,0 +1,481 @@
import { useState, useEffect } from 'react'
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
DialogFooter,
} from '@/ui/components/ui/dialog'
import { Button } from '@/ui/components/ui/button'
import { Input } from '@/ui/components/ui/input'
import { Textarea } from '@/ui/components/ui/textarea'
import { Label } from '@/ui/components/ui/label'
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from '@/ui/components/ui/select'
import { Avatar, AvatarFallback, AvatarImage } from '@/ui/components/ui/avatar'
import { DateTimePicker } from '@/ui/components/datetime-picker'
import { Switch } from '@/ui/components/ui/switch'
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import { client } from '@/ui/api/client'
import { toast } from 'sonner'
import { m } from '@/ui/paraglide/messages.js'
import {
KanbanTaskPriority,
KanbanTaskStatus,
type KanbanGoalInfo,
type AgentInfo,
type KanbanTaskAssetInfo,
UNASSIGNED_GOAL_ID,
} from '@shumai/dtos'
import { getPriorityBadgeColor, getPriorityLabel } from './kanban-types'
import { TaskTargetFolderDialog } from './edit-task-dialog/task-target-folder-dialog'
import { TaskParentSelector } from './task-parent-selector'
import { TaskRelatedAssets } from './task-related-assets'
import { Bot, Folder, Target, Loader2 } from 'lucide-react'
import { cn } from '@/ui/lib/utils'
interface KanbanCreateTaskDialogProps {
teamId: string
isOpen: boolean
onClose: () => void
initialStatus?: KanbanTaskStatus
initialGoalId?: string | null
}
export function KanbanCreateTaskDialog({
teamId,
isOpen,
onClose,
initialGoalId,
}: KanbanCreateTaskDialogProps) {
const queryClient = useQueryClient()
const effectiveInitialGoalId =
initialGoalId === UNASSIGNED_GOAL_ID || !initialGoalId ? 'none' : initialGoalId
const [title, setTitle] = useState('')
const [description, setDescription] = useState('')
const [isAgentTask, setIsAgentTask] = useState(false)
const [priority, setPriority] = useState<KanbanTaskPriority>(KanbanTaskPriority.MEDIUM)
const [goalId, setGoalId] = useState<string>(effectiveInitialGoalId)
const [assigneeId, setAssigneeId] = useState<string>('none')
const [reporterId, setReporterId] = useState<string>('none')
const [startDate, setStartDate] = useState<Date | undefined>(undefined)
const [dueDate, setDueDate] = useState<Date | undefined>(undefined)
const [projectId, setProjectId] = useState<string | null>(null)
const [targetFolderId, setTargetFolderId] = useState<string | null>(null)
const [targetFolderName, setTargetFolderName] = useState<string | null>(null)
const [parentIds, setParentIds] = useState<string[]>([])
const [selectedAssets, setSelectedAssets] = useState<KanbanTaskAssetInfo[]>([])
const [isFolderPickerOpen, setIsFolderPickerOpen] = useState(false)
// Query Current User to default reporter
const { data: me } = useQuery({
queryKey: ['teams', teamId, 'me'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].me.$get({
param: { teamId },
})
if (!res.ok) return null
return await res.json()
},
enabled: !!teamId && isOpen,
})
useEffect(() => {
if (isOpen) {
setTitle('')
setDescription('')
setIsAgentTask(false)
setPriority(KanbanTaskPriority.MEDIUM)
setGoalId(effectiveInitialGoalId)
setAssigneeId('none')
setReporterId(me?.id || 'none')
setStartDate(undefined)
setDueDate(undefined)
setProjectId(null)
setTargetFolderId(null)
setTargetFolderName(null)
setParentIds([])
setSelectedAssets([])
}
}, [isOpen, effectiveInitialGoalId, me?.id])
// Queries for selectors
const { data: members = [] } = useQuery({
queryKey: ['teams', teamId, 'members', 'human'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].members.$get({
param: { teamId },
query: { includeAgents: 'false' },
})
if (!res.ok) return []
const data = await res.json()
return Array.isArray(data) ? data : []
},
enabled: !!teamId && isOpen,
})
const { data: agents = [] } = useQuery({
queryKey: ['teams', teamId, 'agents'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].agents.$get({
param: { teamId },
})
if (!res.ok) return []
return ((await res.json()) as AgentInfo[]) || []
},
enabled: !!teamId && isOpen,
})
const { data: goalsData } = useQuery({
queryKey: ['teams', teamId, 'kanban', 'goals'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].kanban.goals.$get({
param: { teamId },
query: {},
})
if (!res.ok) return { data: [] }
return (await res.json()) as { data: KanbanGoalInfo[] }
},
enabled: !!teamId && isOpen,
})
const goals = goalsData?.data || []
// Create task mutation
const { mutate: createTask, isPending } = useMutation({
mutationFn: async () => {
const res = await client.api.teams[':teamId'].kanban.tasks.$post({
param: { teamId },
json: {
title: title.trim(),
description: description.trim() || undefined,
isAgentTask,
priority,
goalId: goalId !== 'none' ? goalId : undefined,
assigneeId: assigneeId !== 'none' ? assigneeId : undefined,
reporterId: reporterId !== 'none' ? reporterId : undefined,
startDate: startDate ? startDate.toISOString() : undefined,
dueDate: dueDate ? dueDate.toISOString() : undefined,
projectId: projectId || undefined,
targetFolderId: targetFolderId || undefined,
parentIds: parentIds.length > 0 ? parentIds : undefined,
assetIds: selectedAssets.length > 0 ? selectedAssets.map((a) => a.id) : undefined,
},
})
if (!res.ok) {
const text = await res.text().catch(() => '')
let errorMsg: string = m.error()
if (text) {
try {
const json = JSON.parse(text)
if (json && typeof json.message === 'string') {
errorMsg = json.message
}
} catch {
errorMsg = text
}
}
throw new Error(errorMsg)
}
return await res.json()
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'tasks'] })
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'goals'] })
toast.success(m.task_created())
onClose()
},
onError: (err) => {
toast.error(err.message)
},
})
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault()
if (!title.trim() || isPending) return
createTask()
}
const isAgentic = isAgentTask
return (
<Dialog open={isOpen} onOpenChange={(open) => !open && onClose()}>
<DialogContent className="sm:max-w-3xl max-h-[90vh] overflow-y-auto">
<form onSubmit={handleSubmit} className="space-y-4">
<DialogHeader>
<DialogTitle>{m.create_task()}</DialogTitle>
</DialogHeader>
<div className="space-y-3.5 py-1">
{/* Title */}
<div className="space-y-1.5">
<Label htmlFor="create-task-title">{m.task_title()}</Label>
<Input
id="create-task-title"
value={title}
onChange={(e) => setTitle(e.target.value)}
placeholder={m.task_title_placeholder()}
required
autoFocus
/>
</div>
{/* Description */}
<div className="space-y-1.5">
<Label htmlFor="create-task-desc">{m.task_description()}</Label>
<Textarea
id="create-task-desc"
value={description}
onChange={(e) => setDescription(e.target.value)}
placeholder={m.task_description_placeholder()}
rows={3}
/>
</div>
{/* Properties Grid */}
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
{/* Row 1: Agent Task Switch */}
<div className="sm:col-span-2 flex items-center justify-between space-x-2 rounded-lg border border-border/80 bg-muted/30 p-2.5 h-14">
<div className="space-y-0.5 min-w-0 pr-2">
<Label
htmlFor="create-is-agent-task"
className="text-xs font-medium cursor-pointer flex items-center gap-1.5"
>
<Bot className="w-3.5 h-3.5 text-orange-500" />
<span>{m.task_type_agent()}</span>
</Label>
<p className="text-[11px] text-muted-foreground line-clamp-1">
{m.task_type_agent_desc()}
</p>
</div>
<Switch
id="create-is-agent-task"
checked={isAgentTask}
onCheckedChange={(checked) => {
setIsAgentTask(checked)
setAssigneeId('none')
}}
/>
</div>
{/* Row 2: Priority and Goal selectors */}
<div className="space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">
{m.task_priority()}
</Label>
<Select
value={priority}
onValueChange={(val) => setPriority(val as KanbanTaskPriority)}
>
<SelectTrigger className="w-full h-9 text-xs">
<SelectValue />
</SelectTrigger>
<SelectContent>
{Object.values(KanbanTaskPriority).map((p) => (
<SelectItem key={p} value={p}>
<span
className={cn(
'px-1.5 py-0.5 rounded text-[10px] uppercase font-medium',
getPriorityBadgeColor(p),
)}
>
{getPriorityLabel(p)}
</span>
</SelectItem>
))}
</SelectContent>
</Select>
</div>
<div className="space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">{m.goals()}</Label>
<Select value={goalId} onValueChange={setGoalId}>
<SelectTrigger className="w-full h-9 text-xs">
<SelectValue placeholder="None" />
</SelectTrigger>
<SelectContent>
<SelectItem value="none">
<span className="text-muted-foreground italic">None</span>
</SelectItem>
{goals
.filter((g) => g.id !== UNASSIGNED_GOAL_ID)
.map((g) => (
<SelectItem key={g.id} value={g.id}>
<div className="flex items-center gap-2">
<Target className="w-3.5 h-3.5 text-primary" />
<span>{g.title}</span>
</div>
</SelectItem>
))}
</SelectContent>
</Select>
</div>
{/* Row 3: Assignee and Reporter */}
<div className="space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">
{isAgentic ? m.select_agent() : m.assignee()}
</Label>
<Select value={assigneeId} onValueChange={setAssigneeId}>
<SelectTrigger className="w-full h-9 text-xs">
<SelectValue placeholder={m.unassigned()} />
</SelectTrigger>
<SelectContent>
<SelectItem value="none">
<span className="text-muted-foreground italic">{m.unassigned()}</span>
</SelectItem>
{isAgentic
? agents.map((a) => (
<SelectItem key={a.id} value={a.id}>
<div className="flex items-center gap-2">
<Bot className="w-3.5 h-3.5 text-purple-500" />
<span>{a.name}</span>
</div>
</SelectItem>
))
: members.map((mItem) => (
<SelectItem key={mItem.id} value={mItem.id}>
<div className="flex items-center gap-2">
<Avatar size="sm" className="w-4 h-4">
<AvatarImage src={mItem.image} />
<AvatarFallback className="text-[8px]">
{mItem.name.slice(0, 2).toUpperCase()}
</AvatarFallback>
</Avatar>
<span>{mItem.name}</span>
</div>
</SelectItem>
))}
</SelectContent>
</Select>
</div>
<div className="space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">{m.reporter()}</Label>
<Select value={reporterId} onValueChange={setReporterId}>
<SelectTrigger className="w-full h-9 text-xs">
<SelectValue placeholder={m.unassigned()} />
</SelectTrigger>
<SelectContent>
<SelectItem value="none">
<span className="text-muted-foreground italic">{m.unassigned()}</span>
</SelectItem>
{members.map((mItem) => (
<SelectItem key={mItem.id} value={mItem.id}>
<div className="flex items-center gap-2">
<Avatar size="sm" className="w-4 h-4">
<AvatarImage src={mItem.image} />
<AvatarFallback className="text-[8px]">
{mItem.name.slice(0, 2).toUpperCase()}
</AvatarFallback>
</Avatar>
<span>{mItem.name}</span>
</div>
</SelectItem>
))}
</SelectContent>
</Select>
</div>
{/* Row 4: Target Folder Selector (only for agent task) */}
{isAgentic && (
<div className="sm:col-span-2 space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">
{m.target_folder()}
</Label>
<Button
type="button"
variant="outline"
size="sm"
onClick={() => setIsFolderPickerOpen(true)}
className="w-full justify-start h-9 text-xs truncate font-normal"
>
<Folder className="w-3.5 h-3.5 mr-2 text-primary shrink-0" />
<span className="truncate">{targetFolderName || m.select_target_folder()}</span>
</Button>
</div>
)}
{/* Row 5: Start Date and Due Date */}
<div className="space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">
{m.start_date()}
</Label>
<DateTimePicker
value={startDate}
onChange={setStartDate}
placeholder={m.start_date()}
className="h-9 text-xs"
/>
</div>
<div className="space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">{m.due_date()}</Label>
<DateTimePicker
value={dueDate}
onChange={setDueDate}
placeholder={m.due_date()}
className="h-9 text-xs"
/>
</div>
{/* Row 6: Parent Tasks */}
<div className="sm:col-span-2 space-y-1.5">
<Label className="text-xs font-medium text-muted-foreground">
{m.parent_tasks()}
</Label>
<TaskParentSelector teamId={teamId} value={parentIds} onChange={setParentIds} />
</div>
{/* Row 7: Related Assets */}
<div className="sm:col-span-2 pt-1">
<TaskRelatedAssets
teamId={teamId}
projectId={projectId}
assets={selectedAssets}
onAddAssets={(newAssets) => setSelectedAssets((prev) => [...prev, ...newAssets])}
onRemoveAsset={(assetId) =>
setSelectedAssets((prev) => prev.filter((a) => a.id !== assetId))
}
/>
</div>
</div>
</div>
<DialogFooter>
<Button type="button" variant="outline" onClick={onClose} disabled={isPending}>
{m.cancel()}
</Button>
<Button type="submit" disabled={!title.trim() || isPending}>
{isPending && <Loader2 className="w-4 h-4 mr-1.5 animate-spin" />}
{m.create()}
</Button>
</DialogFooter>
</form>
{/* Target Folder Dialog */}
{isFolderPickerOpen && (
<TaskTargetFolderDialog
teamId={teamId}
currentProjectId={projectId}
currentTargetFolderId={targetFolderId}
isOpen={isFolderPickerOpen}
onClose={() => setIsFolderPickerOpen(false)}
onSelect={(projId, foldId, foldName) => {
setProjectId(projId)
setTargetFolderId(foldId)
setTargetFolderName(foldName || 'Selected Folder')
}}
/>
)}
</DialogContent>
</Dialog>
)
}
@@ -0,0 +1,342 @@
import { useState } from 'react'
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
import { client } from '@/ui/api/client'
import { cn } from '@/ui/lib/utils'
import { m } from '@/ui/paraglide/messages.js'
import { Button } from '@/ui/components/ui/button'
import { ScrollArea } from '@/ui/components/ui/scroll-area'
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from '@/ui/components/ui/dropdown-menu'
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
} from '@/ui/components/ui/alert-dialog'
import {
Target,
Plus,
MoreHorizontal,
Edit2,
Trash2,
ListTodo,
Loader2,
ChevronLeft,
ChevronRight,
} from 'lucide-react'
import { toast } from 'sonner'
import { type KanbanGoalInfo, UNASSIGNED_GOAL_ID } from '@shumai/dtos'
import { KanbanCreateGoalDialog } from './kanban-create-goal-dialog'
interface KanbanGoalSidebarProps {
teamId: string
selectedGoalId: string | null
onSelectGoal: (goalId: string | null) => void
isOwnerOrEditor?: boolean
}
export function KanbanGoalSidebar({
teamId,
selectedGoalId,
onSelectGoal,
isOwnerOrEditor = true,
}: KanbanGoalSidebarProps) {
const queryClient = useQueryClient()
const [isCreateGoalOpen, setIsCreateGoalOpen] = useState(false)
const [goalToEdit, setGoalToEdit] = useState<KanbanGoalInfo | null>(null)
const [goalToDelete, setGoalToDelete] = useState<KanbanGoalInfo | null>(null)
const [isCollapsed, setIsCollapsed] = useState(false)
const { data: goalsData, isLoading } = useQuery({
queryKey: ['teams', teamId, 'kanban', 'goals'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].kanban.goals.$get({
param: { teamId },
query: {},
})
if (!res.ok) throw new Error('Failed to fetch goals')
return (await res.json()) as { data: KanbanGoalInfo[] }
},
enabled: !!teamId,
})
const goals = goalsData?.data || []
const totalGoalTasks = goals.reduce((acc, g) => acc + (g.taskCount || 0), 0)
const { mutate: deleteGoal, isPending: isDeleting } = useMutation({
mutationFn: async (goalId: string) => {
const res = await client.api.teams[':teamId'].kanban.goals[':goalId'].$delete({
param: { teamId, goalId },
})
if (!res.ok) {
const err = await res.json().catch(() => ({ message: m.error() }))
throw new Error((err as { message?: string }).message || m.error())
}
return await res.json()
},
onSuccess: (_, deletedGoalId) => {
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'goals'] })
queryClient.invalidateQueries({ queryKey: ['teams', teamId, 'kanban', 'tasks'] })
toast.success(m.goal_deleted())
if (selectedGoalId === deletedGoalId) {
onSelectGoal(null)
}
setGoalToDelete(null)
},
onError: (err) => {
toast.error(err.message)
},
})
if (isCollapsed) {
return (
<div className="border-r border-sidebar-border bg-sidebar flex flex-col items-center w-12 shrink-0 transition-all duration-300">
<div className="h-14 flex items-center justify-center border-b border-sidebar-border w-full shrink-0">
<Button
variant="ghost"
size="icon-sm"
onClick={() => setIsCollapsed(false)}
title={m.goals()}
className="text-sidebar-foreground/70 hover:text-sidebar-foreground"
>
<ChevronRight className="w-4 h-4" />
</Button>
</div>
<div className="mt-3 flex flex-col items-center gap-2">
<Button
variant={selectedGoalId === null ? 'secondary' : 'ghost'}
size="icon-sm"
onClick={() => onSelectGoal(null)}
title={m.all_tasks()}
className={cn(
'w-8 h-8 rounded-md',
selectedGoalId === null && 'bg-sidebar-accent text-sidebar-accent-foreground',
)}
>
<ListTodo className="w-4 h-4" />
</Button>
<Button
variant="ghost"
size="icon-sm"
onClick={() => setIsCreateGoalOpen(true)}
title={m.new_goal()}
className="w-8 h-8 rounded-md text-sidebar-foreground/70 hover:text-sidebar-foreground"
>
<Plus className="w-4 h-4" />
</Button>
</div>
{isCreateGoalOpen && (
<KanbanCreateGoalDialog
teamId={teamId}
isOpen={isCreateGoalOpen}
onClose={() => setIsCreateGoalOpen(false)}
/>
)}
</div>
)
}
return (
<aside className="w-64 border-r border-sidebar-border bg-sidebar flex flex-col shrink-0 transition-all duration-300 select-none">
{/* Sidebar Header */}
<div className="h-14 px-3 flex items-center justify-between border-b border-sidebar-border shrink-0">
<div className="flex items-center gap-2 font-semibold text-xs tracking-wider uppercase text-sidebar-foreground/70">
<Target className="w-4 h-4 text-sidebar-primary" />
<span>{m.goals()}</span>
</div>
<div className="flex items-center gap-1">
{isOwnerOrEditor && (
<Button
variant="ghost"
size="icon-sm"
onClick={() => setIsCreateGoalOpen(true)}
className="h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground"
title={m.new_goal()}
>
<Plus className="w-4 h-4" />
</Button>
)}
<Button
variant="ghost"
size="icon-sm"
onClick={() => setIsCollapsed(true)}
className="h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground"
title="Collapse"
>
<ChevronLeft className="w-4 h-4" />
</Button>
</div>
</div>
{/* Goals List */}
<ScrollArea className="flex-1 p-2">
<div className="space-y-1">
{/* All Tasks Item */}
<div
onClick={() => onSelectGoal(null)}
className={cn(
'flex items-center justify-between px-2.5 py-1 rounded-md text-xs font-medium cursor-pointer transition-colors group h-8 min-h-[32px]',
selectedGoalId === null
? 'bg-sidebar-accent text-sidebar-accent-foreground font-semibold shadow-xs'
: 'text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground',
)}
>
<div className="flex items-center gap-2 truncate min-w-0">
<ListTodo className="w-3.5 h-3.5 shrink-0 text-sidebar-primary" />
<span className="truncate">{m.all_tasks()}</span>
</div>
{totalGoalTasks > 0 && (
<span className="text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 shrink-0">
{totalGoalTasks}
</span>
)}
</div>
{/* Goal Items */}
{isLoading ? (
<div className="flex items-center justify-center p-4">
<Loader2 className="w-4 h-4 animate-spin text-muted-foreground" />
</div>
) : goals.length === 0 ? (
<div className="px-2.5 py-4 text-center text-xs text-muted-foreground">
{m.no_goals_yet()}
</div>
) : (
goals.map((goal) => {
const isSelected = selectedGoalId === goal.id
const isUnassigned = goal.id === UNASSIGNED_GOAL_ID
const title = isUnassigned ? m.unassigned() : goal.title
const hasActions = isOwnerOrEditor && !isUnassigned
return (
<div
key={goal.id}
onClick={() => onSelectGoal(goal.id)}
className={cn(
'flex items-center justify-between px-2.5 py-1 rounded-md text-xs font-medium cursor-pointer transition-colors group relative min-h-[32px]',
isSelected
? 'bg-sidebar-accent text-sidebar-accent-foreground font-semibold shadow-xs'
: 'text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground',
)}
>
<div className="flex items-center gap-2 min-w-0 flex-1">
<Target
className={cn(
'w-3.5 h-3.5 shrink-0',
isSelected ? 'text-sidebar-primary' : 'text-muted-foreground',
)}
/>
<span className="line-clamp-2 break-words leading-tight" title={title}>
{title}
</span>
</div>
<div className="flex items-center shrink-0 ml-1">
{hasActions ? (
<>
{(goal.taskCount ?? 0) > 0 && (
<span className="text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 group-hover:hidden group-focus-within:hidden [&:has(~_div_[data-state=open])]:hidden">
{goal.taskCount}
</span>
)}
<div
className="hidden group-hover:flex group-focus-within:flex [&:has([data-state=open])]:flex items-center"
onClick={(e) => e.stopPropagation()}
>
<DropdownMenu modal={false}>
<DropdownMenuTrigger asChild>
<Button
variant="ghost"
size="icon-xs"
className="h-6 w-6 p-0 text-muted-foreground hover:text-foreground"
>
<MoreHorizontal className="w-3.5 h-3.5" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-36">
<DropdownMenuItem
onClick={() => {
setGoalToEdit(goal)
}}
>
<Edit2 className="w-3.5 h-3.5 mr-2" />
{m.edit()}
</DropdownMenuItem>
<DropdownMenuItem
className="text-destructive focus:text-destructive focus:bg-destructive/10"
onClick={() => {
setGoalToDelete(goal)
}}
>
<Trash2 className="w-3.5 h-3.5 mr-2" />
{m.delete()}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
</>
) : (
(goal.taskCount ?? 0) > 0 && (
<span className="text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60">
{goal.taskCount}
</span>
)
)}
</div>
</div>
)
})
)}
</div>
</ScrollArea>
{/* Create / Edit Goal Dialog */}
{(isCreateGoalOpen || goalToEdit) && (
<KanbanCreateGoalDialog
teamId={teamId}
isOpen={isCreateGoalOpen || !!goalToEdit}
goalToEdit={goalToEdit}
onClose={() => {
setIsCreateGoalOpen(false)
setGoalToEdit(null)
}}
/>
)}
{/* Delete Goal Confirmation */}
{goalToDelete && (
<AlertDialog open={!!goalToDelete} onOpenChange={(open) => !open && setGoalToDelete(null)}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>{m.delete_goal()}</AlertDialogTitle>
<AlertDialogDescription>
{m.delete_goal_confirm({ title: goalToDelete.title })}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel disabled={isDeleting}>{m.cancel()}</AlertDialogCancel>
<AlertDialogAction
onClick={() => deleteGoal(goalToDelete.id)}
disabled={isDeleting}
className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
>
{isDeleting && <Loader2 className="w-4 h-4 mr-1.5 animate-spin" />}
{m.delete()}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
)}
</aside>
)
}
@@ -0,0 +1,89 @@
import { Button } from '@/ui/components/ui/button'
import { m } from '@/ui/paraglide/messages.js'
import { Users, User, Plus, Target, X } from 'lucide-react'
import { type KanbanGoalInfo, UNASSIGNED_GOAL_ID } from '@shumai/dtos'
interface KanbanHeaderProps {
scope: 'team' | 'my'
onScopeChange: (scope: 'team' | 'my') => void
selectedGoal: KanbanGoalInfo | null
onClearGoal: () => void
onCreateTask: () => void
canCreateTask?: boolean
}
export function KanbanHeader({
scope,
onScopeChange,
selectedGoal,
onClearGoal,
onCreateTask,
canCreateTask = true,
}: KanbanHeaderProps) {
return (
<header className="h-14 border-b border-border bg-card/60 backdrop-blur-sm px-4 flex items-center justify-between gap-3 shrink-0 select-none">
{/* Left side: Scope switcher & Goal indicator */}
<div className="flex items-center gap-3 min-w-0">
{/* Scope Toggle (Team vs My Tasks) */}
<div className="flex items-center bg-muted/60 p-0.5 rounded-lg border border-border/50">
<Button
variant={scope === 'team' ? 'secondary' : 'ghost'}
size="sm"
onClick={() => onScopeChange('team')}
className={`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${
scope === 'team'
? 'bg-background text-foreground shadow-xs'
: 'text-muted-foreground hover:text-foreground'
}`}
>
<Users className="w-3.5 h-3.5" />
<span>{m.team_tasks()}</span>
</Button>
<Button
variant={scope === 'my' ? 'secondary' : 'ghost'}
size="sm"
onClick={() => onScopeChange('my')}
className={`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${
scope === 'my'
? 'bg-background text-foreground shadow-xs'
: 'text-muted-foreground hover:text-foreground'
}`}
>
<User className="w-3.5 h-3.5" />
<span>{m.my_tasks()}</span>
</Button>
</div>
{/* Selected Goal Filter Badge */}
{selectedGoal && (
<div className="hidden sm:flex items-center gap-1.5 px-2 py-1 rounded-md bg-sidebar-accent border border-sidebar-border text-xs text-sidebar-accent-foreground min-w-0 max-w-[200px] md:max-w-[280px]">
<Target className="w-3.5 h-3.5 text-sidebar-primary shrink-0" />
<span className="truncate font-medium">
{selectedGoal.id === UNASSIGNED_GOAL_ID ? m.unassigned() : selectedGoal.title}
</span>
<Button
variant="ghost"
size="icon-xs"
onClick={onClearGoal}
className="h-4 w-4 p-0 ml-0.5 text-muted-foreground hover:text-foreground"
title={m.clear_filter()}
>
<X className="w-3 h-3" />
</Button>
</div>
)}
</div>
{/* Right side: Create button */}
{canCreateTask && (
<div className="flex items-center gap-2 shrink-0">
{/* Create Task Button */}
<Button size="sm" onClick={onCreateTask} className="h-8 px-3 text-xs gap-1.5 shadow-xs">
<Plus className="w-3.5 h-3.5" />
<span>{m.create_task()}</span>
</Button>
</div>
)}
</header>
)
}
@@ -0,0 +1,137 @@
import { useState, useEffect } from 'react'
import { useQuery } from '@tanstack/react-query'
import { client } from '@/ui/api/client'
import { KanbanTaskStatus, type KanbanGoalInfo, type KanbanTaskInfo } from '@shumai/dtos'
import { KanbanHeader } from './kanban-header'
import { KanbanGoalSidebar } from './kanban-goal-sidebar'
import { KanbanBoard } from './kanban-board'
import { KanbanCreateTaskDialog } from './kanban-create-task-dialog'
import { EditTaskDialog } from './edit-task-dialog/edit-task-dialog'
import { Loader2 } from 'lucide-react'
interface KanbanPageProps {
teamId: string
initialTaskId?: string
}
export function KanbanPage({ teamId, initialTaskId }: KanbanPageProps) {
const [scope, setScope] = useState<'team' | 'my'>('team')
const [selectedGoalId, setSelectedGoalId] = useState<string | null>(null)
const [editingTaskId, setEditingTaskId] = useState<string | null>(initialTaskId ?? null)
const [isCreateTaskOpen, setIsCreateTaskOpen] = useState(false)
useEffect(() => {
if (initialTaskId) {
setEditingTaskId(initialTaskId)
}
}, [initialTaskId])
const [createTaskInitialStatus, setCreateTaskInitialStatus] = useState<KanbanTaskStatus>(
KanbanTaskStatus.TODO,
)
// Query Current User Role & Info in Team
const { data: me, isLoading: isLoadingMe } = useQuery({
queryKey: ['teams', teamId, 'me'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].me.$get({
param: { teamId },
})
if (!res.ok) throw new Error('Failed to fetch me')
return await res.json()
},
enabled: !!teamId,
})
// Query Goals for active goal object lookup
const { data: goalsData } = useQuery({
queryKey: ['teams', teamId, 'kanban', 'goals'],
queryFn: async () => {
const res = await client.api.teams[':teamId'].kanban.goals.$get({
param: { teamId },
query: {},
})
if (!res.ok) return { data: [] }
return (await res.json()) as { data: KanbanGoalInfo[] }
},
enabled: !!teamId,
})
const goals = goalsData?.data || []
const selectedGoal = selectedGoalId ? goals.find((g) => g.id === selectedGoalId) || null : null
const isOwnerOrEditor =
me?.role?.toLowerCase() === 'owner' || me?.role?.toLowerCase() === 'editor'
const handleOpenCreateTask = (status: KanbanTaskStatus = KanbanTaskStatus.TODO) => {
setCreateTaskInitialStatus(status)
setIsCreateTaskOpen(true)
}
const handleTaskClick = (task: KanbanTaskInfo) => {
setEditingTaskId(task.id)
}
if (isLoadingMe) {
return (
<div className="flex h-full items-center justify-center">
<Loader2 className="w-8 h-8 animate-spin text-muted-foreground" />
</div>
)
}
return (
<div className="flex flex-row h-full bg-background overflow-hidden font-sans">
{/* Left Sidebar: Goals (Full Height) */}
<KanbanGoalSidebar
teamId={teamId}
selectedGoalId={selectedGoalId}
onSelectGoal={setSelectedGoalId}
isOwnerOrEditor={isOwnerOrEditor}
/>
{/* Right Column: Top Header Bar + Kanban Board */}
<div className="flex-1 flex flex-col min-w-0 h-full overflow-hidden">
<KanbanHeader
scope={scope}
onScopeChange={setScope}
selectedGoal={selectedGoal}
onClearGoal={() => setSelectedGoalId(null)}
onCreateTask={() => handleOpenCreateTask(KanbanTaskStatus.TODO)}
canCreateTask={isOwnerOrEditor}
/>
<KanbanBoard
teamId={teamId}
selectedGoalId={selectedGoalId}
scope={scope}
currentUserId={me?.id}
currentUserRole={me?.role}
onTaskClick={handleTaskClick}
onCreateTaskInColumn={(status) => handleOpenCreateTask(status)}
/>
</div>
{/* Edit Task Dialog */}
{editingTaskId && (
<EditTaskDialog
teamId={teamId}
taskId={editingTaskId}
isOpen={!!editingTaskId}
onClose={() => setEditingTaskId(null)}
canEdit={isOwnerOrEditor}
/>
)}
{/* Create Task Dialog */}
{isCreateTaskOpen && (
<KanbanCreateTaskDialog
teamId={teamId}
isOpen={isCreateTaskOpen}
initialStatus={createTaskInitialStatus}
initialGoalId={selectedGoalId}
onClose={() => setIsCreateTaskOpen(false)}
/>
)}
</div>
)
}
@@ -0,0 +1,116 @@
import { KanbanTaskPriority, KanbanTaskStatus } from '@shumai/dtos'
import { m } from '@/ui/paraglide/messages.js'
export const KANBAN_STATUS_COLUMNS: KanbanTaskStatus[] = [
KanbanTaskStatus.TODO,
KanbanTaskStatus.READY,
KanbanTaskStatus.IN_PROGRESS,
KanbanTaskStatus.BLOCKED,
KanbanTaskStatus.IN_REVIEW,
KanbanTaskStatus.DONE,
]
export function getStatusLabel(status: KanbanTaskStatus): string {
switch (status) {
case KanbanTaskStatus.TODO:
return m.status_todo()
case KanbanTaskStatus.READY:
return m.status_ready()
case KanbanTaskStatus.IN_PROGRESS:
return m.status_in_progress()
case KanbanTaskStatus.BLOCKED:
return m.status_blocked()
case KanbanTaskStatus.IN_REVIEW:
return m.status_in_review()
case KanbanTaskStatus.DONE:
return m.status_done()
default:
return status
}
}
export function getStatusColor(status: KanbanTaskStatus): {
badge: string
border: string
dot: string
bg: string
} {
switch (status) {
case KanbanTaskStatus.TODO:
return {
badge: 'bg-muted text-muted-foreground border-border',
border: 'border-border',
dot: 'bg-muted-foreground',
bg: 'bg-muted/30',
}
case KanbanTaskStatus.READY:
return {
badge: 'bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20',
border: 'border-blue-500/30',
dot: 'bg-blue-500',
bg: 'bg-blue-500/5',
}
case KanbanTaskStatus.IN_PROGRESS:
return {
badge: 'bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20',
border: 'border-amber-500/30',
dot: 'bg-amber-500',
bg: 'bg-amber-500/5',
}
case KanbanTaskStatus.BLOCKED:
return {
badge: 'bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20',
border: 'border-red-500/30',
dot: 'bg-red-500',
bg: 'bg-red-500/5',
}
case KanbanTaskStatus.IN_REVIEW:
return {
badge: 'bg-purple-500/10 text-purple-600 dark:text-purple-400 border-purple-500/20',
border: 'border-purple-500/30',
dot: 'bg-purple-500',
bg: 'bg-purple-500/5',
}
case KanbanTaskStatus.DONE:
return {
badge: 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20',
border: 'border-emerald-500/30',
dot: 'bg-emerald-500',
bg: 'bg-emerald-500/5',
}
}
}
export function getStatusBadgeColor(status: KanbanTaskStatus): string {
return getStatusColor(status).badge
}
export function getPriorityLabel(priority: KanbanTaskPriority): string {
switch (priority) {
case KanbanTaskPriority.LOW:
return m.priority_low()
case KanbanTaskPriority.MEDIUM:
return m.priority_medium()
case KanbanTaskPriority.HIGH:
return m.priority_high()
case KanbanTaskPriority.URGENT:
return m.priority_urgent()
default:
return priority
}
}
export function getPriorityBadgeColor(priority: KanbanTaskPriority): string {
switch (priority) {
case KanbanTaskPriority.LOW:
return 'bg-muted text-muted-foreground border-border'
case KanbanTaskPriority.MEDIUM:
return 'bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20'
case KanbanTaskPriority.HIGH:
return 'bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20'
case KanbanTaskPriority.URGENT:
return 'bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20 font-semibold'
default:
return 'bg-muted text-muted-foreground border-border'
}
}
@@ -0,0 +1,933 @@
// @vitest-environment happy-dom
import React from 'react'
import { cleanup, render, screen, fireEvent, waitFor } from '@testing-library/react'
import { afterEach, describe, expect, it, vi } from 'vitest'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import {
KanbanTaskPriority,
KanbanTaskStatus,
KanbanTaskEventType,
type KanbanTaskInfo,
type KanbanGoalInfo,
type KanbanCommentInfo,
UNASSIGNED_GOAL_ID,
} from '@shumai/dtos'
import {
getStatusLabel,
getStatusColor,
getStatusBadgeColor,
getPriorityLabel,
getPriorityBadgeColor,
} from './kanban-types'
import { KanbanCard } from './kanban-card'
import { KanbanHeader } from './kanban-header'
import { KanbanColumn } from './kanban-column'
import { KanbanBoard } from './kanban-board'
import { KanbanGoalSidebar } from './kanban-goal-sidebar'
import { KanbanCreateGoalDialog } from './kanban-create-goal-dialog'
import { KanbanCreateTaskDialog } from './kanban-create-task-dialog'
import { TaskRelatedAssets } from './task-related-assets'
import { TaskCommentCard } from './edit-task-dialog/task-comment-card'
import { TaskCommentInput } from './edit-task-dialog/task-comment-input'
import { TaskEventTimeline } from './edit-task-dialog/task-event-timeline'
import type { KanbanTaskAssetInfo } from '@shumai/dtos'
import { client } from '@/ui/api/client'
const mockUseDraggable = vi.fn()
// Mock @dnd-kit/react
vi.mock('@dnd-kit/react', () => ({
useDraggable: (args: unknown) => {
mockUseDraggable(args)
return {
ref: vi.fn(),
isDragging: false,
}
},
useDroppable: () => ({
ref: vi.fn(),
isDropTarget: false,
}),
useDragOperation: () => ({
source: null,
target: null,
}),
DragDropProvider: ({ children }: { children?: React.ReactNode }) => children,
PointerSensor: {
configure: () => ({}),
},
KeyboardSensor: {},
}))
// Mock @dnd-kit/dom
vi.mock('@dnd-kit/dom', () => ({
PointerActivationConstraints: {
Distance: vi.fn(),
},
}))
// Mock API client
vi.mock('@/ui/api/client', () => ({
client: {
api: {
teams: {
':teamId': {
kanban: {
goals: {
$get: vi.fn(),
$post: vi.fn(),
':goalId': {
$patch: vi.fn(),
$delete: vi.fn(),
},
},
tasks: {
$get: vi.fn(),
$post: vi.fn(),
':taskId': {
$patch: vi.fn(),
$delete: vi.fn(),
},
},
},
members: {
$get: vi.fn().mockResolvedValue({ ok: true, json: async () => [] }),
},
agents: {
$get: vi.fn().mockResolvedValue({ ok: true, json: async () => [] }),
},
me: {
$get: vi.fn().mockResolvedValue({
ok: true,
json: async () => ({ id: 'u-1', name: 'User 1', role: 'owner' }),
}),
},
},
},
},
},
}))
function createWrapper() {
const queryClient = new QueryClient({
defaultOptions: {
queries: { retry: false },
},
})
return ({ children }: { children: React.ReactNode }) => (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
)
}
describe('Kanban UI Unit & Component Tests', () => {
afterEach(() => {
cleanup()
vi.clearAllMocks()
})
describe('Kanban Helpers & Type Utilities', () => {
it('maps status to correct labels and semantic badge colors', () => {
expect(getStatusLabel(KanbanTaskStatus.TODO)).toBeDefined()
expect(getStatusLabel(KanbanTaskStatus.READY)).toBeDefined()
expect(getStatusLabel(KanbanTaskStatus.IN_PROGRESS)).toBeDefined()
expect(getStatusLabel(KanbanTaskStatus.BLOCKED)).toBeDefined()
expect(getStatusLabel(KanbanTaskStatus.IN_REVIEW)).toBeDefined()
expect(getStatusLabel(KanbanTaskStatus.DONE)).toBeDefined()
expect(getStatusColor(KanbanTaskStatus.READY).badge).toBeDefined()
expect(getStatusBadgeColor(KanbanTaskStatus.BLOCKED)).toContain('red')
})
it('maps priority to labels and colors', () => {
expect(getPriorityLabel(KanbanTaskPriority.LOW)).toBeDefined()
expect(getPriorityLabel(KanbanTaskPriority.URGENT)).toBeDefined()
expect(getPriorityBadgeColor(KanbanTaskPriority.URGENT)).toContain('red')
})
})
describe('KanbanCard component', () => {
const mockManualTask: KanbanTaskInfo = {
id: 'task-1',
title: 'Manual Human Task',
description: 'Test description',
isAgentTask: false,
status: KanbanTaskStatus.TODO,
priority: KanbanTaskPriority.HIGH,
startDate: null,
dueDate: '2026-12-31T23:59:59.000Z',
startedAt: null,
completedAt: null,
teamId: 'team-1',
projectId: null,
creator: { id: 'user-1', name: 'Alice' },
reporter: null,
assignee: { id: 'user-2', name: 'Bob' },
goal: { id: 'goal-1', title: 'Q3 Goal' },
targetFolderId: null,
latestStatusEvent: null,
commentCount: 3,
dependencyCount: 1,
dependentCount: 0,
assetCount: 0,
createdAt: '2026-08-20T00:00:00.000Z',
updatedAt: '2026-08-20T00:00:00.000Z',
}
const mockAgenticTask: KanbanTaskInfo = {
...mockManualTask,
id: 'task-2',
title: 'Autonomous Agent Task',
isAgentTask: true,
status: KanbanTaskStatus.IN_PROGRESS,
}
it('renders human task card correctly without agent task label', () => {
const onClick = vi.fn()
render(<KanbanCard task={mockManualTask} onClick={onClick} />)
expect(screen.getByText('Manual Human Task')).toBeDefined()
expect(screen.getByText('Bob')).toBeDefined()
expect(screen.getByText('Q3 Goal')).toBeDefined()
expect(screen.getByText('3')).toBeDefined() // Comments count
expect(screen.getByText('1')).toBeDefined() // Dependency count
expect(screen.queryByText(/Agent Task|智能体任务/i)).toBeNull()
fireEvent.click(screen.getByText('Manual Human Task'))
expect(onClick).toHaveBeenCalledWith(mockManualTask)
})
it('renders agent task card with Agent Task label in orange style and standard card border', () => {
const onClick = vi.fn()
const { container } = render(<KanbanCard task={mockAgenticTask} onClick={onClick} />)
expect(screen.getByText('Autonomous Agent Task')).toBeDefined()
const agentBadge = screen.getByText(/^Agent Task$|^智能体任务$/i)
expect(agentBadge).toBeDefined()
expect(agentBadge.parentElement?.className).toContain('text-orange-600')
// Verify card container uses standard border, not purple border highlight
const card = container.querySelector('.border-border\\/80')
expect(card).toBeDefined()
})
it('renders three-dot delete action for task creator, reporter, or owner and triggers onDelete', () => {
const onDelete = vi.fn()
const { container, rerender } = render(
<KanbanCard
task={mockManualTask}
onClick={vi.fn()}
onDelete={onDelete}
currentUserId="user-1" // mockManualTask creator is user-1
currentUserRole="reviewer"
/>,
)
// Three-dot trigger should be rendered for creator
const triggerBtn = container.querySelector('button')
expect(triggerBtn).toBeDefined()
// Also rendered for reporter (reviewer)
rerender(
<KanbanCard
task={{
...mockManualTask,
creator: { id: 'other-1', name: 'Creator' },
reporter: { id: 'rep-user', name: 'Reporter' },
}}
onClick={vi.fn()}
onDelete={onDelete}
currentUserId="rep-user"
currentUserRole="reviewer"
/>,
)
expect(container.querySelector('button')).toBeDefined()
// When user is not creator, not reporter, and not owner, delete trigger is not rendered
rerender(
<KanbanCard
task={mockManualTask}
onClick={vi.fn()}
onDelete={onDelete}
currentUserId="other-user"
currentUserRole="reviewer"
/>,
)
expect(container.querySelector('button')).toBeNull()
})
it('enforces card drag permission: enabled for owner, editor, reporter, or assignee; disabled for unassigned reviewers', () => {
// 1. Enabled when user is owner
render(
<KanbanCard
task={{
...mockManualTask,
creator: { id: 'other', name: 'Other' },
reporter: null,
assignee: null,
}}
onClick={vi.fn()}
currentUserRole="owner"
currentUserId="random-user"
/>,
)
expect(mockUseDraggable).toHaveBeenLastCalledWith(
expect.objectContaining({ disabled: false }),
)
// 2. Enabled when user is editor (even if not reporter or assignee)
render(
<KanbanCard
task={{
...mockManualTask,
creator: { id: 'other-1', name: 'Other' },
reporter: { id: 'other-2', name: 'Reporter' },
assignee: { id: 'other-3', name: 'Assignee' },
}}
onClick={vi.fn()}
currentUserRole="editor"
currentUserId="stranger-user"
/>,
)
expect(mockUseDraggable).toHaveBeenLastCalledWith(
expect.objectContaining({ disabled: false }),
)
// 3. Enabled when user is reviewer but is assignee
render(
<KanbanCard
task={{
...mockManualTask,
creator: { id: 'other', name: 'Other' },
reporter: null,
assignee: { id: 'user-assignee', name: 'Assignee' },
}}
onClick={vi.fn()}
currentUserRole="reviewer"
currentUserId="user-assignee"
/>,
)
expect(mockUseDraggable).toHaveBeenLastCalledWith(
expect.objectContaining({ disabled: false }),
)
// 4. Disabled when user is reviewer and not reporter, not creator, not assignee
render(
<KanbanCard
task={{
...mockManualTask,
creator: { id: 'other-1', name: 'Other' },
reporter: { id: 'other-2', name: 'Reporter' },
assignee: { id: 'other-3', name: 'Assignee' },
}}
onClick={vi.fn()}
currentUserRole="reviewer"
currentUserId="stranger-user"
/>,
)
expect(mockUseDraggable).toHaveBeenLastCalledWith(expect.objectContaining({ disabled: true }))
})
it('renders asset count badge when task has linked assets', () => {
render(
<KanbanCard
task={{
...mockManualTask,
assetCount: 4,
}}
onClick={vi.fn()}
/>,
)
expect(screen.getByText('4')).toBeDefined()
})
it('renders blocked warning and reason when task is BLOCKED', () => {
const blockedTask: KanbanTaskInfo = {
...mockManualTask,
status: KanbanTaskStatus.BLOCKED,
latestStatusEvent: {
id: 'event-1',
type: KanbanTaskEventType.BLOCKED,
blockReason: 'Missing API Key credentials',
createdAt: '2026-08-20T00:00:00.000Z',
},
}
render(<KanbanCard task={blockedTask} onClick={vi.fn()} />)
expect(screen.getByText('Missing API Key credentials')).toBeDefined()
})
})
describe('KanbanHeader component', () => {
it('handles scope switching and goal clearing', () => {
const onScopeChange = vi.fn()
const onClearGoal = vi.fn()
const onCreateTask = vi.fn()
const selectedGoal: KanbanGoalInfo = {
id: 'goal-1',
title: 'Launch Goal',
teamId: 'team-1',
createdAt: '2026-08-20T00:00:00.000Z',
updatedAt: '2026-08-20T00:00:00.000Z',
}
render(
<KanbanHeader
scope="team"
onScopeChange={onScopeChange}
selectedGoal={selectedGoal}
onClearGoal={onClearGoal}
onCreateTask={onCreateTask}
/>,
)
expect(screen.getByText('Launch Goal')).toBeDefined()
// Click My Tasks
const myTasksButtons = screen.getAllByRole('button')
const myTaskBtn = myTasksButtons.find(
(btn) => btn.textContent?.includes('My Tasks') || btn.textContent?.includes('我的任务'),
)
if (myTaskBtn) {
fireEvent.click(myTaskBtn)
expect(onScopeChange).toHaveBeenCalledWith('my')
}
})
})
describe('KanbanCreateGoalDialog component', () => {
it('submits goal creation form', async () => {
const mockPost = vi.fn().mockResolvedValue({
ok: true,
json: async () => ({ id: 'new-goal', title: 'New Goal' }),
})
// Mocking hono RPC client method for unit testing
// eslint-disable-next-line @typescript-eslint/no-explicit-any
;(client.api.teams[':teamId'].kanban.goals.$post as any) = mockPost
const onClose = vi.fn()
render(<KanbanCreateGoalDialog teamId="team-1" isOpen={true} onClose={onClose} />, {
wrapper: createWrapper(),
})
const titleInput = screen.getByLabelText(/Goal Title|目标标题/i)
fireEvent.change(titleInput, { target: { value: 'Brand New Goal' } })
const submitBtn = screen.getByRole('button', { name: /Create|创建/i })
fireEvent.click(submitBtn)
await waitFor(() => {
expect(mockPost).toHaveBeenCalled()
expect(onClose).toHaveBeenCalled()
})
})
})
describe('TaskCommentCard and TaskCommentInput components', () => {
it('renders comment with markdown and image/file attachments', () => {
const mockComment: KanbanCommentInfo = {
id: 'c-1',
taskId: 't-1',
author: { id: 'u-1', name: 'Alice Author' },
body: 'Hello **bold** world',
attachments: [
{
id: 'att-1',
name: 'preview.png',
sizeByte: 10240,
url: 'https://example.com/preview.png',
proxyType: 'image',
},
{
id: 'att-2',
name: 'specs.pdf',
sizeByte: 20480,
url: 'https://example.com/specs.pdf',
proxyType: 'pdf',
},
],
createdAt: '2026-08-20T00:00:00.000Z',
updatedAt: '2026-08-20T00:00:00.000Z',
}
const onViewAttachment = vi.fn()
render(
<TaskCommentCard
teamId="team-1"
taskId="t-1"
comment={mockComment}
currentUserId="u-1"
isOwnerOrAdmin={true}
onViewAttachment={onViewAttachment}
/>,
{ wrapper: createWrapper() },
)
expect(screen.getByText('Alice Author')).toBeDefined()
expect(screen.getByText('bold')).toBeDefined()
expect(screen.getByText('specs.pdf')).toBeDefined()
// Click image attachment
const img = screen.getByAltText('preview.png')
fireEvent.click(img)
expect(onViewAttachment).toHaveBeenCalledWith(mockComment.attachments[0])
})
it('renders TaskCommentInput and triggers send on button click', async () => {
const onSendMessage = vi.fn()
render(<TaskCommentInput teamId="team-1" onSendMessage={onSendMessage} />, {
wrapper: createWrapper(),
})
const textarea = screen.getByPlaceholderText(/comment/i)
fireEvent.change(textarea, { target: { value: 'New task comment' } })
const sendBtn = screen.getByTitle(/Send comment|发送/i)
fireEvent.click(sendBtn)
await waitFor(() => {
expect(onSendMessage).toHaveBeenCalledWith('New task comment', undefined)
})
})
})
describe('KanbanBoard component with mixed cache entries', () => {
it('renders board and safely handles query cache with non-infinite task queries', async () => {
const queryClient = new QueryClient({
defaultOptions: { queries: { retry: false } },
})
// Seed non-infinite task queries (like comments, events, dependency tasks) that do not have .pages
queryClient.setQueryData(['teams', 'team-1', 'kanban', 'tasks', 't-1', 'comments'], {
data: [{ id: 'c-1', body: 'Comment' }],
})
queryClient.setQueryData(['teams', 'team-1', 'kanban', 'tasks', 't-1', 'events'], {
data: [{ id: 'e-1', type: 'CREATED' }],
})
queryClient.setQueryData(['teams', 'team-1', 'kanban', 'tasks', 'all'], {
data: [{ id: 't-1', title: 'Task 1' }],
})
// Mock tasks $get endpoint
const mockGet = vi.fn().mockResolvedValue({
ok: true,
json: async () => ({
data: [],
pageInfo: { total: 0, hasNextPage: false },
}),
})
// eslint-disable-next-line @typescript-eslint/no-explicit-any
;(client.api.teams[':teamId'].kanban.tasks.$get as any) = mockGet
const onTaskClick = vi.fn()
const onCreateTaskInColumn = vi.fn()
render(
<QueryClientProvider client={queryClient}>
<KanbanBoard
teamId="team-1"
selectedGoalId={null}
scope="team"
onTaskClick={onTaskClick}
onCreateTaskInColumn={onCreateTaskInColumn}
/>
</QueryClientProvider>,
)
expect(screen.getByText(/To Do|待办/i)).toBeDefined()
})
it('renders reorder drop zones for drag-and-drop ordering', () => {
const mockTask: KanbanTaskInfo = {
id: 'task-1',
title: 'Reorderable Task',
isAgentTask: false,
status: KanbanTaskStatus.TODO,
priority: KanbanTaskPriority.MEDIUM,
startDate: null,
dueDate: null,
startedAt: null,
completedAt: null,
teamId: 'team-1',
projectId: null,
sortIndex: 'a0',
creator: { id: 'user-1', name: 'Alice' },
reporter: null,
assignee: null,
goal: null,
targetFolderId: null,
latestStatusEvent: null,
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: '2026-08-20T00:00:00.000Z',
updatedAt: '2026-08-20T00:00:00.000Z',
}
const { container } = render(<KanbanCard task={mockTask} onClick={vi.fn()} />)
// Verify wrapper contains the task title and relative positioning for indicator lines
expect(screen.getByText('Reorderable Task')).toBeDefined()
expect(container.querySelector('.relative')).toBeDefined()
})
it('renders board with proper permissions and handles task update mutation', async () => {
const mockPatch = vi.fn().mockResolvedValue({
ok: true,
json: async () => ({ id: 'task-1', status: KanbanTaskStatus.IN_PROGRESS }),
})
// eslint-disable-next-line @typescript-eslint/no-explicit-any
;(client.api.teams[':teamId'].kanban.tasks[':taskId'].$patch as any) = mockPatch
const queryClient = new QueryClient({
defaultOptions: { queries: { retry: false } },
})
const mockGet = vi.fn().mockResolvedValue({
ok: true,
json: async () => ({
data: [],
pageInfo: { total: 0, hasNextPage: false },
}),
})
// eslint-disable-next-line @typescript-eslint/no-explicit-any
;(client.api.teams[':teamId'].kanban.tasks.$get as any) = mockGet
render(
<QueryClientProvider client={queryClient}>
<KanbanBoard
teamId="team-1"
selectedGoalId={null}
scope="team"
currentUserId="user-1"
currentUserRole="owner"
onTaskClick={vi.fn()}
onCreateTaskInColumn={vi.fn()}
/>
</QueryClientProvider>,
)
expect(screen.getByText(/To Do|待办/i)).toBeDefined()
})
})
describe('TaskRelatedAssets component', () => {
const mockAssets: KanbanTaskAssetInfo[] = [
{
id: 'asset-1',
name: 'Design_Spec.pdf',
type: 'file',
proxyType: 'pdf',
thumbnailUrl: null,
path: '/Project/Design_Spec.pdf',
creator: { id: 'user-1', name: 'Alice' },
sizeByte: 1024,
fileCount: undefined,
projectId: 'proj-1',
createdAt: '2026-08-20T00:00:00.000Z',
},
{
id: 'asset-2',
name: 'Assets Folder',
type: 'folder',
proxyType: null,
thumbnailUrl: null,
path: '/Project/Assets Folder',
creator: { id: 'user-2', name: 'Bob' },
sizeByte: 0,
fileCount: 5,
projectId: 'proj-1',
createdAt: '2026-08-20T00:00:00.000Z',
},
]
it('renders empty state when no assets are linked', () => {
render(
<TaskRelatedAssets
teamId="team-1"
assets={[]}
onAddAssets={vi.fn()}
onRemoveAsset={vi.fn()}
/>,
)
expect(screen.getByText(/No related assets|暂无关联资产/i)).toBeDefined()
})
it('renders asset rows with name, path, and creator and triggers remove', () => {
const onRemove = vi.fn()
render(
<TaskRelatedAssets
teamId="team-1"
assets={mockAssets}
onAddAssets={vi.fn()}
onRemoveAsset={onRemove}
/>,
)
expect(screen.getByText('Design_Spec.pdf')).toBeDefined()
expect(screen.getByText('/Project/Design_Spec.pdf')).toBeDefined()
expect(screen.getByText('Alice')).toBeDefined()
expect(screen.getByText('Assets Folder')).toBeDefined()
expect(screen.getByText('/Project/Assets Folder')).toBeDefined()
// Click remove button on first asset
const removeButtons = screen.getAllByTitle(/Unlink Asset|取消关联资产/i)
expect(removeButtons.length).toBe(2)
fireEvent.click(removeButtons[0])
expect(onRemove).toHaveBeenCalledWith('asset-1')
})
})
describe('KanbanGoalSidebar component', () => {
it('renders goals list with unassigned goal and calculates All Tasks sum correctly', async () => {
const mockGoals: KanbanGoalInfo[] = [
{
id: UNASSIGNED_GOAL_ID,
title: 'Unassigned',
teamId: 'team-1',
creatorId: null,
taskCount: 3,
createdAt: new Date(0).toISOString(),
updatedAt: new Date(0).toISOString(),
},
{
id: 'goal-1',
title: 'Sprint 1',
teamId: 'team-1',
creatorId: 'user-1',
taskCount: 5,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
},
]
// eslint-disable-next-line @typescript-eslint/no-explicit-any
;(client.api.teams[':teamId'].kanban.goals.$get as any) = vi.fn().mockResolvedValue({
ok: true,
json: async () => ({ data: mockGoals }),
})
const onSelectGoal = vi.fn()
render(
<KanbanGoalSidebar
teamId="team-1"
selectedGoalId={null}
onSelectGoal={onSelectGoal}
isOwnerOrEditor={true}
/>,
{ wrapper: createWrapper() },
)
// Total count in All Tasks should be 3 + 5 = 8
await waitFor(() => {
expect(screen.getByText('8')).toBeDefined()
expect(screen.getByText(/All Tasks|所有任务/i)).toBeDefined()
expect(screen.getByText(/Unassigned|未指派/i)).toBeDefined()
expect(screen.getByText('Sprint 1')).toBeDefined()
})
// Clicking Unassigned triggers onSelectGoal with UNASSIGNED_GOAL_ID
const unassignedElement = screen.getByText(/Unassigned|未指派/i)
fireEvent.click(unassignedElement)
expect(onSelectGoal).toHaveBeenCalledWith(UNASSIGNED_GOAL_ID)
})
})
describe('KanbanCreateTaskDialog goal handling', () => {
it('defaults goalId to none when opened with unassigned goal and excludes unassigned from options', async () => {
const mockGoals: KanbanGoalInfo[] = [
{
id: UNASSIGNED_GOAL_ID,
title: 'Unassigned',
teamId: 'team-1',
creatorId: null,
taskCount: 2,
createdAt: new Date(0).toISOString(),
updatedAt: new Date(0).toISOString(),
},
{
id: 'goal-1',
title: 'Alpha Goal',
teamId: 'team-1',
creatorId: 'user-1',
taskCount: 1,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
},
]
// eslint-disable-next-line @typescript-eslint/no-explicit-any
;(client.api.teams[':teamId'].kanban.goals.$get as any) = vi.fn().mockResolvedValue({
ok: true,
json: async () => ({ data: mockGoals }),
})
// eslint-disable-next-line @typescript-eslint/no-explicit-any
;(client.api.teams[':teamId'].members.$get as any) = vi.fn().mockResolvedValue({
ok: true,
json: async () => [],
})
// eslint-disable-next-line @typescript-eslint/no-explicit-any
;(client.api.teams[':teamId'].agents.$get as any) = vi.fn().mockResolvedValue({
ok: true,
json: async () => [],
})
render(
<KanbanCreateTaskDialog
teamId="team-1"
isOpen={true}
onClose={vi.fn()}
initialGoalId={UNASSIGNED_GOAL_ID}
/>,
{ wrapper: createWrapper() },
)
await waitFor(() => {
expect(screen.getByText(/Create Task|创建任务/i)).toBeDefined()
})
})
})
describe('Task creation button visibility based on permissions', () => {
it('KanbanHeader: hides Create Task button when canCreateTask is false', () => {
const { rerender } = render(
<KanbanHeader
scope="team"
onScopeChange={vi.fn()}
selectedGoal={null}
onClearGoal={vi.fn()}
onCreateTask={vi.fn()}
canCreateTask={true}
/>,
)
expect(screen.queryByText(/Create Task|创建任务/i)).not.toBeNull()
rerender(
<KanbanHeader
scope="team"
onScopeChange={vi.fn()}
selectedGoal={null}
onClearGoal={vi.fn()}
onCreateTask={vi.fn()}
canCreateTask={false}
/>,
)
expect(screen.queryByText(/Create Task|创建任务/i)).toBeNull()
})
it('KanbanColumn: only renders + Create Task button in footer for owner and editor', () => {
const mockGet = vi.fn().mockResolvedValue({
ok: true,
json: async () => ({
data: [],
pageInfo: { total: 0, hasNextPage: false },
}),
})
// eslint-disable-next-line @typescript-eslint/no-explicit-any
;(client.api.teams[':teamId'].kanban.tasks.$get as any) = mockGet
const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } })
const { rerender } = render(
<QueryClientProvider client={queryClient}>
<KanbanColumn
teamId="team-1"
status={KanbanTaskStatus.TODO}
selectedGoalId={null}
scope="team"
currentUserRole="editor"
onTaskClick={vi.fn()}
onCreateTaskInColumn={vi.fn()}
/>
</QueryClientProvider>,
)
expect(screen.queryByText(/Create Task|创建任务/i)).not.toBeNull()
rerender(
<QueryClientProvider client={queryClient}>
<KanbanColumn
teamId="team-1"
status={KanbanTaskStatus.TODO}
selectedGoalId={null}
scope="team"
currentUserRole="reviewer"
onTaskClick={vi.fn()}
onCreateTaskInColumn={vi.fn()}
/>
</QueryClientProvider>,
)
expect(screen.queryByText(/Create Task|创建任务/i)).toBeNull()
})
})
describe('Kanban UI Alignment & DnD Improvements', () => {
it('TaskEventTimeline: renders timeline line and circles with aligned center positioning', () => {
const mockEvents = [
{
id: 'ev-1',
taskId: 't-1',
type: KanbanTaskEventType.CREATED,
actor: { id: 'u-1', name: 'Alice' },
fromStatus: null,
toStatus: KanbanTaskStatus.TODO,
data: null,
createdAt: '2026-08-20T00:00:00.000Z',
},
]
const { container } = render(
<TaskEventTimeline teamId="team-1" taskId="t-1" initialEvents={mockEvents} />,
{ wrapper: createWrapper() },
)
// Container has pl-5 and before:left-[4px] before:w-[2px]
const timelineContainer = container.querySelector('.pl-5')
expect(timelineContainer).toBeDefined()
expect(timelineContainer?.className).toContain('before:left-[4px]')
expect(timelineContainer?.className).toContain('before:w-[2px]')
// Circle node has -left-5 top-[3px] w-2.5 h-2.5
const circleNode = container.querySelector('.-left-5')
expect(circleNode).toBeDefined()
expect(circleNode?.className).toContain('top-[3px]')
expect(circleNode?.className).toContain('w-2.5')
})
it('KanbanCard: expands bottom drop zone when isLast is true', () => {
const mockTask: KanbanTaskInfo = {
id: 'task-last',
title: 'Last Task',
isAgentTask: false,
status: KanbanTaskStatus.TODO,
priority: KanbanTaskPriority.MEDIUM,
startDate: null,
dueDate: null,
startedAt: null,
completedAt: null,
teamId: 'team-1',
projectId: null,
creator: { id: 'u-1', name: 'Alice' },
reporter: null,
assignee: null,
goal: null,
targetFolderId: null,
latestStatusEvent: null,
commentCount: 0,
dependencyCount: 0,
dependentCount: 0,
assetCount: 0,
createdAt: '2026-08-20T00:00:00.000Z',
updatedAt: '2026-08-20T00:00:00.000Z',
}
const { container, rerender } = render(
<KanbanCard task={mockTask} onClick={vi.fn()} isLast={false} />,
)
// When isLast is false, uses standard h-1/2 without -bottom-6
expect(container.querySelector('.-bottom-6')).toBeNull()
// When isLast is true, expands drop area with -bottom-6
rerender(<KanbanCard task={mockTask} onClick={vi.fn()} isLast={true} />)
expect(container.querySelector('.-bottom-6')).toBeDefined()
})
})
})
@@ -0,0 +1,279 @@
import { useState, useMemo } from 'react'
import { useQuery } from '@tanstack/react-query'
import { client } from '@/ui/api/client'
import { m } from '@/ui/paraglide/messages.js'
import { Popover, PopoverContent, PopoverTrigger } from '@/ui/components/ui/popover'
import { Input } from '@/ui/components/ui/input'
import { ScrollArea } from '@/ui/components/ui/scroll-area'
import { KanbanTaskStatus, type KanbanTaskInfo, type KanbanTaskSummary } from '@shumai/dtos'
import { getStatusBadgeColor, getStatusLabel } from './kanban-types'
import { Link2, Search, X, Check, Loader2 } from 'lucide-react'
import { cn } from '@/ui/lib/utils'
interface TaskParentSelectorProps {
teamId: string
currentTaskId?: string
excludeTaskIds?: string[]
value?: string[]
knownTasks?: Array<KanbanTaskSummary | KanbanTaskInfo>
onChange?: (parentIds: string[]) => void
disabled?: boolean
canEdit?: boolean
className?: string
}
const SELECTABLE_STATUSES: KanbanTaskStatus[] = [
KanbanTaskStatus.TODO,
KanbanTaskStatus.READY,
KanbanTaskStatus.IN_PROGRESS,
KanbanTaskStatus.IN_REVIEW,
KanbanTaskStatus.DONE,
KanbanTaskStatus.BLOCKED,
]
export function TaskParentSelector({
teamId,
currentTaskId,
excludeTaskIds = [],
value = [],
knownTasks = [],
onChange,
disabled = false,
canEdit = true,
className,
}: TaskParentSelectorProps) {
const [isOpen, setIsOpen] = useState(false)
const [selectedStatus, setSelectedStatus] = useState<KanbanTaskStatus>(KanbanTaskStatus.TODO)
const [searchQuery, setSearchQuery] = useState('')
// Map of known tasks for label rendering of selected items
const [taskMetadataCache, setTaskMetadataCache] = useState<
Record<string, { title: string; status: KanbanTaskStatus }>
>(() => {
const initial: Record<string, { title: string; status: KanbanTaskStatus }> = {}
for (const t of knownTasks) {
initial[t.id] = { title: t.title, status: t.status }
}
return initial
})
// Query 100 tasks of the currently selected status
const { data: statusTasksData, isLoading } = useQuery({
queryKey: ['teams', teamId, 'kanban', 'tasks', 'status', selectedStatus],
queryFn: async () => {
const res = await client.api.teams[':teamId'].kanban.tasks.$get({
param: { teamId },
query: { status: selectedStatus, first: '100' },
})
if (!res.ok) return { data: [] }
return (await res.json()) as { data: KanbanTaskInfo[] }
},
enabled: !!teamId && isOpen,
})
// Update metadata cache when tasks arrive
const fetchedTasks = statusTasksData?.data || []
useMemo(() => {
if (fetchedTasks.length > 0) {
setTaskMetadataCache((prev) => {
let changed = false
const next = { ...prev }
for (const t of fetchedTasks) {
if (!next[t.id] || next[t.id].title !== t.title || next[t.id].status !== t.status) {
next[t.id] = { title: t.title, status: t.status }
changed = true
}
}
return changed ? next : prev
})
}
}, [fetchedTasks])
const excludeSet = useMemo(() => {
const set = new Set(excludeTaskIds)
if (currentTaskId) set.add(currentTaskId)
return set
}, [currentTaskId, excludeTaskIds])
// Filter tasks in current status tab by search query and exclusions
const filteredTasks = useMemo(() => {
const query = searchQuery.trim().toLowerCase()
return fetchedTasks.filter((t) => {
if (excludeSet.has(t.id)) return false
if (!query) return true
return t.title.toLowerCase().includes(query)
})
}, [fetchedTasks, excludeSet, searchQuery])
const handleToggle = (taskId: string) => {
if (!canEdit || disabled) return
const isSelected = value.includes(taskId)
const nextValue = isSelected ? value.filter((id) => id !== taskId) : [...value, taskId]
onChange?.(nextValue)
}
const handleRemove = (taskId: string, e: React.MouseEvent) => {
e.stopPropagation()
if (!canEdit || disabled) return
onChange?.(value.filter((id) => id !== taskId))
}
const isInteractive = canEdit && !disabled
return (
<Popover
open={isOpen && isInteractive}
onOpenChange={(open) => isInteractive && setIsOpen(open)}
>
<PopoverTrigger asChild>
<div
role="button"
tabIndex={isInteractive ? 0 : -1}
className={cn(
'w-full min-h-[36px] px-2.5 py-1.5 flex flex-wrap items-center gap-1.5 rounded-md border border-input bg-background text-xs transition-colors',
isInteractive
? 'cursor-pointer hover:border-ring/60 focus:outline-none focus:ring-2 focus:ring-ring/50'
: 'cursor-not-allowed opacity-70',
className,
)}
>
{value.length === 0 ? (
<div className="flex items-center gap-1.5 text-muted-foreground">
<Link2 className="w-3.5 h-3.5 text-muted-foreground/70" />
<span>{m.select_parent_tasks()}</span>
</div>
) : (
value.map((id) => {
const meta = taskMetadataCache[id]
return (
<span
key={id}
className="inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-[11px] bg-muted text-foreground border border-border/80 shrink-0 max-w-[220px]"
>
{meta?.status && (
<span
className={cn(
'px-1 py-0.2 rounded text-[9px] uppercase font-semibold shrink-0',
getStatusBadgeColor(meta.status),
)}
>
{getStatusLabel(meta.status)}
</span>
)}
<span className="truncate font-medium">{meta?.title || id}</span>
{isInteractive && (
<button
type="button"
onClick={(e) => handleRemove(id, e)}
className="text-muted-foreground hover:text-destructive shrink-0 p-0.5 -mr-1"
>
<X className="w-3 h-3" />
</button>
)}
</span>
)
})
)}
</div>
</PopoverTrigger>
<PopoverContent
align="start"
sideOffset={4}
className="w-[var(--radix-popover-trigger-width)] min-w-[320px] sm:min-w-[420px] max-w-[500px] p-2.5 space-y-2 bg-popover border border-border rounded-lg shadow-lg"
>
{/* Part 1: Status Toggle Group */}
<div className="flex flex-wrap gap-1.5 pb-0.5">
{SELECTABLE_STATUSES.map((st) => {
const isSelected = selectedStatus === st
return (
<button
key={st}
type="button"
onClick={() => setSelectedStatus(st)}
className={cn(
'text-[11px] h-7 px-2.5 rounded-md font-medium transition-colors border shrink-0',
isSelected
? 'bg-primary text-primary-foreground border-primary shadow-xs'
: 'bg-muted/50 hover:bg-accent text-muted-foreground hover:text-foreground border-border/60',
)}
>
{getStatusLabel(st)}
</button>
)
})}
</div>
{/* Part 2: Search Input */}
<div className="relative">
<Search className="w-3.5 h-3.5 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none" />
<Input
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
placeholder={m.filter_tasks_placeholder()}
className="h-8 pl-8 text-xs bg-muted/40"
autoFocus
/>
</div>
{/* Part 2: Selection List */}
<div className="border rounded-md overflow-hidden bg-background/50">
<ScrollArea className="h-48 p-1">
{isLoading ? (
<div className="flex items-center justify-center py-8">
<Loader2 className="w-4 h-4 animate-spin text-muted-foreground" />
</div>
) : filteredTasks.length === 0 ? (
<div className="py-8 text-center text-xs text-muted-foreground italic">
{m.no_matching_tasks()}
</div>
) : (
<div className="space-y-1">
{filteredTasks.map((t) => {
const isSelected = value.includes(t.id)
return (
<div
key={t.id}
onClick={() => handleToggle(t.id)}
className={cn(
'flex items-center justify-between p-2 rounded-md hover:bg-accent cursor-pointer transition-colors text-xs border border-transparent',
isSelected && 'bg-accent/50 border-border/50',
)}
>
<div className="flex items-center gap-2 min-w-0 flex-1 pr-2">
<div
className={cn(
'w-4 h-4 rounded border flex items-center justify-center shrink-0 transition-colors',
isSelected
? 'bg-primary border-primary text-primary-foreground'
: 'border-input bg-background',
)}
>
{isSelected && <Check className="w-3 h-3 stroke-[3]" />}
</div>
<span
className={cn(
'px-1.5 py-0.5 rounded text-[10px] uppercase font-medium shrink-0',
getStatusBadgeColor(t.status),
)}
>
{getStatusLabel(t.status)}
</span>
<span className="font-medium text-foreground truncate">{t.title}</span>
</div>
{t.assignee && (
<span className="text-[10px] text-muted-foreground truncate shrink-0">
{t.assignee.name}
</span>
)}
</div>
)
})}
</div>
)}
</ScrollArea>
</div>
</PopoverContent>
</Popover>
)
}
@@ -0,0 +1,157 @@
import { useState } from 'react'
import { Button } from '@/ui/components/ui/button'
import { Separator } from '@/ui/components/ui/separator'
import { Avatar, AvatarFallback, AvatarImage } from '@/ui/components/ui/avatar'
import { m } from '@/ui/paraglide/messages.js'
import type { KanbanTaskAssetInfo } from '@shumai/dtos'
import { AssetPickerDialog } from './asset-picker-dialog'
import { Plus, X, Folder, File, Files } from 'lucide-react'
interface TaskRelatedAssetsProps {
teamId: string
projectId?: string | null
assets: KanbanTaskAssetInfo[]
onAddAssets: (newAssets: KanbanTaskAssetInfo[]) => void
onRemoveAsset: (assetId: string) => void
disabled?: boolean
}
export function TaskRelatedAssets({
teamId,
projectId,
assets,
onAddAssets,
onRemoveAsset,
disabled = false,
}: TaskRelatedAssetsProps) {
const [isPickerOpen, setIsPickerOpen] = useState(false)
const handleConfirmPicker = (selectedAssets: KanbanTaskAssetInfo[]) => {
// Filter out already linked assets
const existingIds = new Set(assets.map((a) => a.id))
const toAdd = selectedAssets.filter((a) => !existingIds.has(a.id))
if (toAdd.length > 0) {
onAddAssets(toAdd)
}
}
return (
<div className="space-y-2">
{/* Title + Plus Button */}
<div className="flex items-center justify-between">
<div className="flex items-center gap-1.5 text-xs font-semibold text-foreground">
<Files className="w-3.5 h-3.5 text-muted-foreground" />
<span>{m.related_assets()}</span>
{assets.length > 0 && (
<span className="text-[11px] text-muted-foreground font-normal">({assets.length})</span>
)}
</div>
{!disabled && (
<Button
type="button"
variant="ghost"
size="sm"
className="h-6 w-6 p-0 hover:bg-muted"
onClick={() => setIsPickerOpen(true)}
title={m.add_assets()}
>
<Plus className="w-3.5 h-3.5" />
</Button>
)}
</div>
<Separator />
{/* Assets List Rows */}
{assets.length === 0 ? (
<p className="text-xs text-muted-foreground/70 py-1 italic">{m.no_related_assets()}</p>
) : (
<div className="space-y-1.5 max-h-48 overflow-y-auto pr-1">
{assets.map((asset) => {
const isFolder = asset.type === 'folder'
return (
<div
key={asset.id}
className="flex items-center justify-between gap-2 p-1.5 px-2 rounded-md bg-muted/40 hover:bg-muted/70 transition-colors text-xs border border-border/40"
>
{/* Left: Thumbnail & Names */}
<div className="flex items-center gap-2.5 min-w-0 flex-1">
{/* Thumbnail / Icon */}
<div className="w-7 h-7 rounded bg-muted border shrink-0 flex items-center justify-center overflow-hidden">
{asset.thumbnailUrl ? (
<img
src={asset.thumbnailUrl}
alt={asset.name}
className="w-full h-full object-cover"
/>
) : isFolder ? (
<Folder className="w-4 h-4 text-primary fill-primary/20" />
) : (
<File className="w-4 h-4 text-muted-foreground" />
)}
</div>
{/* Name & Path */}
<div className="flex-1 min-w-0">
<p className="font-medium truncate text-foreground leading-snug">
{asset.name}
</p>
<p className="text-[10px] text-muted-foreground truncate leading-none mt-0.5">
{asset.path || '/'}
</p>
</div>
</div>
{/* Right: Creator & Remove Button */}
<div className="flex items-center gap-2 shrink-0">
{asset.creator && (
<div
className="flex items-center gap-1 text-[11px] text-muted-foreground"
title={asset.creator.name}
>
<Avatar className="w-4 h-4 text-[9px]">
<AvatarImage src={asset.creator.image || undefined} />
<AvatarFallback>
{asset.creator.name.slice(0, 1).toUpperCase()}
</AvatarFallback>
</Avatar>
<span className="hidden sm:inline text-[11px] max-w-[80px] truncate">
{asset.creator.name}
</span>
</div>
)}
{!disabled && (
<Button
type="button"
variant="ghost"
size="sm"
className="h-5 w-5 p-0 text-muted-foreground hover:text-destructive hover:bg-destructive/10"
onClick={() => onRemoveAsset(asset.id)}
title={m.unlink_asset()}
>
<X className="w-3 h-3" />
</Button>
)}
</div>
</div>
)
})}
</div>
)}
{/* Asset Picker Dialog */}
{isPickerOpen && (
<AssetPickerDialog
teamId={teamId}
initialProjectId={projectId}
excludeAssetIds={assets.map((a) => a.id)}
isOpen={isPickerOpen}
onClose={() => setIsPickerOpen(false)}
onConfirm={handleConfirmPicker}
/>
)}
</div>
)
}
@@ -4,6 +4,7 @@ import { cn } from '@/ui/lib/utils'
import { SpriteScrubber } from './sprite-scrubber'
import { m } from '@/ui/paraglide/messages.js'
import React from 'react'
import { useNavigate } from '@tanstack/react-router'
interface NotificationCardProps {
notification: NotificationInfo
@@ -33,11 +34,13 @@ const renderNotification = (
}
export const NotificationCard = ({ notification }: NotificationCardProps) => {
const { creator, createdAt, isRead, type, asset, project, team, user } = notification
const navigate = useNavigate()
const { creator, createdAt, isRead, type, asset, project, team, user, kanbanTask } = notification
const message = (() => {
const creatorName = creator?.name || m.unknown_user()
const assetName = asset?.name || m.unknown_asset()
const taskTitle = kanbanTask?.title || m.unknown_task()
const projectName = project?.name || m.unknown_project()
const teamName = team?.name || m.unknown_team()
const targetUserName = user?.name || m.unknown_user()
@@ -45,6 +48,7 @@ export const NotificationCard = ({ notification }: NotificationCardProps) => {
const placeholders = {
creator: <span className="font-semibold">{creatorName}</span>,
asset: <span className="font-semibold">{assetName}</span>,
task: <span className="font-semibold">{taskTitle}</span>,
project: <span className="font-semibold">{projectName}</span>,
team: <span className="font-semibold">{teamName}</span>,
user: <span className="font-semibold">{targetUserName}</span>,
@@ -63,7 +67,9 @@ export const NotificationCard = ({ notification }: NotificationCardProps) => {
)
case 'mention':
return renderNotification(
m.notification_mentioned_you({ creator: '{creator}', asset: '{asset}' }),
kanbanTask
? m.notification_mentioned_you_in_task({ creator: '{creator}', task: '{task}' })
: m.notification_mentioned_you({ creator: '{creator}', asset: '{asset}' }),
placeholders,
)
case 'successful_file_uploaded':
@@ -86,6 +92,36 @@ export const NotificationCard = ({ notification }: NotificationCardProps) => {
m.notification_joined_project({ user: '{user}', project: '{project}' }),
placeholders,
)
case 'kanban_task_created':
return renderNotification(
m.notification_kanban_task_created({ creator: '{creator}', task: '{task}' }),
placeholders,
)
case 'kanban_task_assigned':
return renderNotification(
m.notification_kanban_task_assigned({ creator: '{creator}', task: '{task}' }),
placeholders,
)
case 'kanban_task_status_updated':
return renderNotification(
m.notification_kanban_task_status_updated({ creator: '{creator}', task: '{task}' }),
placeholders,
)
case 'kanban_task_updated':
return renderNotification(
m.notification_kanban_task_updated({ creator: '{creator}', task: '{task}' }),
placeholders,
)
case 'kanban_task_deleted':
return renderNotification(
m.notification_kanban_task_deleted({ creator: '{creator}', task: '{task}' }),
placeholders,
)
case 'kanban_task_comment_created':
return renderNotification(
m.notification_kanban_task_comment_created({ creator: '{creator}', task: '{task}' }),
placeholders,
)
default:
return renderNotification(m.notification_generic({ creator: '{creator}' }), placeholders)
}
@@ -100,8 +136,21 @@ export const NotificationCard = ({ notification }: NotificationCardProps) => {
const hasPreview = asset?.preview && (asset.proxyType === 'image' || asset.proxyType === 'video')
const handleClick = () => {
if (kanbanTask?.id && team?.id) {
navigate({
to: '/teams/$teamId/kanban',
params: { teamId: team.id },
search: { taskId: kanbanTask.id },
})
}
}
return (
<div className="flex py-2 cursor-pointer group border border-transparent items-center justify-center">
<div
onClick={handleClick}
className="flex py-2 cursor-pointer group border border-transparent items-center justify-center hover:bg-muted/50 rounded-md px-1 transition-colors"
>
{/* Unread Indicator */}
<div
className={cn(
@@ -11,6 +11,7 @@ import {
UploadCloud,
Activity,
Bell,
LayoutDashboard,
} from 'lucide-react'
import { toast } from 'sonner'
import type { NotificationSettings as Settings } from '@shumai/dtos'
@@ -224,6 +225,62 @@ export function NotificationSettings({ teamId }: { teamId: string }) {
</div>
</CardContent>
</Card>
{/* Kanban Settings */}
<Card className="border border-slate-200 dark:border-slate-800">
<CardHeader className="border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50">
<div className="flex items-center gap-2">
<LayoutDashboard className="w-5 h-5 text-indigo-500" />
<CardTitle className="text-lg">{m.kanban_notifications()}</CardTitle>
</div>
<CardDescription>{m.kanban_notification_description()}</CardDescription>
</CardHeader>
<CardContent className="divide-y divide-slate-100 dark:divide-slate-800 p-0">
{/* Kanban Tasks */}
<div className="flex items-center justify-between p-6">
<div className="flex gap-4">
<div className="mt-1 flex items-center justify-center w-8 h-8 rounded-lg bg-indigo-50 dark:bg-indigo-900/20 text-indigo-600 dark:text-indigo-400">
<LayoutDashboard className="w-4 h-4" />
</div>
<div className="space-y-0.5">
<h4 className="text-sm font-semibold text-slate-900 dark:text-white">
{m.kanban_tasks()}
</h4>
<p className="text-sm text-slate-500 dark:text-slate-400">
{m.when_kanban_task_events()}
</p>
</div>
</div>
<Switch
checked={settings?.kanbanTasks ?? true}
onCheckedChange={() => handleToggle('kanbanTasks')}
disabled={isUpdating}
/>
</div>
{/* Kanban Comments */}
<div className="flex items-center justify-between p-6">
<div className="flex gap-4">
<div className="mt-1 flex items-center justify-center w-8 h-8 rounded-lg bg-cyan-50 dark:bg-cyan-900/20 text-cyan-600 dark:text-cyan-400">
<MessageSquare className="w-4 h-4" />
</div>
<div className="space-y-0.5">
<h4 className="text-sm font-semibold text-slate-900 dark:text-white">
{m.kanban_comments()}
</h4>
<p className="text-sm text-slate-500 dark:text-slate-400">
{m.when_kanban_task_commented()}
</p>
</div>
</div>
<Switch
checked={settings?.kanbanComments ?? true}
onCheckedChange={() => handleToggle('kanbanComments')}
disabled={isUpdating}
/>
</div>
</CardContent>
</Card>
</div>
</ScrollArea>
)

Some files were not shown because too many files have changed in this diff Show More