@topconsultnpm/sdkui-react 6.22.0-dev3.23 → 6.22.0-dev3.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +45 -43
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +67 -60
- package/lib/components/base/Styled.d.ts +93 -77
- package/lib/components/base/TMAlert.js +6 -8
- package/lib/components/base/TMAreaManager.js +53 -55
- package/lib/components/base/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +2 -1
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMCustomButton.js +39 -48
- package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
- package/lib/components/base/TMFileManager.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +4 -6
- package/lib/components/base/TMLayout.d.ts +4 -4
- package/lib/components/base/TMList.d.ts +2 -1
- package/lib/components/base/TMListView.d.ts +1 -1
- package/lib/components/base/TMPanel.js +167 -167
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMTab.d.ts +4 -3
- package/lib/components/base/TMTabControl.js +208 -208
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +14 -8
- package/lib/components/base/TMTreeView.js +14 -0
- package/lib/components/base/TMUserAvatar.d.ts +2 -1
- package/lib/components/base/TMVilViewer.d.ts +2 -1
- package/lib/components/base/TMWaitPanel.d.ts +3 -2
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +169 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.js +320 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +53 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.js +274 -0
- package/lib/components/base/waitPanel/index.d.ts +1 -0
- package/lib/components/base/waitPanel/index.js +1 -0
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMPathChooser.js +17 -34
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +2 -1
- package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
- package/lib/components/choosers/TMUserChooser.d.ts +2 -2
- package/lib/components/editors/TMEditorStyled.d.ts +20 -42
- package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
- package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
- package/lib/components/features/documents/TMBatchUpdateForm.js +3 -4
- package/lib/components/features/documents/TMCopyToFolderForm.js +32 -35
- package/lib/components/features/documents/TMDcmtForm.js +48 -60
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtIcon.d.ts +2 -3
- package/lib/components/features/documents/TMDcmtIcon.js +3 -5
- package/lib/components/features/documents/TMDcmtPreview.d.ts +8 -6
- package/lib/components/features/documents/TMDcmtPreview.js +5 -3
- package/lib/components/features/documents/TMDcmtTasks.d.ts +2 -1
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +21 -21
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +45 -147
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +2 -1
- package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +2 -1
- package/lib/components/features/documents/TMMergeToPdfForm.js +48 -47
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +2 -1
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +14 -15
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +5 -5
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +3 -3
- package/lib/components/features/documents/TMRelationViewer.d.ts +3 -14
- package/lib/components/features/documents/TMRelationViewer.js +115 -79
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +2 -1
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.d.ts +2 -1
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +9 -3
- package/lib/components/features/search/TMSearchResult.js +6 -8
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +2 -1
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
- package/lib/components/features/search/TMViewHistoryDcmt.js +14 -25
- package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
- package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksView.js +91 -90
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +91 -91
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +8 -7
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +3 -1
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +3 -1
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/TMChooserForm.d.ts +2 -1
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.js +92 -96
- package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
- package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +2 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +5 -6
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
- package/lib/components/pages/TMPage.d.ts +1 -1
- package/lib/components/pages/TMPage.js +29 -31
- package/lib/components/query/TMQueryEditor.d.ts +14 -10
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
- package/lib/components/sidebar/TMHeader.d.ts +3 -3
- package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMMidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.d.ts +2 -2
- package/lib/helper/SDKUI_Localizator.d.ts +7 -0
- package/lib/helper/SDKUI_Localizator.js +70 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +2 -1
- package/lib/helper/TMAppUpdatedModal.js +93 -93
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +280 -280
- package/lib/helper/TMPdfViewer.d.ts +2 -1
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +10 -4
- package/lib/helper/ZipManager.d.ts +1 -1
- package/lib/helper/ZipManager.js +2 -1
- package/lib/helper/dcmtsHelper.d.ts +2 -0
- package/lib/helper/dcmtsHelper.js +3 -1
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
- package/lib/hooks/useCheckInOutOperations.js +14 -34
- package/lib/hooks/useDcmtOperations.d.ts +3 -12
- package/lib/hooks/useDcmtOperations.js +130 -160
- package/lib/hooks/useDocumentOperations.js +12 -23
- package/lib/hooks/useInputDialog.d.ts +2 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
- package/lib/hooks/useMultiMasterDetailDcmts.js +65 -67
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/services/platform_services.d.ts +3 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
2
|
import { LocalizeDcmtOperationTypes } from '../helper/Enum_Localizator';
|
|
3
3
|
import { SDK_Globals, RetrieveFileOptions, DcmtOpers, ResultTypes, RecentCategories, MetadataDataTypes, MetadataDataDomains, DataListCacheService, DcmtTypeListCacheService, TemplateTIDs } from '@topconsultnpm/sdk-ts';
|
|
4
|
-
import { ShowAlert, TMResultManager, FormulaHelper, TMExceptionBoxManager, TMSpinner } from '../components';
|
|
4
|
+
import { ShowAlert, TMResultManager, FormulaHelper, TMExceptionBoxManager, TMSpinner, TMWaitPanelManager } from '../components';
|
|
5
5
|
import { Globalization, getExceptionMessage, dialogConfirmOperation, extensionHandler, downloadBase64File, SDKUI_Globals, dcmtsFileCacheDownload, CACHE_SIZE_LIMIT, clearDcmtsFileCache, dcmtsFileCachePreview, isDcmtFileInCache, removeDcmtsFileCache, SDKUI_Localizator, ZipManager } from '../helper';
|
|
6
6
|
import { DcmtOperationTypes, DownloadTypes, FileExtensionHandler } from '../ts';
|
|
7
7
|
import { useFileDialog, useFileSourceDialog } from './useInputDialog';
|
|
@@ -9,8 +9,6 @@ import { importCertificatesAsync } from '../helper/certificateImportHelper';
|
|
|
9
9
|
import { isXMLFileExt } from '../helper/dcmtsHelper';
|
|
10
10
|
import { ShowConfirm } from '../components/base/TMConfirm';
|
|
11
11
|
import { generateTargetFileName } from '../components/features/documents/copyAndMergeDcmtsShared';
|
|
12
|
-
/** Intervallo minimo (ms) fra due aggiornamenti della progress bar di download. */
|
|
13
|
-
const DOWNLOAD_PROGRESS_THROTTLE_MS = 100;
|
|
14
12
|
const isScannerLicenseConfigured = () => {
|
|
15
13
|
try {
|
|
16
14
|
const scannerLicense = SDKUI_Globals.userSettings.advancedSettings.scannerLicense;
|
|
@@ -109,16 +107,22 @@ const getDownloadFileName = (file, dcmtInfo, useInputFileName = false) => {
|
|
|
109
107
|
return `${baseFileName.slice(0, firstDot)}(${count})${baseFileName.slice(firstDot)}`;
|
|
110
108
|
};
|
|
111
109
|
export const useDcmtOperations = () => {
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const
|
|
110
|
+
// Pannello imperativo: l'avanzamento non passa da uno stato React.
|
|
111
|
+
const waitPanelRef = useRef(null);
|
|
112
|
+
/** Apre il wait panel dell'operazione. Interrompi agisce sull'abortController del ciclo. */
|
|
113
|
+
const openWaitPanel = (options) => {
|
|
114
|
+
waitPanelRef.current?.close();
|
|
115
|
+
const panel = TMWaitPanelManager.show({ cancelable: true, onAbort: () => abortController.abort(), ...options });
|
|
116
|
+
waitPanelRef.current = panel;
|
|
117
|
+
return panel;
|
|
118
|
+
};
|
|
119
|
+
const closeWaitPanel = (panel) => {
|
|
120
|
+
panel.close();
|
|
121
|
+
if (waitPanelRef.current === panel)
|
|
122
|
+
waitPanelRef.current = null;
|
|
123
|
+
};
|
|
124
|
+
// Il pannello vive fuori dall'albero del chiamante: allo smontaggio va chiuso a mano.
|
|
125
|
+
useEffect(() => () => { waitPanelRef.current?.close(); waitPanelRef.current = null; }, []);
|
|
122
126
|
const { OpenFileDialog } = useFileDialog();
|
|
123
127
|
const [selectFileSource, FileSourceDialog] = useFileSourceDialog();
|
|
124
128
|
const copyCompliantDcmtsAsync = async (inputDcmt, onFileDownloaded) => {
|
|
@@ -131,8 +135,14 @@ export const useDcmtOperations = () => {
|
|
|
131
135
|
let returnDcmtInfos = [];
|
|
132
136
|
const rfo = new RetrieveFileOptions();
|
|
133
137
|
rfo.retrieveReason = DcmtOpers.ShowFile;
|
|
134
|
-
|
|
135
|
-
|
|
138
|
+
// Gira dentro runOperationAsync: i byte vanno sulla barra secondaria del pannello gia' aperto.
|
|
139
|
+
const publishSecondary = (pd, label) => {
|
|
140
|
+
const max = pd.ProgressBarMaximum ?? 0;
|
|
141
|
+
const completed = pd.ProgressBarValue === pd.ProgressBarMaximum;
|
|
142
|
+
waitPanelRef.current?.setSecondary(completed
|
|
143
|
+
? { value: 0, max: 0, text: '' }
|
|
144
|
+
: { value: pd.ProgressBarValue, max, text: `${label} ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(max, true)}` });
|
|
145
|
+
};
|
|
136
146
|
let signerInfoDescriptor = undefined;
|
|
137
147
|
if (inputDcmt?.FILEEXT == undefined || inputDcmt.FILEEXT == '') {
|
|
138
148
|
throw new Error('WARNING#' + SDKUI_Localizator.MetadataOnlyDocument);
|
|
@@ -181,21 +191,7 @@ export const useDcmtOperations = () => {
|
|
|
181
191
|
else
|
|
182
192
|
throw new Error('IdC non firmato e non marcato temporalmente!');
|
|
183
193
|
//Ricerca dell'impronta SHA256 nel contenuto dell'IdC
|
|
184
|
-
let fileIdC = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(serachResultIdC.dtdResult.rows[0][0], serachResultIdC.dtdResult.rows[0][1], rfo, abortController.signal, (pd) =>
|
|
185
|
-
if (firstBlock) {
|
|
186
|
-
maxFileSize = pd.ProgressBarMaximum ?? 0;
|
|
187
|
-
setWaitPanelMaxValueSecondary(maxFileSize);
|
|
188
|
-
firstBlock = false;
|
|
189
|
-
}
|
|
190
|
-
setWaitPanelValueSecondary(pd.ProgressBarValue);
|
|
191
|
-
setWaitPanelTextSecondary(`Downloading IdC... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`);
|
|
192
|
-
if (pd.ProgressBarValue === pd.ProgressBarMaximum) {
|
|
193
|
-
setWaitPanelMaxValueSecondary(0);
|
|
194
|
-
setWaitPanelValueSecondary(0);
|
|
195
|
-
setWaitPanelTextSecondary('');
|
|
196
|
-
firstBlock = true;
|
|
197
|
-
}
|
|
198
|
-
});
|
|
194
|
+
let fileIdC = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(serachResultIdC.dtdResult.rows[0][0], serachResultIdC.dtdResult.rows[0][1], rfo, abortController.signal, (pd) => publishSecondary(pd, 'Downloading IdC...'));
|
|
199
195
|
let hashOk = false;
|
|
200
196
|
if (fileIdC) {
|
|
201
197
|
try {
|
|
@@ -212,21 +208,7 @@ export const useDcmtOperations = () => {
|
|
|
212
208
|
throw new Error('Impronta non trovata nel file IdC o non corrispondente a quella del documento');
|
|
213
209
|
}
|
|
214
210
|
let file;
|
|
215
|
-
file = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(inputDcmt.TID, inputDcmt.DID, rfo, abortController.signal, (pd) =>
|
|
216
|
-
if (firstBlock) {
|
|
217
|
-
maxFileSize = pd.ProgressBarMaximum ?? 0;
|
|
218
|
-
setWaitPanelMaxValueSecondary(maxFileSize);
|
|
219
|
-
firstBlock = false;
|
|
220
|
-
}
|
|
221
|
-
setWaitPanelValueSecondary(pd.ProgressBarValue);
|
|
222
|
-
setWaitPanelTextSecondary(`Downloading... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`);
|
|
223
|
-
if (pd.ProgressBarValue === pd.ProgressBarMaximum) {
|
|
224
|
-
setWaitPanelMaxValueSecondary(0);
|
|
225
|
-
setWaitPanelValueSecondary(0);
|
|
226
|
-
setWaitPanelTextSecondary('');
|
|
227
|
-
firstBlock = true;
|
|
228
|
-
}
|
|
229
|
-
});
|
|
211
|
+
file = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(inputDcmt.TID, inputDcmt.DID, rfo, abortController.signal, (pd) => publishSecondary(pd, 'Downloading...'));
|
|
230
212
|
if (file && fileIdC) {
|
|
231
213
|
returnDcmtFiles.push(file);
|
|
232
214
|
returnDcmtInfos.push(inputDcmt);
|
|
@@ -283,13 +265,20 @@ export const useDcmtOperations = () => {
|
|
|
283
265
|
}
|
|
284
266
|
}
|
|
285
267
|
let operationTitle = 'Download File';
|
|
286
|
-
setShowWaitPanel(true);
|
|
287
|
-
setShowPrimary(inputDcmts.length > 1);
|
|
288
|
-
setShowSecondary(true);
|
|
289
|
-
setWaitPanelTitle(operationTitle);
|
|
290
268
|
abortController = new AbortController();
|
|
291
269
|
// Riferimento const: il narrowing su inputDcmts non sopravvive dentro le closure.
|
|
292
270
|
const dcmts = inputDcmts;
|
|
271
|
+
// Con un solo documento c'e' un avanzamento solo, quello dei byte, e sta sulla barra
|
|
272
|
+
// principale: la doppia barra (documenti + byte) serve solo all'elaborazione multipla.
|
|
273
|
+
const isBatch = dcmts.length > 1;
|
|
274
|
+
const panel = openWaitPanel({
|
|
275
|
+
title: operationTitle,
|
|
276
|
+
max: isBatch ? dcmts.length : 0,
|
|
277
|
+
showSecondary: isBatch,
|
|
278
|
+
showCounters: isBatch,
|
|
279
|
+
primaryLabel: isBatch ? SDKUI_Localizator.Documents : undefined,
|
|
280
|
+
secondaryLabel: isBatch ? 'File corrente' : undefined,
|
|
281
|
+
});
|
|
293
282
|
const rfo = new RetrieveFileOptions();
|
|
294
283
|
rfo.retrieveReason = retrieveOptions?.retrieveReason ?? DcmtOpers.ShowFile;
|
|
295
284
|
if (retrieveOptions?.cvtFormat !== undefined)
|
|
@@ -299,55 +288,38 @@ export const useDcmtOperations = () => {
|
|
|
299
288
|
rfo.invoiceRetrieveFormat = retrieveOptions?.invoiceRetrieveFormat ?? SDKUI_Globals.userSettings.searchSettings.invoiceRetrieveFormat;
|
|
300
289
|
rfo.orderRetrieveFormat = retrieveOptions?.orderRetrieveFormat ?? SDKUI_Globals.userSettings.searchSettings.orderRetrieveFormat;
|
|
301
290
|
const results = [];
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
if (!pendingSecondary)
|
|
312
|
-
return;
|
|
313
|
-
setWaitPanelMaxValueSecondary(pendingSecondary.max);
|
|
314
|
-
setWaitPanelValueSecondary(pendingSecondary.value);
|
|
315
|
-
setWaitPanelTextSecondary(pendingSecondary.text);
|
|
316
|
-
pendingSecondary = undefined;
|
|
317
|
-
};
|
|
318
|
-
const publishSecondaryProgress = () => {
|
|
319
|
-
const loaded = currentBytes?.loaded ?? 0;
|
|
320
|
-
const total = currentBytes?.total ?? 0;
|
|
321
|
-
pendingSecondary = total > 0
|
|
322
|
-
? { value: loaded, max: total, text: `Downloading... ${Globalization.getNumberDisplayValue(loaded, true)} / ${Globalization.getNumberDisplayValue(total, true)}` }
|
|
323
|
-
: { value: 0, max: 0, text: '' };
|
|
324
|
-
if (secondaryTimer === undefined)
|
|
325
|
-
secondaryTimer = setTimeout(flushSecondaryProgress, DOWNLOAD_PROGRESS_THROTTLE_MS);
|
|
291
|
+
// Il pannello coalesce le scritture in un flush per frame: nessun throttle serve.
|
|
292
|
+
const publishBytes = (loaded, total) => {
|
|
293
|
+
const text = total > 0
|
|
294
|
+
? `Downloading... ${Globalization.getNumberDisplayValue(loaded, true)} / ${Globalization.getNumberDisplayValue(total, true)}`
|
|
295
|
+
: '';
|
|
296
|
+
if (isBatch)
|
|
297
|
+
panel.setSecondary({ value: loaded, max: total, text });
|
|
298
|
+
else
|
|
299
|
+
panel.update({ value: loaded, max: total, subtitle: text });
|
|
326
300
|
};
|
|
327
301
|
// ---- Download sequenziale: un documento per volta ----
|
|
328
302
|
let completed = 0;
|
|
329
303
|
const downloadOne = async (i) => {
|
|
330
|
-
|
|
304
|
+
if (isBatch)
|
|
305
|
+
panel.setSubtitle(`Download file ${i + 1} di ${dcmts.length}`);
|
|
331
306
|
let file;
|
|
332
307
|
const cacheKey = `${dcmts[i].TID}-${dcmts[i].DID}`;
|
|
333
308
|
if (useCache && dcmtsFileCacheDownload.has(cacheKey)) {
|
|
334
309
|
file = dcmtsFileCacheDownload.get(cacheKey);
|
|
335
310
|
}
|
|
336
311
|
else {
|
|
337
|
-
currentBytes = { loaded: 0, total: 0 };
|
|
338
312
|
try {
|
|
339
|
-
file = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(dcmts[i].TID, dcmts[i].DID, rfo, abortController.signal, (pd) =>
|
|
340
|
-
currentBytes = { loaded: pd.ProgressBarValue, total: pd.ProgressBarMaximum ?? 0 };
|
|
341
|
-
publishSecondaryProgress();
|
|
342
|
-
});
|
|
313
|
+
file = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(dcmts[i].TID, dcmts[i].DID, rfo, abortController.signal, (pd) => publishBytes(pd.ProgressBarValue, pd.ProgressBarMaximum ?? 0));
|
|
343
314
|
}
|
|
344
315
|
finally {
|
|
345
|
-
|
|
346
|
-
|
|
316
|
+
if (isBatch)
|
|
317
|
+
publishBytes(0, 0);
|
|
347
318
|
}
|
|
348
319
|
}
|
|
349
320
|
completed++;
|
|
350
|
-
|
|
321
|
+
if (isBatch)
|
|
322
|
+
panel.setValue(completed);
|
|
351
323
|
if (downloadMode === "openInNewWindow") {
|
|
352
324
|
if (onFileDownloaded && file) {
|
|
353
325
|
onFileDownloaded(file, dcmts[i]);
|
|
@@ -386,30 +358,28 @@ export const useDcmtOperations = () => {
|
|
|
386
358
|
results.push({ rowIndex: i, id1: dcmts[i].TID, id2: dcmts[i].DID, resultType: ResultTypes.SUCCESS });
|
|
387
359
|
};
|
|
388
360
|
for (let i = 0; i < dcmts.length; i++) {
|
|
361
|
+
// Con la conferma di interruzione aperta il ciclo si ferma qui invece di
|
|
362
|
+
// continuare a scaricare dietro al dialogo.
|
|
363
|
+
await panel.waitWhilePaused();
|
|
389
364
|
if (abortController.signal.aborted) {
|
|
390
365
|
results.push({ rowIndex: i, id1: dcmts[i].TID, id2: dcmts[i].DID, resultType: ResultTypes.WARNING, description: `Operazione interrotta. Elaborati ${completed} documenti` });
|
|
366
|
+
panel.warning();
|
|
391
367
|
break;
|
|
392
368
|
}
|
|
393
369
|
try {
|
|
394
370
|
await downloadOne(i);
|
|
371
|
+
panel.ok();
|
|
395
372
|
}
|
|
396
373
|
catch (ex) {
|
|
397
374
|
results.push({ rowIndex: i, id1: dcmts[i].TID, id2: dcmts[i].DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(ex) });
|
|
375
|
+
panel.error();
|
|
398
376
|
const err = ex;
|
|
399
377
|
if (err.name === 'CanceledError') {
|
|
400
378
|
ShowAlert({ message: err.message, mode: 'warning', duration: 3000, title: 'Abort' });
|
|
401
379
|
}
|
|
402
380
|
}
|
|
403
381
|
}
|
|
404
|
-
|
|
405
|
-
clearTimeout(secondaryTimer);
|
|
406
|
-
setWaitPanelTextPrimary('');
|
|
407
|
-
setWaitPanelMaxValuePrimary(0);
|
|
408
|
-
setWaitPanelValuePrimary(0);
|
|
409
|
-
setWaitPanelTextSecondary('');
|
|
410
|
-
setWaitPanelMaxValueSecondary(0);
|
|
411
|
-
setWaitPanelValueSecondary(0);
|
|
412
|
-
setShowWaitPanel(false);
|
|
382
|
+
closeWaitPanel(panel);
|
|
413
383
|
TMResultManager.show(results, operationTitle, "TID", "DID", undefined, undefined, showSuccessAlert);
|
|
414
384
|
};
|
|
415
385
|
const _downloadAttachmentsAsync = async (inputDcmts, confirmAttachments, showSuccessAlert = true) => {
|
|
@@ -544,22 +514,37 @@ export const useDcmtOperations = () => {
|
|
|
544
514
|
}
|
|
545
515
|
if (!file)
|
|
546
516
|
return;
|
|
547
|
-
setShowWaitPanel(true);
|
|
548
|
-
setShowPrimary(inputDcmts.length > 1);
|
|
549
|
-
setShowSecondary(true);
|
|
550
|
-
setWaitPanelTitle(operationTitle);
|
|
551
517
|
abortController = new AbortController();
|
|
518
|
+
// Come nel download: con un solo documento resta il solo avanzamento in byte.
|
|
519
|
+
const isBatch = inputDcmts.length > 1;
|
|
520
|
+
const panel = openWaitPanel({
|
|
521
|
+
title: operationTitle,
|
|
522
|
+
max: isBatch ? inputDcmts.length : 0,
|
|
523
|
+
showSecondary: isBatch,
|
|
524
|
+
showCounters: isBatch,
|
|
525
|
+
primaryLabel: isBatch ? SDKUI_Localizator.Documents : undefined,
|
|
526
|
+
secondaryLabel: isBatch ? 'File corrente' : undefined,
|
|
527
|
+
});
|
|
528
|
+
const publishBytes = (loaded, total) => {
|
|
529
|
+
const text = total > 0
|
|
530
|
+
? `Uploading... ${Globalization.getNumberDisplayValue(loaded, true)} / ${Globalization.getNumberDisplayValue(total, true)}`
|
|
531
|
+
: '';
|
|
532
|
+
if (isBatch)
|
|
533
|
+
panel.setSecondary({ value: loaded, max: total, text });
|
|
534
|
+
else
|
|
535
|
+
panel.update({ value: loaded, max: total, subtitle: text });
|
|
536
|
+
};
|
|
552
537
|
let result = [];
|
|
553
|
-
setWaitPanelMaxValuePrimary(inputDcmts.length);
|
|
554
|
-
let firstBlock = true;
|
|
555
|
-
let maxFileSize = 0;
|
|
556
538
|
for (let i = 0; i < inputDcmts.length; i++) {
|
|
539
|
+
await panel.waitWhilePaused();
|
|
557
540
|
if (abortController.signal.aborted) {
|
|
558
541
|
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.WARNING, description: `Operazione interrotta. Elaborati ${i + 1} documenti` });
|
|
542
|
+
panel.warning();
|
|
559
543
|
break;
|
|
560
544
|
}
|
|
561
545
|
try {
|
|
562
|
-
|
|
546
|
+
if (isBatch)
|
|
547
|
+
panel.setSubtitle(`${SDKUI_Localizator.FileUpload} ${i + 1} di ${inputDcmts.length}`);
|
|
563
548
|
const cacheKey = `${inputDcmts[i].TID}-${inputDcmts[i].DID}`;
|
|
564
549
|
if (dcmtsFileCachePreview.has(cacheKey))
|
|
565
550
|
removeDcmtsFileCache(cacheKey);
|
|
@@ -567,41 +552,30 @@ export const useDcmtOperations = () => {
|
|
|
567
552
|
if (ue) {
|
|
568
553
|
ue.TID = inputDcmts[i].TID;
|
|
569
554
|
ue.DID = inputDcmts[i].DID;
|
|
570
|
-
await ue.SubstituteFileAsync(file, operType, undefined, abortController.signal,
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
setWaitPanelMaxValueSecondary(0);
|
|
580
|
-
setWaitPanelValueSecondary(0);
|
|
581
|
-
setWaitPanelTextSecondary('');
|
|
582
|
-
firstBlock = true;
|
|
583
|
-
}
|
|
584
|
-
});
|
|
555
|
+
await ue.SubstituteFileAsync(file, operType, undefined, abortController.signal,
|
|
556
|
+
// Byte finiti ma il server elabora ancora: la barra si azzera invece di restare al 100%.
|
|
557
|
+
(pd) => pd.ProgressBarValue === pd.ProgressBarMaximum
|
|
558
|
+
? publishBytes(0, 0)
|
|
559
|
+
: publishBytes(pd.ProgressBarValue, pd.ProgressBarMaximum ?? 0));
|
|
560
|
+
}
|
|
561
|
+
if (isBatch) {
|
|
562
|
+
publishBytes(0, 0);
|
|
563
|
+
panel.setValue(i + 1);
|
|
585
564
|
}
|
|
586
|
-
setWaitPanelValuePrimary(i + 1);
|
|
587
565
|
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.SUCCESS });
|
|
566
|
+
panel.ok();
|
|
588
567
|
}
|
|
589
568
|
catch (ex) {
|
|
590
569
|
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(ex) });
|
|
570
|
+
panel.error();
|
|
591
571
|
const err = ex;
|
|
592
572
|
if (err.name === 'CanceledError') {
|
|
593
573
|
ShowAlert({ message: err.message, mode: 'warning', duration: 3000, title: 'Abort' });
|
|
594
574
|
}
|
|
595
575
|
}
|
|
596
576
|
}
|
|
597
|
-
|
|
598
|
-
setWaitPanelMaxValuePrimary(0);
|
|
599
|
-
setWaitPanelValuePrimary(0);
|
|
600
|
-
setWaitPanelTextSecondary('');
|
|
601
|
-
setWaitPanelMaxValueSecondary(0);
|
|
602
|
-
setWaitPanelValueSecondary(0);
|
|
577
|
+
closeWaitPanel(panel);
|
|
603
578
|
actionAfterOperationAsync?.();
|
|
604
|
-
setShowWaitPanel(false);
|
|
605
579
|
TMResultManager.show(result, operationTitle, "TID", "DID");
|
|
606
580
|
};
|
|
607
581
|
const getDcmtFileAsync = async (inputDcmt, rfo, operationTitle, keepWaitPanelPrimary, bypassCache = false) => {
|
|
@@ -612,29 +586,21 @@ export const useDcmtOperations = () => {
|
|
|
612
586
|
const cacheKey = `${inputDcmt.TID}-${inputDcmt.DID}`;
|
|
613
587
|
if (!bypassCache && dcmtsFileCachePreview.has(cacheKey))
|
|
614
588
|
return { file: dcmtsFileCachePreview.get(cacheKey), isFromCache: true };
|
|
615
|
-
setShowWaitPanel(true);
|
|
616
|
-
setShowPrimary(keepWaitPanelPrimary);
|
|
617
|
-
setShowSecondary(true);
|
|
618
|
-
setWaitPanelTitle(operationTitle);
|
|
619
589
|
abortController = new AbortController();
|
|
620
|
-
|
|
621
|
-
|
|
590
|
+
// Un file solo: l'unico avanzamento e' quello in byte e sta sulla barra principale.
|
|
591
|
+
const panel = openWaitPanel({
|
|
592
|
+
title: operationTitle,
|
|
593
|
+
subtitle: extensionHandler(inputDcmt.FILEEXT ?? '') === FileExtensionHandler.CONVERTIBLE ? 'Conversione file in corso...' : 'Recupero file in corso...',
|
|
594
|
+
showCounters: false,
|
|
595
|
+
});
|
|
622
596
|
try {
|
|
623
|
-
setWaitPanelTextSecondary(extensionHandler(inputDcmt.FILEEXT ?? '') === FileExtensionHandler.CONVERTIBLE ? 'Conversione file in corso...' : 'Recupero file in corso...');
|
|
624
597
|
const file = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(inputDcmt?.TID, inputDcmt?.DID, rfo, abortController.signal, (pd) => {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
setWaitPanelTextSecondary(`Downloading... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`);
|
|
632
|
-
if (pd.ProgressBarValue === pd.ProgressBarMaximum) {
|
|
633
|
-
setWaitPanelMaxValueSecondary(0);
|
|
634
|
-
setWaitPanelValueSecondary(0);
|
|
635
|
-
setWaitPanelTextSecondary('');
|
|
636
|
-
firstBlock = true;
|
|
637
|
-
}
|
|
598
|
+
const max = pd.ProgressBarMaximum ?? 0;
|
|
599
|
+
panel.update({
|
|
600
|
+
value: pd.ProgressBarValue,
|
|
601
|
+
max,
|
|
602
|
+
subtitle: `Downloading... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(max, true)}`,
|
|
603
|
+
});
|
|
638
604
|
});
|
|
639
605
|
if (dcmtsFileCachePreview.size >= CACHE_SIZE_LIMIT) {
|
|
640
606
|
const oldestKey = dcmtsFileCachePreview.keys().next().value;
|
|
@@ -646,10 +612,7 @@ export const useDcmtOperations = () => {
|
|
|
646
612
|
return { file: file, isFromCache: false };
|
|
647
613
|
}
|
|
648
614
|
finally {
|
|
649
|
-
|
|
650
|
-
setWaitPanelMaxValueSecondary(0);
|
|
651
|
-
setWaitPanelValueSecondary(0);
|
|
652
|
-
setShowWaitPanel(false);
|
|
615
|
+
closeWaitPanel(panel);
|
|
653
616
|
}
|
|
654
617
|
};
|
|
655
618
|
const getDisplayValueMetadataValueDescriptor = async (mvd) => {
|
|
@@ -706,19 +669,26 @@ export const useDcmtOperations = () => {
|
|
|
706
669
|
return;
|
|
707
670
|
}
|
|
708
671
|
let zipEntries = [];
|
|
709
|
-
setShowWaitPanel(true);
|
|
710
|
-
setShowPrimary(true);
|
|
711
|
-
setShowSecondary(false);
|
|
712
|
-
setWaitPanelTitle(operationTitle);
|
|
713
672
|
abortController = new AbortController();
|
|
673
|
+
// La copia conforme scarica due file per documento: e' l'unica operazione del ciclo
|
|
674
|
+
// con un avanzamento di dettaglio, e gli serve la seconda barra.
|
|
675
|
+
const isCopyCompliant = dcmtOperationType === DcmtOperationTypes.CopyCompliant;
|
|
676
|
+
const panel = openWaitPanel({
|
|
677
|
+
title: operationTitle,
|
|
678
|
+
max: inputDcmts.length,
|
|
679
|
+
showSecondary: isCopyCompliant,
|
|
680
|
+
primaryLabel: isCopyCompliant ? SDKUI_Localizator.Documents : undefined,
|
|
681
|
+
secondaryLabel: isCopyCompliant ? 'File corrente' : undefined,
|
|
682
|
+
});
|
|
714
683
|
let result = [];
|
|
715
|
-
setWaitPanelMaxValuePrimary(inputDcmts.length);
|
|
716
684
|
for (let i = 0; i < inputDcmts.length; i++) {
|
|
685
|
+
await panel.waitWhilePaused();
|
|
717
686
|
if (abortController.signal.aborted) {
|
|
718
687
|
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.WARNING, description: `Operazione interrotta. Elaborati ${i + 1} documenti` });
|
|
688
|
+
panel.warning();
|
|
719
689
|
break;
|
|
720
690
|
}
|
|
721
|
-
|
|
691
|
+
panel.setSubtitle(`Documento ${i + 1} di ${inputDcmts.length}`);
|
|
722
692
|
try {
|
|
723
693
|
switch (dcmtOperationType) {
|
|
724
694
|
case DcmtOperationTypes.AddToFavs:
|
|
@@ -828,28 +798,29 @@ export const useDcmtOperations = () => {
|
|
|
828
798
|
}
|
|
829
799
|
}
|
|
830
800
|
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.SUCCESS });
|
|
801
|
+
panel.ok();
|
|
831
802
|
}
|
|
832
803
|
catch (ex) {
|
|
833
804
|
let msg = getExceptionMessage(ex);
|
|
834
805
|
if (msg.startsWith('WARNING#')) {
|
|
835
806
|
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.WARNING, description: msg.replace('WARNING#', '') });
|
|
807
|
+
panel.warning();
|
|
836
808
|
}
|
|
837
|
-
else
|
|
809
|
+
else {
|
|
838
810
|
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.ERROR, description: msg });
|
|
811
|
+
panel.error();
|
|
812
|
+
}
|
|
839
813
|
const err = ex;
|
|
840
814
|
if (err.name === 'CanceledError') {
|
|
841
815
|
ShowAlert({ message: err.message, mode: 'warning', duration: 3000, title: 'Abort' });
|
|
842
816
|
}
|
|
843
817
|
}
|
|
844
|
-
|
|
818
|
+
panel.setValue(i + 1);
|
|
845
819
|
}
|
|
846
820
|
if (zipEntries.length > 0) {
|
|
847
821
|
await zipDocuments(zipEntries, dcmtOperationType, inputDcmts[0].TID);
|
|
848
822
|
}
|
|
849
|
-
|
|
850
|
-
setWaitPanelValuePrimary(0);
|
|
851
|
-
setWaitPanelTextPrimary('');
|
|
852
|
-
setShowWaitPanel(false);
|
|
823
|
+
closeWaitPanel(panel);
|
|
853
824
|
actionAfterOperationAsync?.();
|
|
854
825
|
TMResultManager.show(result, operationTitle, "TID", "DID");
|
|
855
826
|
};
|
|
@@ -862,7 +833,6 @@ export const useDcmtOperations = () => {
|
|
|
862
833
|
}
|
|
863
834
|
};
|
|
864
835
|
return {
|
|
865
|
-
abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary,
|
|
866
836
|
downloadDcmtsAsync, getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache, runOperationAsync, FileSourceDialog
|
|
867
837
|
};
|
|
868
838
|
};
|
|
@@ -109,10 +109,10 @@ export const useDocumentOperations = (props) => {
|
|
|
109
109
|
// Context helpers
|
|
110
110
|
const isDcmtFormContext = context === SearchResultContext.DCMT_FORM;
|
|
111
111
|
const isMasterDetailContext = context === SearchResultContext.MASTER_DETAIL;
|
|
112
|
-
const { showHistory, showHistoryCallback, hideHistoryCallback, showCheckoutInformationForm, commentFormState, hideCommentFormCallback, showCheckoutInformationFormCallback, hideCheckoutInformationFormCallback, copyCheckoutPathToClipboardCallback, handleCheckOutCallback, handleCheckInCallback,
|
|
112
|
+
const { showHistory, showHistoryCallback, hideHistoryCallback, showCheckoutInformationForm, commentFormState, hideCommentFormCallback, showCheckoutInformationFormCallback, hideCheckoutInformationFormCallback, copyCheckoutPathToClipboardCallback, handleCheckOutCallback, handleCheckInCallback, } = useCheckInOutOperations({
|
|
113
113
|
onRefreshPreview: onRefreshPreviewCallback
|
|
114
114
|
});
|
|
115
|
-
const {
|
|
115
|
+
const { downloadDcmtsAsync, runOperationAsync, getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache, FileSourceDialog } = useDcmtOperations();
|
|
116
116
|
const {
|
|
117
117
|
// Data
|
|
118
118
|
relatedDcmts, pairedSearchResults, manyToManyRelations, selectedManyToManyRelation, manyToManyChooserDataSource, relatedDcmtsChooserDataSource,
|
|
@@ -178,8 +178,14 @@ export const useDocumentOperations = (props) => {
|
|
|
178
178
|
const [isOpenDetailsModal, setIsOpenDetailsModal] = useState(false);
|
|
179
179
|
const [isOpenMasterModal, setIsOpenMasterModal] = useState(false);
|
|
180
180
|
const [isOpenMultiDetailModal, setIsOpenMultiDetailModal] = useState(false);
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
// La maschera delle correlazioni viene montata subito (parte il calcolo, con il wait panel)
|
|
182
|
+
// ma resa visibile (isOpen...) solo a calcolo finito: intanto sotto restano i risultati.
|
|
183
|
+
const [isMountedDetails, setIsMountedDetails] = useState(false);
|
|
184
|
+
const [isMountedMaster, setIsMountedMaster] = useState(false);
|
|
185
|
+
const openDetailDcmtsFormHandler = (value) => { setIsMountedDetails(value); if (!value)
|
|
186
|
+
setIsOpenDetails(false); };
|
|
187
|
+
const openMasterDcmtsFormHandler = (value) => { setIsMountedMaster(value); if (!value)
|
|
188
|
+
setIsOpenMaster(false); };
|
|
183
189
|
const openDetailDcmtsModalHandler = (value) => { setIsOpenDetailsModal(value); };
|
|
184
190
|
const openMasterDcmtsModalHandler = (value) => { setIsOpenMasterModal(value); };
|
|
185
191
|
// State to control whether the export form (for exporting to Excel/CSV/txt and others) should be shown
|
|
@@ -1413,8 +1419,8 @@ export const useDocumentOperations = (props) => {
|
|
|
1413
1419
|
onRefreshBlogDatagrid,
|
|
1414
1420
|
onRefreshPreviewDatagrid
|
|
1415
1421
|
}, fetchRemoteCertificates: fetchRemoteCertificates, graphometricManager: graphometricManager })) }), (showHistory && dtd && selectedDcmtInfos.length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: dtd, deviceType: deviceType, inputDcmt: selectedDcmtInfos[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && selectedDcmtInfos.length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: selectedDcmtInfos[0].TID, did: selectedDcmtInfos[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: onRefreshBlog, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(selectedDcmtInfos[0].DID)] }), (showCheckoutInformationForm && dtd && selectedDcmtInfos.length > 0) &&
|
|
1416
|
-
_jsx(TMDcmtCheckoutInfoForm, { dtdName: dtd.name ?? SDKUI_Localizator.SearchResult, selectedDcmtOrFocused: selectedDcmtInfos[0], onClose: hideCheckoutInformationFormCallback }), isOpenDetailsModal && _jsx(TMModal, { width: "95%", height: "95%", onClose: () => setIsOpenDetailsModal(false), title: SDKUI_Localizator.Relations, children: _jsx(TMMasterDetailDcmts, { ...masterDetailDetailsCommonProps, onBack: () => setIsOpenDetailsModal(false) }) }), _jsx(StyledMultiViewPanel, { $isVisible: isOpenDetails, children:
|
|
1417
|
-
_jsx(TMMultiMasterDetailDcmtsForm, { dtd: dtd, masterDcmt: selectedDcmtInfos[0], onClose: () => setIsOpenMultiDetailModal(false), canNavigateMaster: canNavigateMultiDetailMaster ? canNavigateHandler : undefined, onNavigateMaster: canNavigateMultiDetailMaster ? onNavigateHandler : undefined, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar, showTodoDcmtForm: showTodoDcmtForm, openFileUploaderPdfEditor: openFileUploaderPdfEditor, graphometricManager: graphometricManager, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, fetchRemoteCertificates: fetchRemoteCertificates, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onReferenceClick: onReferenceClick, onTaskCreateRequest: onTaskCreateRequest, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onFileOpened: onFileOpened, passToArchiveCallback: passToArchiveCallback, openWGsCopyMoveForm: openWGsCopyMoveForm }), isOpenMasterModal && _jsx(TMModal, { width: "95%", height: "95%", onClose: () => setIsOpenMasterModal(false), title: SDKUI_Localizator.Relations, children: _jsx(TMMasterDetailDcmts, { ...masterDetailMasterCommonProps, onBack: () => setIsOpenMasterModal(false) }) }), _jsxs(StyledMultiViewPanel, { $isVisible: isOpenMaster, children: [
|
|
1422
|
+
_jsx(TMDcmtCheckoutInfoForm, { dtdName: dtd.name ?? SDKUI_Localizator.SearchResult, selectedDcmtOrFocused: selectedDcmtInfos[0], onClose: hideCheckoutInformationFormCallback }), isOpenDetailsModal && _jsx(TMModal, { width: "95%", height: "95%", onClose: () => setIsOpenDetailsModal(false), title: SDKUI_Localizator.Relations, children: _jsx(TMMasterDetailDcmts, { ...masterDetailDetailsCommonProps, onBack: () => setIsOpenDetailsModal(false) }) }), _jsx(StyledMultiViewPanel, { $isVisible: isOpenDetails, children: isMountedDetails && _jsx(TMMasterDetailDcmts, { ...masterDetailDetailsCommonProps, onFirstLoadCompleted: () => setIsOpenDetails(true), onBack: () => openDetailDcmtsFormHandler(false) }) }), (isOpenMultiDetailModal && dtd) &&
|
|
1423
|
+
_jsx(TMMultiMasterDetailDcmtsForm, { dtd: dtd, masterDcmt: selectedDcmtInfos[0], onClose: () => setIsOpenMultiDetailModal(false), canNavigateMaster: canNavigateMultiDetailMaster ? canNavigateHandler : undefined, onNavigateMaster: canNavigateMultiDetailMaster ? onNavigateHandler : undefined, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar, showTodoDcmtForm: showTodoDcmtForm, openFileUploaderPdfEditor: openFileUploaderPdfEditor, graphometricManager: graphometricManager, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, fetchRemoteCertificates: fetchRemoteCertificates, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onReferenceClick: onReferenceClick, onTaskCreateRequest: onTaskCreateRequest, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onFileOpened: onFileOpened, passToArchiveCallback: passToArchiveCallback, openWGsCopyMoveForm: openWGsCopyMoveForm }), isOpenMasterModal && _jsx(TMModal, { width: "95%", height: "95%", onClose: () => setIsOpenMasterModal(false), title: SDKUI_Localizator.Relations, children: _jsx(TMMasterDetailDcmts, { ...masterDetailMasterCommonProps, onBack: () => setIsOpenMasterModal(false) }) }), _jsxs(StyledMultiViewPanel, { $isVisible: isOpenMaster, children: [isMountedMaster && _jsx(TMMasterDetailDcmts, { ...masterDetailMasterCommonProps, onFirstLoadCompleted: () => setIsOpenMaster(true), onBack: () => openMasterDcmtsFormHandler(false) }), secondaryMasterDcmts.length > 0 && secondaryMasterDcmts.map((dcmt, index) => {
|
|
1418
1424
|
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { ...masterDetailMasterCommonProps, inputDcmts: [dcmt], allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID) }) }, `${index}-${dcmt.DID}`));
|
|
1419
1425
|
})] }), isOpenArchiveRelationForm && _jsx(TMDcmtForm, { isModal: true, titleModal: SDKUI_Localizator.Archive + ' - ' + (archiveType === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster), TID: archiveRelatedDcmtFormTID, layoutMode: LayoutModes.Ark, inputMids: archiveRelatedDcmtFormMids, showBackButton: false, allowButtonsRefs: false, onClose: () => {
|
|
1420
1426
|
setIsOpenArchiveRelationForm(false);
|
|
@@ -1513,25 +1519,8 @@ export const useDocumentOperations = (props) => {
|
|
|
1513
1519
|
copyCheckoutPathToClipboardCallback,
|
|
1514
1520
|
handleCheckOutCallback,
|
|
1515
1521
|
handleCheckInCallback,
|
|
1516
|
-
showCicoWaitPanel,
|
|
1517
|
-
cicoWaitPanelTitle,
|
|
1518
|
-
showCicoPrimaryProgress,
|
|
1519
|
-
cicoPrimaryProgressText,
|
|
1520
|
-
cicoPrimaryProgressValue,
|
|
1521
|
-
cicoPrimaryProgressMax,
|
|
1522
1522
|
},
|
|
1523
1523
|
dcmtOperations: {
|
|
1524
|
-
abortController,
|
|
1525
|
-
showWaitPanel,
|
|
1526
|
-
showPrimary,
|
|
1527
|
-
waitPanelTitle,
|
|
1528
|
-
waitPanelTextPrimary,
|
|
1529
|
-
waitPanelValuePrimary,
|
|
1530
|
-
waitPanelMaxValuePrimary,
|
|
1531
|
-
showSecondary,
|
|
1532
|
-
waitPanelTextSecondary,
|
|
1533
|
-
waitPanelValueSecondary,
|
|
1534
|
-
waitPanelMaxValueSecondary,
|
|
1535
1524
|
downloadDcmtsAsync,
|
|
1536
1525
|
getDcmtFileAsync,
|
|
1537
1526
|
clearDcmtsFileCache,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { FileDescriptor, FileFormats } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
export declare const useInputCvtFormatDialog: () => [() => Promise<FileFormats>, () => JSX.Element];
|
|
3
4
|
export declare const useFileDialog: () => {
|
|
@@ -5,7 +6,7 @@ export declare const useFileDialog: () => {
|
|
|
5
6
|
};
|
|
6
7
|
export declare const useInputAttachmentsDialog: () => {
|
|
7
8
|
openConfirmAttachmentsDialog: (list: FileDescriptor[]) => Promise<string[] | undefined>;
|
|
8
|
-
ConfirmAttachmentsDialog: () =>
|
|
9
|
+
ConfirmAttachmentsDialog: () => React.JSX.Element | null;
|
|
9
10
|
};
|
|
10
11
|
export type FileSourceType = 'filesystem' | 'scanner-new' | 'scanner-edit' | undefined;
|
|
11
12
|
export declare const useFileSourceDialog: () => [(hasExistingFile?: boolean) => Promise<FileSourceType>, () => JSX.Element];
|
|
@@ -16,19 +16,6 @@ export type MidValue = {
|
|
|
16
16
|
mid: number;
|
|
17
17
|
value: string;
|
|
18
18
|
};
|
|
19
|
-
/** Stato del wait panel: le chiavi sono quelle dei props di TMLayoutWaitingContainer */
|
|
20
|
-
export type WaitPanelState = {
|
|
21
|
-
showWaitPanel: boolean;
|
|
22
|
-
waitPanelTitle: string;
|
|
23
|
-
showWaitPanelPrimary: boolean;
|
|
24
|
-
waitPanelTextPrimary: string;
|
|
25
|
-
waitPanelValuePrimary: number;
|
|
26
|
-
waitPanelMaxValuePrimary: number;
|
|
27
|
-
showWaitPanelSecondary: boolean;
|
|
28
|
-
waitPanelTextSecondary: string;
|
|
29
|
-
waitPanelValueSecondary: number;
|
|
30
|
-
waitPanelMaxValueSecondary: number;
|
|
31
|
-
};
|
|
32
19
|
interface UseMultiMasterDetailDcmtsParams {
|
|
33
20
|
/** Tipo documento del master */
|
|
34
21
|
dtd: DcmtTypeDescriptor;
|
|
@@ -108,6 +95,4 @@ export declare const useMultiMasterDetailDcmts: ({ dtd, masterDcmt, onClose, can
|
|
|
108
95
|
setStopOnFirstError: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
109
96
|
isArchiving: boolean;
|
|
110
97
|
archiveAllAsync: () => Promise<void>;
|
|
111
|
-
waitPanel: WaitPanelState;
|
|
112
|
-
abortController: AbortController | undefined;
|
|
113
98
|
};
|