@topconsultnpm/sdkui-react 6.22.0-dev3.9 → 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.
Files changed (96) hide show
  1. package/lib/components/base/TMAlert.js +6 -8
  2. package/lib/components/base/TMAreaManager.js +53 -55
  3. package/lib/components/base/TMButton.js +4 -2
  4. package/lib/components/base/TMCustomButton.js +40 -48
  5. package/lib/components/base/TMDataGrid.js +219 -219
  6. package/lib/components/base/TMPanel.js +173 -170
  7. package/lib/components/base/TMSpinner.d.ts +2 -1
  8. package/lib/components/base/TMSpinner.js +9 -7
  9. package/lib/components/base/TMTabControl.d.ts +5 -0
  10. package/lib/components/base/TMTabControl.js +18 -7
  11. package/lib/components/base/TMTreeView.js +20 -0
  12. package/lib/components/base/TMWaitPanel.js +1 -1
  13. package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
  14. package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
  15. package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +169 -0
  16. package/lib/components/base/waitPanel/TMWaitPanelManager.js +320 -0
  17. package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +53 -0
  18. package/lib/components/base/waitPanel/TMWaitPanelView.js +274 -0
  19. package/lib/components/base/waitPanel/index.d.ts +1 -0
  20. package/lib/components/base/waitPanel/index.js +1 -0
  21. package/lib/components/choosers/TMPathChooser.js +17 -34
  22. package/lib/components/editors/TMTextBox.d.ts +4 -0
  23. package/lib/components/editors/TMTextBox.js +99 -11
  24. package/lib/components/features/archive/TMArchive.js +7 -2
  25. package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +29 -0
  26. package/lib/components/features/assistant/TMHelpOnLineChat.js +1384 -0
  27. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
  28. package/lib/components/features/assistant/dataset/Designer-Suggested-Questions.json +102 -0
  29. package/lib/components/features/assistant/dataset/Login-Suggested-Questions.json +32 -0
  30. package/lib/components/features/assistant/dataset/Surfer-Suggested-Questions.json +102 -0
  31. package/lib/components/features/documents/TMBatchUpdateForm.js +3 -4
  32. package/lib/components/features/documents/TMCopyToFolderForm.js +53 -84
  33. package/lib/components/features/documents/TMDcmtForm.js +50 -61
  34. package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -3
  35. package/lib/components/features/documents/TMDcmtIcon.js +3 -5
  36. package/lib/components/features/documents/TMDcmtPreview.js +5 -3
  37. package/lib/components/features/documents/TMDcmtTasks.js +2 -9
  38. package/lib/components/features/documents/TMFileUploader.js +26 -26
  39. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
  40. package/lib/components/features/documents/TMMasterDetailDcmts.js +53 -148
  41. package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
  42. package/lib/components/features/documents/TMMergeToPdfForm.js +49 -54
  43. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +14 -15
  44. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +1 -1
  45. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +3 -3
  46. package/lib/components/features/documents/TMRelationViewer.d.ts +13 -14
  47. package/lib/components/features/documents/TMRelationViewer.js +206 -143
  48. package/lib/components/features/documents/relationTreeState.d.ts +32 -0
  49. package/lib/components/features/documents/relationTreeState.js +89 -0
  50. package/lib/components/features/search/TMSearch.js +3 -4
  51. package/lib/components/features/search/TMSearchQueryPanel.js +0 -4
  52. package/lib/components/features/search/TMSearchResult.d.ts +5 -0
  53. package/lib/components/features/search/TMSearchResult.js +37 -19
  54. package/lib/components/features/search/TMTreeSelector.js +23 -27
  55. package/lib/components/features/search/TMViewHistoryDcmt.js +14 -25
  56. package/lib/components/features/tasks/TMTasksView.js +91 -90
  57. package/lib/components/features/wg/TMWGsCopyMoveForm.js +91 -91
  58. package/lib/components/forms/TMResultDialog.js +1 -1
  59. package/lib/components/grids/TMBlogsPost.js +92 -96
  60. package/lib/components/index.d.ts +5 -1
  61. package/lib/components/index.js +4 -1
  62. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +16 -15
  63. package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +1 -0
  64. package/lib/components/layout/panelManager/TMPanelManagerContext.js +5 -1
  65. package/lib/components/layout/panelManager/TMPanelManagerLoader.d.ts +6 -0
  66. package/lib/components/layout/panelManager/TMPanelManagerLoader.js +18 -0
  67. package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +4 -8
  68. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +1 -1
  69. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.js +2 -1
  70. package/lib/components/pages/TMPage.js +29 -31
  71. package/lib/components/query/TMQueryEditor.d.ts +3 -0
  72. package/lib/components/query/TMQueryEditor.js +2 -1
  73. package/lib/components/sidebar/TMHeader.d.ts +1 -0
  74. package/lib/components/sidebar/TMHeader.js +2 -2
  75. package/lib/helper/Enum_Localizator.js +1 -0
  76. package/lib/helper/SDKUI_Globals.d.ts +3 -0
  77. package/lib/helper/SDKUI_Globals.js +3 -0
  78. package/lib/helper/SDKUI_Localizator.d.ts +21 -0
  79. package/lib/helper/SDKUI_Localizator.js +210 -0
  80. package/lib/helper/ZipManager.d.ts +1 -1
  81. package/lib/helper/ZipManager.js +2 -1
  82. package/lib/helper/dcmtsHelper.d.ts +2 -0
  83. package/lib/helper/dcmtsHelper.js +3 -1
  84. package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
  85. package/lib/hooks/useCheckInOutOperations.js +14 -34
  86. package/lib/hooks/useDcmtOperations.d.ts +3 -19
  87. package/lib/hooks/useDcmtOperations.js +160 -222
  88. package/lib/hooks/useDocumentOperations.d.ts +1 -0
  89. package/lib/hooks/useDocumentOperations.js +14 -25
  90. package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
  91. package/lib/hooks/useMultiMasterDetailDcmts.js +65 -67
  92. package/lib/hooks/usePreventFileDrop.js +9 -0
  93. package/lib/hooks/useWorkflowApprove.js +33 -17
  94. package/lib/services/caseflow/CaseFlowService.d.ts +36 -6
  95. package/lib/services/caseflow/CaseFlowService.js +55 -14
  96. 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, TMLayoutWaitingContainer } from '../..';
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 sixLogo from '../../../assets/six.png';
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
- const handleCancelFirstLoad = useCallback(() => {
90
- setIsCheckingFirstLoad(false);
91
- handleBack();
92
- }, [handleBack]);
93
- // Avanzamento del calcolo correlazioni, mostrato nell'overlay di primo caricamento
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
- // Con piu' documenti in input, indica quanti sono stati completati (es. "3/10")
103
- const progress = totalCount > 1 ? ` (${loadedCount}/${totalCount})` : '';
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: `${SDKUI_Localizator.RelationsCalculationStopped}${progress}`,
130
+ message: SDKUI_Localizator.RelationsCalculationStoppedProgress.replaceParams(loadedCount.toString(), totalCount.toString()),
106
131
  title: SDKUI_Localizator.Attention,
