From d1ddf2de7a88b41042197b5b11db331988ae7e1d Mon Sep 17 00:00:00 2001 From: WuYongJie Date: Wed, 10 Jun 2026 18:00:53 +0800 Subject: [PATCH] refactor(intake): split non-integrated workspace containers --- .../NonIntegratedDetailClient.tsx | 1004 +++++++---------- .../firstQualityWorkspaceRenderers.tsx | 43 + ...uctDevelopmentReviewWorkspaceRenderers.tsx | 9 + .../ProductDevelopmentDetailContent.tsx | 16 + .../DocumentWorkspaceContentSection.tsx | 46 + .../shared/archivePreviewRenderer.tsx | 39 + .../styleAssetWorkspaceRenderers.tsx | 24 + 7 files changed, 586 insertions(+), 595 deletions(-) create mode 100644 furniture-3d-system/src/app/intake/non-integrated/workspaces/first-quality/firstQualityWorkspaceRenderers.tsx create mode 100644 furniture-3d-system/src/app/intake/non-integrated/workspaces/product-development/ProductDevelopmentDetailContent.tsx create mode 100644 furniture-3d-system/src/app/intake/non-integrated/workspaces/shared/DocumentWorkspaceContentSection.tsx create mode 100644 furniture-3d-system/src/app/intake/non-integrated/workspaces/shared/archivePreviewRenderer.tsx create mode 100644 furniture-3d-system/src/app/intake/non-integrated/workspaces/style-assets/styleAssetWorkspaceRenderers.tsx 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 56516a9d..35ef69ac 100644 --- a/furniture-3d-system/src/app/intake/non-integrated/NonIntegratedDetailClient.tsx +++ b/furniture-3d-system/src/app/intake/non-integrated/NonIntegratedDetailClient.tsx @@ -14,9 +14,6 @@ import { useRef, useState, } from "react"; -import { - ArchivePreviewPanel, -} from "./workspaces/shared/ArchivePreviewPanel"; import { CreateFooter } from "./workspaces/shared/CreateFooter"; import { AUTO_COMPLETED_WORKFLOW_CATEGORIES, @@ -45,10 +42,7 @@ import { BRAND_OPTIONS, PROJECT_STATUS_COPY, } from "./workspaces/basic-info/basicInfoConfig"; -import { FirstQualityWorkspace } from "./workspaces/FirstQualityWorkspace"; -import { FirstQualityWorkspaceShell } from "./workspaces/first-quality/FirstQualityWorkspaceShell"; -import { InstallationWorkspace } from "./workspaces/InstallationWorkspace"; -import { OpeningReferenceWorkspace } from "./workspaces/OpeningReferenceWorkspace"; +import { buildFirstQualityWorkspaceRenderers } from "./workspaces/first-quality/firstQualityWorkspaceRenderers"; import { buildProductPatentLedgerTarget, type LinkEntryProductPatentDashboardComponent, @@ -58,6 +52,7 @@ import { buildRawMaterialProcessConfigTab } from "./workspaces/RawMaterialDomain import { buildProductDevelopmentReviewWorkspaceRenderers } from "./workspaces/opening-reference/productDevelopmentReviewWorkspaceRenderers"; import { buildProductFactoryWorkspaceRenderer } from "./workspaces/product-factory/productFactoryWorkspaceRenderer"; import { buildProductWorkflowWorkspaceRenderers } from "./workspaces/product-workflow/productWorkflowWorkspaceRenderers"; +import { buildStyleAssetWorkspaceRenderers } from "./workspaces/style-assets/styleAssetWorkspaceRenderers"; import { buildDocumentWorkspacePreviewContentRenderer, buildDocumentWorkspaceRenderers, @@ -76,6 +71,7 @@ import { import { getProductFactoryTargetSkuIds } from "./workspaces/product-factory/productFactoryTargetSkuHelpers"; import { BasicInfoCreateSection } from "./workspaces/basic-info/BasicInfoCreateSection"; import { BasicInfoDetailSection } from "./workspaces/basic-info/BasicInfoDetailSection"; +import { ProductDevelopmentDetailContent } from "./workspaces/product-development/ProductDevelopmentDetailContent"; import { SkuContentSection } from "./workspaces/basic-info/SkuContentSection"; import { SupplementSection } from "./workspaces/basic-info/SupplementSection"; import { @@ -84,13 +80,12 @@ import { } from "./workspaces/shared/InheritedSkuBatchTabs"; import { DetailOverlayDialogs } from "./workspaces/shared/DetailOverlayDialogs"; import { DetailFeedbackToasts } from "./workspaces/shared/DetailFeedbackToasts"; +import { buildArchivePreviewPanelRenderer } from "./workspaces/shared/archivePreviewRenderer"; import { DetailWorkspaceFrame, LinkEntryAuxiliaryWorkspaceSection, } from "./workspaces/shared/DetailWorkspaceFrame"; -import { DocumentWorkspaceHeaderActionsSlot } from "./workspaces/shared/DocumentWorkspaceHeaderActionsSlot"; -import { DocumentWorkspacePanelContent } from "./workspaces/shared/DocumentWorkspacePanelContent"; -import { DocumentWorkspaceSectionCard } from "./workspaces/shared/DocumentWorkspaceSectionCard"; +import { DocumentWorkspaceContentSection } from "./workspaces/shared/DocumentWorkspaceContentSection"; import { DocumentWorkspaceSidebar } from "./workspaces/shared/DocumentWorkspaceSidebar"; import { buildDetailLayoutState } from "./workspaces/shared/detailLayoutState"; import { @@ -287,7 +282,6 @@ import { } from "./workspaces/style-assets/styleFileHelpers"; import { useStyleWorkspaceEntries } from "./workspaces/style-assets/useStyleWorkspaceEntries"; import { usePackagingPreviewDerivedState } from "./workspaces/style-assets/usePackagingPreviewDerivedState"; -import { PackagingWorkspace } from "./workspaces/style-assets/PackagingWorkspace"; import { useInstallationAssetGroups } from "./workspaces/style-assets/useInstallationAssetGroups"; import { EMPTY_DOCUMENT_WORKSPACE_NOTES, @@ -9617,139 +9611,42 @@ export default function NonIntegratedDetailClient({ workspaceStructuredPreviewStatus, }); - function renderPackagingWorkspace() { - const packagingSectionHasContent = - activePackagingStyleFiles.length > 0 || - Object.values(styleDetails).some((detail) => - hasPackagingStyleStructuredContent(detail), - ); - const handleSelectPackagingWorkspacePanel = ( - panel: PackagingWorkspacePanel, - ) => { - setActivePackagingWorkspacePanel(panel); - setSelectedWorkspaceFileId(""); - }; - const handlePackagingModelNodesChange = (nodeNames: string[]) => { - setPreviewNodeNames(nodeNames); - setPreviewNodeOffsetMap((current) => - filterPreviewNodeMapByNames(current, nodeNames), - ); - setPreviewNodeRotationMap((current) => - filterPreviewNodeMapByNames(current, nodeNames), - ); - const nextSelectedNodeNames = filterPreviewNodeNamesByAvailable( - selectedPreviewNodeNamesRef.current, - nodeNames, - ); - selectedPreviewNodeNamesRef.current = nextSelectedNodeNames; - setSelectedPreviewNodeNames(nextSelectedNodeNames); - setSelectedPreviewNodeName((current) => - resolveSelectedPreviewNodeName( - current, - nodeNames, - nextSelectedNodeNames, - ), - ); - const nextMaterialIds = filterPreviewNodeMapByNames( - selectedPackagingModelNodeMaterialIds, - nodeNames, - ); - if (nextMaterialIds !== selectedPackagingModelNodeMaterialIds) { - persistPreviewNodeMaterialIds(nextMaterialIds); - } - }; - - return ( - packagingModel3dInputRef.current?.click(), - onPreviewTransformEnd: handlePreviewTransformEnd, - onPreviewTransformStart: handlePreviewTransformStart, - }} - onChangePackagingOuterType={handleChangePackagingOuterType} - onDeleteFile={handleDeleteUploadFile} - onDownloadFile={handleDownloadUploadFile} - onPackagingModel3dChange={handlePackagingModel3dChange} - onPackagingUploadChange={handleUploadPackagingFiles} - onSelectPackagingStyle={handleSelectPackagingStyle} - onSelectPanel={handleSelectPackagingWorkspacePanel} - onSelectWorkspaceFile={handleSelectWorkspaceFile} - /> + const packagingSectionHasContent = + activePackagingStyleFiles.length > 0 || + Object.values(styleDetails).some((detail) => + hasPackagingStyleStructuredContent(detail), ); - } - - function renderFirstQualityWorkspace() { - const handleSelectFirstQualityWorkspacePanel = ( - panel: FirstQualityWorkspacePanel, - ) => { - setActiveFirstQualityWorkspacePanel(panel); - setSelectedWorkspaceFileId(""); - }; - - return ( - + const handleSelectPackagingWorkspacePanel = ( + panel: PackagingWorkspacePanel, + ) => { + setActivePackagingWorkspacePanel(panel); + setSelectedWorkspaceFileId(""); + }; + const handlePackagingModelNodesChange = (nodeNames: string[]) => { + setPreviewNodeNames(nodeNames); + setPreviewNodeOffsetMap((current) => + filterPreviewNodeMapByNames(current, nodeNames), ); - } + setPreviewNodeRotationMap((current) => + filterPreviewNodeMapByNames(current, nodeNames), + ); + const nextSelectedNodeNames = filterPreviewNodeNamesByAvailable( + selectedPreviewNodeNamesRef.current, + nodeNames, + ); + selectedPreviewNodeNamesRef.current = nextSelectedNodeNames; + setSelectedPreviewNodeNames(nextSelectedNodeNames); + setSelectedPreviewNodeName((current) => + resolveSelectedPreviewNodeName(current, nodeNames, nextSelectedNodeNames), + ); + const nextMaterialIds = filterPreviewNodeMapByNames( + selectedPackagingModelNodeMaterialIds, + nodeNames, + ); + if (nextMaterialIds !== selectedPackagingModelNodeMaterialIds) { + persistPreviewNodeMaterialIds(nextMaterialIds); + } + }; function renderInheritedSkuBatchTabs() { return ( @@ -9863,129 +9760,62 @@ export default function NonIntegratedDetailClient({ onConfirmPushRows: handleConfirmProductPricingPushRows, }, }); - function renderArchivePreviewPanel(options?: { - title?: string; - description?: string; - emptyTitle?: string; - emptyDescription?: string; - }) { - const previewTitle = options?.title ?? workspacePreviewTitle; - const previewDescription = - options?.description ?? workspacePreviewDescription; + const renderArchivePreviewPanel = buildArchivePreviewPanelRenderer({ + title: workspacePreviewTitle, + description: workspacePreviewDescription, + hasSelectedFile: Boolean(effectiveSelectedWorkspaceFile), + renderPreviewContent: renderDocumentWorkspacePreviewContent, + }); - return ( - - ); - } - - function renderFactoryQualityWorkspace() { - return ( - - setSkuImagePreview({ - kind: "image", - src, - alt, - }) - } - /> - ); - } - - function renderInstallationWorkspace() { - return ( - - ); - } - - function renderOpeningReferenceWorkspace() { - return ( - - openingReference.productImage - ? setWorkspaceImagePreview({ - kind: "standalone", - src: openingReference.productImage, - alt: openingReference.productName.trim() || "开品参考图片", - }) - : undefined - } - onDocumentUpload={(event) => - handleUploadFilesChange(event, OPENING_REFERENCE_WORKSPACE_CATEGORY) - } - onDownloadFile={handleDownloadUploadFile} - onDeleteFile={handleDeleteUploadFile} - /> - ); - } const currentProductDisplayName = buildCurrentProductDisplayName({ formValues, openingReference, product: existingProduct, }); - const { renderPatentApplicationWorkspace, renderProjectReviewWorkspace } = - buildProductDevelopmentReviewWorkspaceRenderers({ + const { + renderOpeningReferenceWorkspace, + renderPatentApplicationWorkspace, + renderProjectReviewWorkspace, + } = buildProductDevelopmentReviewWorkspaceRenderers({ + openingReference: { + openingReference, + openingReferenceFiles: activeDocumentWorkspaceFiles, + openingReferenceProductNameLabel, + openingReferenceProductNamePlaceholder, + formYear: formValues.year, + formDesigner: formValues.designer, + demandFlowNo: formValues.demandFlowNo, + existingProductCreatedAt, + showApprovalWorkflow: mode !== "create", + productId: productId ?? "", + currentProductDisplayName, + designerNameOptions, + planningOwnerNameOptions, + isCurrentUserPlainReadOnlyViewer, + isReadOnly, + canDownloadWorkspaceFiles, + openingReferenceImageInputRef, + documentWorkspaceUploadInputRef, + confirmationAction: renderDocumentWorkspaceConfirmationAction(), + primaryButtonClassName: DETAIL_PRIMARY_BUTTON_CLASS, + isLockedCategoryField: isLockedCategoryOpeningReferenceField, + onFieldChange: handleOpeningReferenceFieldChange, + onAdaptableBrandsChange: handleOpeningReferenceAdaptableBrandsChange, + onImageChange: handleOpeningReferenceImageChange, + onPreviewImage: () => + openingReference.productImage + ? setWorkspaceImagePreview({ + kind: "standalone", + src: openingReference.productImage, + alt: openingReference.productName.trim() || "开品参考图片", + }) + : undefined, + onDocumentUpload: (event) => + handleUploadFilesChange(event, OPENING_REFERENCE_WORKSPACE_CATEGORY), + onDownloadFile: handleDownloadUploadFile, + onDeleteFile: handleDeleteUploadFile, + }, patentApplication: { patentApplication, openingReference, @@ -10171,6 +10001,133 @@ export default function NonIntegratedDetailClient({ }, }); + const { + renderFactoryQualityWorkspace, + renderFirstQualityWorkspace, + } = buildFirstQualityWorkspaceRenderers({ + factoryQuality: { + allRows: productFirstQualityRows, + displayedRows: displayedProductFirstQualityRows, + files: factoryQualityFiles, + inheritedSkuBatchTabs: renderInheritedSkuBatchTabs(), + isReadOnly, + canDownloadWorkspaceFiles, + onUpdateRow: updateFirstQualityRow, + onUploadFiles: handleUploadFirstQualityFiles, + onDownloadFiles: handleDownloadWorkspaceFiles, + onPreviewImage: (src, alt) => + setSkuImagePreview({ + kind: "image", + src, + alt, + }), + }, + shell: { + activePanel: activeFirstQualityWorkspacePanel, + canDownloadWorkspaceFiles, + displayedFirstQualityIsConfirmed, + displayedFirstQualityRowsComplete, + displayedProductFirstQualityRowCount: + displayedProductFirstQualityRows.length, + documentWorkspaceUploadInputRef, + effectiveSelectedWorkspaceFile, + factoryQualityFiles, + isCurrentUserPlainReadOnlyViewer, + isReadOnly, + onConfirmFirstQualityRows: handleConfirmFirstQualityRows, + onDeleteUploadFile: handleDeleteUploadFile, + onDownloadUploadFile: handleDownloadUploadFile, + onDownloadWorkspaceFiles: handleDownloadWorkspaceFiles, + onSelectPanel: (panel) => { + setActiveFirstQualityWorkspacePanel(panel); + setSelectedWorkspaceFileId(""); + }, + onUploadQualityStandardFiles: + handleUploadDetectionQualityStandardFiles, + qualityStandardFileAccept: QUALITY_STANDARD_FILE_ACCEPT, + qualityStandardFiles, + }, + renderQualityStandardWorkspace, + }); + + const { renderInstallationWorkspace, renderPackagingWorkspace } = + buildStyleAssetWorkspaceRenderers({ + installation: { + installationStyleEntries, + selectedInstallationStyleEntry, + activeInstallationStyleFiles, + activeInstallationAssetType, + activeInstallationAssetFiles, + activeInstallationVersionGroups, + activeInstallationAssetLabel, + noteLabel: activeDocumentWorkspaceCopy.noteLabel, + notePlaceholder: activeDocumentWorkspaceCopy.notePlaceholder, + noteValue: documentWorkspaceNotes[activeDocumentWorkspaceCategory], + isReadOnly, + selectedFileId: effectiveSelectedWorkspaceFile?.id ?? "", + archivePreviewPanel: renderArchivePreviewPanel(), + onSelectStyle: handleSelectInstallationStyle, + onSelectAssetType: handleSelectInstallationAssetType, + onNoteChange: handleDocumentWorkspaceNoteChange, + onSelectFile: handleSelectWorkspaceFile, + }, + packaging: { + actionGroupClassName: DOCUMENT_WORKSPACE_ACTION_GROUP_CLASS, + activePanel: activePackagingWorkspacePanel, + activePackagingStyleFiles, + canDownloadWorkspaceFiles, + confirmationAction: renderPackagingSectionConfirmationAction({ + category: PACKAGING_WORKSPACE_CATEGORY, + hasContent: packagingSectionHasContent, + label: getDocumentWorkspaceCategoryLabel( + PACKAGING_WORKSPACE_CATEGORY, + ), + }), + isReadOnly, + packagingModel3dInputRef, + packagingWorkspaceUploadInputRef, + previewContent: renderDocumentWorkspacePreviewContent(), + selectedPackagingStyleDetail, + selectedPackagingStyleEntry, + packagingStyleEntries, + selectedWorkspaceFile: effectiveSelectedWorkspaceFile, + modelPreviewProps: { + canEditPreviewModelMaterial, + isPackagingModelPreviewActive, + isReadOnly, + model3dPreviewUrl, + selectedPackagingModelFileName, + selectedPackagingStyleEntry, + previewGizmoMode, + previewNodeNames, + selectedPreviewNodeName, + activeSelectedPreviewNodeNames, + previewNodeOffsets, + previewNodeRotations, + packagingPreviewMaterialAssignments, + previewHoleOverlayState, + onGizmoModeChange: setPreviewGizmoMode, + onModelNodesChange: handlePackagingModelNodesChange, + onNodeContextMenu: handlePreviewNodeContextMenu, + onNodePositionOffsetChange: handlePreviewNodePositionOffsetChange, + onNodeRotationChange: handlePreviewNodeRotationChange, + onNodeSelect: handlePreviewNodeSelect, + onOpenModelUpload: () => + packagingModel3dInputRef.current?.click(), + onPreviewTransformEnd: handlePreviewTransformEnd, + onPreviewTransformStart: handlePreviewTransformStart, + }, + onChangePackagingOuterType: handleChangePackagingOuterType, + onDeleteFile: handleDeleteUploadFile, + onDownloadFile: handleDownloadUploadFile, + onPackagingModel3dChange: handlePackagingModel3dChange, + onPackagingUploadChange: handleUploadPackagingFiles, + onSelectPackagingStyle: handleSelectPackagingStyle, + onSelectPanel: handleSelectPackagingWorkspacePanel, + onSelectWorkspaceFile: handleSelectWorkspaceFile, + }, + }); + const { alt: workspacePreviewDialogAlt, label: workspacePreviewDialogLabel, @@ -10270,7 +10227,7 @@ export default function NonIntegratedDetailClient({ } > {documentWorkspaceView === "detail" ? ( -
+ {mode === "create" ? ( ) : null} - {renderCreateFooter()} -
+ ) : ( -
- - option.key === activeInstallationAssetType, - )?.accept - } - installationUploadInputKey={`installation-upload-${selectedInstallationStyleEntry?.key ?? "shared"}-${activeInstallationAssetType}`} - installationWorkspaceUploadInputRef={ - installationWorkspaceUploadInputRef - } - isCurrentProductPhotoUploadDisabled={ - isCurrentProductPhotoUploadDisabled - } - isCurrentUserAdmin={isCurrentUserAdmin} - isCurrentUserPlainReadOnlyViewer={ - isCurrentUserPlainReadOnlyViewer - } - isDetectionWorkspace={isDetectionWorkspace} - isExportingProductLimit={isExportingProductLimit} - isExportingQualityInspection={ - isExportingQualityInspection - } - isExportingReviewSheet={isExportingReviewSheet} - isFactoryQualityWorkspace={isFactoryQualityWorkspace} - isFinishedSampleShipmentWorkspace={ - isFinishedSampleShipmentWorkspace - } - isImportingProductLimit={isImportingProductLimit} - isInstallationWorkspace={isInstallationWorkspace} - isJstPushEnabled={PRODUCT_PRICING_JST_PUSH_ENABLED} - isOpeningReferenceWorkspace={ - isOpeningReferenceWorkspace - } - isPackagingWorkspace={isPackagingWorkspace} - isPatentApplicationWorkspace={ - isPatentApplicationWorkspace - } - isPlanningLayoutWorkspace={isPlanningLayoutWorkspace} - isProductDataWorkspace={isProductDataWorkspace} - isProductFactoryReopenPickerOpen={ - isProductFactoryReopenPickerOpen - } - isProductFactoryWorkspace={isProductFactoryWorkspace} - isProductLimitNodeLocked={isProductLimitNodeLocked} - isProductLimitWorkspace={isProductLimitWorkspace} - isProductPhotoWorkspace={isProductPhotoWorkspace} - isProductPricingNodeLocked={isProductPricingNodeLocked} - isProductPricingWorkspace={isProductPricingWorkspace} - isProjectReviewWorkspace={isProjectReviewWorkspace} - isReadOnly={isReadOnly} - isReviewWorkspace={isReviewWorkspace} - isSampleMeasurementWorkspace={ - isSampleMeasurementWorkspace - } - productFactoryReopenField={productFactoryReopenField} - productLimitWorkbookAccept={ - NON_INTEGRATED_PRODUCT_LIMIT_WORKBOOK_ACCEPT - } - productLimitWorkbookInputRef={ - productLimitWorkbookInputRef - } - productPhotoCurrentUploadInputRef={ - productPhotoCurrentUploadInputRef - } - productPhotoDetailUploadInputRef={ - productPhotoDetailUploadInputRef - } - qualityStandardFileAccept={QUALITY_STANDARD_FILE_ACCEPT} - reviewRoundCount={reviewRounds.length} - selectedProductPhotoTarget={selectedProductPhotoTarget} - onAddReviewRound={handleAddReviewRound} - onBatchConfirmProductPricingPush={ - handleBatchConfirmProductPricingPush - } - onCloseProductFactoryReopenPicker={() => - setIsProductFactoryReopenPickerOpen(false) - } - onConfirmProductLimitRows={() => - void handleConfirmProductLimitRows() - } - onConfirmReviewSheet={() => - void handleConfirmReviewSheet() - } - onDeleteReviewRound={handleDeleteReviewRound} - onDeleteUploadFile={handleDeleteUploadFile} - onDownloadUploadFile={(file) => - void handleDownloadUploadFile(file) - } - onDownloadWorkspaceFiles={(files) => - void handleDownloadWorkspaceFiles(files) - } - onExportProductLimitWorkbook={() => - void handleExportProductLimitWorkbook() - } - onExportQualityInspection={() => - void handleExportQualityInspection() - } - onExportReviewSheet={() => - void handleExportReviewSheet() - } - onFinishedSampleShipmentStatusClick={ - handleFinishedSampleShipmentStatusClick - } - onImportProductLimitWorkbookChange={ - handleImportProductLimitWorkbookChange - } - onOpenAiWhiteBackground={() => - setIsAiWhiteBackgroundModalOpen(true) - } - onOpenProductPhotoCurrentUpload={ - openProductPhotoCurrentUpload - } - onOpenProductPhotoPanelUpload={ - openProductPhotoPanelUpload - } - onProductFactoryReopenApply={ - handleReopenProductFactoryConfirmation - } - onProductFactoryReopenFieldChange={ - setProductFactoryReopenField - } - onProductFactoryStatusClick={ - handleProductFactoryStatusClick - } - onReplaceCurrentProductPhoto={(event) => - void handleReplaceCurrentProductPhoto(event) - } - onSampleMeasurementStatusClick={ - handleSampleMeasurementStatusClick - } - onToggleProductFactoryReopenPicker={() => - setIsProductFactoryReopenPickerOpen( - (isOpen) => !isOpen, - ) - } - onUploadDetectionQualityStandardFiles={(event) => - void handleUploadDetectionQualityStandardFiles(event) - } - onUploadFilesChange={(event, category) => - void handleUploadFilesChange(event, category) - } - onUploadInstallationFiles={(event) => - void handleUploadInstallationFiles(event) - } - onUploadProductPhotoPanelFiles={(event) => - void handleUploadProductPhotoPanelFiles(event) - } - /> - } - > -
- -
-
- {renderCreateFooter()} -
+ + option.key === activeInstallationAssetType, + )?.accept, + installationUploadInputKey: `installation-upload-${selectedInstallationStyleEntry?.key ?? "shared"}-${activeInstallationAssetType}`, + installationWorkspaceUploadInputRef, + isCurrentProductPhotoUploadDisabled, + isCurrentUserAdmin, + isCurrentUserPlainReadOnlyViewer, + isDetectionWorkspace, + isExportingProductLimit, + isExportingQualityInspection, + isExportingReviewSheet, + isFactoryQualityWorkspace, + isFinishedSampleShipmentWorkspace, + isImportingProductLimit, + isInstallationWorkspace, + isJstPushEnabled: PRODUCT_PRICING_JST_PUSH_ENABLED, + isOpeningReferenceWorkspace, + isPackagingWorkspace, + isPatentApplicationWorkspace, + isPlanningLayoutWorkspace, + isProductDataWorkspace, + isProductFactoryReopenPickerOpen, + isProductFactoryWorkspace, + isProductLimitNodeLocked, + isProductLimitWorkspace, + isProductPhotoWorkspace, + isProductPricingNodeLocked, + isProductPricingWorkspace, + isProjectReviewWorkspace, + isReadOnly, + isReviewWorkspace, + isSampleMeasurementWorkspace, + productFactoryReopenField, + productLimitWorkbookAccept: + NON_INTEGRATED_PRODUCT_LIMIT_WORKBOOK_ACCEPT, + productLimitWorkbookInputRef, + productPhotoCurrentUploadInputRef, + productPhotoDetailUploadInputRef, + qualityStandardFileAccept: QUALITY_STANDARD_FILE_ACCEPT, + reviewRoundCount: reviewRounds.length, + selectedProductPhotoTarget, + onAddReviewRound: handleAddReviewRound, + onBatchConfirmProductPricingPush: + handleBatchConfirmProductPricingPush, + onCloseProductFactoryReopenPicker: () => + setIsProductFactoryReopenPickerOpen(false), + onConfirmProductLimitRows: () => + void handleConfirmProductLimitRows(), + onConfirmReviewSheet: () => + void handleConfirmReviewSheet(), + onDeleteReviewRound: handleDeleteReviewRound, + onDeleteUploadFile: handleDeleteUploadFile, + onDownloadUploadFile: (file) => + void handleDownloadUploadFile(file), + onDownloadWorkspaceFiles: (files) => + void handleDownloadWorkspaceFiles(files), + onExportProductLimitWorkbook: () => + void handleExportProductLimitWorkbook(), + onExportQualityInspection: () => + void handleExportQualityInspection(), + onExportReviewSheet: () => void handleExportReviewSheet(), + onFinishedSampleShipmentStatusClick: + handleFinishedSampleShipmentStatusClick, + onImportProductLimitWorkbookChange: + handleImportProductLimitWorkbookChange, + onOpenAiWhiteBackground: () => + setIsAiWhiteBackgroundModalOpen(true), + onOpenProductPhotoCurrentUpload: + openProductPhotoCurrentUpload, + onOpenProductPhotoPanelUpload: openProductPhotoPanelUpload, + onProductFactoryReopenApply: + handleReopenProductFactoryConfirmation, + onProductFactoryReopenFieldChange: + setProductFactoryReopenField, + onProductFactoryStatusClick: + handleProductFactoryStatusClick, + onReplaceCurrentProductPhoto: (event) => + void handleReplaceCurrentProductPhoto(event), + onSampleMeasurementStatusClick: + handleSampleMeasurementStatusClick, + onToggleProductFactoryReopenPicker: () => + setIsProductFactoryReopenPickerOpen( + (isOpen) => !isOpen, + ), + onUploadDetectionQualityStandardFiles: (event) => + void handleUploadDetectionQualityStandardFiles(event), + onUploadFilesChange: (event, category) => + void handleUploadFilesChange(event, category), + onUploadInstallationFiles: (event) => + void handleUploadInstallationFiles(event), + onUploadProductPhotoPanelFiles: (event) => + void handleUploadProductPhotoPanelFiles(event), + }} + panel={{ + isDetectionWorkspace, + isFactoryQualityWorkspace, + isFinishedSampleShipmentWorkspace, + isInstallationWorkspace, + isOpeningReferenceWorkspace, + isPackagingWorkspace, + isPatentApplicationWorkspace, + isPlanningLayoutWorkspace, + isProductDataWorkspace, + isProductFactoryWorkspace, + isProductLimitWorkspace, + isProductPhotoWorkspace, + isProductPricingWorkspace, + isProjectReviewWorkspace, + isReviewWorkspace, + isSampleMeasurementWorkspace, + renderAttachmentWorkspace, + renderDetectionWorkspace, + renderFinishedSampleShipmentWorkspace, + renderFirstQualityWorkspace, + renderInstallationWorkspace, + renderOpeningReferenceWorkspace, + renderPackagingWorkspace, + renderPatentApplicationWorkspace, + renderPlanningLayoutWorkspace, + renderProductDataWorkspace, + renderProductFactoryWorkspace, + renderProductLimitWorkspace, + renderProductPhotoWorkspace, + renderProductPricingWorkspace, + renderProjectReviewWorkspace, + renderReviewSheetWorkspace, + renderSampleMeasurementWorkspace, + }} + /> )} )} diff --git a/furniture-3d-system/src/app/intake/non-integrated/workspaces/first-quality/firstQualityWorkspaceRenderers.tsx b/furniture-3d-system/src/app/intake/non-integrated/workspaces/first-quality/firstQualityWorkspaceRenderers.tsx new file mode 100644 index 00000000..2182a84d --- /dev/null +++ b/furniture-3d-system/src/app/intake/non-integrated/workspaces/first-quality/firstQualityWorkspaceRenderers.tsx @@ -0,0 +1,43 @@ +import type { ComponentProps, ReactNode } from "react"; + +import { FirstQualityWorkspace } from "../FirstQualityWorkspace"; +import { FirstQualityWorkspaceShell } from "./FirstQualityWorkspaceShell"; + +type FirstQualityWorkspaceProps = ComponentProps; +type FirstQualityWorkspaceShellProps = ComponentProps< + typeof FirstQualityWorkspaceShell +>; + +type FirstQualityWorkspaceRendererOptions = { + factoryQuality: FirstQualityWorkspaceProps; + shell: Omit< + FirstQualityWorkspaceShellProps, + "renderFactoryQualityWorkspace" | "renderQualityStandardWorkspace" + >; + renderQualityStandardWorkspace: () => ReactNode; +}; + +export function buildFirstQualityWorkspaceRenderers({ + factoryQuality, + shell, + renderQualityStandardWorkspace, +}: FirstQualityWorkspaceRendererOptions) { + function renderFactoryQualityWorkspace() { + return ; + } + + function renderFirstQualityWorkspace() { + return ( + + ); + } + + return { + renderFactoryQualityWorkspace, + renderFirstQualityWorkspace, + }; +} diff --git a/furniture-3d-system/src/app/intake/non-integrated/workspaces/opening-reference/productDevelopmentReviewWorkspaceRenderers.tsx b/furniture-3d-system/src/app/intake/non-integrated/workspaces/opening-reference/productDevelopmentReviewWorkspaceRenderers.tsx index b7345cb3..ad822059 100644 --- a/furniture-3d-system/src/app/intake/non-integrated/workspaces/opening-reference/productDevelopmentReviewWorkspaceRenderers.tsx +++ b/furniture-3d-system/src/app/intake/non-integrated/workspaces/opening-reference/productDevelopmentReviewWorkspaceRenderers.tsx @@ -1,23 +1,32 @@ import type { ComponentProps } from "react"; +import { OpeningReferenceWorkspace } from "../OpeningReferenceWorkspace"; import { ProductPatentApplicationDomain } from "../patent/ProductPatentDomain"; import { ProjectReviewWorkspace } from "../ProjectReviewWorkspace"; +type OpeningReferenceWorkspaceProps = ComponentProps< + typeof OpeningReferenceWorkspace +>; type ProductPatentApplicationDomainProps = ComponentProps< typeof ProductPatentApplicationDomain >; type ProjectReviewWorkspaceProps = ComponentProps; type ProductDevelopmentReviewWorkspaceRendererOptions = { + openingReference: OpeningReferenceWorkspaceProps; patentApplication: ProductPatentApplicationDomainProps; projectReview: ProjectReviewWorkspaceProps; }; export function buildProductDevelopmentReviewWorkspaceRenderers({ + openingReference, patentApplication, projectReview, }: ProductDevelopmentReviewWorkspaceRendererOptions) { return { + renderOpeningReferenceWorkspace() { + return ; + }, renderPatentApplicationWorkspace() { return ; }, diff --git a/furniture-3d-system/src/app/intake/non-integrated/workspaces/product-development/ProductDevelopmentDetailContent.tsx b/furniture-3d-system/src/app/intake/non-integrated/workspaces/product-development/ProductDevelopmentDetailContent.tsx new file mode 100644 index 00000000..167752d9 --- /dev/null +++ b/furniture-3d-system/src/app/intake/non-integrated/workspaces/product-development/ProductDevelopmentDetailContent.tsx @@ -0,0 +1,16 @@ +import type { ReactNode } from "react"; + +export function ProductDevelopmentDetailContent({ + children, + footer, +}: { + children: ReactNode; + footer: ReactNode; +}) { + return ( +
+ {children} + {footer} +
+ ); +} diff --git a/furniture-3d-system/src/app/intake/non-integrated/workspaces/shared/DocumentWorkspaceContentSection.tsx b/furniture-3d-system/src/app/intake/non-integrated/workspaces/shared/DocumentWorkspaceContentSection.tsx new file mode 100644 index 00000000..d9cc4cdf --- /dev/null +++ b/furniture-3d-system/src/app/intake/non-integrated/workspaces/shared/DocumentWorkspaceContentSection.tsx @@ -0,0 +1,46 @@ +import type { ComponentProps, ReactNode } from "react"; + +import { DocumentWorkspaceHeaderActionsSlot } from "./DocumentWorkspaceHeaderActionsSlot"; +import { DocumentWorkspacePanelContent } from "./DocumentWorkspacePanelContent"; +import { DocumentWorkspaceSectionCard } from "./DocumentWorkspaceSectionCard"; + +type DocumentWorkspaceSectionCardProps = ComponentProps< + typeof DocumentWorkspaceSectionCard +>; +type DocumentWorkspaceHeaderActionsProps = ComponentProps< + typeof DocumentWorkspaceHeaderActionsSlot +>; +type DocumentWorkspacePanelContentProps = ComponentProps< + typeof DocumentWorkspacePanelContent +>; + +export function DocumentWorkspaceContentSection({ + card, + footer, + headerActions, + panel, +}: { + card: Omit; + footer: ReactNode; + headerActions: DocumentWorkspaceHeaderActionsProps; + panel: DocumentWorkspacePanelContentProps; +}) { + return ( +
+ } + > +
+ +
+
+ {footer} +
+ ); +} diff --git a/furniture-3d-system/src/app/intake/non-integrated/workspaces/shared/archivePreviewRenderer.tsx b/furniture-3d-system/src/app/intake/non-integrated/workspaces/shared/archivePreviewRenderer.tsx new file mode 100644 index 00000000..0a406956 --- /dev/null +++ b/furniture-3d-system/src/app/intake/non-integrated/workspaces/shared/archivePreviewRenderer.tsx @@ -0,0 +1,39 @@ +import type { ReactNode } from "react"; + +import { ArchivePreviewPanel } from "./ArchivePreviewPanel"; + +type ArchivePreviewPanelRendererOptions = { + title: string; + description: string; + hasSelectedFile: boolean; + renderPreviewContent: () => ReactNode; +}; + +type ArchivePreviewPanelOverride = { + title?: string; + description?: string; + emptyTitle?: string; + emptyDescription?: string; +}; + +export function buildArchivePreviewPanelRenderer({ + title, + description, + hasSelectedFile, + renderPreviewContent, +}: ArchivePreviewPanelRendererOptions) { + return function renderArchivePreviewPanel( + options?: ArchivePreviewPanelOverride, + ) { + return ( + + ); + }; +} diff --git a/furniture-3d-system/src/app/intake/non-integrated/workspaces/style-assets/styleAssetWorkspaceRenderers.tsx b/furniture-3d-system/src/app/intake/non-integrated/workspaces/style-assets/styleAssetWorkspaceRenderers.tsx new file mode 100644 index 00000000..9344a2a3 --- /dev/null +++ b/furniture-3d-system/src/app/intake/non-integrated/workspaces/style-assets/styleAssetWorkspaceRenderers.tsx @@ -0,0 +1,24 @@ +import type { ComponentProps } from "react"; + +import { InstallationWorkspace } from "../InstallationWorkspace"; +import { PackagingWorkspace } from "./PackagingWorkspace"; + +type InstallationWorkspaceProps = ComponentProps; +type PackagingWorkspaceProps = ComponentProps; + +export function buildStyleAssetWorkspaceRenderers({ + installation, + packaging, +}: { + installation: InstallationWorkspaceProps; + packaging: PackagingWorkspaceProps; +}) { + return { + renderInstallationWorkspace() { + return ; + }, + renderPackagingWorkspace() { + return ; + }, + }; +}