@topconsultnpm/sdkui-react 6.22.0-dev3.8 → 6.22.0-dev4.2
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/base/TMAlert.js +6 -8
- package/lib/components/base/TMAreaManager.js +53 -55
- package/lib/components/base/TMButton.js +4 -2
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.js +219 -219
- package/lib/components/base/TMPanel.js +173 -170
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMSpinner.js +9 -7
- package/lib/components/base/TMTabControl.d.ts +7 -0
- package/lib/components/base/TMTabControl.js +24 -12
- package/lib/components/base/TMTreeView.js +20 -0
- package/lib/components/base/TMWaitPanel.js +1 -1
- 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/TMPathChooser.js +17 -34
- package/lib/components/editors/TMTextBox.d.ts +4 -0
- package/lib/components/editors/TMTextBox.js +99 -11
- 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 +2 -2
- 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 +3 -4
- package/lib/components/features/documents/TMCopyToFolderForm.js +50 -42
- package/lib/components/features/documents/TMDcmtForm.js +50 -61
- 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 +5 -3
- package/lib/components/features/documents/TMDcmtTasks.js +2 -9
- package/lib/components/features/documents/TMFileUploader.js +26 -26
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +53 -141
- package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +56 -54
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +14 -15
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +1 -1
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +3 -3
- package/lib/components/features/documents/TMRelationViewer.d.ts +13 -14
- package/lib/components/features/documents/TMRelationViewer.js +206 -143
- package/lib/components/features/documents/relationTreeState.d.ts +32 -0
- package/lib/components/features/documents/relationTreeState.js +89 -0
- package/lib/components/features/search/TMSearch.js +3 -4
- package/lib/components/features/search/TMSearchQueryPanel.js +0 -4
- package/lib/components/features/search/TMSearchResult.d.ts +5 -0
- package/lib/components/features/search/TMSearchResult.js +37 -19
- package/lib/components/features/search/TMTreeSelector.js +23 -27
- package/lib/components/features/search/TMViewHistoryDcmt.js +14 -25
- package/lib/components/features/tasks/TMTasksView.js +91 -90
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +91 -91
- package/lib/components/forms/TMResultDialog.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +92 -96
- package/lib/components/index.d.ts +5 -1
- package/lib/components/index.js +4 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +16 -15
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +5 -1
- package/lib/components/layout/panelManager/TMPanelManagerLoader.d.ts +6 -0
- package/lib/components/layout/panelManager/TMPanelManagerLoader.js +18 -0
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +4 -8
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +1 -1
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.js +2 -1
- package/lib/components/pages/TMPage.js +29 -31
- package/lib/components/query/TMQueryEditor.d.ts +3 -0
- package/lib/components/query/TMQueryEditor.js +2 -1
- package/lib/components/sidebar/TMHeader.d.ts +1 -0
- package/lib/components/sidebar/TMHeader.js +2 -2
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/SDKUI_Globals.d.ts +3 -0
- package/lib/helper/SDKUI_Globals.js +3 -0
- package/lib/helper/SDKUI_Localizator.d.ts +21 -0
- package/lib/helper/SDKUI_Localizator.js +210 -0
- package/lib/helper/ZipManager.d.ts +1 -1
- package/lib/helper/ZipManager.js +2 -1
- package/lib/helper/dcmtsHelper.d.ts +2 -0
- package/lib/helper/dcmtsHelper.js +3 -1
- 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 +14 -25
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
- package/lib/hooks/useMultiMasterDetailDcmts.js +65 -67
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/services/caseflow/CaseFlowService.d.ts +36 -6
- package/lib/services/caseflow/CaseFlowService.js +55 -14
- package/package.json +69 -69
|
@@ -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,25 +106,30 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
86
106
|
stopRelationsCalculationRef.current?.();
|
|
87
107
|
onBack?.();
|
|
88
108
|
}, [onBack]);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
//
|
|
94
|
-
const [relationsProgress, setRelationsProgress] = useState({ value: 0, max: 0 });
|
|
95
|
-
const handleRelationsProgress = useCallback((value, max) => {
|
|
96
|
-
setRelationsProgress({ value, max });
|
|
97
|
-
}, []);
|
|
98
|
-
// Notifica all'utente che i dati mostrati sono parziali (non quando si sta uscendo)
|
|
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
|
|
99
114
|
const handleRelationsCalculationStopped = useCallback((loadedCount, totalCount) => {
|
|
100
115
|
if (isLeavingRef.current)
|
|
101
116
|
return;
|
|
102
|
-
//
|
|
103
|
-
|
|
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
|
|
104
129
|
ShowAlert({
|
|
105
|
-
message:
|
|
130
|
+
message: SDKUI_Localizator.RelationsCalculationStoppedProgress.replaceParams(loadedCount.toString(), totalCount.toString()),
|
|
106
131
|
title: SDKUI_Localizator.Attention,
|
|
107
|
-
duration:
|
|
132
|
+
duration: 6000,
|
|
108
133
|
mode: 'info',
|
|
109
134
|
});
|
|
110
135
|
}, []);
|
|
@@ -282,7 +307,6 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
282
307
|
onRefreshAfterAddDcmtToFavs,
|
|
283
308
|
},
|
|
284
309
|
});
|
|
285
|
-
const { dcmtOperations: { abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, }, } = features;
|
|
286
310
|
// Nuovi documenti in input: il componente non sta più uscendo dalla maschera
|
|
287
311
|
// (chiave stabile: l'array inputDcmts può essere ricreato a ogni render)
|
|
288
312
|
const inputDcmtsKey = useMemo(() => (inputDcmts ?? []).map(d => `${d.TID}-${d.DID}`).join('|'), [inputDcmts]);
|
|
@@ -386,11 +410,11 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
386
410
|
setContextMenuVisible(true);
|
|
387
411
|
}, children: [_jsx(TMRelationViewerWrapper, { refreshKey: refreshKey, inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, showZeroDcmts: showZeroDcmts,
|
|
388
412
|
// customItemRender={customItemRender}
|
|
389
|
-
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: {
|
|
390
414
|
visible: contextMenuVisible,
|
|
391
415
|
position: contextMenuPosition,
|
|
392
416
|
onClose: () => setContextMenuVisible(false)
|
|
393
|
-
} })] }) }), [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]);
|
|
394
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]);
|
|
395
419
|
const initialPanelDimensions = {
|
|
396
420
|
'tmTreeView': { width: '50%', height: '100%' },
|
|
@@ -470,9 +494,7 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
470
494
|
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: false, orderNumber: 2, isActive: allInitialPanelVisibility['tmFormOrResult'] }
|
|
471
495
|
}
|
|
472
496
|
], [tmTreeView, tmFormOrResult, focusedItem?.isDcmt, dtdMaster]);
|
|
473
|
-
return (
|
|
474
|
-
? `${isForMaster ? SDKUI_Localizator.LoadingMasterDocuments : SDKUI_Localizator.LoadingDetailDocuments} (${relationsProgress.value}/${relationsProgress.max})`
|
|
475
|
-
: undefined, progressValue: relationsProgress.value, progressMax: relationsProgress.max })), _jsxs("div", { style: isCheckingFirstLoad ? { position: 'absolute', width: 0, height: 0, overflow: 'hidden', opacity: 0, pointerEvents: 'none' } : { width: '100%', height: '100%' }, children: [_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmTreeView', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }), renderDcmtOperations, renderFloatingBar] })] }));
|
|
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] }) }));
|
|
476
498
|
};
|
|
477
499
|
export default TMMasterDetailDcmts;
|
|
478
500
|
/**
|
|
@@ -481,7 +503,7 @@ export default TMMasterDetailDcmts;
|
|
|
481
503
|
* - Panel visibility toggling
|
|
482
504
|
* - Focus delay handling
|
|
483
505
|
*/
|
|
484
|
-
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 }) => {
|
|
485
507
|
const { setPanelVisibilityById, setToolbarButtonVisibility } = useTMPanelManagerContext();
|
|
486
508
|
// Monitor device type changes to restore panel visibility when switching from mobile to desktop
|
|
487
509
|
const deviceType = useDeviceType();
|
|
@@ -541,7 +563,7 @@ const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurr
|
|
|
541
563
|
onItemContextMenu?.(item, e);
|
|
542
564
|
}, 100);
|
|
543
565
|
}, [onItemContextMenu, handleFocusedItemChanged]);
|
|
544
|
-
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));
|
|
545
567
|
};
|
|
546
568
|
const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCreateRequest, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshSearchAsyncDatagrid, onRefreshSearchResults, handleNavigateToReference, fetchRemoteCertificates }) => {
|
|
547
569
|
const { setPanelVisibilityById } = useTMPanelManagerContext();
|
|
@@ -551,113 +573,3 @@ const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCrea
|
|
|
551
573
|
}, fetchRemoteCertificates: fetchRemoteCertificates }, refreshKey) :
|
|
552
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)) }));
|
|
553
575
|
};
|
|
554
|
-
const TMLoadingOverlay = ({ onCancel, onStop, description, cancelText, stopText, progressValue, progressMax }) => {
|
|
555
|
-
// Stesso calcolo di TMWaitPanel: 0 quando il massimo non è ancora noto
|
|
556
|
-
const progressPercent = (progressMax ?? 0) > 0
|
|
557
|
-
? Math.min(100, ((progressValue ?? 0) / (progressMax ?? 1)) * 100)
|
|
558
|
-
: 0;
|
|
559
|
-
return (_jsx("div", { style: {
|
|
560
|
-
position: 'absolute',
|
|
561
|
-
top: 0,
|
|
562
|
-
left: 0,
|
|
563
|
-
width: '100%',
|
|
564
|
-
height: '100%',
|
|
565
|
-
backgroundColor: 'rgba(248, 250, 252, 0.92)',
|
|
566
|
-
zIndex: 1000,
|
|
567
|
-
display: 'flex',
|
|
568
|
-
justifyContent: 'center',
|
|
569
|
-
alignItems: 'center',
|
|
570
|
-
}, children: _jsxs("div", { style: {
|
|
571
|
-
display: 'flex',
|
|
572
|
-
flexDirection: 'column',
|
|
573
|
-
alignItems: 'center',
|
|
574
|
-
gap: '16px',
|
|
575
|
-
padding: '24px 32px',
|
|
576
|
-
background: '#fcfcfc',
|
|
577
|
-
borderRadius: '8px',
|
|
578
|
-
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.1)',
|
|
579
|
-
}, children: [_jsxs("div", { style: { position: 'relative', width: '80px', height: '80px' }, children: [_jsx("img", { style: {
|
|
580
|
-
position: 'absolute',
|
|
581
|
-
top: '50%',
|
|
582
|
-
left: '50%',
|
|
583
|
-
transform: 'translate(-54%, -54%)'
|
|
584
|
-
}, src: sixLogo, width: 35, alt: "" }), _jsx("style", { children: `
|
|
585
|
-
@keyframes tmSpinnerRotate {
|
|
586
|
-
0% { transform: rotate(0deg); }
|
|
587
|
-
100% { transform: rotate(360deg); }
|
|
588
|
-
}
|
|
589
|
-
.tm-spinner-animation {
|
|
590
|
-
display: inline-block;
|
|
591
|
-
width: 80px;
|
|
592
|
-
height: 80px;
|
|
593
|
-
position: absolute;
|
|
594
|
-
top: 50%;
|
|
595
|
-
left: 50%;
|
|
596
|
-
transform: translate(-50%, -50%);
|
|
597
|
-
}
|
|
598
|
-
.tm-spinner-animation div {
|
|
599
|
-
animation: tmSpinnerRotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
|
600
|
-
transform-origin: 40px 40px;
|
|
601
|
-
}
|
|
602
|
-
.tm-spinner-animation div:after {
|
|
603
|
-
content: " ";
|
|
604
|
-
display: block;
|
|
605
|
-
position: absolute;
|
|
606
|
-
width: 7px;
|
|
607
|
-
height: 7px;
|
|
608
|
-
border-radius: 50%;
|
|
609
|
-
background: #0c448e;
|
|
610
|
-
margin: -4px 0 0 -4px;
|
|
611
|
-
}
|
|
612
|
-
.tm-spinner-animation div:nth-child(1) { animation-delay: -0.036s; }
|
|
613
|
-
.tm-spinner-animation div:nth-child(1):after { top: 63px; left: 63px; background: #f7a51f; }
|
|
614
|
-
.tm-spinner-animation div:nth-child(2) { animation-delay: -0.072s; }
|
|
615
|
-
.tm-spinner-animation div:nth-child(2):after { top: 68px; left: 56px; background: #f7a51f; }
|
|
616
|
-
.tm-spinner-animation div:nth-child(3) { animation-delay: -0.108s; }
|
|
617
|
-
.tm-spinner-animation div:nth-child(3):after { top: 71px; left: 48px; background: #d3237b; }
|
|
618
|
-
.tm-spinner-animation div:nth-child(4) { animation-delay: -0.144s; }
|
|
619
|
-
.tm-spinner-animation div:nth-child(4):after { top: 72px; left: 40px; background: #d3237b; }
|
|
620
|
-
.tm-spinner-animation div:nth-child(5) { animation-delay: -0.18s; }
|
|
621
|
-
.tm-spinner-animation div:nth-child(5):after { top: 71px; left: 32px; background: #d12a1c; }
|
|
622
|
-
.tm-spinner-animation div:nth-child(6) { animation-delay: -0.216s; }
|
|
623
|
-
.tm-spinner-animation div:nth-child(6):after { top: 68px; left: 24px; background: #d12a1c; }
|
|
624
|
-
.tm-spinner-animation div:nth-child(7) { animation-delay: -0.252s; }
|
|
625
|
-
.tm-spinner-animation div:nth-child(7):after { top: 63px; left: 17px; background: #782b7d; }
|
|
626
|
-
.tm-spinner-animation div:nth-child(8) { animation-delay: -0.288s; }
|
|
627
|
-
.tm-spinner-animation div:nth-child(8):after { top: 56px; left: 12px; background: #782b7d; }
|
|
628
|
-
` }), _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 }), (progressMax ?? 0) > 1 && (_jsxs("div", { style: { width: '260px' }, children: [_jsx("div", { style: { width: '100%', height: '20px', background: '#e0e0e0', borderRadius: '10px', overflow: 'hidden' }, children: _jsx("div", { style: { width: `${progressPercent.toFixed(2)}%`, height: '100%', background: '#4caf50', transition: 'width 0.3s ease' } }) }), _jsxs("p", { style: { fontWeight: 'bold', color: '#333', margin: '8px 0 0', textAlign: 'center' }, children: [progressPercent.toFixed(2), "%"] })] })), (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: {
|
|
629
|
-
padding: '8px 24px',
|
|
630
|
-
fontSize: '13px',
|
|
631
|
-
fontWeight: 500,
|
|
632
|
-
color: 'white',
|
|
633
|
-
background: '#0c448e',
|
|
634
|
-
border: '1.5px solid #0c448e',
|
|
635
|
-
borderRadius: '6px',
|
|
636
|
-
cursor: 'pointer',
|
|
637
|
-
transition: 'all 0.2s ease',
|
|
638
|
-
}, onMouseEnter: (e) => {
|
|
639
|
-
e.currentTarget.style.background = '#0a3872';
|
|
640
|
-
e.currentTarget.style.borderColor = '#0a3872';
|
|
641
|
-
}, onMouseLeave: (e) => {
|
|
642
|
-
e.currentTarget.style.background = '#0c448e';
|
|
643
|
-
e.currentTarget.style.borderColor = '#0c448e';
|
|
644
|
-
}, children: stopText ?? SDKUI_Localizator.ShowPartialResults })), onCancel && (_jsx("button", { onClick: onCancel, style: {
|
|
645
|
-
padding: '8px 24px',
|
|
646
|
-
fontSize: '13px',
|
|
647
|
-
fontWeight: 500,
|
|
648
|
-
color: '#64748b',
|
|
649
|
-
background: 'transparent',
|
|
650
|
-
border: '1.5px solid #cbd5e1',
|
|
651
|
-
borderRadius: '6px',
|
|
652
|
-
cursor: 'pointer',
|
|
653
|
-
transition: 'all 0.2s ease',
|
|
654
|
-
}, onMouseEnter: (e) => {
|
|
655
|
-
e.currentTarget.style.background = '#f1f5f9';
|
|
656
|
-
e.currentTarget.style.borderColor = '#94a3b8';
|
|
657
|
-
e.currentTarget.style.color = '#475569';
|
|
658
|
-
}, onMouseLeave: (e) => {
|
|
659
|
-
e.currentTarget.style.background = 'transparent';
|
|
660
|
-
e.currentTarget.style.borderColor = '#cbd5e1';
|
|
661
|
-
e.currentTarget.style.color = '#64748b';
|
|
662
|
-
}, children: cancelText ?? SDKUI_Localizator.Back }))] }))] }) }));
|
|
663
|
-
};
|
|
@@ -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)
|
|
@@ -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;
|
|
@@ -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,19 +300,19 @@ const TMMultiMasterDetailDcmtsForm = (props) => {
|
|
|
301
300
|
// ----- Render principale --------------------------------------------------------------------
|
|
302
301
|
if (isLoading)
|
|
303
302
|
return null;
|
|
304
|
-
return _jsxs(_Fragment, { children: [_jsx("div", { style: { width: 0, height: 0 }, children: _jsx(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
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({
|
|
304
|
+
steps,
|
|
305
|
+
phase,
|
|
306
|
+
hasMultipleTypes,
|
|
307
|
+
isBackLocked,
|
|
308
|
+
showBackArrow: isSummaryPhase,
|
|
309
|
+
onBack: backToTypeSelection,
|
|
310
|
+
onStepClick: (stepPhase) => (stepPhase === MultiDetailArchivePhase.SelectDcmtType ? backToTypeSelection() : setPhase(stepPhase)),
|
|
311
|
+
}) }), !isSummaryPhase
|
|
312
|
+
? renderSelectDcmtType({ detailRelationItems, selectedRelation, onSelectRelation: selectRelation })
|
|
313
|
+
: (isSummaryReady
|
|
314
|
+
? renderArchiveSummary()
|
|
315
|
+
: _jsx("div", { style: styles.loader, children: _jsx(LoadIndicator, { height: 40, width: 40 }) }))] }) }) }), isOpenAddForm && selectedRelation?.detailTID && (_jsx(TMDcmtForm, { isModal: true, titleModal: getDtdDisplayName(selectedItem?.detailDtd), TID: selectedRelation.detailTID, layoutMode: LayoutModes.Ark, showBackButton: false, allowButtonsRefs: false, inputMids: formInputMids, inputFile: editingRow?.__file ?? null, archiveListMode: {
|
|
317
316
|
isEditingRow: editingRowId !== undefined,
|
|
318
317
|
onUpsertRow: (values, file) => upsertRow(values, file),
|
|
319
318
|
}, onClose: closeAddForm, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar, showTodoDcmtForm: showTodoDcmtForm, openFileUploaderPdfEditor: openFileUploaderPdfEditor, graphometricManager: graphometricManager })), isOpenMasterForm && masterDcmt?.TID !== undefined && masterDcmt?.DID !== undefined && (_jsx(TMDcmtForm, { isModal: true, titleModal: `${SDKUI_Localizator.Update}: ${getDtdDisplayName(dtd)}`, TID: masterDcmt.TID, DID: masterDcmt.DID, layoutMode: LayoutModes.Update, showBackButton: false, allowRelations: false, allowButtonsRefs: false, onSavedAsyncCallback: handleMasterSavedAsync, onClose: () => setIsOpenMasterForm(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, onTaskCreateRequest: onTaskCreateRequest, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar, showTodoDcmtForm: showTodoDcmtForm, openFileUploaderPdfEditor: openFileUploaderPdfEditor, graphometricManager: graphometricManager, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, fetchRemoteCertificates: fetchRemoteCertificates, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onReferenceClick: onReferenceClick }))] });
|
|
@@ -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) */
|
|
@@ -2,7 +2,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
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;
|