107
- duration: 4000,
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, focusedItemFormData: focusedItemFormData, onLoadingStateChanged: setIsRelationViewerLoading, onLoadingProgress: handleRelationsProgress, onStopCalculationReady: handleStopCalculationReady, onCalculationStopped: handleRelationsCalculationStopped }), _jsx(TMContextMenu, { items: operationItems, externalControl: {
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,12 +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 (_jsxs("div", { style: { width: '100%', height: '100%', position: 'relative' }, children: [isCheckingFirstLoad && (_jsx(TMLoadingOverlay, { onCancel: handleCancelFirstLoad, onStop: handleStopRelationsCalculation, description: relationsProgress.max > 1
474
- ? `${isForMaster ? SDKUI_Localizator.LoadingMasterDocuments : SDKUI_Localizator.LoadingDetailDocuments} (${relationsProgress.value}/${relationsProgress.max})`
475
- : undefined, progressValue: relationsProgress.value, progressMax: relationsProgress.max,
476
- // Con un solo documento in input la chiamata è unica: non ci sono
477
- // risultati parziali da mostrare, quindi il pulsante resta disabilitato
478
- stopDisabled: (inputDcmts?.length ?? 0) <= 1 })), _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] }) }));
479
498
  };
480
499
  export default TMMasterDetailDcmts;
