refactor(intake): move detection workspace helpers
This commit is contained in:
parent
96e7a4db8d
commit
4f66a42cec
@ -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,
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user