@topconsultnpm/sdkui-react 6.22.0-dev3.8 → 6.22.0-dev4.10
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 +43 -45
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +60 -67
- package/lib/components/base/Styled.d.ts +77 -93
- 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/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +4 -3
- package/lib/components/base/TMCounterContainer.js +16 -1
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.js +243 -223
- package/lib/components/base/TMDataGridExportForm.d.ts +1 -2
- package/lib/components/base/TMFileManager.d.ts +1 -2
- package/lib/components/base/TMFileManagerDataGridView.d.ts +1 -2
- 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 +6 -4
- package/lib/components/base/TMLayout.d.ts +4 -4
- package/lib/components/base/TMList.d.ts +1 -2
- package/lib/components/base/TMListView.d.ts +1 -1
- package/lib/components/base/TMPanel.js +173 -170
- package/lib/components/base/TMSpinner.d.ts +3 -3
- package/lib/components/base/TMSpinner.js +9 -7
- package/lib/components/base/TMTab.d.ts +3 -4
- package/lib/components/base/TMTabControl.d.ts +7 -0
- package/lib/components/base/TMTabControl.js +225 -213
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +8 -14
- package/lib/components/base/TMTreeView.js +20 -0
- package/lib/components/base/TMUserAvatar.d.ts +1 -2
- package/lib/components/base/TMVilViewer.d.ts +1 -2
- package/lib/components/base/TMWaitPanel.d.ts +2 -3
- 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 +57 -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/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +1 -2
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +1 -2
- package/lib/components/choosers/TMPathChooser.js +17 -34
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +1 -2
- 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 +42 -20
- package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +1 -2
- package/lib/components/editors/TMHtmlEditor.d.ts +1 -2
- package/lib/components/editors/TMTextBox.d.ts +4 -0
- package/lib/components/editors/TMTextBox.js +99 -11
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- 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.d.ts +1 -1
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +1 -2
- package/lib/components/features/documents/TMBatchUpdateForm.js +3 -4
- package/lib/components/features/documents/TMCopyToFolderForm.js +50 -42
- package/lib/components/features/documents/TMDcmtForm.js +50 -61
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -4
- package/lib/components/features/documents/TMDcmtIcon.js +3 -5
- package/lib/components/features/documents/TMDcmtPreview.d.ts +6 -8
- package/lib/components/features/documents/TMDcmtPreview.js +5 -3
- package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -2
- package/lib/components/features/documents/TMDcmtTasks.js +2 -9
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +5 -5
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +53 -141
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +1 -2
- package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +59 -56
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +1 -2
- 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 +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/TMDcmtCheckoutInfoForm.d.ts +1 -2
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +1 -2
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +1 -2
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.d.ts +1 -2
- package/lib/components/features/search/TMSearch.js +3 -4
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +3 -9
- 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 +129 -102
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +1 -2
- package/lib/components/features/search/TMTreeSelector.js +23 -27
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +1 -2
- package/lib/components/features/search/TMViewHistoryDcmt.js +15 -26
- 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 +97 -90
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +2 -3
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +95 -91
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +7 -8
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +1 -3
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +1 -3
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/TMChooserForm.d.ts +1 -2
- package/lib/components/forms/TMResultDialog.js +1 -1
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +1 -2
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.js +93 -97
- package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
- package/lib/components/grids/TMValidationItemsList.d.ts +1 -2
- package/lib/components/index.d.ts +5 -1
- package/lib/components/index.js +4 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -2
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +4 -3
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +3 -2
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +5 -1
- package/lib/components/layout/panelManager/TMPanelManagerLoader.d.ts +5 -0
- package/lib/components/layout/panelManager/TMPanelManagerLoader.js +18 -0
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +6 -5
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +4 -8
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.js +2 -1
- 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 +32 -31
- package/lib/components/query/TMQueryEditor.d.ts +13 -14
- package/lib/components/query/TMQueryEditor.js +2 -1
- package/lib/components/settings/SettingsAppearance.d.ts +1 -2
- package/lib/components/sidebar/TMAboutApp.d.ts +1 -2
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
- package/lib/components/sidebar/TMHeader.d.ts +4 -3
- package/lib/components/sidebar/TMHeader.js +2 -2
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -3
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +2 -3
- package/lib/components/viewers/TMMidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.d.ts +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/TMAppUpdatedModal.d.ts +1 -2
- 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 +1 -2
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +4 -10
- 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 +201 -184
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +14 -25
- package/lib/hooks/useInputDialog.d.ts +1 -2
- 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/lib/services/platform_services.d.ts +2 -3
- package/package.json +2 -2
|
@@ -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';
|
|
@@ -107,16 +107,24 @@ const getDownloadFileName = (file, dcmtInfo, useInputFileName = false) => {
|
|
|
107
107
|
return `${baseFileName.slice(0, firstDot)}(${count})${baseFileName.slice(firstDot)}`;
|
|
108
108
|
};
|
|
109
109
|
export const useDcmtOperations = () => {
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
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
|
+
/** Messaggio per il popover delle pill del pannello: il DID dice a quale documento si riferisce. */
|
|
125
|
+
const panelMessage = (dcmt, message) => `DID ${dcmt.DID}: ${message}`;
|
|
126
|
+
// Il pannello vive fuori dall'albero del chiamante: allo smontaggio va chiuso a mano.
|
|
127
|
+
useEffect(() => () => { waitPanelRef.current?.close(); waitPanelRef.current = null; }, []);
|
|
120
128
|
const { OpenFileDialog } = useFileDialog();
|
|
121
129
|
const [selectFileSource, FileSourceDialog] = useFileSourceDialog();
|
|
122
130
|
const copyCompliantDcmtsAsync = async (inputDcmt, onFileDownloaded) => {
|
|
@@ -129,8 +137,14 @@ export const useDcmtOperations = () => {
|
|
|
129
137
|
let returnDcmtInfos = [];
|
|
130
138
|
const rfo = new RetrieveFileOptions();
|
|
131
139
|
rfo.retrieveReason = DcmtOpers.ShowFile;
|
|
132
|
-
|
|
133
|
-
|
|
140
|
+
// Gira dentro runOperationAsync: i byte vanno sulla barra secondaria del pannello gia' aperto.
|
|
141
|
+
const publishSecondary = (pd, label) => {
|
|
142
|
+
const max = pd.ProgressBarMaximum ?? 0;
|
|
143
|
+
const completed = pd.ProgressBarValue === pd.ProgressBarMaximum;
|
|
144
|
+
waitPanelRef.current?.setSecondary(completed
|
|
145
|
+
? { value: 0, max: 0, text: '' }
|
|
146
|
+
: { value: pd.ProgressBarValue, max, text: `${label} ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(max, true)}` });
|
|
147
|
+
};
|
|
134
148
|
let signerInfoDescriptor = undefined;
|
|
135
149
|
if (inputDcmt?.FILEEXT == undefined || inputDcmt.FILEEXT == '') {
|
|
136
150
|
throw new Error('WARNING#' + SDKUI_Localizator.MetadataOnlyDocument);
|
|
@@ -179,21 +193,7 @@ export const useDcmtOperations = () => {
|
|
|
179
193
|
else
|
|
180
194
|
throw new Error('IdC non firmato e non marcato temporalmente!');
|
|
181
195
|
//Ricerca dell'impronta SHA256 nel contenuto dell'IdC
|
|
182
|
-
let fileIdC = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(serachResultIdC.dtdResult.rows[0][0], serachResultIdC.dtdResult.rows[0][1], rfo, abortController.signal, (pd) =>
|
|
183
|
-
if (firstBlock) {
|
|
184
|
-
maxFileSize = pd.ProgressBarMaximum ?? 0;
|
|
185
|
-
setWaitPanelMaxValueSecondary(maxFileSize);
|
|
186
|
-
firstBlock = false;
|
|
187
|
-
}
|
|
188
|
-
setWaitPanelValueSecondary(pd.ProgressBarValue);
|
|
189
|
-
setWaitPanelTextSecondary(`Downloading IdC... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`);
|
|
190
|
-
if (pd.ProgressBarValue === pd.ProgressBarMaximum) {
|
|
191
|
-
setWaitPanelMaxValueSecondary(0);
|
|
192
|
-
setWaitPanelValueSecondary(0);
|
|
193
|
-
setWaitPanelTextSecondary('');
|
|
194
|
-
firstBlock = true;
|
|
195
|
-
}
|
|
196
|
-
});
|
|
196
|
+
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...'));
|
|
197
197
|
let hashOk = false;
|
|
198
198
|
if (fileIdC) {
|
|
199
199
|
try {
|
|
@@ -210,21 +210,7 @@ export const useDcmtOperations = () => {
|
|
|
210
210
|
throw new Error('Impronta non trovata nel file IdC o non corrispondente a quella del documento');
|
|
211
211
|
}
|
|
212
212
|
let file;
|
|
213
|
-
file = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(inputDcmt.TID, inputDcmt.DID, rfo, abortController.signal, (pd) =>
|
|
214
|
-
if (firstBlock) {
|
|
215
|
-
maxFileSize = pd.ProgressBarMaximum ?? 0;
|
|
216
|
-
setWaitPanelMaxValueSecondary(maxFileSize);
|
|
217
|
-
firstBlock = false;
|
|
218
|
-
}
|
|
219
|
-
setWaitPanelValueSecondary(pd.ProgressBarValue);
|
|
220
|
-
setWaitPanelTextSecondary(`Downloading... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`);
|
|
221
|
-
if (pd.ProgressBarValue === pd.ProgressBarMaximum) {
|
|
222
|
-
setWaitPanelMaxValueSecondary(0);
|
|
223
|
-
setWaitPanelValueSecondary(0);
|
|
224
|
-
setWaitPanelTextSecondary('');
|
|
225
|
-
firstBlock = true;
|
|
226
|
-
}
|
|
227
|
-
});
|
|
213
|
+
file = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(inputDcmt.TID, inputDcmt.DID, rfo, abortController.signal, (pd) => publishSecondary(pd, 'Downloading...'));
|
|
228
214
|
if (file && fileIdC) {
|
|
229
215
|
returnDcmtFiles.push(file);
|
|
230
216
|
returnDcmtInfos.push(inputDcmt);
|
|
@@ -281,11 +267,20 @@ export const useDcmtOperations = () => {
|
|
|
281
267
|
}
|
|
282
268
|
}
|
|
283
269
|
let operationTitle = 'Download File';
|
|
284
|
-
setShowWaitPanel(true);
|
|
285
|
-
setShowPrimary(inputDcmts.length > 1);
|
|
286
|
-
setShowSecondary(true);
|
|
287
|
-
setWaitPanelTitle(operationTitle);
|
|
288
270
|
abortController = new AbortController();
|
|
271
|
+
// Riferimento const: il narrowing su inputDcmts non sopravvive dentro le closure.
|
|
272
|
+
const dcmts = inputDcmts;
|
|
273
|
+
// Con un solo documento c'e' un avanzamento solo, quello dei byte, e sta sulla barra
|
|
274
|
+
// principale: la doppia barra (documenti + byte) serve solo all'elaborazione multipla.
|
|
275
|
+
const isBatch = dcmts.length > 1;
|
|
276
|
+
const panel = openWaitPanel({
|
|
277
|
+
title: operationTitle,
|
|
278
|
+
max: isBatch ? dcmts.length : 0,
|
|
279
|
+
showSecondary: isBatch,
|
|
280
|
+
showCounters: isBatch,
|
|
281
|
+
primaryLabel: isBatch ? SDKUI_Localizator.Documents : undefined,
|
|
282
|
+
secondaryLabel: isBatch ? 'File corrente' : undefined,
|
|
283
|
+
});
|
|
289
284
|
const rfo = new RetrieveFileOptions();
|
|
290
285
|
rfo.retrieveReason = retrieveOptions?.retrieveReason ?? DcmtOpers.ShowFile;
|
|
291
286
|
if (retrieveOptions?.cvtFormat !== undefined)
|
|
@@ -294,85 +289,102 @@ export const useDcmtOperations = () => {
|
|
|
294
289
|
rfo.generalRetrieveFormat = retrieveOptions.generalRetrieveFormat;
|
|
295
290
|
rfo.invoiceRetrieveFormat = retrieveOptions?.invoiceRetrieveFormat ?? SDKUI_Globals.userSettings.searchSettings.invoiceRetrieveFormat;
|
|
296
291
|
rfo.orderRetrieveFormat = retrieveOptions?.orderRetrieveFormat ?? SDKUI_Globals.userSettings.searchSettings.orderRetrieveFormat;
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
292
|
+
const results = [];
|
|
293
|
+
// Il pannello coalesce le scritture in un flush per frame: nessun throttle serve.
|
|
294
|
+
const publishBytes = (loaded, total) => {
|
|
295
|
+
const text = total > 0
|
|
296
|
+
? `Downloading... ${Globalization.getNumberDisplayValue(loaded, true)} / ${Globalization.getNumberDisplayValue(total, true)}`
|
|
297
|
+
: '';
|
|
298
|
+
if (isBatch)
|
|
299
|
+
panel.setSecondary({ value: loaded, max: total, text });
|
|
300
|
+
else
|
|
301
|
+
panel.update({ value: loaded, max: total, subtitle: text });
|
|
302
|
+
};
|
|
303
|
+
// ---- Download sequenziale: un documento per volta ----
|
|
304
|
+
let completed = 0;
|
|
305
|
+
const downloadOne = async (i) => {
|
|
306
|
+
if (isBatch)
|
|
307
|
+
panel.setSubtitle(`Download file ${i + 1} di ${dcmts.length}`);
|
|
308
|
+
let file;
|
|
309
|
+
const cacheKey = `${dcmts[i].TID}-${dcmts[i].DID}`;
|
|
310
|
+
if (useCache && dcmtsFileCacheDownload.has(cacheKey)) {
|
|
311
|
+
file = dcmtsFileCacheDownload.get(cacheKey);
|
|
305
312
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
313
|
+
else {
|
|
314
|
+
try {
|
|
315
|
+
file = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(dcmts[i].TID, dcmts[i].DID, rfo, abortController.signal, (pd) => publishBytes(pd.ProgressBarValue, pd.ProgressBarMaximum ?? 0));
|
|
316
|
+
}
|
|
317
|
+
finally {
|
|
318
|
+
if (isBatch)
|
|
319
|
+
publishBytes(0, 0);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
completed++;
|
|
323
|
+
if (isBatch)
|
|
324
|
+
panel.setValue(completed);
|
|
325
|
+
if (downloadMode === "openInNewWindow") {
|
|
326
|
+
if (onFileDownloaded && file) {
|
|
327
|
+
onFileDownloaded(file, dcmts[i]);
|
|
312
328
|
}
|
|
313
329
|
else {
|
|
314
|
-
|
|
315
|
-
if (firstBlock) {
|
|
316
|
-
maxFileSize = pd.ProgressBarMaximum ?? 0;
|
|
317
|
-
setWaitPanelMaxValueSecondary(maxFileSize);
|
|
318
|
-
firstBlock = false;
|
|
319
|
-
}
|
|
320
|
-
setWaitPanelValueSecondary(pd.ProgressBarValue);
|
|
321
|
-
setWaitPanelTextSecondary(`Downloading... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`);
|
|
322
|
-
if (pd.ProgressBarValue === pd.ProgressBarMaximum) {
|
|
323
|
-
setWaitPanelMaxValueSecondary(0);
|
|
324
|
-
setWaitPanelValueSecondary(0);
|
|
325
|
-
setWaitPanelTextSecondary('');
|
|
326
|
-
firstBlock = true;
|
|
327
|
-
}
|
|
328
|
-
});
|
|
330
|
+
window.open(window.URL.createObjectURL(file), '_blank', 'noopener');
|
|
329
331
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
if (
|
|
333
|
-
(
|
|
334
|
-
? onFileDownloaded(file, inputDcmts[i])
|
|
335
|
-
: window.open(fileURL, '_blank', 'noopener');
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
if (onFileDownloaded && file) {
|
|
335
|
+
await onFileDownloaded(file, dcmts[i]);
|
|
336
336
|
}
|
|
337
337
|
else {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
338
|
+
// L'object URL serve solo in questo ramo: creato qui e revocato dopo il
|
|
339
|
+
// click, così i blob non restano agganciati al documento per sempre.
|
|
340
|
+
const fileURL = window.URL.createObjectURL(file);
|
|
341
|
+
const alink2 = document.createElement('a');
|
|
342
|
+
alink2.href = fileURL;
|
|
343
|
+
// Usa useInputFileName per determinare la priorità del nome file
|
|
344
|
+
alink2.download = getDownloadFileName(file, dcmts[i], useInputFileName);
|
|
345
|
+
alink2.target = "_blank";
|
|
346
|
+
alink2.rel = "noreferrer";
|
|
347
|
+
alink2.click();
|
|
348
|
+
// 60s come per l'iframe di stampa: revocare troppo presto può far fallire
|
|
349
|
+
// il download se il browser non ha ancora risolto il blob URL.
|
|
350
|
+
setTimeout(() => window.URL.revokeObjectURL(fileURL), 60000);
|
|
350
351
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
dcmtsFileCacheDownload.set(cacheKey, file);
|
|
352
|
+
}
|
|
353
|
+
if (useCache) {
|
|
354
|
+
if (dcmtsFileCacheDownload.size >= CACHE_SIZE_LIMIT) {
|
|
355
|
+
const oldestKey = dcmtsFileCacheDownload.keys().next().value;
|
|
356
|
+
dcmtsFileCacheDownload.delete(oldestKey);
|
|
357
357
|
}
|
|
358
|
-
|
|
358
|
+
dcmtsFileCacheDownload.set(cacheKey, file);
|
|
359
|
+
}
|
|
360
|
+
results.push({ rowIndex: i, id1: dcmts[i].TID, id2: dcmts[i].DID, resultType: ResultTypes.SUCCESS });
|
|
361
|
+
};
|
|
362
|
+
for (let i = 0; i < dcmts.length; i++) {
|
|
363
|
+
// Con la conferma di interruzione aperta il ciclo si ferma qui invece di
|
|
364
|
+
// continuare a scaricare dietro al dialogo.
|
|
365
|
+
await panel.waitWhilePaused();
|
|
366
|
+
if (abortController.signal.aborted) {
|
|
367
|
+
const description = SDKUI_Localizator.OperationDcmtsInterrupted.replaceParams(completed);
|
|
368
|
+
results.push({ rowIndex: i, id1: dcmts[i].TID, id2: dcmts[i].DID, resultType: ResultTypes.WARNING, description });
|
|
369
|
+
panel.warning(1, description);
|
|
370
|
+
break;
|
|
371
|
+
}
|
|
372
|
+
try {
|
|
373
|
+
await downloadOne(i);
|
|
374
|
+
panel.ok();
|
|
359
375
|
}
|
|
360
376
|
catch (ex) {
|
|
361
|
-
|
|
377
|
+
const description = getExceptionMessage(ex);
|
|
378
|
+
results.push({ rowIndex: i, id1: dcmts[i].TID, id2: dcmts[i].DID, resultType: ResultTypes.ERROR, description });
|
|
379
|
+
panel.error(1, panelMessage(dcmts[i], description));
|
|
362
380
|
const err = ex;
|
|
363
381
|
if (err.name === 'CanceledError') {
|
|
364
382
|
ShowAlert({ message: err.message, mode: 'warning', duration: 3000, title: 'Abort' });
|
|
365
383
|
}
|
|
366
384
|
}
|
|
367
385
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
setWaitPanelValuePrimary(0);
|
|
371
|
-
setWaitPanelTextSecondary('');
|
|
372
|
-
setWaitPanelMaxValueSecondary(0);
|
|
373
|
-
setWaitPanelValueSecondary(0);
|
|
374
|
-
setShowWaitPanel(false);
|
|
375
|
-
TMResultManager.show(result, operationTitle, "TID", "DID", undefined, undefined, showSuccessAlert);
|
|
386
|
+
closeWaitPanel(panel);
|
|
387
|
+
TMResultManager.show(results, operationTitle, "TID", "DID", undefined, undefined, showSuccessAlert);
|
|
376
388
|
};
|
|
377
389
|
const _downloadAttachmentsAsync = async (inputDcmts, confirmAttachments, showSuccessAlert = true) => {
|
|
378
390
|
if (inputDcmts === undefined)
|
|
@@ -413,7 +425,7 @@ export const useDcmtOperations = () => {
|
|
|
413
425
|
// Download the selected files
|
|
414
426
|
for (let i = 0; i < selectedFiles.length; i++) {
|
|
415
427
|
if (abortController.signal.aborted) {
|
|
416
|
-
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.WARNING, description:
|
|
428
|
+
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.WARNING, description: SDKUI_Localizator.OperationItemsInterrupted.replaceParams(i) });
|
|
417
429
|
break;
|
|
418
430
|
}
|
|
419
431
|
let fd = files.find(f => f.name === selectedFiles[i]);
|
|
@@ -506,22 +518,38 @@ export const useDcmtOperations = () => {
|
|
|
506
518
|
}
|
|
507
519
|
if (!file)
|
|
508
520
|
return;
|
|
509
|
-
setShowWaitPanel(true);
|
|
510
|
-
setShowPrimary(inputDcmts.length > 1);
|
|
511
|
-
setShowSecondary(true);
|
|
512
|
-
setWaitPanelTitle(operationTitle);
|
|
513
521
|
abortController = new AbortController();
|
|
522
|
+
// Come nel download: con un solo documento resta il solo avanzamento in byte.
|
|
523
|
+
const isBatch = inputDcmts.length > 1;
|
|
524
|
+
const panel = openWaitPanel({
|
|
525
|
+
title: operationTitle,
|
|
526
|
+
max: isBatch ? inputDcmts.length : 0,
|
|
527
|
+
showSecondary: isBatch,
|
|
528
|
+
showCounters: isBatch,
|
|
529
|
+
primaryLabel: isBatch ? SDKUI_Localizator.Documents : undefined,
|
|
530
|
+
secondaryLabel: isBatch ? 'File corrente' : undefined,
|
|
531
|
+
});
|
|
532
|
+
const publishBytes = (loaded, total) => {
|
|
533
|
+
const text = total > 0
|
|
534
|
+
? `Uploading... ${Globalization.getNumberDisplayValue(loaded, true)} / ${Globalization.getNumberDisplayValue(total, true)}`
|
|
535
|
+
: '';
|
|
536
|
+
if (isBatch)
|
|
537
|
+
panel.setSecondary({ value: loaded, max: total, text });
|
|
538
|
+
else
|
|
539
|
+
panel.update({ value: loaded, max: total, subtitle: text });
|
|
540
|
+
};
|
|
514
541
|
let result = [];
|
|
515
|
-
setWaitPanelMaxValuePrimary(inputDcmts.length);
|
|
516
|
-
let firstBlock = true;
|
|
517
|
-
let maxFileSize = 0;
|
|
518
542
|
for (let i = 0; i < inputDcmts.length; i++) {
|
|
543
|
+
await panel.waitWhilePaused();
|
|
519
544
|
if (abortController.signal.aborted) {
|
|
520
|
-
|
|
545
|
+
const description = SDKUI_Localizator.OperationDcmtsInterrupted.replaceParams(i);
|
|
546
|
+
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.WARNING, description });
|
|
547
|
+
panel.warning(1, description);
|
|
521
548
|
break;
|
|
522
549
|
}
|
|
523
550
|
try {
|
|
524
|
-
|
|
551
|
+
if (isBatch)
|
|
552
|
+
panel.setSubtitle(`${SDKUI_Localizator.FileUpload} ${i + 1} di ${inputDcmts.length}`);
|
|
525
553
|
const cacheKey = `${inputDcmts[i].TID}-${inputDcmts[i].DID}`;
|
|
526
554
|
if (dcmtsFileCachePreview.has(cacheKey))
|
|
527
555
|
removeDcmtsFileCache(cacheKey);
|
|
@@ -529,41 +557,31 @@ export const useDcmtOperations = () => {
|
|
|
529
557
|
if (ue) {
|
|
530
558
|
ue.TID = inputDcmts[i].TID;
|
|
531
559
|
ue.DID = inputDcmts[i].DID;
|
|
532
|
-
await ue.SubstituteFileAsync(file, operType, undefined, abortController.signal,
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
setWaitPanelMaxValueSecondary(0);
|
|
542
|
-
setWaitPanelValueSecondary(0);
|
|
543
|
-
setWaitPanelTextSecondary('');
|
|
544
|
-
firstBlock = true;
|
|
545
|
-
}
|
|
546
|
-
});
|
|
560
|
+
await ue.SubstituteFileAsync(file, operType, undefined, abortController.signal,
|
|
561
|
+
// Byte finiti ma il server elabora ancora: la barra si azzera invece di restare al 100%.
|
|
562
|
+
(pd) => pd.ProgressBarValue === pd.ProgressBarMaximum
|
|
563
|
+
? publishBytes(0, 0)
|
|
564
|
+
: publishBytes(pd.ProgressBarValue, pd.ProgressBarMaximum ?? 0));
|
|
565
|
+
}
|
|
566
|
+
if (isBatch) {
|
|
567
|
+
publishBytes(0, 0);
|
|
568
|
+
panel.setValue(i + 1);
|
|
547
569
|
}
|
|
548
|
-
setWaitPanelValuePrimary(i + 1);
|
|
549
570
|
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.SUCCESS });
|
|
571
|
+
panel.ok();
|
|
550
572
|
}
|
|
551
573
|
catch (ex) {
|
|
552
|
-
|
|
574
|
+
const description = getExceptionMessage(ex);
|
|
575
|
+
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.ERROR, description });
|
|
576
|
+
panel.error(1, panelMessage(inputDcmts[i], description));
|
|
553
577
|
const err = ex;
|
|
554
578
|
if (err.name === 'CanceledError') {
|
|
555
579
|
ShowAlert({ message: err.message, mode: 'warning', duration: 3000, title: 'Abort' });
|
|
556
580
|
}
|
|
557
581
|
}
|
|
558
582
|
}
|
|
559
|
-
|
|
560
|
-
setWaitPanelMaxValuePrimary(0);
|
|
561
|
-
setWaitPanelValuePrimary(0);
|
|
562
|
-
setWaitPanelTextSecondary('');
|
|
563
|
-
setWaitPanelMaxValueSecondary(0);
|
|
564
|
-
setWaitPanelValueSecondary(0);
|
|
583
|
+
closeWaitPanel(panel);
|
|
565
584
|
actionAfterOperationAsync?.();
|
|
566
|
-
setShowWaitPanel(false);
|
|
567
585
|
TMResultManager.show(result, operationTitle, "TID", "DID");
|
|
568
586
|
};
|
|
569
587
|
const getDcmtFileAsync = async (inputDcmt, rfo, operationTitle, keepWaitPanelPrimary, bypassCache = false) => {
|
|
@@ -574,29 +592,21 @@ export const useDcmtOperations = () => {
|
|
|
574
592
|
const cacheKey = `${inputDcmt.TID}-${inputDcmt.DID}`;
|
|
575
593
|
if (!bypassCache && dcmtsFileCachePreview.has(cacheKey))
|
|
576
594
|
return { file: dcmtsFileCachePreview.get(cacheKey), isFromCache: true };
|
|
577
|
-
setShowWaitPanel(true);
|
|
578
|
-
setShowPrimary(keepWaitPanelPrimary);
|
|
579
|
-
setShowSecondary(true);
|
|
580
|
-
setWaitPanelTitle(operationTitle);
|
|
581
595
|
abortController = new AbortController();
|
|
582
|
-
|
|
583
|
-
|
|
596
|
+
// Un file solo: l'unico avanzamento e' quello in byte e sta sulla barra principale.
|
|
597
|
+
const panel = openWaitPanel({
|
|
598
|
+
title: operationTitle,
|
|
599
|
+
subtitle: extensionHandler(inputDcmt.FILEEXT ?? '') === FileExtensionHandler.CONVERTIBLE ? 'Conversione file in corso...' : 'Recupero file in corso...',
|
|
600
|
+
showCounters: false,
|
|
601
|
+
});
|
|
584
602
|
try {
|
|
585
|
-
setWaitPanelTextSecondary(extensionHandler(inputDcmt.FILEEXT ?? '') === FileExtensionHandler.CONVERTIBLE ? 'Conversione file in corso...' : 'Recupero file in corso...');
|
|
586
603
|
const file = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(inputDcmt?.TID, inputDcmt?.DID, rfo, abortController.signal, (pd) => {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
setWaitPanelTextSecondary(`Downloading... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`);
|
|
594
|
-
if (pd.ProgressBarValue === pd.ProgressBarMaximum) {
|
|
595
|
-
setWaitPanelMaxValueSecondary(0);
|
|
596
|
-
setWaitPanelValueSecondary(0);
|
|
597
|
-
setWaitPanelTextSecondary('');
|
|
598
|
-
firstBlock = true;
|
|
599
|
-
}
|
|
604
|
+
const max = pd.ProgressBarMaximum ?? 0;
|
|
605
|
+
panel.update({
|
|
606
|
+
value: pd.ProgressBarValue,
|
|
607
|
+
max,
|
|
608
|
+
subtitle: `Downloading... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(max, true)}`,
|
|
609
|
+
});
|
|
600
610
|
});
|
|
601
611
|
if (dcmtsFileCachePreview.size >= CACHE_SIZE_LIMIT) {
|
|
602
612
|
const oldestKey = dcmtsFileCachePreview.keys().next().value;
|
|
@@ -608,10 +618,7 @@ export const useDcmtOperations = () => {
|
|
|
608
618
|
return { file: file, isFromCache: false };
|
|
609
619
|
}
|
|
610
620
|
finally {
|
|
611
|
-
|
|
612
|
-
setWaitPanelMaxValueSecondary(0);
|
|
613
|
-
setWaitPanelValueSecondary(0);
|
|
614
|
-
setShowWaitPanel(false);
|
|
621
|
+
closeWaitPanel(panel);
|
|
615
622
|
}
|
|
616
623
|
};
|
|
617
624
|
const getDisplayValueMetadataValueDescriptor = async (mvd) => {
|
|
@@ -668,19 +675,27 @@ export const useDcmtOperations = () => {
|
|
|
668
675
|
return;
|
|
669
676
|
}
|
|
670
677
|
let zipEntries = [];
|
|
671
|
-
setShowWaitPanel(true);
|
|
672
|
-
setShowPrimary(true);
|
|
673
|
-
setShowSecondary(false);
|
|
674
|
-
setWaitPanelTitle(operationTitle);
|
|
675
678
|
abortController = new AbortController();
|
|
679
|
+
// La copia conforme scarica due file per documento: e' l'unica operazione del ciclo
|
|
680
|
+
// con un avanzamento di dettaglio, e gli serve la seconda barra.
|
|
681
|
+
const isCopyCompliant = dcmtOperationType === DcmtOperationTypes.CopyCompliant;
|
|
682
|
+
const panel = openWaitPanel({
|
|
683
|
+
title: operationTitle,
|
|
684
|
+
max: inputDcmts.length,
|
|
685
|
+
showSecondary: isCopyCompliant,
|
|
686
|
+
primaryLabel: isCopyCompliant ? SDKUI_Localizator.Documents : undefined,
|
|
687
|
+
secondaryLabel: isCopyCompliant ? 'File corrente' : undefined,
|
|
688
|
+
});
|
|
676
689
|
let result = [];
|
|
677
|
-
setWaitPanelMaxValuePrimary(inputDcmts.length);
|
|
678
690
|
for (let i = 0; i < inputDcmts.length; i++) {
|
|
691
|
+
await panel.waitWhilePaused();
|
|
679
692
|
if (abortController.signal.aborted) {
|
|
680
|
-
|
|
693
|
+
const description = SDKUI_Localizator.OperationDcmtsInterrupted.replaceParams(i);
|
|
694
|
+
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.WARNING, description });
|
|
695
|
+
panel.warning(1, description);
|
|
681
696
|
break;
|
|
682
697
|
}
|
|
683
|
-
|
|
698
|
+
panel.setSubtitle(`Documento ${i + 1} di ${inputDcmts.length}`);
|
|
684
699
|
try {
|
|
685
700
|
switch (dcmtOperationType) {
|
|
686
701
|
case DcmtOperationTypes.AddToFavs:
|
|
@@ -785,33 +800,36 @@ export const useDcmtOperations = () => {
|
|
|
785
800
|
const importWarnings = await importCertificatesAsync(inputDcmts[i], i, fetchRemoteCertificates, abortController.signal);
|
|
786
801
|
if (importWarnings) {
|
|
787
802
|
result.push(...importWarnings);
|
|
803
|
+
importWarnings.forEach(w => panel.warning(1, panelMessage(inputDcmts[i], w.description ?? '')));
|
|
788
804
|
}
|
|
789
805
|
break;
|
|
790
806
|
}
|
|
791
807
|
}
|
|
792
808
|
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.SUCCESS });
|
|
809
|
+
panel.ok();
|
|
793
810
|
}
|
|
794
811
|
catch (ex) {
|
|
795
812
|
let msg = getExceptionMessage(ex);
|
|
796
813
|
if (msg.startsWith('WARNING#')) {
|
|
797
|
-
|
|
814
|
+
const description = msg.replace('WARNING#', '');
|
|
815
|
+
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.WARNING, description });
|
|
816
|
+
panel.warning(1, panelMessage(inputDcmts[i], description));
|
|
798
817
|
}
|
|
799
|
-
else
|
|
818
|
+
else {
|
|
800
819
|
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.ERROR, description: msg });
|
|
820
|
+
panel.error(1, panelMessage(inputDcmts[i], msg));
|
|
821
|
+
}
|
|
801
822
|
const err = ex;
|
|
802
823
|
if (err.name === 'CanceledError') {
|
|
803
824
|
ShowAlert({ message: err.message, mode: 'warning', duration: 3000, title: 'Abort' });
|
|
804
825
|
}
|
|
805
826
|
}
|
|
806
|
-
|
|
827
|
+
panel.setValue(i + 1);
|
|
807
828
|
}
|
|
808
829
|
if (zipEntries.length > 0) {
|
|
809
830
|
await zipDocuments(zipEntries, dcmtOperationType, inputDcmts[0].TID);
|
|
810
831
|
}
|
|
811
|
-
|
|
812
|
-
setWaitPanelValuePrimary(0);
|
|
813
|
-
setWaitPanelTextPrimary('');
|
|
814
|
-
setShowWaitPanel(false);
|
|
832
|
+
closeWaitPanel(panel);
|
|
815
833
|
actionAfterOperationAsync?.();
|
|
816
834
|
TMResultManager.show(result, operationTitle, "TID", "DID");
|
|
817
835
|
};
|
|
@@ -824,7 +842,6 @@ export const useDcmtOperations = () => {
|
|
|
824
842
|
}
|
|
825
843
|
};
|
|
826
844
|
return {
|
|
827
|
-
abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary,
|
|
828
845
|
downloadDcmtsAsync, getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache, runOperationAsync, FileSourceDialog
|
|
829
846
|
};
|
|
830
847
|
};
|
|
@@ -63,6 +63,7 @@ export interface UIConfigProps {
|
|
|
63
63
|
toppyHelpCenterUsePortal?: boolean;
|
|
64
64
|
inputDcmtFormLayoutMode?: LayoutModes;
|
|
65
65
|
graphometricManager?: IGraphometricManagerProp;
|
|
66
|
+
showSelector?: boolean;
|
|
66
67
|
}
|
|
67
68
|
export interface TasksProps {
|
|
68
69
|
allTasks?: Array<TaskDescriptor>;
|