mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 15:14:10 +00:00
feat(asset): Recently Deleted previews, retention countdown, and version stack delete/restore (#418)
* feat(asset): improve Recently Deleted previews and retention indicators - Include soft-deleted children when building folder previews for the Recently Deleted view, and resolve deleted version stacks to their latest version so a trashed folder shows what was inside it. - Add a "days left" badge (clock + Nd) to file and folder cards in the Recently Deleted view, placed to the left of the comments badge. - Fix an issue where deleting or restoring a version stack from the file list did nothing because the WebUI dropped version_stack items before calling the API. - Share the 30-day trash retention window through TRASH_RETENTION_DAYS. * test(asset): use typed MediaInfo in recently-deleted preview tests Replace the explicit any cast with a fully typed MediaInfo object so the new tests comply with the no-explicit-any policy.
This commit is contained in:
@@ -141,7 +141,9 @@ export function useFileActions({
|
||||
}
|
||||
|
||||
const confirmDelete = () => {
|
||||
const fileIds = itemsToDelete.filter((i) => i.type === 'file').map((i) => i.id!)
|
||||
const fileIds = itemsToDelete
|
||||
.filter((i) => i.type === 'file' || i.type === 'version_stack')
|
||||
.map((i) => i.id!)
|
||||
const folderIds = itemsToDelete.filter((i) => i.type === 'folder').map((i) => i.id!)
|
||||
|
||||
if (fileIds.length > 0) {
|
||||
@@ -183,7 +185,9 @@ export function useFileActions({
|
||||
}
|
||||
|
||||
const handleRestore = (items: AssetInfo[]) => {
|
||||
const fileIds = items.filter((i) => i.type === 'file').map((i) => i.id!)
|
||||
const fileIds = items
|
||||
.filter((i) => i.type === 'file' || i.type === 'version_stack')
|
||||
.map((i) => i.id!)
|
||||
const folderIds = items.filter((i) => i.type === 'folder').map((i) => i.id!)
|
||||
|
||||
if (fileIds.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user