@topconsultnpm/sdkui-react 6.22.0-dev3.16 → 6.22.0-dev3.18
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/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +1 -2
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMDataGrid.js +219 -219
- 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 +167 -167
- package/lib/components/base/TMSpinner.d.ts +1 -2
- package/lib/components/base/TMTab.d.ts +3 -4
- package/lib/components/base/TMTabControl.js +208 -208
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +8 -14
- 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/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/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/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/archive/TMArchive.js +7 -2
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +1 -2
- package/lib/components/features/documents/TMCopyToFolderForm.js +21 -49
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -2
- package/lib/components/features/documents/TMDcmtPreview.d.ts +6 -8
- package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -2
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +21 -21
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +1 -2
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +1 -7
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +1 -2
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +4 -4
- 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/TMSearchQueryPanel.d.ts +3 -9
- package/lib/components/features/search/TMSearchResult.js +78 -78
- 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/TMViewHistoryDcmt.d.ts +1 -2
- 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/wg/TMWGsCopyMoveForm.d.ts +2 -3
- 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/TMBlogsPostUtils.d.ts +9 -9
- package/lib/components/grids/TMValidationItemsList.d.ts +1 -2
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -2
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +6 -5
- 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/query/TMQueryEditor.d.ts +10 -14
- 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 +3 -3
- 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/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/helpers.d.ts +1 -1
- package/lib/hooks/useDcmtOperations.d.ts +0 -7
- package/lib/hooks/useDcmtOperations.js +39 -71
- package/lib/hooks/useInputDialog.d.ts +1 -2
- package/lib/services/caseflow/CaseFlowService.d.ts +11 -1
- package/lib/services/caseflow/CaseFlowService.js +16 -1
- package/lib/services/platform_services.d.ts +2 -3
- package/package.json +1 -1
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
interface TMPdfViewerProps {
|
|
3
2
|
pdfBlob: Blob;
|
|
4
3
|
title?: string;
|
|
5
4
|
isResizingActive?: boolean;
|
|
6
5
|
enableFitToWidth?: boolean;
|
|
7
6
|
}
|
|
8
|
-
declare const TMPdfViewer: (props: TMPdfViewerProps) =>
|
|
7
|
+
declare const TMPdfViewer: (props: TMPdfViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export default TMPdfViewer;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
interface TMToppyMessageProps {
|
|
3
3
|
message: ReactNode;
|
|
4
4
|
titleTooltip?: string;
|
|
5
5
|
maxWidth?: string;
|
|
6
6
|
}
|
|
7
|
-
declare const TMToppyMessage: (props: TMToppyMessageProps) =>
|
|
7
|
+
declare const TMToppyMessage: (props: TMToppyMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default TMToppyMessage;
|
package/lib/helper/TMUtils.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const getFullFileExtension: (fileName: string, depth?: number) =>
|
|
|
24
24
|
* Es: pdf.p7m.tsd → pdf, pdf.p7m → pdf, pdf → pdf
|
|
25
25
|
*/
|
|
26
26
|
export declare const getBaseExtension: (ext: string) => string;
|
|
27
|
-
export declare const getFileIcon: (fileExtension: string | undefined, fileCount: number | undefined, tooltipContent?: JSX.Element | string) =>
|
|
27
|
+
export declare const getFileIcon: (fileExtension: string | undefined, fileCount: number | undefined, tooltipContent?: JSX.Element | string) => import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
export declare function formatBytes(bytes: number | undefined, decimalPlaces?: number): string;
|
|
29
29
|
export interface RowData {
|
|
30
30
|
[key: string]: string | number | null;
|
|
@@ -52,15 +52,9 @@ interface TabItemProps {
|
|
|
52
52
|
$isSelected: boolean;
|
|
53
53
|
$activeGradient?: string;
|
|
54
54
|
}
|
|
55
|
-
export declare const StyledTabItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export declare const StyledTabIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "style"> & {
|
|
59
|
-
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
60
|
-
}, TabItemProps>> & string;
|
|
61
|
-
export declare const TMCountBadge: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
62
|
-
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
63
|
-
}> & string;
|
|
55
|
+
export declare const StyledTabItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof TabItemProps> & TabItemProps, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof TabItemProps> & TabItemProps, never>>> & string;
|
|
56
|
+
export declare const StyledTabIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, keyof TabItemProps> & TabItemProps, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, keyof TabItemProps> & TabItemProps, never>>> & string;
|
|
57
|
+
export declare const TMCountBadge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
64
58
|
export declare const PDGS_COLORS: {
|
|
65
59
|
DOSSIER: string;
|
|
66
60
|
DOCUMENT: string;
|
package/lib/helper/helpers.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export { openApps, calcResponsiveDirection, calcResponsiveSizes, taskModalSizes,
|
|
|
77
77
|
export declare function moduleVersion(module: moduleTypes): string;
|
|
78
78
|
export declare function buildtype(module: moduleTypes): string;
|
|
79
79
|
export declare const highlightText: (text: string, searchValue: string) => JSX.Element;
|
|
80
|
-
export declare const renderHighlightedText: (text: string, searchText: string, isSelected: boolean) => string | (string |
|
|
80
|
+
export declare const renderHighlightedText: (text: string, searchText: string, isSelected: boolean) => string | (string | import("react/jsx-runtime").JSX.Element)[];
|
|
81
81
|
export declare function versionAndBuildtypeInfo(module: moduleTypes): string;
|
|
82
82
|
export declare const getListMaxItems: (deviceType: DeviceType | undefined) => number;
|
|
83
83
|
export declare const svgToString: (icon: React.ReactElement) => string;
|
|
@@ -24,13 +24,6 @@ export interface DownloadDcmtsAsyncParams {
|
|
|
24
24
|
* - false (default): usa il nome file recuperato dal backend (file.name) come priorità
|
|
25
25
|
*/
|
|
26
26
|
useInputFileName?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Numero di download eseguiti in parallelo (default 1 = sequenziale, comportamento preesistente).
|
|
29
|
-
* Valori > 1 vanno usati solo quando il chiamante consuma i file via
|
|
30
|
-
* `onFileDownloaded`: nel percorso senza callback ogni file genera un click su un
|
|
31
|
-
* tag <a download>, e più click ravvicinati vengono bloccati dal browser.
|
|
32
|
-
*/
|
|
33
|
-
downloadConcurrency?: number;
|
|
34
27
|
}
|
|
35
28
|
export interface UseDcmtOperationsReturn {
|
|
36
29
|
abortController: AbortController;
|
|
@@ -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
|
-
/** Limite massimo di download paralleli accettato da `downloadDcmtsAsync`. */
|
|
13
|
-
const MAX_DOWNLOAD_CONCURRENCY = 8;
|
|
14
12
|
/** Intervallo minimo (ms) fra due aggiornamenti della progress bar di download. */
|
|
15
13
|
const DOWNLOAD_PROGRESS_THROTTLE_MS = 100;
|
|
16
14
|
const isScannerLicenseConfigured = () => {
|
|
@@ -261,7 +259,7 @@ export const useDcmtOperations = () => {
|
|
|
261
259
|
ShowAlert({ message: SDKUI_Localizator.ZipCreatedSavedInFolder.replaceParams(zipFileName, "Zip creato con successo"), mode: 'success', duration: 5000, title: SDKUI_Localizator.CompressToZipFile });
|
|
262
260
|
}
|
|
263
261
|
};
|
|
264
|
-
const _downloadDcmtsAsync = async (inputDcmts, downloadMode = "download", onFileDownloaded, skipConfirmation = false, retrieveOptions, useCache = true, showSuccessAlert = true, useInputFileName = false
|
|
262
|
+
const _downloadDcmtsAsync = async (inputDcmts, downloadMode = "download", onFileDownloaded, skipConfirmation = false, retrieveOptions, useCache = true, showSuccessAlert = true, useInputFileName = false) => {
|
|
265
263
|
if (inputDcmts === undefined)
|
|
266
264
|
return;
|
|
267
265
|
if (inputDcmts.length <= 0)
|
|
@@ -290,29 +288,22 @@ export const useDcmtOperations = () => {
|
|
|
290
288
|
setShowSecondary(true);
|
|
291
289
|
setWaitPanelTitle(operationTitle);
|
|
292
290
|
abortController = new AbortController();
|
|
293
|
-
// Riferimento const: il narrowing su inputDcmts non sopravvive dentro le closure
|
|
291
|
+
// Riferimento const: il narrowing su inputDcmts non sopravvive dentro le closure.
|
|
294
292
|
const dcmts = inputDcmts;
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
if (retrieveOptions?.generalRetrieveFormat !== undefined)
|
|
305
|
-
rfo.generalRetrieveFormat = retrieveOptions.generalRetrieveFormat;
|
|
306
|
-
rfo.invoiceRetrieveFormat = retrieveOptions?.invoiceRetrieveFormat ?? SDKUI_Globals.userSettings.searchSettings.invoiceRetrieveFormat;
|
|
307
|
-
rfo.orderRetrieveFormat = retrieveOptions?.orderRetrieveFormat ?? SDKUI_Globals.userSettings.searchSettings.orderRetrieveFormat;
|
|
308
|
-
return rfo;
|
|
309
|
-
};
|
|
310
|
-
const results = new Array(dcmts.length);
|
|
293
|
+
const rfo = new RetrieveFileOptions();
|
|
294
|
+
rfo.retrieveReason = retrieveOptions?.retrieveReason ?? DcmtOpers.ShowFile;
|
|
295
|
+
if (retrieveOptions?.cvtFormat !== undefined)
|
|
296
|
+
rfo.cvtFormat = retrieveOptions.cvtFormat;
|
|
297
|
+
if (retrieveOptions?.generalRetrieveFormat !== undefined)
|
|
298
|
+
rfo.generalRetrieveFormat = retrieveOptions.generalRetrieveFormat;
|
|
299
|
+
rfo.invoiceRetrieveFormat = retrieveOptions?.invoiceRetrieveFormat ?? SDKUI_Globals.userSettings.searchSettings.invoiceRetrieveFormat;
|
|
300
|
+
rfo.orderRetrieveFormat = retrieveOptions?.orderRetrieveFormat ?? SDKUI_Globals.userSettings.searchSettings.orderRetrieveFormat;
|
|
301
|
+
const results = [];
|
|
311
302
|
setWaitPanelMaxValuePrimary(dcmts.length);
|
|
312
|
-
// ---- Progress secondaria:
|
|
303
|
+
// ---- Progress secondaria: throttlata ----
|
|
313
304
|
// Gli eventi di avanzamento di axios arrivano a ogni chunk: senza throttle ognuno
|
|
314
305
|
// provoca un re-render dell'intera form (relation viewer compreso).
|
|
315
|
-
|
|
306
|
+
let currentBytes;
|
|
316
307
|
let pendingSecondary;
|
|
317
308
|
let secondaryTimer;
|
|
318
309
|
const flushSecondaryProgress = () => {
|
|
@@ -325,41 +316,33 @@ export const useDcmtOperations = () => {
|
|
|
325
316
|
pendingSecondary = undefined;
|
|
326
317
|
};
|
|
327
318
|
const publishSecondaryProgress = () => {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
for (const bytes of inFlightBytes.values()) {
|
|
331
|
-
loaded += bytes.loaded;
|
|
332
|
-
total += bytes.total;
|
|
333
|
-
}
|
|
319
|
+
const loaded = currentBytes?.loaded ?? 0;
|
|
320
|
+
const total = currentBytes?.total ?? 0;
|
|
334
321
|
pendingSecondary = total > 0
|
|
335
322
|
? { value: loaded, max: total, text: `Downloading... ${Globalization.getNumberDisplayValue(loaded, true)} / ${Globalization.getNumberDisplayValue(total, true)}` }
|
|
336
323
|
: { value: 0, max: 0, text: '' };
|
|
337
324
|
if (secondaryTimer === undefined)
|
|
338
325
|
secondaryTimer = setTimeout(flushSecondaryProgress, DOWNLOAD_PROGRESS_THROTTLE_MS);
|
|
339
326
|
};
|
|
340
|
-
// ----
|
|
341
|
-
let nextIndex = 0;
|
|
342
|
-
let started = 0;
|
|
327
|
+
// ---- Download sequenziale: un documento per volta ----
|
|
343
328
|
let completed = 0;
|
|
344
|
-
let abortReported = false;
|
|
345
329
|
const downloadOne = async (i) => {
|
|
346
|
-
|
|
347
|
-
setWaitPanelTextPrimary(`Download file ${started} di ${dcmts.length}`);
|
|
330
|
+
setWaitPanelTextPrimary(`Download file ${i + 1} di ${dcmts.length}`);
|
|
348
331
|
let file;
|
|
349
332
|
const cacheKey = `${dcmts[i].TID}-${dcmts[i].DID}`;
|
|
350
333
|
if (useCache && dcmtsFileCacheDownload.has(cacheKey)) {
|
|
351
334
|
file = dcmtsFileCacheDownload.get(cacheKey);
|
|
352
335
|
}
|
|
353
336
|
else {
|
|
354
|
-
|
|
337
|
+
currentBytes = { loaded: 0, total: 0 };
|
|
355
338
|
try {
|
|
356
|
-
file = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(dcmts[i].TID, dcmts[i].DID,
|
|
357
|
-
|
|
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 };
|
|
358
341
|
publishSecondaryProgress();
|
|
359
342
|
});
|
|
360
343
|
}
|
|
361
344
|
finally {
|
|
362
|
-
|
|
345
|
+
currentBytes = undefined;
|
|
363
346
|
publishSecondaryProgress();
|
|
364
347
|
}
|
|
365
348
|
}
|
|
@@ -400,40 +383,26 @@ export const useDcmtOperations = () => {
|
|
|
400
383
|
}
|
|
401
384
|
dcmtsFileCacheDownload.set(cacheKey, file);
|
|
402
385
|
}
|
|
403
|
-
results
|
|
386
|
+
results.push({ rowIndex: i, id1: dcmts[i].TID, id2: dcmts[i].DID, resultType: ResultTypes.SUCCESS });
|
|
404
387
|
};
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
try {
|
|
419
|
-
await downloadOne(i);
|
|
420
|
-
}
|
|
421
|
-
catch (ex) {
|
|
422
|
-
results[i] = { rowIndex: i, id1: dcmts[i].TID, id2: dcmts[i].DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(ex) };
|
|
423
|
-
const err = ex;
|
|
424
|
-
if (err.name === 'CanceledError') {
|
|
425
|
-
ShowAlert({ message: err.message, mode: 'warning', duration: 3000, title: 'Abort' });
|
|
426
|
-
}
|
|
388
|
+
for (let i = 0; i < dcmts.length; i++) {
|
|
389
|
+
if (abortController.signal.aborted) {
|
|
390
|
+
results.push({ rowIndex: i, id1: dcmts[i].TID, id2: dcmts[i].DID, resultType: ResultTypes.WARNING, description: `Operazione interrotta. Elaborati ${completed} documenti` });
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
try {
|
|
394
|
+
await downloadOne(i);
|
|
395
|
+
}
|
|
396
|
+
catch (ex) {
|
|
397
|
+
results.push({ rowIndex: i, id1: dcmts[i].TID, id2: dcmts[i].DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(ex) });
|
|
398
|
+
const err = ex;
|
|
399
|
+
if (err.name === 'CanceledError') {
|
|
400
|
+
ShowAlert({ message: err.message, mode: 'warning', duration: 3000, title: 'Abort' });
|
|
427
401
|
}
|
|
428
402
|
}
|
|
429
|
-
}
|
|
430
|
-
// `|| 1` intercetta NaN/0/negativi: senza, Array.from({length: NaN}) non creerebbe
|
|
431
|
-
// alcun worker e il download terminerebbe in silenzio senza scaricare nulla.
|
|
432
|
-
const workers = Math.max(1, Math.min(Math.trunc(downloadConcurrency) || 1, MAX_DOWNLOAD_CONCURRENCY, dcmts.length));
|
|
433
|
-
await Promise.all(Array.from({ length: workers }, () => runWorker()));
|
|
403
|
+
}
|
|
434
404
|
if (secondaryTimer !== undefined)
|
|
435
405
|
clearTimeout(secondaryTimer);
|
|
436
|
-
const result = results.filter((r) => r !== undefined);
|
|
437
406
|
setWaitPanelTextPrimary('');
|
|
438
407
|
setWaitPanelMaxValuePrimary(0);
|
|
439
408
|
setWaitPanelValuePrimary(0);
|
|
@@ -441,7 +410,7 @@ export const useDcmtOperations = () => {
|
|
|
441
410
|
setWaitPanelMaxValueSecondary(0);
|
|
442
411
|
setWaitPanelValueSecondary(0);
|
|
443
412
|
setShowWaitPanel(false);
|
|
444
|
-
TMResultManager.show(
|
|
413
|
+
TMResultManager.show(results, operationTitle, "TID", "DID", undefined, undefined, showSuccessAlert);
|
|
445
414
|
};
|
|
446
415
|
const _downloadAttachmentsAsync = async (inputDcmts, confirmAttachments, showSuccessAlert = true) => {
|
|
447
416
|
if (inputDcmts === undefined)
|
|
@@ -505,13 +474,12 @@ export const useDcmtOperations = () => {
|
|
|
505
474
|
};
|
|
506
475
|
const downloadDcmtsAsync = async (params) => {
|
|
507
476
|
const { inputDcmts, downloadType = DownloadTypes.Attachment, downloadMode = "download", onFileDownloaded, confirmAttachments, skipConfirmation = false, retrieveOptions, useCache = true, showSuccessAlert = true, useInputFileName = false, // Default: usa il nome dal backend
|
|
508
|
-
downloadConcurrency = 1, // Default: sequenziale
|
|
509
477
|
} = params;
|
|
510
478
|
switch (downloadType) {
|
|
511
479
|
// Per il download di documenti, passa useInputFileName per controllare la priorità del nome
|
|
512
|
-
case DownloadTypes.Dcmt: return await _downloadDcmtsAsync(inputDcmts, downloadMode, onFileDownloaded, skipConfirmation, retrieveOptions, useCache, showSuccessAlert, useInputFileName
|
|
480
|
+
case DownloadTypes.Dcmt: return await _downloadDcmtsAsync(inputDcmts, downloadMode, onFileDownloaded, skipConfirmation, retrieveOptions, useCache, showSuccessAlert, useInputFileName);
|
|
513
481
|
case DownloadTypes.Attachment: return await _downloadAttachmentsAsync(inputDcmts, confirmAttachments, showSuccessAlert);
|
|
514
|
-
default: return await _downloadDcmtsAsync(inputDcmts, undefined, undefined, skipConfirmation, retrieveOptions, useCache, showSuccessAlert, useInputFileName
|
|
482
|
+
default: return await _downloadDcmtsAsync(inputDcmts, undefined, undefined, skipConfirmation, retrieveOptions, useCache, showSuccessAlert, useInputFileName);
|
|
515
483
|
}
|
|
516
484
|
};
|
|
517
485
|
const uploadDcmtsAsync = async (inputDcmts, operationTitle, operType, actionAfterOperationAsync) => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { FileDescriptor, FileFormats } from '@topconsultnpm/sdk-ts';
|
|
3
2
|
export declare const useInputCvtFormatDialog: () => [() => Promise<FileFormats>, () => JSX.Element];
|
|
4
3
|
export declare const useFileDialog: () => {
|
|
@@ -6,7 +5,7 @@ export declare const useFileDialog: () => {
|
|
|
6
5
|
};
|
|
7
6
|
export declare const useInputAttachmentsDialog: () => {
|
|
8
7
|
openConfirmAttachmentsDialog: (list: FileDescriptor[]) => Promise<string[] | undefined>;
|
|
9
|
-
ConfirmAttachmentsDialog: () =>
|
|
8
|
+
ConfirmAttachmentsDialog: () => import("react/jsx-runtime").JSX.Element | null;
|
|
10
9
|
};
|
|
11
10
|
export type FileSourceType = 'filesystem' | 'scanner-new' | 'scanner-edit' | undefined;
|
|
12
11
|
export declare const useFileSourceDialog: () => [(hasExistingFile?: boolean) => Promise<FileSourceType>, () => JSX.Element];
|
|
@@ -213,7 +213,17 @@ export declare class CaseFlowService {
|
|
|
213
213
|
static completeDataCompletionWorkItem(caseFlowId: number, workItemId: number, metadataValues: Record<number, string>, response?: string, cftid?: number): Promise<void>;
|
|
214
214
|
/** Rifiuta un workitem. Il motivo viene pubblicato in bacheca dal backend. */
|
|
215
215
|
static rejectWorkItem(caseFlowId: number, workItemId: number, response?: string, cftid?: number): Promise<void>;
|
|
216
|
-
/**
|
|
216
|
+
/**
|
|
217
|
+
* Prende in carico un'azione per se stessi (operazione Claim): il backend
|
|
218
|
+
* crea il workitem intestato al chiamante e porta l'azione in lavorazione.
|
|
219
|
+
*
|
|
220
|
+
* Non e' un caso particolare di `createWorkItemForAction`: assegnare e'
|
|
221
|
+
* riservato a Owner e Supervisore, prendere in carico e' di chiunque lavori
|
|
222
|
+
* alla pratica. Passando dall'operazione Assign, un Partecipante si vedeva
|
|
223
|
+
* rifiutare la presa in carico (TMC-2789).
|
|
224
|
+
*/
|
|
225
|
+
static claimAction(caseFlowId: number, actionID: number, cftid?: number): Promise<void>;
|
|
226
|
+
/** Assegna un'azione a un ALTRO utente creando il relativo workitem (operazione Assign). */
|
|
217
227
|
static createWorkItemForAction(caseFlowId: number, actionID: number, toUserID: number, description?: string, cftid?: number): Promise<void>;
|
|
218
228
|
/** Forza il completamento di un'azione (supervisor). */
|
|
219
229
|
static forceCompleteAction(caseFlowId: number, actionID: number, reason?: string, cftid?: number): Promise<void>;
|
|
@@ -551,7 +551,22 @@ export class CaseFlowService {
|
|
|
551
551
|
comment: response,
|
|
552
552
|
}), cftid);
|
|
553
553
|
}
|
|
554
|
-
/**
|
|
554
|
+
/**
|
|
555
|
+
* Prende in carico un'azione per se stessi (operazione Claim): il backend
|
|
556
|
+
* crea il workitem intestato al chiamante e porta l'azione in lavorazione.
|
|
557
|
+
*
|
|
558
|
+
* Non e' un caso particolare di `createWorkItemForAction`: assegnare e'
|
|
559
|
+
* riservato a Owner e Supervisore, prendere in carico e' di chiunque lavori
|
|
560
|
+
* alla pratica. Passando dall'operazione Assign, un Partecipante si vedeva
|
|
561
|
+
* rifiutare la presa in carico (TMC-2789).
|
|
562
|
+
*/
|
|
563
|
+
static async claimAction(caseFlowId, actionID, cftid) {
|
|
564
|
+
await this.executeWorkItemOperation(caseFlowId, CaseFlowWIOperationDescriptor.fromJS({
|
|
565
|
+
operation: CF_WIOperations.Claim,
|
|
566
|
+
actionID,
|
|
567
|
+
}), cftid);
|
|
568
|
+
}
|
|
569
|
+
/** Assegna un'azione a un ALTRO utente creando il relativo workitem (operazione Assign). */
|
|
555
570
|
static async createWorkItemForAction(caseFlowId, actionID, toUserID, description, cftid) {
|
|
556
571
|
await this.executeWorkItemOperation(caseFlowId, CaseFlowWIOperationDescriptor.fromJS({
|
|
557
572
|
operation: CF_WIOperations.Assign,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { JobTypes, ObjectClasses, ProcessDescriptor, DcmtTypeDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
2
|
export declare class PlatformObjectService {
|
|
4
3
|
static readonly retrieveAllAsync: (objClass: ObjectClasses, refreshCache?: boolean) => Promise<import("@topconsultnpm/sdk-ts").AreaDescriptor[] | import("@topconsultnpm/sdk-ts").NotificationDescriptor[] | import("@topconsultnpm/sdk-ts").RelationDescriptor[] | import("@topconsultnpm/sdk-ts").TaskDescriptor[] | import("@topconsultnpm/sdk-ts").WorkingGroupDescriptor[] | undefined>;
|
|
@@ -14,6 +13,6 @@ export declare class PlatformObjectService {
|
|
|
14
13
|
static readonly createAsync: (objClass: ObjectClasses, jobType: JobTypes, d: any) => Promise<number | undefined>;
|
|
15
14
|
static readonly deleteAsync: (objClass: ObjectClasses, id: number) => Promise<number | undefined>;
|
|
16
15
|
static readonly getName: (objClass: ObjectClasses, jobType?: JobTypes, isPlural?: boolean) => string;
|
|
17
|
-
static readonly getIcon: (objClass: ObjectClasses, d: any) =>
|
|
18
|
-
static readonly getTooltip: (objClass: ObjectClasses, d: any) =>
|
|
16
|
+
static readonly getIcon: (objClass: ObjectClasses, d: any) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
static readonly getTooltip: (objClass: ObjectClasses, d: any) => import("react/jsx-runtime").JSX.Element | null;
|
|
19
18
|
}
|