481
500
  /**
@@ -484,7 +503,7 @@ export default TMMasterDetailDcmts;
484
503
  * - Panel visibility toggling
485
504
  * - Focus delay handling
486
505
  */
487
- const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, customItemRender, allowMultipleSelection, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onNoRelationsFound, onItemContextMenu, focusedItemFormData, onLoadingStateChanged, onLoadingProgress, onStopCalculationReady, onCalculationStopped }) => {
506
+ const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, customItemRender, allowMultipleSelection, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onNoRelationsFound, onItemContextMenu, onLoadingStateChanged, onStopCalculationReady, onCalculationStopped, initialTreeState, onTreeStateChange }) => {
488
507
  const { setPanelVisibilityById, setToolbarButtonVisibility } = useTMPanelManagerContext();
489
508
  // Monitor device type changes to restore panel visibility when switching from mobile to desktop
490
509
  const deviceType = useDeviceType();
@@ -544,7 +563,7 @@ const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurr
544
563
  onItemContextMenu?.(item, e);
545
564
  }, 100);
546
565
  }, [onItemContextMenu, handleFocusedItemChanged]);
547
- 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, focusedItemFormData: focusedItemFormData, onLoadingStateChanged: onLoadingStateChanged, onLoadingProgress: onLoadingProgress, onStopCalculationReady: onStopCalculationReady, onCalculationStopped: onCalculationStopped }, refreshKey));
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));
548
567
  };
549
568
  const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCreateRequest, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshSearchAsyncDatagrid, onRefreshSearchResults, handleNavigateToReference, fetchRemoteCertificates }) => {
550
569
  const { setPanelVisibilityById } = useTMPanelManagerContext();
@@ -554,117 +573,3 @@ const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCrea
554
573
  }, fetchRemoteCertificates: fetchRemoteCertificates }, refreshKey) :
555
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)) }));
556
575
  };
