@topconsultnpm/sdkui-react 6.22.0-dev3.9 → 6.22.0-dev4.11
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/TMCounterContainer.d.ts +3 -1
- package/lib/components/base/TMCounterContainer.js +16 -1
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.js +24 -4
- 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 +5 -0
- package/lib/components/base/TMTabControl.js +18 -7
- 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 +179 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.js +373 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +58 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.js +346 -0
- package/lib/components/base/waitPanel/index.d.ts +1 -0
- package/lib/components/base/waitPanel/index.js +1 -0
- package/lib/components/choosers/TMDistinctValues.js +3 -3
- 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 +28 -0
- package/lib/components/features/assistant/TMHelpOnLineChat.js +1231 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
- package/lib/components/features/documents/TMBatchUpdateForm.js +3 -4
- package/lib/components/features/documents/TMCopyToFolderForm.js +53 -84
- 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 -148
- package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +52 -56
- 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 +51 -24
- package/lib/components/features/search/TMTreeSelector.js +23 -27
- package/lib/components/features/search/TMViewHistoryDcmt.js +15 -26
- package/lib/components/features/tasks/TMTasksView.js +97 -90
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +104 -100
- package/lib/components/forms/TMResultDialog.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +93 -97
- 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 +32 -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 +7 -2
- package/lib/helper/SDKUI_Globals.js +7 -2
- package/lib/helper/SDKUI_Localizator.d.ts +31 -6
- package/lib/helper/SDKUI_Localizator.js +301 -51
- package/lib/helper/ZipManager.d.ts +1 -1
- package/lib/helper/ZipManager.js +2 -1
- package/lib/helper/checkinCheckoutManager.js +2 -3
- 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 +16 -37
- package/lib/hooks/useDcmtOperations.d.ts +3 -19
- package/lib/hooks/useDcmtOperations.js +175 -229
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +16 -29
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
- package/lib/hooks/useMultiMasterDetailDcmts.js +70 -68
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/services/caseflow/CaseFlowService.d.ts +69 -9
- package/lib/services/caseflow/CaseFlowService.js +126 -58
- package/package.json +2 -2
|
@@ -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
|
-
|
|
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,37 @@ const TMMergeToPdfForm = (props) => {
|
|
|
162
152
|
// Raccoglie gli errori come downloadDcmtsAsync
|
|
163
153
|
const metadataConversionResults = [];
|
|
164
154
|
if (metadataOnlyDcmts.length > 0) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
|
|
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
|
-
metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description:
|
|
172
|
+
metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: SDKUI_Localizator.MetadataPdfCreationFailed });
|
|
173
|
+
metadataPanel.error(1, `DID ${dcmt.DID}: ${SDKUI_Localizator.MetadataPdfCreationFailed}`);
|
|
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
|
+
const description = getExceptionMessage(error);
|
|
179
|
+
metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description });
|
|
180
|
+
metadataPanel.error(1, `DID ${dcmt.DID}: ${description}`);
|
|
187
181
|
}
|
|
182
|
+
// Avanza a conversione conclusa: con un solo documento la barra non parte dal 100%
|
|
183
|
+
await metadataPanel.step();
|
|
188
184
|
}
|
|
189
|
-
|
|
190
|
-
setIsMergingPdf(false);
|
|
185
|
+
metadataPanel.close();
|
|
191
186
|
// Mostra riepilogo errori se presenti (come downloadDcmtsAsync)
|
|
192
187
|
const hasErrors = metadataConversionResults.some(r => r.resultType === ResultTypes.ERROR);
|
|
193
188
|
if (hasErrors) {
|
|
@@ -206,7 +201,7 @@ const TMMergeToPdfForm = (props) => {
|
|
|
206
201
|
const collectFileForMerge = async (file, dcmtInfo) => {
|
|
207
202
|
pdfFilesMap.set(`${dcmtInfo.TID}_${dcmtInfo.DID}`, file);
|
|
208
203
|
};
|
|
209
|
-
await downloadDcmtsAsync({ inputDcmts: dcmtsWithFile, downloadType: DownloadTypes.Dcmt, downloadMode: 'download', onFileDownloaded: collectFileForMerge, skipConfirmation: true, retrieveOptions: rfo, useCache: false
|
|
204
|
+
await downloadDcmtsAsync({ inputDcmts: dcmtsWithFile, downloadType: DownloadTypes.Dcmt, downloadMode: 'download', onFileDownloaded: collectFileForMerge, skipConfirmation: true, retrieveOptions: rfo, useCache: false });
|
|
210
205
|
}
|
|
211
206
|
// Ricostruisci l'array pdfFiles nell'ordine originale di selezione
|
|
212
207
|
const pdfFiles = [];
|
|
@@ -233,16 +228,17 @@ const TMMergeToPdfForm = (props) => {
|
|
|
233
228
|
if (!pdfFiles)
|
|
234
229
|
return;
|
|
235
230
|
const finalName = pdfFileName.trim().toLowerCase().endsWith('.pdf') ? pdfFileName.trim() : pdfFileName.trim() + '.pdf';
|
|
236
|
-
//
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
231
|
+
// Il merge non e' interrompibile: pannello senza Interrompi.
|
|
232
|
+
const mergePanel = TMWaitPanelManager.show({
|
|
233
|
+
title: SDKUI_Localizator.MergeToPdf,
|
|
234
|
+
subtitle: SDKUI_Localizator.MergeToPdf,
|
|
235
|
+
max: pdfFiles.length,
|
|
236
|
+
showCounters: false,
|
|
237
|
+
});
|
|
241
238
|
try {
|
|
242
239
|
const mergeOptions = {
|
|
243
240
|
onProgress: (current, total, file) => {
|
|
244
|
-
|
|
245
|
-
setMergeProgressText(`${SDKUI_Localizator.MergeToPdf}: ${file.name}`);
|
|
241
|
+
mergePanel.update({ value: current, subtitle: `${SDKUI_Localizator.MergeToPdf}: ${file.name}` });
|
|
246
242
|
}
|
|
247
243
|
};
|
|
248
244
|
// Se c'è una cartella selezionata (non Download di default), salva direttamente nella cartella
|
|
@@ -266,7 +262,7 @@ const TMMergeToPdfForm = (props) => {
|
|
|
266
262
|
return;
|
|
267
263
|
}
|
|
268
264
|
finally {
|
|
269
|
-
|
|
265
|
+
mergePanel.close();
|
|
270
266
|
}
|
|
271
267
|
onClose();
|
|
272
268
|
};
|
|
@@ -367,29 +363,29 @@ const TMMergeToPdfForm = (props) => {
|
|
|
367
363
|
? SDKUI_Localizator.FileNotPdfWillBeExcluded.replaceParams(extLabel)
|
|
368
364
|
: SDKUI_Localizator.FilesNotPdfWillBeExcluded.replaceParams(nonPdfSelectedItems.length.toString(), extLabel);
|
|
369
365
|
})() }))] })] }))] })] }));
|
|
370
|
-
return (_jsx(
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
366
|
+
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: {
|
|
367
|
+
display: 'flex',
|
|
368
|
+
alignItems: 'center',
|
|
369
|
+
justifyContent: 'center',
|
|
370
|
+
gap: '6px',
|
|
371
|
+
padding: '8px 20px',
|
|
372
|
+
fontSize: '0.95rem',
|
|
373
|
+
fontWeight: 600,
|
|
374
|
+
color: '#fff',
|
|
375
|
+
background: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0) || !hasEnoughPdfForMerge)
|
|
376
|
+
? '#b0b0b0'
|
|
377
|
+
: 'linear-gradient(135deg, #28a745 0%, #218838 100%)',
|
|
378
|
+
border: 'none',
|
|
379
|
+
borderRadius: '6px',
|
|
380
|
+
cursor: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0) || !hasEnoughPdfForMerge) ? 'not-allowed' : 'pointer',
|
|
381
|
+
boxShadow: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0) || !hasEnoughPdfForMerge)
|
|
382
|
+
? 'none'
|
|
383
|
+
: '0 2px 8px rgba(40, 167, 69, 0.35)',
|
|
384
|
+
transition: 'all 0.2s ease',
|
|
385
|
+
}, children: [_jsx(IconPlay, {}), _jsx("span", { children: mergeableSelectedCount === 0
|
|
386
|
+
? SDKUI_Localizator.MergeToPdf
|
|
387
|
+
: mergeableSelectedCount > 999
|
|
388
|
+
? _jsx(TMTooltip, { content: mergeableSelectedCount.toString(), children: SDKUI_Localizator.MergeFilesToPdf.replaceParams('999+') })
|
|
389
|
+
: SDKUI_Localizator.MergeFilesToPdf.replaceParams(mergeableSelectedCount.toString()) })] }) })] }) }));
|
|
394
390
|
};
|
|
395
391
|
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;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DcmtTypeDescriptor, SearchResultDescriptor, DataColumnDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
3
|
import { DcmtMetadataMap } from '../../../helper';
|
|
4
|
-
import { DcmtInfo
|
|
4
|
+
import { DcmtInfo } from '../../../ts';
|
|
5
5
|
import { ITMTreeItem } from '../../base/TMTreeView';
|
|
6
|
+
import { RelationTreeState } from './relationTreeState';
|
|
6
7
|
/**
|
|
7
8
|
* Tree item structure for relations
|
|
8
9
|
*/
|
|
@@ -26,6 +27,7 @@ export interface RelationTreeItem extends ITMTreeItem {
|
|
|
26
27
|
fileExt?: string;
|
|
27
28
|
fileCount?: number;
|
|
28
29
|
}
|
|
30
|
+
export type { RelationTreeState } from './relationTreeState';
|
|
29
31
|
/**
|
|
30
32
|
* Props for TMRelationViewer component
|
|
31
33
|
*/
|
|
@@ -111,11 +113,6 @@ export interface TMRelationViewerProps {
|
|
|
111
113
|
* Use to show a context menu.
|
|
112
114
|
*/
|
|
113
115
|
onItemContextMenu?: (item: RelationTreeItem, e: React.MouseEvent) => void;
|
|
114
|
-
/**
|
|
115
|
-
* Metadata values for the focused item
|
|
116
|
-
* (used in master-detail context)
|
|
117
|
-
*/
|
|
118
|
-
focusedItemFormData?: MetadataValueDescriptorEx[];
|
|
119
116
|
/**
|
|
120
117
|
* If true, shows a toolbar button to expand/collapse all tree nodes.
|
|
121
118
|
* Default: false
|
|
@@ -132,11 +129,6 @@ export interface TMRelationViewerProps {
|
|
|
132
129
|
* Useful to disable interactions (like context menu) during loading.
|
|
133
130
|
*/
|
|
134
131
|
onLoadingStateChanged?: (isLoading: boolean) => void;
|
|
135
|
-
/**
|
|
136
|
-
* Invoked while the initial correlations load progresses, with how many input
|
|
137
|
-
* documents have been processed out of the total.
|
|
138
|
-
*/
|
|
139
|
-
onLoadingProgress?: (value: number, max: number) => void;
|
|
140
132
|
/**
|
|
141
133
|
* Invoked on mount to hand over a function that stops the ongoing correlations
|
|
142
134
|
* calculation: no further GetMetadata calls are performed and only the
|
|
@@ -151,6 +143,14 @@ export interface TMRelationViewerProps {
|
|
|
151
143
|
* Riceve quanti documenti di input sono stati completati sul totale.
|
|
152
144
|
*/
|
|
153
145
|
onCalculationStopped?: (loadedCount: number, totalCount: number) => void;
|
|
146
|
+
/**
|
|
147
|
+
* Stato dell'albero da ripristinare al primo caricamento, al posto dell'espansione
|
|
148
|
+
* iniziale predefinita: permette al padre di rimontare il viewer dopo un'operazione
|
|
149
|
+
* senza che l'albero torni allo stato di partenza. Se assente vale il default.
|
|
150
|
+
*/
|
|
151
|
+
initialTreeState?: RelationTreeState;
|
|
152
|
+
/** Notifica lo stato dell'albero, da restituire come `initialTreeState` dopo un refresh. */
|
|
153
|
+
onTreeStateChange?: (state: RelationTreeState) => void;
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
156
|
* Check if document type has detail relations
|
|
@@ -166,10 +166,9 @@ export declare const hasMasterRelations: (dTID: number | undefined) => Promise<b
|
|
|
166
166
|
export declare const getDisplayValueByColumn: (col: DataColumnDescriptor | undefined, value: any) => any;
|
|
167
167
|
/**
|
|
168
168
|
* Convert SearchResultDescriptor to structured data source with metadata
|
|
169
|
-
* I valori dei documenti sono
|
|
169
|
+
* I valori dei documenti sono già presenti nelle righe restituite dalla ricerca:
|
|
170
170
|
* qui vengono solo abbinati ai rispettivi MetadataDescriptor (perm,
|
|
171
|
-
* isSpecialSearchOutput, ...), risolti
|
|
172
|
-
* Nessuna chiamata al server per riga.
|
|
171
|
+
* isSpecialSearchOutput, ...), risolti una sola volta per tipo documento.
|
|
173
172
|
*/
|
|
174
173
|
export declare const searchResultToDataSource: (searchResult: SearchResultDescriptor | undefined, hideSysMetadata?: boolean, signal?: AbortSignal) => Promise<any[]>;
|
|
175
174
|
export declare const DEFAULT_RELATION_EXPAND_LEVEL = 4;
|