mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-03 06:24:30 +00:00
feat(project): add recent viewed files section to project folder tree (#348)
* feat(project): add recent viewed files section to project folder tree * feat(webui): disable toolbar buttons and context menu in recents page * test(core): optimize recents cap test execution time * feat(webui): show hint text in recents page top toolbar * feat(webui): rename recents section to Recently Viewed * refactor(core): consolidate recents methods into AssetService * fix(api): forward pagination parameters in folder children endpoint (#349) * fix(project-recents): scope views and disable recents mutations * fix(api): allow recent views in demo mode * fix(api): limit demo recent view exception to post
This commit is contained in:
@@ -236,8 +236,9 @@ model User {
|
||||
kanbanTasksReported KanbanTask[] @relation("KanbanTaskReporter")
|
||||
kanbanTasksAssigned KanbanTask[] @relation("KanbanTaskAssignee")
|
||||
kanbanGoalsCreated KanbanGoal[] @relation("UserToKanbanGoal")
|
||||
kanbanTaskComments KanbanTaskComment[]
|
||||
kanbanTaskEvents KanbanTaskEvent[]
|
||||
kanbanTaskComments KanbanTaskComment[]
|
||||
kanbanTaskEvents KanbanTaskEvent[]
|
||||
recentFiles RecentFileItem[]
|
||||
|
||||
@@map("users")
|
||||
}
|
||||
@@ -414,6 +415,7 @@ model Project {
|
||||
collections Collection[] @relation("ProjectToCollection")
|
||||
auditLogs AuditLog[] @relation("ProjectToAuditLog")
|
||||
kanbanTasks KanbanTask[] @relation("ProjectToKanbanTask")
|
||||
recentFiles RecentFileItem[]
|
||||
|
||||
@@map("projects")
|
||||
@@index([createdAt])
|
||||
@@ -564,6 +566,7 @@ model Asset {
|
||||
agentMd AssetAgentMd? @relation("AssetToAgentMd")
|
||||
kanbanTargetTasks KanbanTask[] @relation("KanbanTaskTargetFolder")
|
||||
kanbanTasks KanbanTaskAsset[]
|
||||
recentFiles RecentFileItem[]
|
||||
|
||||
@@map("assets")
|
||||
@@index([type])
|
||||
@@ -1273,5 +1276,22 @@ model KanbanTaskEvent {
|
||||
@@map("kanban_task_events")
|
||||
}
|
||||
|
||||
model RecentFileItem {
|
||||
id String @id @default(ulid())
|
||||
userId String @map("user_id")
|
||||
projectId String @map("project_id")
|
||||
assetId String @map("asset_id")
|
||||
viewedAt DateTime @default(now()) @map("viewed_at")
|
||||
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
|
||||
asset Asset @relation(fields: [assetId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([userId, projectId, assetId], name: "userIdProjectIdAssetId")
|
||||
@@index([userId, projectId, viewedAt(sort: Desc)])
|
||||
@@index([assetId])
|
||||
@@map("recent_file_items")
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user