557
- const TMLoadingOverlay = ({ onCancel, onStop, description, cancelText, stopText, progressValue, progressMax, stopDisabled }) => {
558
- // Stesso calcolo di TMWaitPanel: 0 quando il massimo non è ancora noto
559
- const progressPercent = (progressMax ?? 0) > 0
560
- ? Math.min(100, ((progressValue ?? 0) / (progressMax ?? 1)) * 100)
561
- : 0;
562
- return (_jsx("div", { style: {
563
- position: 'absolute',
564
- top: 0,
565
- left: 0,
566
- width: '100%',
567
- height: '100%',
568
- backgroundColor: 'rgba(248, 250, 252, 0.92)',
569
- zIndex: 1000,
570
- display: 'flex',
571
- justifyContent: 'center',
572
- alignItems: 'center',
573
- }, children: _jsxs("div", { style: {
574
- display: 'flex',
575
- flexDirection: 'column',
576
- alignItems: 'center',
577
- gap: '16px',
578
- padding: '24px 32px',
579
- background: '#fcfcfc',
580
- borderRadius: '8px',
581
- boxShadow: '0 4px 16px rgba(0, 0, 0, 0.1)',
582
- }, children: [_jsxs("div", { style: { position: 'relative', width: '80px', height: '80px' }, children: [_jsx("img", { style: {
583
- position: 'absolute',
584
- top: '50%',
585
- left: '50%',
586
- transform: 'translate(-54%, -54%)'
587
- }, src: sixLogo, width: 35, alt: "" }), _jsx("style", { children: `
588
- @keyframes tmSpinnerRotate {
589
- 0% { transform: rotate(0deg); }
590
- 100% { transform: rotate(360deg); }
591
- }
592
- .tm-spinner-animation {
593
- display: inline-block;
594
- width: 80px;
595
- height: 80px;
596
- position: absolute;
597
- top: 50%;
598
- left: 50%;
599
- transform: translate(-50%, -50%);
600
- }
601
- .tm-spinner-animation div {
602
- animation: tmSpinnerRotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
603
- transform-origin: 40px 40px;
604
- }
605
- .tm-spinner-animation div:after {
606
- content: " ";
607
- display: block;
608
- position: absolute;
609
- width: 7px;
610
- height: 7px;
611
- border-radius: 50%;
612
- background: #0c448e;
613
- margin: -4px 0 0 -4px;
614
- }
615
- .tm-spinner-animation div:nth-child(1) { animation-delay: -0.036s; }
616
- .tm-spinner-animation div:nth-child(1):after { top: 63px; left: 63px; background: #f7a51f; }
617
- .tm-spinner-animation div:nth-child(2) { animation-delay: -0.072s; }
618
- .tm-spinner-animation div:nth-child(2):after { top: 68px; left: 56px; background: #f7a51f; }
619
- .tm-spinner-animation div:nth-child(3) { animation-delay: -0.108s; }
620
- .tm-spinner-animation div:nth-child(3):after { top: 71px; left: 48px; background: #d3237b; }
621
- .tm-spinner-animation div:nth-child(4) { animation-delay: -0.144s; }
622
- .tm-spinner-animation div:nth-child(4):after { top: 72px; left: 40px; background: #d3237b; }
623
- .tm-spinner-animation div:nth-child(5) { animation-delay: -0.18s; }
624
- .tm-spinner-animation div:nth-child(5):after { top: 71px; left: 32px; background: #d12a1c; }
625
- .tm-spinner-animation div:nth-child(6) { animation-delay: -0.216s; }
626
- .tm-spinner-animation div:nth-child(6):after { top: 68px; left: 24px; background: #d12a1c; }
627
- .tm-spinner-animation div:nth-child(7) { animation-delay: -0.252s; }
628
- .tm-spinner-animation div:nth-child(7):after { top: 63px; left: 17px; background: #782b7d; }
629
- .tm-spinner-animation div:nth-child(8) { animation-delay: -0.288s; }
630
- .tm-spinner-animation div:nth-child(8):after { top: 56px; left: 12px; background: #782b7d; }
631
- ` }), _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, disabled: stopDisabled, title: SDKUI_Localizator.StopRelationsCalculation, style: {
632
- padding: '8px 24px',
633
- fontSize: '13px',
634
- fontWeight: 500,
635
- color: stopDisabled ? '#94a3b8' : 'white',
636
- background: stopDisabled ? '#e2e8f0' : '#0c448e',
637
- border: `1.5px solid ${stopDisabled ? '#e2e8f0' : '#0c448e'}`,
638
- borderRadius: '6px',
639
- cursor: stopDisabled ? 'not-allowed' : 'pointer',
640
- transition: 'all 0.2s ease',
641
- }, onMouseEnter: (e) => {
642
- if (stopDisabled)
643
- return;
644
- e.currentTarget.style.background = '#0a3872';
645
- e.currentTarget.style.borderColor = '#0a3872';
646
- }, onMouseLeave: (e) => {
647
- if (stopDisabled)
648
- return;
649
- e.currentTarget.style.background = '#0c448e';
650
- e.currentTarget.style.borderColor = '#0c448e';
651
- }, children: stopText ?? SDKUI_Localizator.ShowPartialResults })), onCancel && (_jsx("button", { onClick: onCancel, style: {
652
- padding: '8px 24px',
653
- fontSize: '13px',
654
- fontWeight: 500,
655
- color: '#64748b',
656
- background: 'transparent',
657
- border: '1.5px solid #cbd5e1',
658
- borderRadius: '6px',
659
- cursor: 'pointer',
660
- transition: 'all 0.2s ease',
661
- }, onMouseEnter: (e) => {
662
- e.currentTarget.style.background = '#f1f5f9';
663
- e.currentTarget.style.borderColor = '#94a3b8';
664
- e.currentTarget.style.color = '#475569';
665
- }, onMouseLeave: (e) => {
666
- e.currentTarget.style.background = 'transparent';
667
- e.currentTarget.style.borderColor = '#cbd5e1';
668
- e.currentTarget.style.color = '#64748b';
669
- }, children: cancelText ?? SDKUI_Localizator.Back }))] }))] }) }));
670
- };
@@ -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
- const metadata = getUserMetadataSorted(dtd);
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)
@@ -8,8 +8,8 @@ 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';
@@ -18,12 +18,6 @@ import ShowAlert from '../../base/TMAlert';
18
18
  import TMTooltip from '../../base/TMTooltip';
