From 4f66a42cecf19f01db1e1e03b3a20511e3468904 Mon Sep 17 00:00:00 2001 From: WuYongJie Date: Mon, 8 Jun 2026 20:29:24 +0800 Subject: [PATCH] refactor(intake): move detection workspace helpers --- .../NonIntegratedDetailClient.tsx | 18 ++++-------------- .../non-integrated/documentWorkspaceHelpers.ts | 13 +++++++++++++ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/furniture-3d-system/src/app/intake/non-integrated/NonIntegratedDetailClient.tsx b/furniture-3d-system/src/app/intake/non-integrated/NonIntegratedDetailClient.tsx index f79279d6..e654b058 100644 --- a/furniture-3d-system/src/app/intake/non-integrated/NonIntegratedDetailClient.tsx +++ b/furniture-3d-system/src/app/intake/non-integrated/NonIntegratedDetailClient.tsx @@ -421,21 +421,24 @@ import { PRODUCT_PHOTO_NINE_VIEW_SLOT_LABELS, PRODUCT_PHOTO_NINE_VIEW_SLOTS, PRODUCT_PHOTO_PANEL_ORDER, + QUALITY_STANDARD_FILE_ACCEPT, areProductPhotoSelectionsEqual, + buildDocumentWorkspaceRevisionFileEntries, buildProductPhotoMetadata, getDocumentWorkspaceCategoryLabel, getDocumentWorkspaceShortcutCountClass, getDocumentWorkspaceSidebarButtonClass, - buildDocumentWorkspaceRevisionFileEntries, getProductPhotoPanelCompactTitle, getProductPhotoPanelTitle, getSupplementWorkspaceShortcutButtonClass, getUploadCategoryOptionLabel, inferProductDataGroup, inferProductPhotoNineViewSlot, + resolveDetectionWorkspaceAssetType, resolveProductDataGroup, resolveProductPhotoAssignment, resolveProductPhotoFileStyleKey, + type DetectionWorkspaceAssetType, type DocumentWorkspaceCategory, type ProductDataGroup, type ProductPhotoFileGroup, @@ -759,8 +762,6 @@ type UploadProgressState = { type DownloadProgressState = UploadProgressState & { phase: "fetching" | "zipping"; }; -type DetectionWorkspaceAssetType = NonIntegratedDetectionAssetType; - type InstallationStyleEntry = { key: string; label: string; @@ -4595,17 +4596,6 @@ async function uploadFileToServer( }; } -const QUALITY_STANDARD_FILE_ACCEPT = - ".xls,.xlsx,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; - -function resolveDetectionWorkspaceAssetType( - file: NonIntegratedUploadFile, -): DetectionWorkspaceAssetType { - return file.detectionAssetType === "quality-standard" - ? "quality-standard" - : "attachment"; -} - function applyUploadFileCategoryMetadata( file: NonIntegratedUploadFile, category: UploadCategoryKey, diff --git a/furniture-3d-system/src/app/intake/non-integrated/documentWorkspaceHelpers.ts b/furniture-3d-system/src/app/intake/non-integrated/documentWorkspaceHelpers.ts index 2723960b..c30e3e51 100644 --- a/furniture-3d-system/src/app/intake/non-integrated/documentWorkspaceHelpers.ts +++ b/furniture-3d-system/src/app/intake/non-integrated/documentWorkspaceHelpers.ts @@ -1,5 +1,6 @@ import { getNonIntegratedDocumentWorkspaceCategoryLabel, + type NonIntegratedDetectionAssetType, type NonIntegratedDocumentWorkspaceCategory, type NonIntegratedUploadFile, type NonIntegratedWorkflowNodeCategory, @@ -32,6 +33,7 @@ export type UploadCategoryKey = export type DocumentWorkspaceCategory = NonIntegratedDocumentWorkspaceCategory; export type WorkflowNodeCategory = NonIntegratedWorkflowNodeCategory; +export type DetectionWorkspaceAssetType = NonIntegratedDetectionAssetType; export type ProductDataGroup = | "sampling" | "exploded" @@ -106,6 +108,17 @@ export function buildDocumentWorkspaceRevisionFileEntries( factoryQualityAssetType: file.factoryQualityAssetType, })); } + +export const QUALITY_STANDARD_FILE_ACCEPT = + ".xls,.xlsx,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; + +export function resolveDetectionWorkspaceAssetType( + file: NonIntegratedUploadFile, +): DetectionWorkspaceAssetType { + return file.detectionAssetType === "quality-standard" + ? "quality-standard" + : "attachment"; +} export const PRODUCT_PHOTO_NINE_VIEW_SLOTS: { key: ProductPhotoNineViewSlot; label: string;