refactor(intake): move document revision file helper

This commit is contained in:
WuYongJie 2026-06-08 20:14:56 +08:00
parent d5834de00e
commit 14d7ddcd4e
2 changed files with 29 additions and 28 deletions

View File

@ -426,6 +426,7 @@ import {
getDocumentWorkspaceCategoryLabel,
getDocumentWorkspaceShortcutCountClass,
getDocumentWorkspaceSidebarButtonClass,
buildDocumentWorkspaceRevisionFileEntries,
getProductPhotoPanelCompactTitle,
getProductPhotoPanelTitle,
getSupplementWorkspaceShortcutButtonClass,
@ -4523,34 +4524,6 @@ function createInitialDocumentWorkspaceNotes(
);
}
function buildDocumentWorkspaceRevisionFileEntries(
uploadFiles: NonIntegratedUploadFile[],
category: DocumentWorkspaceCategory,
) {
return uploadFiles
.filter((file) => file.category === category)
.map((file) => ({
id: file.id,
name: file.name,
category: file.category,
dataUrl: file.dataUrl,
mimeType: file.mimeType,
productDataGroup: file.productDataGroup,
detectionAssetType: file.detectionAssetType,
photoGroup: file.photoGroup,
photoSlot: file.photoSlot,
productPhotoStyleKey: file.productPhotoStyleKey,
installStyleKey: file.installStyleKey,
installAssetType: file.installAssetType,
installVersionLabel: file.installVersionLabel,
installIsCurrentVersion: file.installIsCurrentVersion,
packagingStyleKey: file.packagingStyleKey,
packagingAssetType: file.packagingAssetType,
factoryQualityStyleKey: file.factoryQualityStyleKey,
factoryQualityAssetType: file.factoryQualityAssetType,
}));
}
function createInitialDocumentWorkspaceConfirmations(
product: NonIntegratedProductRecord | null,
): NonIntegratedDocumentWorkspaceConfirmationMap {

View File

@ -78,6 +78,34 @@ export function areProductPhotoSelectionsEqual(
return false;
}
export function buildDocumentWorkspaceRevisionFileEntries(
uploadFiles: NonIntegratedUploadFile[],
category: DocumentWorkspaceCategory,
) {
return uploadFiles
.filter((file) => file.category === category)
.map((file) => ({
id: file.id,
name: file.name,
category: file.category,
dataUrl: file.dataUrl,
mimeType: file.mimeType,
productDataGroup: file.productDataGroup,
detectionAssetType: file.detectionAssetType,
photoGroup: file.photoGroup,
photoSlot: file.photoSlot,
productPhotoStyleKey: file.productPhotoStyleKey,
installStyleKey: file.installStyleKey,
installAssetType: file.installAssetType,
installVersionLabel: file.installVersionLabel,
installIsCurrentVersion: file.installIsCurrentVersion,
packagingStyleKey: file.packagingStyleKey,
packagingAssetType: file.packagingAssetType,
factoryQualityStyleKey: file.factoryQualityStyleKey,
factoryQualityAssetType: file.factoryQualityAssetType,
}));
}
export const PRODUCT_PHOTO_NINE_VIEW_SLOTS: {
key: ProductPhotoNineViewSlot;
label: string;