19
19
  import MergePdfManager from '../../../helper/MergePdfManager';
20
20
  import { TMResultManager } from '../../forms/TMResultDialog';
21
- /**
22
- * Numero di documenti scaricati in parallelo durante l'unione.
23
- * I file vengono consumati via callback (nessun click su <a download>), quindi il
24
- * parallelismo è sicuro; il riordino finale è garantito da pdfFilesMap.
25
- */
26
- const MERGE_DOWNLOAD_CONCURRENCY = 5;
27
21
  /**
28
22
  * Converte il formato di visualizzazione fatture impostato dall'utente nel corrispondente formato PDF:
29
23
  * il foglio di stile SDI resta SDI, in tutti gli altri casi si usa ASW.
@@ -56,16 +50,12 @@ const toPdfOrderRetrieveFormat = (format) => {
56
50
  */
57
51
  const TMMergeToPdfForm = (props) => {
58
52
  const { mode, selectedDcmtInfos, selectedItemsFull, onClose, showTMRelationViewer, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers } = props;
59
- const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, } = useDcmtOperations();
53
+ // Il wait panel del download lo apre e lo aggiorna l'hook: qui serve solo la funzione.
54
+ const { downloadDcmtsAsync } = useDcmtOperations();
60
55
  const deviceType = useDeviceType();
61
56
  const [pdfFileName, setPdfFileName] = useState(`${SDKUI_Localizator.Result.toLowerCase()}.pdf`);
62
57
  const [destinationFolder, setDestinationFolder] = useState('Download');
63
58
  const [selectedItemsRelationViewer, setSelectedItemsRelationViewer] = useState([]);
64
- // ---- Stato per il merge PDF (progress bar) ----
65
- const [isMergingPdf, setIsMergingPdf] = useState(false);
66
- const [mergeProgressText, setMergeProgressText] = useState('');
67
- const [mergeProgressValue, setMergeProgressValue] = useState(0);
68
- const [mergeProgressMax, setMergeProgressMax] = useState(0);
69
59
  // ---- Ref per la selezione cartella (File System Access API) ----
70
60
  const folderHandleRef = useRef(null);
71
61
  const skipSelectFolderRef = useRef(false);
@@ -162,32 +152,36 @@ const TMMergeToPdfForm = (props) => {
162
152
  // Raccoglie gli errori come downloadDcmtsAsync
163
153
  const metadataConversionResults = [];
164
154
  if (metadataOnlyDcmts.length > 0) {
165
- setIsMergingPdf(true);
166
- setMergeProgressMax(metadataOnlyDcmts.length);
167
- setMergeProgressValue(0);
168
- setMergeProgressText('Creazione PDF metadati...');
155
+ const metadataPanel = TMWaitPanelManager.show({
156
+ title: SDKUI_Localizator.MergeToPdf,
157
+ subtitle: 'Creazione PDF metadati...',
158
+ max: metadataOnlyDcmts.length,
159
+ });
169
160
  for (let i = 0; i < metadataOnlyDcmts.length; i++) {
170
161
  const dcmt = metadataOnlyDcmts[i];
171
162
  try {
172
- setMergeProgressValue(i);
173
- setMergeProgressText(`Creazione PDF metadati... (${i + 1}/${metadataOnlyDcmts.length})`);
163
+ metadataPanel.setSubtitle(`Creazione PDF metadati... (${i + 1}/${metadataOnlyDcmts.length})`);
174
164
  const conversionResult = await createMetadataPdfFromDocument(dcmt);
175
165
  if (conversionResult) {
176
166
  pdfFilesMap.set(`${dcmt.TID}_${dcmt.DID}`, conversionResult.file);
177
167
  metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.SUCCESS });
168
+ metadataPanel.ok();
178
169
  }
179
170
  else {
180
171
  // createMetadataPdfFromDocument ha restituito null (errore interno loggato)
181
172
  metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: 'Creazione PDF metadati fallita' });
173
+ metadataPanel.error();
182
174
  }
