@topconsultnpm/sdkui-react 6.22.0-t2 → 6.22.0-t3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +3 -3
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +1 -1
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +6 -6
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +15 -15
- package/lib/components/base/Styled.js +7 -5
- package/lib/components/base/TMAccordionNew.js +7 -7
- package/lib/components/base/TMAlert.d.ts +32 -32
- package/lib/components/base/TMAlert.js +6 -8
- package/lib/components/base/TMAreaManager.js +53 -55
- package/lib/components/base/TMButton.js +4 -4
- package/lib/components/base/TMClosableList.js +3 -3
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.d.ts +2 -0
- package/lib/components/base/TMDataGrid.js +35 -7
- package/lib/components/base/TMDropDownMenu.js +1 -1
- package/lib/components/base/TMFileManagerDataGridView.js +1 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +2 -2
- package/lib/components/base/TMLayout.d.ts +2 -2
- package/lib/components/base/TMLayout.js +3 -3
- package/lib/components/base/TMList.js +1 -1
- package/lib/components/base/TMListView.js +3 -3
- package/lib/components/base/TMModal.js +1 -1
- package/lib/components/base/TMPanel.js +8 -8
- package/lib/components/base/TMPopUp.js +2 -2
- package/lib/components/base/TMResizableMenu.js +2 -2
- package/lib/components/base/TMRightSidebar.js +1 -1
- package/lib/components/base/TMShowAllOrMaxItemsButton.js +1 -1
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMSpinner.js +9 -7
- package/lib/components/base/TMTab.js +2 -2
- package/lib/components/base/TMTabControl.d.ts +106 -0
- package/lib/components/base/TMTabControl.js +664 -0
- package/lib/components/base/TMToggleButton.js +2 -2
- package/lib/components/base/TMToolbarCard.js +3 -3
- package/lib/components/base/TMTreeView.js +35 -3
- package/lib/components/base/TMWaitPanel.js +3 -3
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +169 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.js +320 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +53 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.js +274 -0
- package/lib/components/base/waitPanel/index.d.ts +1 -0
- package/lib/components/base/waitPanel/index.js +1 -0
- package/lib/components/choosers/TMCultureIDPicker.js +2 -2
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemPicker.js +2 -2
- package/lib/components/choosers/TMDcmtTypeChooser.js +1 -1
- package/lib/components/choosers/TMDiskChooser.js +1 -1
- package/lib/components/choosers/TMDistinctValues.js +28 -19
- package/lib/components/choosers/TMDynDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMImageIDChooser.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +2 -2
- package/lib/components/choosers/TMPathChooser.js +17 -34
- package/lib/components/choosers/TMQuickSearchInfo.js +4 -4
- package/lib/components/choosers/TMQuickSearchSettingsForm.js +1 -1
- package/lib/components/choosers/TMRelationChooser.js +1 -1
- package/lib/components/choosers/TMSelectedValuesSummary.js +1 -3
- package/lib/components/choosers/TMUserChooser.js +1 -1
- package/lib/components/editors/TMCheckBox.js +1 -1
- package/lib/components/editors/TMDropDown.js +7 -7
- package/lib/components/editors/TMEditorStyled.d.ts +1 -1
- package/lib/components/editors/TMFormulaEditor.js +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.js +1 -1
- package/lib/components/editors/TMLocalizedTextBox.js +1 -1
- package/lib/components/editors/TMMetadataValues.js +6 -6
- package/lib/components/editors/TMRadioButton.js +2 -2
- package/lib/components/editors/TMSummary.js +3 -3
- package/lib/components/editors/TMTextArea.js +3 -3
- package/lib/components/editors/TMTextBox.js +3 -3
- package/lib/components/editors/TMTextExpression.js +1 -1
- package/lib/components/features/archive/TMArchive.js +7 -2
- package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +29 -0
- package/lib/components/features/assistant/TMHelpOnLineChat.js +1384 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +4 -4
- package/lib/components/features/assistant/TMToppySpeechBubble.js +1 -1
- package/lib/components/features/assistant/dataset/Designer-Suggested-Questions.json +102 -0
- package/lib/components/features/assistant/dataset/Login-Suggested-Questions.json +32 -0
- package/lib/components/features/assistant/dataset/Surfer-Suggested-Questions.json +102 -0
- package/lib/components/features/documents/TMBatchUpdateForm.js +4 -5
- package/lib/components/features/documents/TMCopyToFolderForm.js +50 -42
- package/lib/components/features/documents/TMDcmtForm.js +53 -64
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +2 -2
- package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -3
- package/lib/components/features/documents/TMDcmtIcon.js +3 -5
- package/lib/components/features/documents/TMDcmtPreview.js +6 -4
- package/lib/components/features/documents/TMDcmtTasks.js +2 -9
- package/lib/components/features/documents/TMDownloadRelationViewerSection.js +1 -1
- package/lib/components/features/documents/TMFileUploader.js +7 -7
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +55 -130
- package/lib/components/features/documents/TMMasterInfoFields.js +4 -5
- package/lib/components/features/documents/TMMergeToPdfForm.js +56 -54
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +3 -6
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +1 -1
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +4 -4
- package/lib/components/features/documents/TMRelationViewer.d.ts +16 -9
- package/lib/components/features/documents/TMRelationViewer.js +240 -168
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +1 -1
- package/lib/components/features/documents/relationTreeState.d.ts +32 -0
- package/lib/components/features/documents/relationTreeState.js +89 -0
- package/lib/components/features/search/TMMetadataOutputForm.js +1 -1
- package/lib/components/features/search/TMMetadataSorterForm.js +1 -1
- package/lib/components/features/search/TMSavedQuerySelector.js +2 -2
- package/lib/components/features/search/TMSearch.d.ts +1 -1
- package/lib/components/features/search/TMSearch.js +71 -12
- package/lib/components/features/search/TMSearchQueryEditor.js +2 -2
- package/lib/components/features/search/TMSearchQueryPanel.js +1 -5
- package/lib/components/features/search/TMSearchResult.d.ts +5 -0
- package/lib/components/features/search/TMSearchResult.js +34 -18
- package/lib/components/features/search/TMSignatureInfoContent.js +1 -1
- package/lib/components/features/search/TMTreeSelector.js +38 -36
- package/lib/components/features/search/TMViewHistoryDcmt.js +14 -25
- package/lib/components/features/tasks/TMTaskForm.js +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.js +3 -3
- package/lib/components/features/tasks/TMTasksAgenda.js +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
- package/lib/components/features/tasks/TMTasksHeader.js +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.js +1 -1
- package/lib/components/features/tasks/TMTasksView.js +97 -102
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +92 -92
- package/lib/components/features/workflow/TMWorkflowPopup.js +2 -2
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +4 -4
- package/lib/components/forms/Login/Menu.js +1 -1
- package/lib/components/forms/Login/OTPReader.js +1 -1
- package/lib/components/forms/Login/PasswordStrengthChecker.js +1 -1
- package/lib/components/forms/Login/RapidAccessLogin.js +2 -2
- package/lib/components/forms/Login/RecoverPasswordFlow.js +2 -2
- package/lib/components/forms/Login/SelectBox.js +1 -1
- package/lib/components/forms/Login/StepIndicator.js +1 -1
- package/lib/components/forms/Login/TMLoginForm.js +7 -7
- package/lib/components/forms/Login/TextBox.js +1 -1
- package/lib/components/forms/TMApplyForm.js +3 -3
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/forms/TMResultDialog.js +1 -1
- package/lib/components/forms/TMSaveForm.js +3 -3
- package/lib/components/grids/TMBlogAttachments.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +92 -96
- package/lib/components/grids/TMBlogsPostUtils.js +1 -1
- package/lib/components/grids/TMRecentsManager.js +4 -4
- package/lib/components/grids/TMValidationItemsList.js +1 -1
- package/lib/components/index.d.ts +6 -0
- package/lib/components/index.js +5 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +3 -3
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +1 -1
- package/lib/components/layout/panelManager/TMPanelWrapper.js +1 -1
- package/lib/components/pages/TMPage.js +30 -32
- package/lib/components/query/TMQueryCountButton.js +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +3 -0
- package/lib/components/query/TMQueryEditor.js +9 -8
- package/lib/components/sidebar/TMCommandsPanel.js +1 -1
- package/lib/components/sidebar/TMHeader.d.ts +1 -0
- package/lib/components/sidebar/TMHeader.js +9 -9
- package/lib/components/sidebar/TMSidebar.js +1 -1
- package/lib/components/sidebar/TMSidebarItem.js +1 -1
- package/lib/components/viewers/TMMidViewer.js +2 -2
- package/lib/components/viewers/TMTidViewer.js +3 -3
- package/lib/components/wizard/TMStepIndicator.js +3 -3
- package/lib/helper/Enum_Localizator.d.ts +4 -4
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/Globalization.d.ts +1 -1
- package/lib/helper/SDKUI_Localizator.d.ts +736 -712
- package/lib/helper/SDKUI_Localizator.js +240 -0
- package/lib/helper/TMAppUpdatedModal.js +2 -2
- package/lib/helper/TMIcons.js +1 -3
- package/lib/helper/TMPdfViewer.js +1 -1
- package/lib/helper/TMToppyMessage.js +1 -1
- package/lib/helper/TMUtils.js +1 -1
- package/lib/helper/ZipManager.d.ts +1 -1
- package/lib/helper/ZipManager.js +2 -1
- package/lib/helper/checkinCheckoutManager.d.ts +1 -1
- package/lib/helper/checkinCheckoutManager.js +1 -1
- package/lib/helper/dcmtsHelper.d.ts +4 -2
- package/lib/helper/dcmtsHelper.js +3 -1
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/helper/helpers.js +2 -2
- package/lib/hooks/tmDistinctValuesGridHelper.d.ts +1 -1
- package/lib/hooks/useCaseFlowApprove.d.ts +3 -3
- package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
- package/lib/hooks/useCheckInOutOperations.js +14 -34
- package/lib/hooks/useDcmtOperations.d.ts +3 -12
- package/lib/hooks/useDcmtOperations.js +187 -179
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +16 -27
- package/lib/hooks/useInputDialog.js +1 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +1 -16
- package/lib/hooks/useMultiMasterDetailDcmts.js +65 -67
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/hooks/useQueryParametersDialog.js +1 -1
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/services/caseflow/CaseFlowService.d.ts +47 -6
- package/lib/services/caseflow/CaseFlowService.js +82 -14
- package/lib/services/platform_services.d.ts +4 -4
- package/package.json +9 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { DcmtTypeListCacheService, LayoutModes, ObjectClasses, SDK_Globals, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import TMRelationViewer from './TMRelationViewer';
|
|
@@ -14,12 +14,13 @@ import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/p
|
|
|
14
14
|
import TMSearchResult from '../search/TMSearchResult';
|
|
15
15
|
import TMDcmtForm from './TMDcmtForm';
|
|
16
16
|
import { TMNothingToShow } from './TMDcmtPreview';
|
|
17
|
-
import { TMButton
|
|
17
|
+
import { TMButton } from '../..';
|
|
18
|
+
import TMLayoutContainer from '../../base/TMLayout';
|
|
18
19
|
import { useDocumentOperations } from '../../../hooks/useDocumentOperations';
|
|
19
20
|
import TMToppyMessage from '../../../helper/TMToppyMessage';
|
|
20
21
|
import TMPanel from '../../base/TMPanel';
|
|
21
|
-
import
|
|
22
|
-
const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, deviceType, inputDcmts, isForMaster, showCurrentDcmtIndicator = true, allowNavigation, canNext, canPrev, onNext, onPrev, onBack, appendMasterDcmts, onTaskCreateRequest, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, datagridUtility, dcmtUtility, fetchRemoteCertificates }) => {
|
|
22
|
+
import TMSpinner from '../../base/TMSpinner';
|
|
23
|
+
const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, deviceType, inputDcmts, isForMaster, showCurrentDcmtIndicator = true, allowNavigation, canNext, canPrev, onNext, onPrev, onBack, onFirstLoadCompleted, appendMasterDcmts, onTaskCreateRequest, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, datagridUtility, dcmtUtility, fetchRemoteCertificates }) => {
|
|
23
24
|
const floatingBarContainerRef = useRef(null);
|
|
24
25
|
const [focusedItem, setFocusedItem] = useState();
|
|
25
26
|
const [selectedItems, setSelectedItems] = useState([]);
|
|
@@ -45,6 +46,13 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
45
46
|
const [refreshKey, setRefreshKey] = useState(0);
|
|
46
47
|
// Separate refresh key for TMFormOrResultWrapper only (doesn't affect tmTreeView)
|
|
47
48
|
const [refreshKeyFormOrResult, setRefreshKeyFormOrResult] = useState(0);
|
|
49
|
+
// Stato dell'albero conservato qui perché il bump di refreshKey rimonta TMRelationViewer:
|
|
50
|
+
// una ref interna al viewer non sopravvivrebbe. Riletto dal useMemo di tmTreeView,
|
|
51
|
+
// che si ricalcola proprio al refresh.
|
|
52
|
+
const treeStateRef = useRef(undefined);
|
|
53
|
+
const handleTreeStateChange = useCallback((state) => {
|
|
54
|
+
treeStateRef.current = state;
|
|
55
|
+
}, []);
|
|
48
56
|
/** State for transformed focusedItem metadata values (similar to formData in TMDcmtForm) */
|
|
49
57
|
const [focusedItemFormData, setFocusedItemFormData] = useState([]);
|
|
50
58
|
// Trigger operationItems refresh (after file substitution, etc.)
|
|
@@ -64,6 +72,24 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
64
72
|
setIsCheckingFirstLoad(false);
|
|
65
73
|
}
|
|
66
74
|
}, [isRelationViewerLoading, isCheckingFirstLoad]);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (!isCheckingFirstLoad)
|
|
77
|
+
onFirstLoadCompleted?.();
|
|
78
|
+
}, [isCheckingFirstLoad, onFirstLoadCompleted]);
|
|
79
|
+
// Dal montaggio fino all'apertura del wait panel del viewer (il tempo di caricare i
|
|
80
|
+
// tipi documento) la pagina resta nascosta: senza spinner non si vedrebbe nulla.
|
|
81
|
+
const [waitingFirstLoad, setWaitingFirstLoad] = useState(true);
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (!waitingFirstLoad)
|
|
84
|
+
return;
|
|
85
|
+
// Da qui in avanti e' il wait panel a dare riscontro
|
|
86
|
+
if (isRelationViewerLoading) {
|
|
87
|
+
setWaitingFirstLoad(false);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
TMSpinner.show({ description: SDKUI_Localizator.Loading });
|
|
91
|
+
return () => TMSpinner.hide();
|
|
92
|
+
}, [waitingFirstLoad, isRelationViewerLoading]);
|
|
67
93
|
// Increments trigger counter to force operationItems to re-calculate
|
|
68
94
|
const onRefreshOperationsDatagrid = useCallback(async () => {
|
|
69
95
|
setRefreshOperationsTrigger(prev => prev + 1);
|
|
@@ -72,12 +98,6 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
72
98
|
const handleStopCalculationReady = useCallback((stopCalculation) => {
|
|
73
99
|
stopRelationsCalculationRef.current = stopCalculation;
|
|
74
100
|
}, []);
|
|
75
|
-
// Interrompe il calcolo delle correlazioni: mostra subito quelle già calcolate
|
|
76
|
-
// senza attendere le restanti chiamate GetMetadata
|
|
77
|
-
const handleStopRelationsCalculation = useCallback(() => {
|
|
78
|
-
stopRelationsCalculationRef.current?.();
|
|
79
|
-
setIsCheckingFirstLoad(false); // Nasconde l'overlay e mostra l'albero (parziale)
|
|
80
|
-
}, []);
|
|
81
101
|
// Esce dalla maschera interrompendo anche le chiamate GetMetadata ancora in coda:
|
|
82
102
|
// l'interruzione è invocata in modo sincrono perché onBack può smontare il componente
|
|
83
103
|
// (un effect non farebbe in tempo a propagare l'interruzione)
|
|
@@ -86,18 +106,30 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
86
106
|
stopRelationsCalculationRef.current?.();
|
|
87
107
|
onBack?.();
|
|
88
108
|
}, [onBack]);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
// Notifica all'utente che i dati mostrati sono parziali
|
|
94
|
-
const handleRelationsCalculationStopped = useCallback(() => {
|
|
109
|
+
// Letta da handleRelationsCalculationStopped, che deve restare stabile: arriva fino
|
|
110
|
+
// alle dipendenze di loadData nel viewer, dove un cambio farebbe ripartire il calcolo
|
|
111
|
+
const handleBackRef = useRef(handleBack);
|
|
112
|
+
handleBackRef.current = handleBack;
|
|
113
|
+
// Notifica all'utente che i dati mostrati sono parziali
|
|
114
|
+
const handleRelationsCalculationStopped = useCallback((loadedCount, totalCount) => {
|
|
95
115
|
if (isLeavingRef.current)
|
|
96
116
|
return;
|
|
117
|
+
// Interrotto prima di calcolare qualcosa: non c'è nulla da mostrare, si torna indietro
|
|
118
|
+
if (loadedCount === 0) {
|
|
119
|
+
ShowAlert({
|
|
120
|
+
message: SDKUI_Localizator.RelationsCalculationStoppedEmpty,
|
|
121
|
+
title: SDKUI_Localizator.Attention,
|
|
122
|
+
duration: 6000,
|
|
123
|
+
mode: 'warning',
|
|
124
|
+
});
|
|
125
|
+
handleBackRef.current();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
// Testo breve: il box di ShowAlert ha altezza fissa e taglia oltre le due righe
|
|
97
129
|
ShowAlert({
|
|
98
|
-
message: SDKUI_Localizator.
|
|
130
|
+
message: SDKUI_Localizator.RelationsCalculationStoppedProgress.replaceParams(loadedCount.toString(), totalCount.toString()),
|
|
99
131
|
title: SDKUI_Localizator.Attention,
|
|
100
|
-
duration:
|
|
132
|
+
duration: 6000,
|
|
101
133
|
mode: 'info',
|
|
102
134
|
});
|
|
103
135
|
}, []);
|
|
@@ -275,7 +307,6 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
275
307
|
onRefreshAfterAddDcmtToFavs,
|
|
276
308
|
},
|
|
277
309
|
});
|
|
278
|
-
const { dcmtOperations: { abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, }, } = features;
|
|
279
310
|
// Nuovi documenti in input: il componente non sta più uscendo dalla maschera
|
|
280
311
|
// (chiave stabile: l'array inputDcmts può essere ricreato a ogni render)
|
|
281
312
|
const inputDcmtsKey = useMemo(() => (inputDcmts ?? []).map(d => `${d.TID}-${d.DID}`).join('|'), [inputDcmts]);
|
|
@@ -379,11 +410,11 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
379
410
|
setContextMenuVisible(true);
|
|
380
411
|
}, children: [_jsx(TMRelationViewerWrapper, { refreshKey: refreshKey, inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, showZeroDcmts: showZeroDcmts,
|
|
381
412
|
// customItemRender={customItemRender}
|
|
382
|
-
allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: handleSelectedItemsChanged, onNoRelationsFound: handleNoRelationsFound, onItemContextMenu: isRelationViewerLoading ? undefined : onItemContextMenu,
|
|
413
|
+
allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: handleSelectedItemsChanged, onNoRelationsFound: handleNoRelationsFound, onItemContextMenu: isRelationViewerLoading ? undefined : onItemContextMenu, onLoadingStateChanged: setIsRelationViewerLoading, onStopCalculationReady: handleStopCalculationReady, onCalculationStopped: handleRelationsCalculationStopped, initialTreeState: treeStateRef.current, onTreeStateChange: handleTreeStateChange }), _jsx(TMContextMenu, { items: operationItems, externalControl: {
|
|
383
414
|
visible: contextMenuVisible,
|
|
384
415
|
position: contextMenuPosition,
|
|
385
416
|
onClose: () => setContextMenuVisible(false)
|
|
386
|
-
} })] }) }), [inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, allowMultipleSelection, focusedItem, selectedItems, handleFocusedItemChanged, handleSelectedItemsChanged, handleNoRelationsFound, onItemContextMenu, contextMenuVisible, contextMenuPosition, refreshKey, focusedItemFormData, isRelationViewerLoading, handleStopCalculationReady, handleRelationsCalculationStopped]);
|
|
417
|
+
} })] }) }), [inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, allowMultipleSelection, focusedItem, selectedItems, handleFocusedItemChanged, handleSelectedItemsChanged, handleNoRelationsFound, onItemContextMenu, contextMenuVisible, contextMenuPosition, refreshKey, focusedItemFormData, isRelationViewerLoading, handleStopCalculationReady, handleRelationsCalculationStopped, handleTreeStateChange]);
|
|
387
418
|
const tmFormOrResult = useMemo(() => _jsx(TMFormOrResultWrapper, { refreshKey: refreshKeyFormOrResult, deviceType: deviceType, focusedItem: focusedItem, onTaskCreateRequest: onTaskCreateRequest, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, handleNavigateToReference: handleNavigateToReference, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onRefreshSearchResults: onRefreshAllPanels }), [focusedItem, deviceType, allTasks, handleNavigateToWGs, handleNavigateToDossiers, handleNavigateToReference, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshAfterAddDcmtToFavs, refreshKeyFormOrResult]);
|
|
388
419
|
const initialPanelDimensions = {
|
|
389
420
|
'tmTreeView': { width: '50%', height: '100%' },
|
|
@@ -463,7 +494,7 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
463
494
|
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: false, orderNumber: 2, isActive: allInitialPanelVisibility['tmFormOrResult'] }
|
|
464
495
|
}
|
|
465
496
|
], [tmTreeView, tmFormOrResult, focusedItem?.isDcmt, dtdMaster]);
|
|
466
|
-
return (
|
|
497
|
+
return (_jsx("div", { style: { width: '100%', height: '100%', position: 'relative' }, children: _jsxs("div", { style: isCheckingFirstLoad ? { position: 'absolute', width: 0, height: 0, overflow: 'hidden', opacity: 0, pointerEvents: 'none' } : { width: '100%', height: '100%' }, children: [_jsx(TMLayoutContainer, { direction: 'vertical', children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmTreeView', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }), renderDcmtOperations, renderFloatingBar] }) }));
|
|
467
498
|
};
|
|
468
499
|
export default TMMasterDetailDcmts;
|
|
469
500
|
/**
|
|
@@ -472,7 +503,7 @@ export default TMMasterDetailDcmts;
|
|
|
472
503
|
* - Panel visibility toggling
|
|
473
504
|
* - Focus delay handling
|
|
474
505
|
*/
|
|
475
|
-
const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, customItemRender, allowMultipleSelection, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onNoRelationsFound, onItemContextMenu,
|
|
506
|
+
const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, customItemRender, allowMultipleSelection, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onNoRelationsFound, onItemContextMenu, onLoadingStateChanged, onStopCalculationReady, onCalculationStopped, initialTreeState, onTreeStateChange }) => {
|
|
476
507
|
const { setPanelVisibilityById, setToolbarButtonVisibility } = useTMPanelManagerContext();
|
|
477
508
|
// Monitor device type changes to restore panel visibility when switching from mobile to desktop
|
|
478
509
|
const deviceType = useDeviceType();
|
|
@@ -532,7 +563,7 @@ const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurr
|
|
|
532
563
|
onItemContextMenu?.(item, e);
|
|
533
564
|
}, 100);
|
|
534
565
|
}, [onItemContextMenu, handleFocusedItemChanged]);
|
|
535
|
-
return (_jsx(TMRelationViewer, { inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, initialShowZeroDcmts: showZeroDcmts, customItemRender: customItemRender, allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: onSelectedItemsChanged, maxDepthLevel: 1, invertMasterNavigation: false, showExpandAllButton: true, onNoRelationsFound: onNoRelationsFound, onItemContextMenu: onContextMenu,
|
|
566
|
+
return (_jsx(TMRelationViewer, { inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, initialShowZeroDcmts: showZeroDcmts, customItemRender: customItemRender, allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: onSelectedItemsChanged, maxDepthLevel: 1, invertMasterNavigation: false, showExpandAllButton: true, onNoRelationsFound: onNoRelationsFound, onItemContextMenu: onContextMenu, onLoadingStateChanged: onLoadingStateChanged, onStopCalculationReady: onStopCalculationReady, onCalculationStopped: onCalculationStopped, initialTreeState: initialTreeState, onTreeStateChange: onTreeStateChange }, refreshKey));
|
|
536
567
|
};
|
|
537
568
|
const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCreateRequest, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshSearchAsyncDatagrid, onRefreshSearchResults, handleNavigateToReference, fetchRemoteCertificates }) => {
|
|
538
569
|
const { setPanelVisibilityById } = useTMPanelManagerContext();
|
|
@@ -542,109 +573,3 @@ const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCrea
|
|
|
542
573
|
}, fetchRemoteCertificates: fetchRemoteCertificates }, refreshKey) :
|
|
543
574
|
focusedItem?.searchResult === undefined ? (_jsx(TMPanel, { title: SDKUI_Localizator.SearchResult, children: _jsx(TMToppyMessage, { message: SDKUI_Localizator.SelectDocumentToViewSearchResults }) })) : (_jsx(TMSearchResult, { groupId: 'tmFormOrResult', isClosable: deviceType !== DeviceType.MOBILE, context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, showDcmtFormSidebar: false, autoFocusFirstRow: false, onTaskCreateRequest: onTaskCreateRequest, onClose: () => { setPanelVisibilityById('tmTreeView', true); }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, enablePinIcons: false, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, showBackButton: false, onRefreshSearchAsyncDatagrid: onRefreshSearchResults, onReferenceClick: handleNavigateToReference, fetchRemoteCertificates: fetchRemoteCertificates }, refreshKey)) }));
|
|
544
575
|
};
|
|
545
|
-
const TMLoadingOverlay = ({ onCancel, onStop, description, cancelText, stopText }) => {
|
|
546
|
-
return (_jsx("div", { style: {
|
|
547
|
-
position: 'absolute',
|
|
548
|
-
top: 0,
|
|
549
|
-
left: 0,
|
|
550
|
-
width: '100%',
|
|
551
|
-
height: '100%',
|
|
552
|
-
backgroundColor: 'rgba(248, 250, 252, 0.92)',
|
|
553
|
-
zIndex: 1000,
|
|
554
|
-
display: 'flex',
|
|
555
|
-
justifyContent: 'center',
|
|
556
|
-
alignItems: 'center',
|
|
557
|
-
}, children: _jsxs("div", { style: {
|
|
558
|
-
display: 'flex',
|
|
559
|
-
flexDirection: 'column',
|
|
560
|
-
alignItems: 'center',
|
|
561
|
-
gap: '16px',
|
|
562
|
-
padding: '24px 32px',
|
|
563
|
-
background: '#fcfcfc',
|
|
564
|
-
borderRadius: '8px',
|
|
565
|
-
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.1)',
|
|
566
|
-
}, children: [_jsxs("div", { style: { position: 'relative', width: '80px', height: '80px' }, children: [_jsx("img", { style: {
|
|
567
|
-
position: 'absolute',
|
|
568
|
-
top: '50%',
|
|
569
|
-
left: '50%',
|
|
570
|
-
transform: 'translate(-54%, -54%)'
|
|
571
|
-
}, src: sixLogo, width: 35, alt: "" }), _jsx("style", { children: `
|
|
572
|
-
@keyframes tmSpinnerRotate {
|
|
573
|
-
0% { transform: rotate(0deg); }
|
|
574
|
-
100% { transform: rotate(360deg); }
|
|
575
|
-
}
|
|
576
|
-
.tm-spinner-animation {
|
|
577
|
-
display: inline-block;
|
|
578
|
-
width: 80px;
|
|
579
|
-
height: 80px;
|
|
580
|
-
position: absolute;
|
|
581
|
-
top: 50%;
|
|
582
|
-
left: 50%;
|
|
583
|
-
transform: translate(-50%, -50%);
|
|
584
|
-
}
|
|
585
|
-
.tm-spinner-animation div {
|
|
586
|
-
animation: tmSpinnerRotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
|
587
|
-
transform-origin: 40px 40px;
|
|
588
|
-
}
|
|
589
|
-
.tm-spinner-animation div:after {
|
|
590
|
-
content: " ";
|
|
591
|
-
display: block;
|
|
592
|
-
position: absolute;
|
|
593
|
-
width: 7px;
|
|
594
|
-
height: 7px;
|
|
595
|
-
border-radius: 50%;
|
|
596
|
-
background: #0c448e;
|
|
597
|
-
margin: -4px 0 0 -4px;
|
|
598
|
-
}
|
|
599
|
-
.tm-spinner-animation div:nth-child(1) { animation-delay: -0.036s; }
|
|
600
|
-
.tm-spinner-animation div:nth-child(1):after { top: 63px; left: 63px; background: #f7a51f; }
|
|
601
|
-
.tm-spinner-animation div:nth-child(2) { animation-delay: -0.072s; }
|
|
602
|
-
.tm-spinner-animation div:nth-child(2):after { top: 68px; left: 56px; background: #f7a51f; }
|
|
603
|
-
.tm-spinner-animation div:nth-child(3) { animation-delay: -0.108s; }
|
|
604
|
-
.tm-spinner-animation div:nth-child(3):after { top: 71px; left: 48px; background: #d3237b; }
|
|
605
|
-
.tm-spinner-animation div:nth-child(4) { animation-delay: -0.144s; }
|
|
606
|
-
.tm-spinner-animation div:nth-child(4):after { top: 72px; left: 40px; background: #d3237b; }
|
|
607
|
-
.tm-spinner-animation div:nth-child(5) { animation-delay: -0.18s; }
|
|
608
|
-
.tm-spinner-animation div:nth-child(5):after { top: 71px; left: 32px; background: #d12a1c; }
|
|
609
|
-
.tm-spinner-animation div:nth-child(6) { animation-delay: -0.216s; }
|
|
610
|
-
.tm-spinner-animation div:nth-child(6):after { top: 68px; left: 24px; background: #d12a1c; }
|
|
611
|
-
.tm-spinner-animation div:nth-child(7) { animation-delay: -0.252s; }
|
|
612
|
-
.tm-spinner-animation div:nth-child(7):after { top: 63px; left: 17px; background: #782b7d; }
|
|
613
|
-
.tm-spinner-animation div:nth-child(8) { animation-delay: -0.288s; }
|
|
614
|
-
.tm-spinner-animation div:nth-child(8):after { top: 56px; left: 12px; background: #782b7d; }
|
|
615
|
-
` }), _jsxs("div", { className: "tm-spinner-animation", children: [_jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {})] })] }), _jsx("span", { style: { fontSize: '14px', color: '#334155', textAlign: 'center' }, children: description ?? SDKUI_Localizator.Loading }), (onStop || onCancel) && (_jsxs("div", { style: { marginTop: '4px', display: 'flex', alignItems: 'center', justifyContent: 'center', flexWrap: 'wrap', gap: '10px' }, children: [onStop && (_jsx("button", { onClick: onStop, title: SDKUI_Localizator.StopRelationsCalculation, style: {
|
|
616
|
-
padding: '8px 24px',
|
|
617
|
-
fontSize: '13px',
|
|
618
|
-
fontWeight: 500,
|
|
619
|
-
color: 'white',
|
|
620
|
-
background: '#0c448e',
|
|
621
|
-
border: '1.5px solid #0c448e',
|
|
622
|
-
borderRadius: '6px',
|
|
623
|
-
cursor: 'pointer',
|
|
624
|
-
transition: 'all 0.2s ease',
|
|
625
|
-
}, onMouseEnter: (e) => {
|
|
626
|
-
e.currentTarget.style.background = '#0a3872';
|
|
627
|
-
e.currentTarget.style.borderColor = '#0a3872';
|
|
628
|
-
}, onMouseLeave: (e) => {
|
|
629
|
-
e.currentTarget.style.background = '#0c448e';
|
|
630
|
-
e.currentTarget.style.borderColor = '#0c448e';
|
|
631
|
-
}, children: stopText ?? SDKUI_Localizator.ShowPartialResults })), onCancel && (_jsx("button", { onClick: onCancel, style: {
|
|
632
|
-
padding: '8px 24px',
|
|
633
|
-
fontSize: '13px',
|
|
634
|
-
fontWeight: 500,
|
|
635
|
-
color: '#64748b',
|
|
636
|
-
background: 'transparent',
|
|
637
|
-
border: '1.5px solid #cbd5e1',
|
|
638
|
-
borderRadius: '6px',
|
|
639
|
-
cursor: 'pointer',
|
|
640
|
-
transition: 'all 0.2s ease',
|
|
641
|
-
}, onMouseEnter: (e) => {
|
|
642
|
-
e.currentTarget.style.background = '#f1f5f9';
|
|
643
|
-
e.currentTarget.style.borderColor = '#94a3b8';
|
|
644
|
-
e.currentTarget.style.color = '#475569';
|
|
645
|
-
}, onMouseLeave: (e) => {
|
|
646
|
-
e.currentTarget.style.background = 'transparent';
|
|
647
|
-
e.currentTarget.style.borderColor = '#cbd5e1';
|
|
648
|
-
e.currentTarget.style.color = '#64748b';
|
|
649
|
-
}, children: cancelText ?? SDKUI_Localizator.Back }))] }))] }) }));
|
|
650
|
-
};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { DataListViewModes, MetadataDataDomains, SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { hoverStyle, IconChevronDown, IconClearButton, IconCopy, IconSearch, IconSuccess, SDKUI_Localizator } from '../../../helper';
|
|
5
|
-
import { formatScalarValue, getUserMetadataSorted } from '../../../helper/dcmtsHelper';
|
|
5
|
+
import { canViewMetadata, formatScalarValue, getUserMetadataSorted } from '../../../helper/dcmtsHelper';
|
|
6
6
|
import { useDataListItem } from '../../../hooks/useDataListItem';
|
|
7
7
|
import { TMColors } from '../../../utils/theme';
|
|
8
8
|
import ShowAlert from '../../base/TMAlert';
|
|
@@ -84,7 +84,8 @@ const TMMasterInfoFields = ({ dtd, dcmt, getValuesByMidAsync, reloadToken, isExp
|
|
|
84
84
|
setRows([]);
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
// I metadati che l'utente non può vedere non si mostrano, come nel risultato di ricerca
|
|
88
|
+
const metadata = getUserMetadataSorted(dtd).filter(canViewMetadata);
|
|
88
89
|
// Precarica le liste dati referenziate dai metadati, così le card mostrano subito il valore leggibile
|
|
89
90
|
const dataListIDs = new Set();
|
|
90
91
|
metadata.forEach(md => { if (md.dataDomain === MetadataDataDomains.DataList && md.dataListID)
|
|
@@ -158,9 +159,7 @@ const TMMasterInfoFields = ({ dtd, dcmt, getValuesByMidAsync, reloadToken, isExp
|
|
|
158
159
|
const hasValue = item.value !== undefined && item.value !== null && item.value !== '';
|
|
159
160
|
const displayNode = item.dataListID > 0 && hasValue ? renderDataListCell(item.value, item.dataListID, item.viewMode) : (hasValue ? formatScalarValue(item.value, item.dataType, item.format, item.formatCulture) : '');
|
|
160
161
|
return (_jsx(MetadataCard, { caption: item.caption, copyText: getCopyText(item), children: hasValue
|
|
161
|
-
? (
|
|
162
|
-
// Tooltip con il valore esteso (utile quando è troncato)
|
|
163
|
-
_jsx(TMTooltip, { content: displayNode, parentStyle: { flex: 1, minWidth: 0 }, childStyle: { maxWidth: '100%', minWidth: 0 }, children: _jsx("span", { style: { ...styles.value, minWidth: 0 }, children: displayNode }) }))
|
|
162
|
+
? (_jsx(TMTooltip, { content: displayNode, parentStyle: { flex: 1, minWidth: 0 }, childStyle: { maxWidth: '100%', minWidth: 0 }, children: _jsx("span", { style: { ...styles.value, minWidth: 0 }, children: displayNode }) }))
|
|
164
163
|
// Segnaposto per i metadati vuoti: la card mantiene la stessa altezza
|
|
165
164
|
: _jsx("span", { style: { ...styles.value, ...styles.emptyValue }, children: "\u2014" }) }, item.mid));
|
|
166
165
|
};
|
|
@@ -2,14 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useState } from 'react';
|
|
3
3
|
import { DownloadTypes } from '../../../ts';
|
|
4
4
|
import { calcResponsiveSizes, getExceptionMessage, IconFolderOpen, IconPlay, IconUndo, SDKUI_Globals, SDKUI_Localizator, } from '../../../helper';
|
|
5
|
-
import { DcmtOpers, FileFormats, GeneralRetrieveFormats, InvoiceRetrieveFormats, OrderRetrieveFormats, ResultTypes,
|
|
5
|
+
import { DcmtOpers, FileFormats, GeneralRetrieveFormats, InvoiceRetrieveFormats, OrderRetrieveFormats, ResultTypes, ValidationItem, } from '@topconsultnpm/sdk-ts';
|
|
6
6
|
import TMModal from '../../base/TMModal';
|
|
7
7
|
import { useDeviceType } from '../../base/TMDeviceProvider';
|
|
8
8
|
import TMTextBox from '../../editors/TMTextBox';
|
|
9
9
|
import { ButtonNames, TMMessageBoxManager } from '../../base/TMPopUp';
|
|
10
10
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
11
|
-
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
|
12
11
|
import { TMSplitterLayout } from '../../base/TMLayout';
|
|
12
|
+
import TMWaitPanelManager from '../../base/waitPanel/TMWaitPanelManager';
|
|
13
13
|
import { TMColors } from '../../../utils/theme';
|
|
14
14
|
import TMDownloadRelationViewerSection from './TMDownloadRelationViewerSection';
|
|
15
15
|
import { getDcmtInfosToDownload, getFloatingLabelStyle, isDirectoryPickerSupported, MIN_PDF_FOR_MERGE, } from './copyAndMergeDcmtsShared';
|
|
@@ -50,16 +50,12 @@ const toPdfOrderRetrieveFormat = (format) => {
|
|
|
50
50
|
*/
|
|
51
51
|
const TMMergeToPdfForm = (props) => {
|
|
52
52
|
const { mode, selectedDcmtInfos, selectedItemsFull, onClose, showTMRelationViewer, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers } = props;
|
|
53
|
-
|
|
53
|
+
// Il wait panel del download lo apre e lo aggiorna l'hook: qui serve solo la funzione.
|
|
54
|
+
const { downloadDcmtsAsync } = useDcmtOperations();
|
|
54
55
|
const deviceType = useDeviceType();
|
|
55
56
|
const [pdfFileName, setPdfFileName] = useState(`${SDKUI_Localizator.Result.toLowerCase()}.pdf`);
|
|
56
57
|
const [destinationFolder, setDestinationFolder] = useState('Download');
|
|
57
58
|
const [selectedItemsRelationViewer, setSelectedItemsRelationViewer] = useState([]);
|
|
58
|
-
// ---- Stato per il merge PDF (progress bar) ----
|
|
59
|
-
const [isMergingPdf, setIsMergingPdf] = useState(false);
|
|
60
|
-
const [mergeProgressText, setMergeProgressText] = useState('');
|
|
61
|
-
const [mergeProgressValue, setMergeProgressValue] = useState(0);
|
|
62
|
-
const [mergeProgressMax, setMergeProgressMax] = useState(0);
|
|
63
59
|
// ---- Ref per la selezione cartella (File System Access API) ----
|
|
64
60
|
const folderHandleRef = useRef(null);
|
|
65
61
|
const skipSelectFolderRef = useRef(false);
|
|
@@ -156,32 +152,36 @@ const TMMergeToPdfForm = (props) => {
|
|
|
156
152
|
// Raccoglie gli errori come downloadDcmtsAsync
|
|
157
153
|
const metadataConversionResults = [];
|
|
158
154
|
if (metadataOnlyDcmts.length > 0) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
155
|
+
const metadataPanel = TMWaitPanelManager.show({
|
|
156
|
+
title: SDKUI_Localizator.MergeToPdf,
|
|
157
|
+
subtitle: 'Creazione PDF metadati...',
|
|
158
|
+
max: metadataOnlyDcmts.length,
|
|
159
|
+
});
|
|
163
160
|
for (let i = 0; i < metadataOnlyDcmts.length; i++) {
|
|
164
161
|
const dcmt = metadataOnlyDcmts[i];
|
|
165
162
|
try {
|
|
166
|
-
|
|
167
|
-
setMergeProgressText(`Creazione PDF metadati... (${i + 1}/${metadataOnlyDcmts.length})`);
|
|
163
|
+
metadataPanel.setSubtitle(`Creazione PDF metadati... (${i + 1}/${metadataOnlyDcmts.length})`);
|
|
168
164
|
const conversionResult = await createMetadataPdfFromDocument(dcmt);
|
|
169
165
|
if (conversionResult) {
|
|
170
166
|
pdfFilesMap.set(`${dcmt.TID}_${dcmt.DID}`, conversionResult.file);
|
|
171
167
|
metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.SUCCESS });
|
|
168
|
+
metadataPanel.ok();
|
|
172
169
|
}
|
|
173
170
|
else {
|
|
174
171
|
// createMetadataPdfFromDocument ha restituito null (errore interno loggato)
|
|
175
172
|
metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: 'Creazione PDF metadati fallita' });
|
|
173
|
+
metadataPanel.error();
|
|
176
174
|
}
|
|
177
175
|
}
|
|
178
176
|
catch (error) {
|
|
179
177
|
console.error(`Errore creazione PDF metadati per TID=${dcmt.TID}, DID=${dcmt.DID}`, error);
|
|
180
178
|
metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
179
|
+
metadataPanel.error();
|
|
181
180
|
}
|
|
181
|
+
// Avanza a conversione conclusa: con un solo documento la barra non parte dal 100%
|
|
182
|
+
await metadataPanel.step();
|
|
182
183
|
}
|
|
183
|
-
|
|
184
|
-
setIsMergingPdf(false);
|
|
184
|
+
metadataPanel.close();
|
|
185
185
|
// Mostra riepilogo errori se presenti (come downloadDcmtsAsync)
|
|
186
186
|
const hasErrors = metadataConversionResults.some(r => r.resultType === ResultTypes.ERROR);
|
|
187
187
|
if (hasErrors) {
|
|
@@ -190,12 +190,13 @@ const TMMergeToPdfForm = (props) => {
|
|
|
190
190
|
}
|
|
191
191
|
// Per i documenti con file, usa il download normale
|
|
192
192
|
if (dcmtsWithFile.length > 0) {
|
|
193
|
-
const rfo =
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
193
|
+
const rfo = {
|
|
194
|
+
retrieveReason: DcmtOpers.None,
|
|
195
|
+
generalRetrieveFormat: GeneralRetrieveFormats.OriginalUnsigned,
|
|
196
|
+
cvtFormat: FileFormats.PDF,
|
|
197
|
+
invoiceRetrieveFormat: toPdfInvoiceRetrieveFormat(SDKUI_Globals.userSettings?.searchSettings.invoiceRetrieveFormat),
|
|
198
|
+
orderRetrieveFormat: toPdfOrderRetrieveFormat(SDKUI_Globals.userSettings?.searchSettings.orderRetrieveFormat),
|
|
199
|
+
};
|
|
199
200
|
const collectFileForMerge = async (file, dcmtInfo) => {
|
|
200
201
|
pdfFilesMap.set(`${dcmtInfo.TID}_${dcmtInfo.DID}`, file);
|
|
201
202
|
};
|
|
@@ -226,16 +227,17 @@ const TMMergeToPdfForm = (props) => {
|
|
|
226
227
|
if (!pdfFiles)
|
|
227
228
|
return;
|
|
228
229
|
const finalName = pdfFileName.trim().toLowerCase().endsWith('.pdf') ? pdfFileName.trim() : pdfFileName.trim() + '.pdf';
|
|
229
|
-
//
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
230
|
+
// Il merge non e' interrompibile: pannello senza Interrompi.
|
|
231
|
+
const mergePanel = TMWaitPanelManager.show({
|
|
232
|
+
title: SDKUI_Localizator.MergeToPdf,
|
|
233
|
+
subtitle: SDKUI_Localizator.MergeToPdf,
|
|
234
|
+
max: pdfFiles.length,
|
|
235
|
+
showCounters: false,
|
|
236
|
+
});
|
|
234
237
|
try {
|
|
235
238
|
const mergeOptions = {
|
|
236
239
|
onProgress: (current, total, file) => {
|
|
237
|
-
|
|
238
|
-
setMergeProgressText(`${SDKUI_Localizator.MergeToPdf}: ${file.name}`);
|
|
240
|
+
mergePanel.update({ value: current, subtitle: `${SDKUI_Localizator.MergeToPdf}: ${file.name}` });
|
|
239
241
|
}
|
|
240
242
|
};
|
|
241
243
|
// Se c'è una cartella selezionata (non Download di default), salva direttamente nella cartella
|
|
@@ -259,7 +261,7 @@ const TMMergeToPdfForm = (props) => {
|
|
|
259
261
|
return;
|
|
260
262
|
}
|
|
261
263
|
finally {
|
|
262
|
-
|
|
264
|
+
mergePanel.close();
|
|
263
265
|
}
|
|
264
266
|
onClose();
|
|
265
267
|
};
|
|
@@ -360,29 +362,29 @@ const TMMergeToPdfForm = (props) => {
|
|
|
360
362
|
? SDKUI_Localizator.FileNotPdfWillBeExcluded.replaceParams(extLabel)
|
|
361
363
|
: SDKUI_Localizator.FilesNotPdfWillBeExcluded.replaceParams(nonPdfSelectedItems.length.toString(), extLabel);
|
|
362
364
|
})() }))] })] }))] })] }));
|
|
363
|
-
return (_jsx(
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
365
|
+
return (_jsx(TMModal, { width: calcResponsiveSizes(deviceType, showTMRelationViewer ? '90%' : '500px', showTMRelationViewer ? '90%' : '500px', '95%'), height: showTMRelationViewer ? '95%' : 'auto', title: getTitle(), onClose: onClose, showCloseButton: true, children: _jsxs("div", { onContextMenu: (e) => e.preventDefault(), style: { display: 'flex', flexDirection: 'column', gap: '16px', padding: '16px', width: '100%', height: '100%', boxSizing: 'border-box', overflow: 'hidden' }, children: [showTMRelationViewer ? (_jsx("div", { style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }, children: _jsxs(TMSplitterLayout, { direction: 'vertical', showSeparator: true, separatorSize: 8, separatorColor: 'transparent', separatorActiveColor: 'transparent', overflow: 'hidden', min: ["50", "50"], start: ["70%", "30%"], children: [_jsx(TMDownloadRelationViewerSection, { selectedDcmtInfos: selectedDcmtInfos, onSelectionChanged: setSelectedItemsRelationViewer, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), configSection] }, "TMMergeToPdf-relation-config") })) : (configSection), _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', flexShrink: 0, marginTop: '12px' }, children: _jsxs("button", { disabled: !isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0) || !hasEnoughPdfForMerge, onClick: run, style: {
|
|
366
|
+
display: 'flex',
|
|
367
|
+
alignItems: 'center',
|
|
368
|
+
justifyContent: 'center',
|
|
369
|
+
gap: '6px',
|
|
370
|
+
padding: '8px 20px',
|
|
371
|
+
fontSize: '0.95rem',
|
|
372
|
+
fontWeight: 600,
|
|
373
|
+
color: '#fff',
|
|
374
|
+
background: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0) || !hasEnoughPdfForMerge)
|
|
375
|
+
? '#b0b0b0'
|
|
376
|
+
: 'linear-gradient(135deg, #28a745 0%, #218838 100%)',
|
|
377
|
+
border: 'none',
|
|
378
|
+
borderRadius: '6px',
|
|
379
|
+
cursor: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0) || !hasEnoughPdfForMerge) ? 'not-allowed' : 'pointer',
|
|
380
|
+
boxShadow: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0) || !hasEnoughPdfForMerge)
|
|
381
|
+
? 'none'
|
|
382
|
+
: '0 2px 8px rgba(40, 167, 69, 0.35)',
|
|
383
|
+
transition: 'all 0.2s ease',
|
|
384
|
+
}, children: [_jsx(IconPlay, {}), _jsx("span", { children: mergeableSelectedCount === 0
|
|
385
|
+
? SDKUI_Localizator.MergeToPdf
|
|
386
|
+
: mergeableSelectedCount > 999
|
|
387
|
+
? _jsx(TMTooltip, { content: mergeableSelectedCount.toString(), children: SDKUI_Localizator.MergeFilesToPdf.replaceParams('999+') })
|
|
388
|
+
: SDKUI_Localizator.MergeFilesToPdf.replaceParams(mergeableSelectedCount.toString()) })] }) })] }) }));
|
|
387
389
|
};
|
|
388
390
|
export default TMMergeToPdfForm;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { LayoutModes } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { LoadIndicator } from "devextreme-react/load-indicator";
|
|
@@ -6,7 +6,6 @@ import { SearchResultContext } from "../../../ts";
|
|
|
6
6
|
import { getFullFileExtension, getMultiDetailModalSize, getMultiDetailPanelStates, hasMultiDetailPanelStates, hoverStyle, IconArchive, IconArrowDown, IconArrowUp, IconDelete, IconDuplicate, IconEdit, IconEraser, IconInfo, IconMenuVertical, IconRefresh, IconSearch, IconSearchCheck, saveMultiDetailModalSize, saveMultiDetailPanelStates, SDKUI_Localizator } from "../../../helper";
|
|
7
7
|
import { TMColors } from "../../../utils/theme";
|
|
8
8
|
import { DeviceType, useDeviceType } from "../../base/TMDeviceProvider";
|
|
9
|
-
import { TMLayoutWaitingContainer } from "../../base/TMWaitPanel";
|
|
10
9
|
import TMModal from "../../base/TMModal";
|
|
11
10
|
import TMDataGrid from "../../base/TMDataGrid";
|
|
12
11
|
import TMTooltip from "../../base/TMTooltip";
|
|
@@ -48,7 +47,7 @@ const styles = {
|
|
|
48
47
|
const MOBILE_SECTION = 'archiveList';
|
|
49
48
|
const TMMultiMasterDetailDcmtsForm = (props) => {
|
|
50
49
|
const { dtd, masterDcmt, onClose, canNavigateMaster, onNavigateMaster, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, showDcmtFormSidebar, showTodoDcmtForm, openFileUploaderPdfEditor, graphometricManager, editPdfForm, openS4TViewer, showToppyDraggableHelpCenter, toppyHelpCenterUsePortal, fetchRemoteCertificates, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onReferenceClick, onTaskCreateRequest, onRefreshAfterAddDcmtToFavs, onFileOpened, passToArchiveCallback, openWGsCopyMoveForm } = props;
|
|
51
|
-
const { isLoading, isSummaryReady, phase, setPhase, detailRelationItems, selectedRelation, selectedItem, hasMultipleTypes, selectRelation, backToTypeSelection, isBackLocked, closeModal, isMasterNavigationEnabled, canNavigateMasterPrev, canNavigateMasterNext, navigateMaster, sectionsOpen, setSectionOpen, openAllSections, clearLayout, layoutResetToken, hasSavedLayout, setHasSavedLayout, canUpdateMaster, masterFieldsCount, getMasterMetadataAsync, masterInfoReloadToken, isOpenMasterForm, setIsOpenMasterForm, handleMasterSavedAsync, archivedDetailResults, archivedDetailsCount, isLoadingArchivedDetails, refreshArchivedDetailsAsync, detailColumns, detailSupportsFile, archiveRows, currentRows, focusedRowKey, setFocusedRowKey, selectedRowKeys, setSelectedRowKeys, isOpenAddForm, editingRowId, editingRow, formInputMids, openAddForm, openEditForm, closeAddForm, deleteRow, duplicateRow, upsertRow, updateRowValues, copyArchivedDetailToRows, stopOnFirstError, setStopOnFirstError, isArchiving, archiveAllAsync,
|
|
50
|
+
const { isLoading, isSummaryReady, phase, setPhase, detailRelationItems, selectedRelation, selectedItem, hasMultipleTypes, selectRelation, backToTypeSelection, isBackLocked, closeModal, isMasterNavigationEnabled, canNavigateMasterPrev, canNavigateMasterNext, navigateMaster, sectionsOpen, setSectionOpen, openAllSections, clearLayout, layoutResetToken, hasSavedLayout, setHasSavedLayout, canUpdateMaster, masterFieldsCount, getMasterMetadataAsync, masterInfoReloadToken, isOpenMasterForm, setIsOpenMasterForm, handleMasterSavedAsync, archivedDetailResults, archivedDetailsCount, isLoadingArchivedDetails, refreshArchivedDetailsAsync, detailColumns, detailSupportsFile, archiveRows, currentRows, focusedRowKey, setFocusedRowKey, selectedRowKeys, setSelectedRowKeys, isOpenAddForm, editingRowId, editingRow, formInputMids, openAddForm, openEditForm, closeAddForm, deleteRow, duplicateRow, upsertRow, updateRowValues, copyArchivedDetailToRows, stopOnFirstError, setStopOnFirstError, isArchiving, archiveAllAsync, } = useMultiMasterDetailDcmts({ dtd, masterDcmt, onClose, canNavigateMaster, onNavigateMaster });
|
|
52
51
|
const deviceType = useDeviceType();
|
|
53
52
|
// Su mobile il panel manager mostra un pannello alla volta: le sezioni si raggiungono dalla sua barra
|
|
54
53
|
const isMobile = useMemo(() => deviceType === DeviceType.MOBILE, [deviceType]);
|
|
@@ -301,9 +300,7 @@ const TMMultiMasterDetailDcmtsForm = (props) => {
|
|
|
301
300
|
// ----- Render principale --------------------------------------------------------------------
|
|
302
301
|
if (isLoading)
|
|
303
302
|
return null;
|
|
304
|
-
return _jsxs(_Fragment, { children: [_jsx(
|
|
305
|
-
// Cancellato il layout il popup torna alle dimensioni di default
|
|
306
|
-
sizeResetToken: layoutResetToken, title: modalTitle, hidePopup: false, askClosingConfirm: archiveRows.length > 0, recenterOnResize: true, titleActions: renderTitleActions(), children: _jsxs("div", { style: styles.content, children: [hasMultipleTypes && _jsx("div", { style: styles.header, children: renderStepper({
|
|
303
|
+
return _jsxs(_Fragment, { children: [_jsx("div", { style: { width: 0, height: 0 }, children: _jsx(TMModal, { width: modalSize.width, height: modalSize.height, onClose: closeModal, onResized: persistModalSize, sizeResetToken: layoutResetToken, title: modalTitle, hidePopup: false, askClosingConfirm: archiveRows.length > 0, recenterOnResize: true, titleActions: renderTitleActions(), children: _jsxs("div", { style: styles.content, children: [hasMultipleTypes && _jsx("div", { style: styles.header, children: renderStepper({
|
|
307
304
|
steps,
|
|
308
305
|
phase,
|
|
309
306
|
hasMultipleTypes,
|
|
@@ -87,7 +87,7 @@ export declare const toGridNumber: (value: unknown) => number | undefined;
|
|
|
87
87
|
* si rilegge nel form, si mostra in griglia e si archivia come una riga compilata a mano
|
|
88
88
|
*/
|
|
89
89
|
export declare const toArchiveRowValue: (value: MetadataScalarValue, dataType: MetadataDataTypes | undefined) => string;
|
|
90
|
-
/** Colonne della griglia di riepilogo dai metadati (utente) del tipo documento */
|
|
90
|
+
/** Colonne della griglia di riepilogo dai metadati (utente) del tipo documento, esclusi quelli che l'utente non può vedere */
|
|
91
91
|
export declare const buildColumnsFromDtd: (dtd: DcmtTypeDescriptor | undefined, renderDataListCell: (value: string | Date | number | undefined, dataListID: number, viewMode: DataListViewModes) => React.ReactElement) => Array<IColumnProps>;
|
|
92
92
|
export declare const getDetailDtdAsync: (detailTID: number | undefined) => Promise<DcmtTypeDescriptor | undefined>;
|
|
93
93
|
/** Nome visualizzato del tipo documento (localizzato se richiesto) */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useEffect, useRef } from 'react';
|
|
3
3
|
import { AccessLevelsEx, DataListViewModes, DcmtTypeListCacheService, MetadataDataDomains, MetadataDataTypes, SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { hoverStyle, IconChevronRight, IconWindowMaximize, IconWindowMinimize, SDKUI_Localizator } from '../../../helper';
|
|
5
|
-
import { formatScalarValue, getUserMetadataSorted } from '../../../helper/dcmtsHelper';
|
|
5
|
+
import { canViewMetadata, formatScalarValue, getUserMetadataSorted } from '../../../helper/dcmtsHelper';
|
|
6
6
|
import { TMColors } from '../../../utils/theme';
|
|
7
7
|
import { TMDcmtTypeIcon } from '../../viewers/TMTidViewer';
|
|
8
8
|
import TMTooltip from '../../base/TMTooltip';
|
|
@@ -71,8 +71,8 @@ export const toArchiveRowValue = (value, dataType) => {
|
|
|
71
71
|
}
|
|
72
72
|
return String(value);
|
|
73
73
|
};
|
|
74
|
-
/** Colonne della griglia di riepilogo dai metadati (utente) del tipo documento */
|
|
75
|
-
export const buildColumnsFromDtd = (dtd, renderDataListCell) => getUserMetadataSorted(dtd).map(md => {
|
|
74
|
+
/** Colonne della griglia di riepilogo dai metadati (utente) del tipo documento, esclusi quelli che l'utente non può vedere */
|
|
75
|
+
export const buildColumnsFromDtd = (dtd, renderDataListCell) => getUserMetadataSorted(dtd).filter(canViewMetadata).map(md => {
|
|
76
76
|
const dataListID = md.dataListID ?? 0;
|
|
77
77
|
const isDataList = md.dataDomain === MetadataDataDomains.DataList && dataListID > 0;
|
|
78
78
|
const viewMode = md.dataListViewMode ?? DataListViewModes.None;
|