183
175
  }
184
176
  catch (error) {
185
177
  console.error(`Errore creazione PDF metadati per TID=${dcmt.TID}, DID=${dcmt.DID}`, error);
186
178
  metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
179
+ metadataPanel.error();
187
180
  }
181
+ // Avanza a conversione conclusa: con un solo documento la barra non parte dal 100%
182
+ await metadataPanel.step();
188
183
  }
189
- setMergeProgressValue(metadataOnlyDcmts.length);
190
- setIsMergingPdf(false);
184
+ metadataPanel.close();
191
185
  // Mostra riepilogo errori se presenti (come downloadDcmtsAsync)
192
186
  const hasErrors = metadataConversionResults.some(r => r.resultType === ResultTypes.ERROR);
193
187
  if (hasErrors) {
@@ -206,7 +200,7 @@ const TMMergeToPdfForm = (props) => {
206
200
  const collectFileForMerge = async (file, dcmtInfo) => {
207
201
  pdfFilesMap.set(`${dcmtInfo.TID}_${dcmtInfo.DID}`, file);
208
202
  };
209
- await downloadDcmtsAsync({ inputDcmts: dcmtsWithFile, downloadType: DownloadTypes.Dcmt, downloadMode: 'download', onFileDownloaded: collectFileForMerge, skipConfirmation: true, retrieveOptions: rfo, useCache: false, downloadConcurrency: MERGE_DOWNLOAD_CONCURRENCY });
203
+ await downloadDcmtsAsync({ inputDcmts: dcmtsWithFile, downloadType: DownloadTypes.Dcmt, downloadMode: 'download', onFileDownloaded: collectFileForMerge, skipConfirmation: true, retrieveOptions: rfo, useCache: false });
210
204
  }
211
205
  // Ricostruisci l'array pdfFiles nell'ordine originale di selezione
212
206
  const pdfFiles = [];
@@ -233,16 +227,17 @@ const TMMergeToPdfForm = (props) => {
233
227
  if (!pdfFiles)
234
228
  return;
235
229
  const finalName = pdfFileName.trim().toLowerCase().endsWith('.pdf') ? pdfFileName.trim() : pdfFileName.trim() + '.pdf';
236
- // Inizializza progress bar per il merge
237
- setIsMergingPdf(true);
238
- setMergeProgressMax(pdfFiles.length);
239
- setMergeProgressValue(0);
240
- setMergeProgressText(SDKUI_Localizator.MergeToPdf);
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
+ });
241
237
  try {
242
238
  const mergeOptions = {
243
239
  onProgress: (current, total, file) => {
244
- setMergeProgressValue(current);
245
- setMergeProgressText(`${SDKUI_Localizator.MergeToPdf}: ${file.name}`);
240
+ mergePanel.update({ value: current, subtitle: `${SDKUI_Localizator.MergeToPdf}: ${file.name}` });
246
241
  }
247
242
  };
248
243
  // Se c'è una cartella selezionata (non Download di default), salva direttamente nella cartella
@@ -266,7 +261,7 @@ const TMMergeToPdfForm = (props) => {
266
261
  return;
267
262
  }
268
263
  finally {
269
- setIsMergingPdf(false);
264
+ mergePanel.close();
270
265
  }
271
266
  onClose();
272
267
  };
@@ -367,29 +362,29 @@ const TMMergeToPdfForm = (props) => {
367
362
  ? SDKUI_Localizator.FileNotPdfWillBeExcluded.replaceParams(extLabel)
368
363
  : SDKUI_Localizator.FilesNotPdfWillBeExcluded.replaceParams(nonPdfSelectedItems.length.toString(), extLabel);
369
364
  })() }))] })] }))] })] }));
370
- return (_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel || isMergingPdf, showWaitPanelPrimary: isMergingPdf ? true : showPrimary, showWaitPanelSecondary: isMergingPdf ? false : showSecondary, waitPanelTitle: isMergingPdf ? SDKUI_Localizator.MergeToPdf : waitPanelTitle, waitPanelTextPrimary: isMergingPdf ? mergeProgressText : waitPanelTextPrimary, waitPanelValuePrimary: isMergingPdf ? mergeProgressValue : waitPanelValuePrimary, waitPanelMaxValuePrimary: isMergingPdf ? mergeProgressMax : waitPanelMaxValuePrimary, waitPanelTextSecondary: isMergingPdf ? '' : waitPanelTextSecondary, waitPanelValueSecondary: isMergingPdf ? 0 : waitPanelValueSecondary, waitPanelMaxValueSecondary: isMergingPdf ? 0 : waitPanelMaxValueSecondary, isCancelable: !isMergingPdf, abortController: abortController, usePortal: true, children: _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: {
371
- display: 'flex',
372
- alignItems: 'center',
373
- justifyContent: 'center',
374
- gap: '6px',
375
- padding: '8px 20px',
376
- fontSize: '0.95rem',
377
- fontWeight: 600,
378
- color: '#fff',
379
- background: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0) || !hasEnoughPdfForMerge)
380
- ? '#b0b0b0'
381
- : 'linear-gradient(135deg, #28a745 0%, #218838 100%)',
382
- border: 'none',
383
- borderRadius: '6px',
384
- cursor: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0) || !hasEnoughPdfForMerge) ? 'not-allowed' : 'pointer',
385
- boxShadow: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0) || !hasEnoughPdfForMerge)
386
- ? 'none'
387
- : '0 2px 8px rgba(40, 167, 69, 0.35)',
388
- transition: 'all 0.2s ease',
389
- }, children: [_jsx(IconPlay, {}), _jsx("span", { children: mergeableSelectedCount === 0
390
- ? SDKUI_Localizator.MergeToPdf
391
- : mergeableSelectedCount > 999
392
- ? _jsx(TMTooltip, { content: mergeableSelectedCount.toString(), children: SDKUI_Localizator.MergeFilesToPdf.replaceParams('999+') })
393
- : SDKUI_Localizator.MergeFilesToPdf.replaceParams(mergeableSelectedCount.toString()) })] }) })] }) }) }));
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()) })] }) })] }) }));
394
389
  };
395
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, waitPanel, abortController, } = useMultiMasterDetailDcmts({ dtd, masterDcmt, onClose, canNavigateMaster, onNavigateMaster });
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(TMLayoutWaitingContainer, { direction: 'vertical', ...waitPanel, isCancelable: true, abortController: abortController, usePortal: true, 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({
305
- steps,
306
- phase,
307
- hasMultipleTypes,
308
- isBackLocked,
309
- showBackArrow: isSummaryPhase,
310
- onBack: backToTypeSelection,
311
- onStepClick: (stepPhase) => (stepPhase === MultiDetailArchivePhase.SelectDcmtType ? backToTypeSelection() : setPhase(stepPhase)),
312
- }) }), !isSummaryPhase
313
- ? renderSelectDcmtType({ detailRelationItems, selectedRelation, onSelectRelation: selectRelation })
314
- : (isSummaryReady
315
- ? renderArchiveSummary()
316
- : _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: {
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;