@topconsultnpm/sdkui-react 6.21.0-t2 → 6.21.0-t4
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/TMContextMenu.js +28 -2
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +4 -4
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +6 -6
- package/lib/components/base/Styled.d.ts +1 -1
- package/lib/components/base/TMAreaManager.js +11 -0
- 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/TMDataGrid.js +12 -2
- package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
- package/lib/components/base/TMDataGridExportForm.js +19 -8
- package/lib/components/base/TMFileManager.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.js +4 -4
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +3 -3
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +7 -0
- package/lib/components/base/TMFileManagerUtils.js +14 -1
- 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/TMModal.js +2 -2
- package/lib/components/base/TMPopUp.d.ts +1 -0
- package/lib/components/base/TMPopUp.js +59 -2
- package/lib/components/base/TMSpinner.d.ts +5 -2
- package/lib/components/base/TMSpinner.js +33 -6
- package/lib/components/base/TMTab.d.ts +4 -3
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +16 -13
- package/lib/components/base/TMTreeView.js +242 -79
- 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 +5 -2
- package/lib/components/base/TMWaitPanel.js +8 -6
- package/lib/components/choosers/TMDistinctValues.js +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.js +6 -1
- package/lib/components/choosers/TMGroupChooser.js +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.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 +6 -6
- package/lib/components/editors/TMFormulaEditor.d.ts +2 -1
- package/lib/components/editors/TMFormulaEditor.js +98 -49
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
- package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
- package/lib/components/editors/TMMetadataEditor.js +6 -2
- package/lib/components/editors/TMMetadataValues.js +23 -6
- package/lib/components/editors/TMTextBox.d.ts +1 -0
- package/lib/components/editors/TMTextBox.js +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/blog/TMBlogCommentForm.d.ts +2 -1
- package/lib/components/features/blog/TMBlogCommentForm.js +5 -2
- package/lib/components/features/documents/TMCopyToFolderForm.js +46 -24
- package/lib/components/features/documents/TMDcmtForm.d.ts +2 -0
- package/lib/components/features/documents/TMDcmtForm.js +21 -10
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtIcon.d.ts +4 -1
- package/lib/components/features/documents/TMDcmtIcon.js +6 -33
- package/lib/components/features/documents/TMDcmtPreview.d.ts +1 -1
- 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 +1 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -2
- package/lib/components/features/documents/TMMasterDetailDcmts.js +55 -16
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +2 -3
- package/lib/components/features/documents/TMMergeToPdfForm.js +115 -56
- package/lib/components/features/documents/TMRelationViewer.d.ts +12 -10
- package/lib/components/features/documents/TMRelationViewer.js +405 -95
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +4 -16
- package/lib/components/features/documents/copyAndMergeDcmtsShared.js +47 -61
- package/lib/components/features/documents/mergePdfUtils.d.ts +52 -0
- package/lib/components/features/documents/mergePdfUtils.js +268 -0
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +18 -0
- package/lib/components/features/search/TMMetadataOutputForm.js +225 -0
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +18 -0
- package/lib/components/features/search/TMMetadataSorterForm.js +243 -0
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.d.ts +2 -2
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryEditor.js +14 -8
- package/lib/components/features/search/TMSearchQueryPanel.js +249 -58
- package/lib/components/features/search/TMSearchResult.d.ts +3 -2
- package/lib/components/features/search/TMSearchResult.js +94 -25
- 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 +1 -1
- package/lib/components/features/search/metadataFormHelper.d.ts +16 -0
- package/lib/components/features/search/metadataFormHelper.js +77 -0
- 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 +3 -2
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +8 -7
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/Login/TMLoginForm.js +15 -3
- 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/TMBlogAttachments.js +2 -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 +5 -3
- package/lib/components/grids/TMBlogsPostUtils.d.ts +10 -9
- package/lib/components/grids/TMBlogsPostUtils.js +3 -1
- package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
- 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 +1 -1
- 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/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
- 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/components/viewers/TMTidViewer.js +14 -2
- package/lib/components/wizard/TMWizard.d.ts +1 -0
- package/lib/components/wizard/TMWizard.js +5 -3
- package/lib/helper/Enum_Localizator.js +2 -0
- package/lib/helper/MergePdfManager.d.ts +45 -0
- package/lib/helper/MergePdfManager.js +148 -0
- package/lib/helper/SDKUI_Globals.d.ts +1 -0
- package/lib/helper/SDKUI_Globals.js +3 -1
- package/lib/helper/SDKUI_Localizator.d.ts +40 -0
- package/lib/helper/SDKUI_Localizator.js +412 -12
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +278 -278
- package/lib/helper/TMPdfViewer.d.ts +2 -1
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +57 -21
- package/lib/helper/TMUtils.js +159 -1
- package/lib/helper/certificateImportHelper.d.ts +43 -0
- package/lib/helper/certificateImportHelper.js +403 -0
- package/lib/helper/checkinCheckoutManager.d.ts +4 -3
- package/lib/helper/checkinCheckoutManager.js +29 -11
- package/lib/helper/helpers.d.ts +3 -2
- package/lib/helper/helpers.js +10 -0
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +4 -3
- package/lib/hooks/useDataUserIdItem.js +1 -1
- package/lib/hooks/useDcmtOperations.d.ts +20 -2
- package/lib/hooks/useDcmtOperations.js +244 -25
- package/lib/hooks/useDocumentOperations.d.ts +2 -2
- package/lib/hooks/useDocumentOperations.js +52 -13
- package/lib/hooks/useInputDialog.d.ts +2 -1
- package/lib/hooks/useRelatedDocuments.js +4 -4
- package/lib/services/platform_services.d.ts +7 -6
- package/lib/ts/types.d.ts +3 -1
- package/lib/ts/types.js +2 -0
- package/package.json +15 -7
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RetrieveFileOptions, DcmtOpers, FileDescriptor, GeneralRetrieveFormats, InvoiceRetrieveFormats, OrderRetrieveFormats, FileFormats } from '@topconsultnpm/sdk-ts';
|
|
2
2
|
import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes } from '../ts';
|
|
3
|
+
import { IntesiCertificateData } from '../helper/certificateImportHelper';
|
|
3
4
|
export interface RetrieveFormatOptions {
|
|
4
5
|
retrieveReason?: DcmtOpers;
|
|
5
6
|
cvtFormat?: FileFormats;
|
|
@@ -7,6 +8,23 @@ export interface RetrieveFormatOptions {
|
|
|
7
8
|
invoiceRetrieveFormat?: InvoiceRetrieveFormats;
|
|
8
9
|
orderRetrieveFormat?: OrderRetrieveFormats;
|
|
9
10
|
}
|
|
11
|
+
export interface DownloadDcmtsAsyncParams {
|
|
12
|
+
inputDcmts: DcmtInfo[] | undefined;
|
|
13
|
+
downloadType?: DownloadTypes;
|
|
14
|
+
downloadMode?: DownloadModes;
|
|
15
|
+
onFileDownloaded?: (dcmtFile: File, dcmtInfo: DcmtInfo) => void | Promise<void>;
|
|
16
|
+
confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>;
|
|
17
|
+
skipConfirmation?: boolean;
|
|
18
|
+
retrieveOptions?: RetrieveFormatOptions;
|
|
19
|
+
useCache?: boolean;
|
|
20
|
+
showSuccessAlert?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Controlla la priorità del nome file per il download:
|
|
23
|
+
* - true: usa il fileName da inputDcmts (dcmtInfo.fileName) come priorità
|
|
24
|
+
* - false (default): usa il nome file recuperato dal backend (file.name) come priorità
|
|
25
|
+
*/
|
|
26
|
+
useInputFileName?: boolean;
|
|
27
|
+
}
|
|
10
28
|
export interface UseDcmtOperationsReturn {
|
|
11
29
|
abortController: AbortController;
|
|
12
30
|
showWaitPanel: boolean;
|
|
@@ -19,7 +37,7 @@ export interface UseDcmtOperationsReturn {
|
|
|
19
37
|
waitPanelTextSecondary: string;
|
|
20
38
|
waitPanelValueSecondary: number;
|
|
21
39
|
waitPanelMaxValueSecondary: number;
|
|
22
|
-
downloadDcmtsAsync: (
|
|
40
|
+
downloadDcmtsAsync: (params: DownloadDcmtsAsyncParams) => Promise<void>;
|
|
23
41
|
getDcmtFileAsync: (inputDcmt: DcmtInfo | undefined, rfo: RetrieveFileOptions, operationTitle: string, keepWaitPanelPrimary: boolean, bypassCache?: boolean) => Promise<{
|
|
24
42
|
file: File | undefined;
|
|
25
43
|
isFromCache: boolean;
|
|
@@ -27,7 +45,7 @@ export interface UseDcmtOperationsReturn {
|
|
|
27
45
|
clearDcmtsFileCache: () => void;
|
|
28
46
|
removeDcmtsFileCache: (key: string) => void;
|
|
29
47
|
isDcmtFileInCache: (key: string) => boolean;
|
|
30
|
-
runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>;
|
|
48
|
+
runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>, fetchRemoteCertificates?: (email: string) => Promise<IntesiCertificateData[]>) => Promise<void>;
|
|
31
49
|
FileSourceDialog: () => JSX.Element;
|
|
32
50
|
}
|
|
33
51
|
export declare const useDcmtOperations: () => UseDcmtOperationsReturn;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { LocalizeDcmtOperationTypes } from '../helper/Enum_Localizator';
|
|
3
|
-
import { SDK_Globals, RetrieveFileOptions, DcmtOpers, ResultTypes, RecentCategories, MetadataDataTypes, MetadataDataDomains, DataListCacheService } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { SDK_Globals, RetrieveFileOptions, DcmtOpers, ResultTypes, RecentCategories, MetadataDataTypes, MetadataDataDomains, DataListCacheService, DcmtTypeListCacheService, TemplateTIDs } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { ShowAlert, TMResultManager, FormulaHelper, TMExceptionBoxManager, TMSpinner } from '../components';
|
|
5
|
-
import { Globalization, getExceptionMessage, dialogConfirmOperation, extensionHandler, downloadBase64File, SDKUI_Globals, dcmtsFileCacheDownload, CACHE_SIZE_LIMIT, clearDcmtsFileCache, dcmtsFileCachePreview, isDcmtFileInCache, removeDcmtsFileCache, SDKUI_Localizator } from '../helper';
|
|
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';
|
|
8
|
+
import { importCertificatesAsync } from '../helper/certificateImportHelper';
|
|
8
9
|
import { isXMLFileExt } from '../helper/dcmtsHelper';
|
|
9
10
|
import { ShowConfirm } from '../components/base/TMConfirm';
|
|
11
|
+
import { generateTargetFileName } from '../components/features/documents/copyAndMergeDcmtsShared';
|
|
10
12
|
const isScannerLicenseConfigured = () => {
|
|
11
13
|
try {
|
|
12
14
|
const scannerLicense = SDKUI_Globals.userSettings.advancedSettings.scannerLicense;
|
|
@@ -19,30 +21,72 @@ const isScannerLicenseConfigured = () => {
|
|
|
19
21
|
let abortController = new AbortController();
|
|
20
22
|
const downloadCountMap = new Map();
|
|
21
23
|
/**
|
|
22
|
-
* Genera il nome file per il download con
|
|
23
|
-
*
|
|
24
|
+
* Genera il nome file per il download con logica di priorità configurabile.
|
|
25
|
+
*
|
|
26
|
+
* @param file - File recuperato dal backend (può contenere il nome originale)
|
|
27
|
+
* @param dcmtInfo - Informazioni del documento (fileName, DID, FILEEXT)
|
|
28
|
+
* @param useInputFileName - Controlla la priorità del nome:
|
|
29
|
+
* - true: priorità a dcmtInfo.fileName → file.name → DID
|
|
30
|
+
* - false (default): priorità a file.name → dcmtInfo.fileName → DID
|
|
31
|
+
*
|
|
32
|
+
* Gestisce anche:
|
|
33
|
+
* - Aggiunta automatica dell'estensione se mancante
|
|
34
|
+
* - Duplicati per file con estensioni multiple (es: file.pdf.p7m)
|
|
24
35
|
*/
|
|
25
|
-
const getDownloadFileName = (file, dcmtInfo) => {
|
|
36
|
+
const getDownloadFileName = (file, dcmtInfo, useInputFileName = false) => {
|
|
26
37
|
// === FASE 1: Costruzione nome base con fallback ===
|
|
27
|
-
// Determina l'estensione con fallback
|
|
38
|
+
// Determina l'estensione con fallback: prima dal backend, poi dal documento
|
|
28
39
|
const fileExtFromBackend = file?.name?.split('.').pop()?.toLowerCase();
|
|
29
40
|
const fileExtFromDcmt = dcmtInfo.FILEEXT?.toLowerCase();
|
|
30
41
|
const fileExtension = fileExtFromBackend ?? fileExtFromDcmt ?? '';
|
|
31
42
|
let baseFileName;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Logica di priorità per il nome file:
|
|
45
|
+
*
|
|
46
|
+
* Se useInputFileName = true:
|
|
47
|
+
* 1. Usa dcmtInfo.fileName (nome passato nell'input)
|
|
48
|
+
* 2. Fallback a file.name (nome dal backend)
|
|
49
|
+
* 3. Fallback finale a DID
|
|
50
|
+
*
|
|
51
|
+
* Se useInputFileName = false (default):
|
|
52
|
+
* 1. Usa file.name (nome recuperato dal backend)
|
|
53
|
+
* 2. Fallback a dcmtInfo.fileName (nome salvato nel documento)
|
|
54
|
+
* 3. Fallback finale a DID
|
|
55
|
+
*/
|
|
56
|
+
if (useInputFileName) {
|
|
57
|
+
// Priorità al nome da inputDcmts (dcmtInfo.fileName)
|
|
58
|
+
if (dcmtInfo.fileName) {
|
|
59
|
+
const hasExtension = dcmtInfo.fileName.includes('.');
|
|
60
|
+
baseFileName = hasExtension
|
|
61
|
+
? dcmtInfo.fileName
|
|
62
|
+
: (fileExtension ? `${dcmtInfo.fileName}.${fileExtension}` : dcmtInfo.fileName);
|
|
63
|
+
}
|
|
64
|
+
// Seconda priorità: nome dal backend
|
|
65
|
+
else if (file?.name) {
|
|
66
|
+
baseFileName = file.name;
|
|
67
|
+
}
|
|
68
|
+
// Fallback finale: ID documento con estensione
|
|
69
|
+
else {
|
|
70
|
+
baseFileName = fileExtension ? `${dcmtInfo.DID}.${fileExtension}` : `${dcmtInfo.DID}`;
|
|
71
|
+
}
|
|
42
72
|
}
|
|
43
|
-
// 3. Fallback finale: ID documento con estensione
|
|
44
73
|
else {
|
|
45
|
-
|
|
74
|
+
// Comportamento default: priorità al nome dal backend
|
|
75
|
+
// 1. Priorità massima: nome dal backend
|
|
76
|
+
if (file?.name) {
|
|
77
|
+
baseFileName = file.name;
|
|
78
|
+
}
|
|
79
|
+
// 2. Seconda priorità: nome salvato nel documento
|
|
80
|
+
else if (dcmtInfo.fileName) {
|
|
81
|
+
const hasExtension = dcmtInfo.fileName.includes('.');
|
|
82
|
+
baseFileName = hasExtension
|
|
83
|
+
? dcmtInfo.fileName
|
|
84
|
+
: (fileExtension ? `${dcmtInfo.fileName}.${fileExtension}` : dcmtInfo.fileName);
|
|
85
|
+
}
|
|
86
|
+
// 3. Fallback finale: ID documento con estensione
|
|
87
|
+
else {
|
|
88
|
+
baseFileName = fileExtension ? `${dcmtInfo.DID}.${fileExtension}` : `${dcmtInfo.DID}`;
|
|
89
|
+
}
|
|
46
90
|
}
|
|
47
91
|
// === FASE 2: Gestione duplicati per file con estensioni multiple ===
|
|
48
92
|
const firstDot = baseFileName.indexOf('.');
|
|
@@ -75,7 +119,145 @@ export const useDcmtOperations = () => {
|
|
|
75
119
|
const [waitPanelMaxValueSecondary, setWaitPanelMaxValueSecondary] = useState(0);
|
|
76
120
|
const { OpenFileDialog } = useFileDialog();
|
|
77
121
|
const [selectFileSource, FileSourceDialog] = useFileSourceDialog();
|
|
78
|
-
const
|
|
122
|
+
const copyCompliantDcmtsAsync = async (inputDcmt, onFileDownloaded) => {
|
|
123
|
+
return await _copyCompliantDcmtsAsync(inputDcmt, onFileDownloaded);
|
|
124
|
+
};
|
|
125
|
+
const _copyCompliantDcmtsAsync = async (inputDcmt, onFileDownloaded) => {
|
|
126
|
+
if (inputDcmt === undefined)
|
|
127
|
+
return;
|
|
128
|
+
let returnDcmtFiles = [];
|
|
129
|
+
let returnDcmtInfos = [];
|
|
130
|
+
const rfo = new RetrieveFileOptions();
|
|
131
|
+
rfo.retrieveReason = DcmtOpers.ShowFile;
|
|
132
|
+
let firstBlock = true;
|
|
133
|
+
let maxFileSize = 0;
|
|
134
|
+
let signerInfoDescriptor = undefined;
|
|
135
|
+
if (inputDcmt?.FILEEXT == undefined || inputDcmt.FILEEXT == '') {
|
|
136
|
+
throw new Error('WARNING#' + SDKUI_Localizator.MetadataOnlyDocument);
|
|
137
|
+
}
|
|
138
|
+
let ue = SDK_Globals.tmSession?.NewUpdateEngineByID();
|
|
139
|
+
if (ue) {
|
|
140
|
+
ue.TID = inputDcmt?.TID;
|
|
141
|
+
ue.DID = inputDcmt?.DID;
|
|
142
|
+
//Verifichiamo la nostra firma che nel Lex è sempre CadES
|
|
143
|
+
if (inputDcmt?.FILEEXT && inputDcmt.FILEEXT?.toLowerCase().includes('p7m')) {
|
|
144
|
+
//Verifica firma e recupero informazioni firmatari
|
|
145
|
+
await ue.VerifySignAsync();
|
|
146
|
+
//Recuperiamo le impronte
|
|
147
|
+
signerInfoDescriptor = await ue.GetSignersAsync();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
//Documenti master
|
|
151
|
+
let dsRes = await SDK_Globals.tmSession?.NewSearchEngine().GetAllMasterDcmtsAsync(inputDcmt?.TID, inputDcmt?.DID);
|
|
152
|
+
if (dsRes == undefined || dsRes.length === 0) {
|
|
153
|
+
throw new Error('Nessun documento master trovato');
|
|
154
|
+
}
|
|
155
|
+
//Cerchiamo quello con modello IdC
|
|
156
|
+
let serachResultIdC = null;
|
|
157
|
+
for (const dtRes of dsRes) {
|
|
158
|
+
let dtdCur = await DcmtTypeListCacheService.GetAsync(dtRes.fromTID);
|
|
159
|
+
if (dtdCur?.templateTID === TemplateTIDs.IDC_DcmtType && dtRes.dcmtsFound && dtRes.dcmtsFound > 0) {
|
|
160
|
+
serachResultIdC = { ...dtRes };
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (serachResultIdC == null || serachResultIdC.dcmtsFound !== 1) {
|
|
164
|
+
throw new Error('Nessun IdC correlato al documento');
|
|
165
|
+
}
|
|
166
|
+
if (ue) {
|
|
167
|
+
ue.Metadata_ClearAll();
|
|
168
|
+
ue.TID = serachResultIdC.dtdResult.rows[0][0];
|
|
169
|
+
ue.DID = serachResultIdC.dtdResult.rows[0][1];
|
|
170
|
+
//Verifica dell'IdC
|
|
171
|
+
await ue.VerifySignAsync();
|
|
172
|
+
const signerInfoDescriptorIdC = await ue.GetSignersAsync();
|
|
173
|
+
//Controllo se marcato temporalmente
|
|
174
|
+
if (signerInfoDescriptorIdC) {
|
|
175
|
+
if (signerInfoDescriptorIdC.signers?.filter(s => s.isTimeStamp === true).length === 0) {
|
|
176
|
+
throw new Error('IdC non marcato temporalmente!');
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
else
|
|
180
|
+
throw new Error('IdC non firmato e non marcato temporalmente!');
|
|
181
|
+
//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
|
+
});
|
|
197
|
+
let hashOk = false;
|
|
198
|
+
if (fileIdC) {
|
|
199
|
+
try {
|
|
200
|
+
const contenuto = await fileIdC.text();
|
|
201
|
+
if (contenuto && signerInfoDescriptor?.shA256) {
|
|
202
|
+
hashOk = contenuto.toLocaleUpperCase().includes(signerInfoDescriptor.shA256.toLocaleUpperCase());
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
catch (errDebug) {
|
|
206
|
+
throw new Error(`Errore nella lettura del file IdC: ${errDebug}`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (!hashOk) {
|
|
210
|
+
throw new Error('Impronta non trovata nel file IdC o non corrispondente a quella del documento');
|
|
211
|
+
}
|
|
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
|
+
});
|
|
228
|
+
if (file && fileIdC) {
|
|
229
|
+
returnDcmtFiles.push(file);
|
|
230
|
+
returnDcmtInfos.push(inputDcmt);
|
|
231
|
+
returnDcmtFiles.push(fileIdC);
|
|
232
|
+
returnDcmtInfos.push({ ...inputDcmt, fileName: inputDcmt.fileName + "_IdC", FILEEXT: 'TXT.P7M.TSD' });
|
|
233
|
+
}
|
|
234
|
+
onFileDownloaded && await onFileDownloaded(returnDcmtFiles, returnDcmtInfos);
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
const zipGetName = async (operation, tid) => {
|
|
238
|
+
let nameZip = tid ? tid.toString() + ".zip" : operation.toString() + ".zip";
|
|
239
|
+
switch (operation) {
|
|
240
|
+
case DcmtOperationTypes.CopyCompliant:
|
|
241
|
+
nameZip = `Duplicato_Informatico_${tid ?? '1'}`;
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
return nameZip.trim().toLowerCase().endsWith('.zip')
|
|
245
|
+
? nameZip.trim() : nameZip.trim() + '.zip';
|
|
246
|
+
};
|
|
247
|
+
const zipDocuments = async (zipEntries, typeOperation, tid, passwordZip) => {
|
|
248
|
+
if (zipEntries.length > 0) {
|
|
249
|
+
const zipFileName = await zipGetName(typeOperation, tid);
|
|
250
|
+
// Crea il blob ZIP
|
|
251
|
+
const zipBlob = await ZipManager.createZip(zipEntries, {
|
|
252
|
+
compressionLevel: 6,
|
|
253
|
+
password: passwordZip || undefined,
|
|
254
|
+
});
|
|
255
|
+
// Download zip nella cartella Downloads del browser
|
|
256
|
+
ZipManager.downloadBlob(zipBlob, zipFileName);
|
|
257
|
+
ShowAlert({ message: SDKUI_Localizator.ZipCreatedSavedInFolder.replaceParams(zipFileName, "Zip creato con successo"), mode: 'success', duration: 5000, title: SDKUI_Localizator.CompressToZipFile });
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
const _downloadDcmtsAsync = async (inputDcmts, downloadMode = "download", onFileDownloaded, skipConfirmation = false, retrieveOptions, useCache = true, showSuccessAlert = true, useInputFileName = false) => {
|
|
79
261
|
if (inputDcmts === undefined)
|
|
80
262
|
return;
|
|
81
263
|
if (inputDcmts.length <= 0)
|
|
@@ -159,7 +341,8 @@ export const useDcmtOperations = () => {
|
|
|
159
341
|
else {
|
|
160
342
|
const alink2 = document.createElement('a');
|
|
161
343
|
alink2.href = fileURL;
|
|
162
|
-
|
|
344
|
+
// Usa useInputFileName per determinare la priorità del nome file
|
|
345
|
+
alink2.download = getDownloadFileName(file, inputDcmts[i], useInputFileName);
|
|
163
346
|
alink2.target = "_blank";
|
|
164
347
|
alink2.rel = "noreferrer";
|
|
165
348
|
alink2.click();
|
|
@@ -251,11 +434,14 @@ export const useDcmtOperations = () => {
|
|
|
251
434
|
TMExceptionBoxManager.show({ exception: err });
|
|
252
435
|
}
|
|
253
436
|
};
|
|
254
|
-
const downloadDcmtsAsync = async (
|
|
437
|
+
const downloadDcmtsAsync = async (params) => {
|
|
438
|
+
const { inputDcmts, downloadType = DownloadTypes.Attachment, downloadMode = "download", onFileDownloaded, confirmAttachments, skipConfirmation = false, retrieveOptions, useCache = true, showSuccessAlert = true, useInputFileName = false, // Default: usa il nome dal backend
|
|
439
|
+
} = params;
|
|
255
440
|
switch (downloadType) {
|
|
256
|
-
|
|
441
|
+
// Per il download di documenti, passa useInputFileName per controllare la priorità del nome
|
|
442
|
+
case DownloadTypes.Dcmt: return await _downloadDcmtsAsync(inputDcmts, downloadMode, onFileDownloaded, skipConfirmation, retrieveOptions, useCache, showSuccessAlert, useInputFileName);
|
|
257
443
|
case DownloadTypes.Attachment: return await _downloadAttachmentsAsync(inputDcmts, confirmAttachments, showSuccessAlert);
|
|
258
|
-
default: return await _downloadDcmtsAsync(inputDcmts, undefined, undefined, skipConfirmation, retrieveOptions, useCache, showSuccessAlert);
|
|
444
|
+
default: return await _downloadDcmtsAsync(inputDcmts, undefined, undefined, skipConfirmation, retrieveOptions, useCache, showSuccessAlert, useInputFileName);
|
|
259
445
|
}
|
|
260
446
|
};
|
|
261
447
|
const uploadDcmtsAsync = async (inputDcmts, operationTitle, operType, actionAfterOperationAsync) => {
|
|
@@ -450,7 +636,7 @@ export const useDcmtOperations = () => {
|
|
|
450
636
|
}
|
|
451
637
|
}
|
|
452
638
|
};
|
|
453
|
-
const runOperationAsync = async (inputDcmts, dcmtOperationType, actionAfterOperationAsync) => {
|
|
639
|
+
const runOperationAsync = async (inputDcmts, dcmtOperationType, actionAfterOperationAsync, fetchRemoteCertificates) => {
|
|
454
640
|
if (inputDcmts === undefined)
|
|
455
641
|
return;
|
|
456
642
|
if (inputDcmts.length <= 0)
|
|
@@ -481,6 +667,7 @@ export const useDcmtOperations = () => {
|
|
|
481
667
|
await uploadDcmtsAsync(inputDcmts, operationTitle, undefined, actionAfterOperationAsync);
|
|
482
668
|
return;
|
|
483
669
|
}
|
|
670
|
+
let zipEntries = [];
|
|
484
671
|
setShowWaitPanel(true);
|
|
485
672
|
setShowPrimary(true);
|
|
486
673
|
setShowSecondary(false);
|
|
@@ -529,6 +716,23 @@ export const useDcmtOperations = () => {
|
|
|
529
716
|
}
|
|
530
717
|
break;
|
|
531
718
|
}
|
|
719
|
+
case DcmtOperationTypes.CopyCompliant:
|
|
720
|
+
const collectFileForZip = async (file, dcmtInfo) => {
|
|
721
|
+
if (file.length !== dcmtInfo.length) {
|
|
722
|
+
console.warn(`Numero di file (${file.length}) e documenti (${dcmtInfo.length}) non corrispondono. Impossibile associare correttamente i file ai documenti per la creazione dello zip.`);
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
for (let j = 0; j < file.length; j++) {
|
|
726
|
+
let targetFileName = await generateTargetFileName(file[j], dcmtInfo[j], {
|
|
727
|
+
fileNamingMode: 'documentTypeAndDid',
|
|
728
|
+
separatorChar: '_',
|
|
729
|
+
});
|
|
730
|
+
targetFileName = targetFileName.replace(/\.xml\.p7m\.tsd$/i, '_IdC.XML.P7M.TSD');
|
|
731
|
+
zipEntries.push({ filename: targetFileName, data: file[j] });
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
await copyCompliantDcmtsAsync(inputDcmts[i], collectFileForZip);
|
|
735
|
+
break;
|
|
532
736
|
case DcmtOperationTypes.CheckFile:
|
|
533
737
|
await SDK_Globals.tmSession?.NewSearchEngine().CheckFileAsync(inputDcmts[i].TID, inputDcmts[i].DID);
|
|
534
738
|
break;
|
|
@@ -577,11 +781,23 @@ export const useDcmtOperations = () => {
|
|
|
577
781
|
}
|
|
578
782
|
break;
|
|
579
783
|
}
|
|
784
|
+
case DcmtOperationTypes.ImportCertificates: {
|
|
785
|
+
const importWarnings = await importCertificatesAsync(inputDcmts[i], i, fetchRemoteCertificates, abortController.signal);
|
|
786
|
+
if (importWarnings) {
|
|
787
|
+
result.push(...importWarnings);
|
|
788
|
+
}
|
|
789
|
+
break;
|
|
790
|
+
}
|
|
580
791
|
}
|
|
581
792
|
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.SUCCESS });
|
|
582
793
|
}
|
|
583
794
|
catch (ex) {
|
|
584
|
-
|
|
795
|
+
let msg = getExceptionMessage(ex);
|
|
796
|
+
if (msg.startsWith('WARNING#')) {
|
|
797
|
+
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.WARNING, description: msg.replace('WARNING#', '') });
|
|
798
|
+
}
|
|
799
|
+
else
|
|
800
|
+
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.ERROR, description: msg });
|
|
585
801
|
const err = ex;
|
|
586
802
|
if (err.name === 'CanceledError') {
|
|
587
803
|
ShowAlert({ message: err.message, mode: 'warning', duration: 3000, title: 'Abort' });
|
|
@@ -589,6 +805,9 @@ export const useDcmtOperations = () => {
|
|
|
589
805
|
}
|
|
590
806
|
setWaitPanelValuePrimary(i + 1);
|
|
591
807
|
}
|
|
808
|
+
if (zipEntries.length > 0) {
|
|
809
|
+
await zipDocuments(zipEntries, dcmtOperationType, inputDcmts[0].TID);
|
|
810
|
+
}
|
|
592
811
|
setWaitPanelMaxValuePrimary(0);
|
|
593
812
|
setWaitPanelValuePrimary(0);
|
|
594
813
|
setWaitPanelTextPrimary('');
|
|
@@ -6,7 +6,7 @@ import { DcmtInfo, MetadataValueDescriptorEx, SearchResultContext, TaskContext }
|
|
|
6
6
|
import { UseCheckInOutOperationsReturn } from "./useCheckInOutOperations";
|
|
7
7
|
import { UseDcmtOperationsReturn } from "./useDcmtOperations";
|
|
8
8
|
import { UseRelatedDocumentsReturn } from "./useRelatedDocuments";
|
|
9
|
-
import {
|
|
9
|
+
import { IntesiCertificateData } from '../helper';
|
|
10
10
|
export interface DocumentDataProps {
|
|
11
11
|
dtd: DcmtTypeDescriptor | undefined;
|
|
12
12
|
selectedItems: Array<any>;
|
|
@@ -15,6 +15,7 @@ export interface DocumentDataProps {
|
|
|
15
15
|
currentMetadataValues: Array<MetadataValueDescriptorEx>;
|
|
16
16
|
allUsers?: Array<UserDescriptor>;
|
|
17
17
|
searchResult?: SearchResultDescriptor;
|
|
18
|
+
fetchRemoteCertificates?: (email: string) => Promise<IntesiCertificateData[]>;
|
|
18
19
|
datagridUtility?: {
|
|
19
20
|
visibleItems?: any[];
|
|
20
21
|
onRefreshSearchAsyncDatagrid?: () => Promise<void>;
|
|
@@ -100,7 +101,6 @@ interface UseDocumentOperationsProps {
|
|
|
100
101
|
tasks: TasksProps;
|
|
101
102
|
callbacks: OperationCallbacks;
|
|
102
103
|
exportData?: ExportDataProps;
|
|
103
|
-
mergePdfManager?: MergePdfManagerType;
|
|
104
104
|
}
|
|
105
105
|
export interface UseDocumentOperationsResult {
|
|
106
106
|
operationItems: Array<TMContextMenuItemProps>;
|
|
@@ -21,7 +21,7 @@ import { useDcmtOperations } from "./useDcmtOperations";
|
|
|
21
21
|
import useFloatingBarPinnedItems from "./useFloatingBarPinnedItems";
|
|
22
22
|
import { useInputAttachmentsDialog, useInputCvtFormatDialog } from "./useInputDialog";
|
|
23
23
|
import { useRelatedDocuments } from "./useRelatedDocuments";
|
|
24
|
-
import { convertSearchResultDescriptorToFileItems, dcmtsFileCachePreview, getDcmtCicoStatus, getMoreInfoTasksForDocument, IconActivity, IconArchiveDetail, IconArchiveDoc, IconArchiveMaster, IconBatchUpdate, IconCheck, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconCopy, IconCustom, IconDelete, IconDetailDcmts, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconInfo, IconMenuCAArchive, IconMoveToFolder, IconPair, IconPin, IconPlatform, IconPreview, IconRelation, IconSearch, IconShare, IconSharedDcmt, IconShow, IconSignaturePencil, IconStar, IconSubstFile, IconUndo, IconUnpair, IconUserGroupOutline, isConvertibleToPdfExt, isPdfEditorAvailable, SDKUI_Globals, SDKUI_Localizator, searchResultToMetadataValues, TMImageLibrary } from '../helper';
|
|
24
|
+
import { convertSearchResultDescriptorToFileItems, dcmtsFileCachePreview, getDcmtCicoStatus, getMoreInfoTasksForDocument, IconActivity, IconArchiveDetail, IconArchiveDoc, IconArchiveMaster, IconBatchUpdate, IconCheck, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconCopy, IconCustom, IconDelete, IconDetailDcmts, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconImport, IconInfo, IconMenuCAArchive, IconMoveToFolder, IconPair, IconPin, IconPlatform, IconPreview, IconRelation, IconSearch, IconShare, IconSharedDcmt, IconShow, IconSignaturePencil, IconStar, IconSubstFile, IconUndo, IconUnpair, IconUserGroupOutline, isConvertibleToPdfExt, isPdfEditorAvailable, S4T_USER_REGISTRY_MASTER, SDKUI_Globals, SDKUI_Localizator, searchResultToMetadataValues, TMImageLibrary } from '../helper';
|
|
25
25
|
import { isXMLFileExt } from "../helper/dcmtsHelper";
|
|
26
26
|
import TMCopyToFolderForm from "../components/features/documents/TMCopyToFolderForm";
|
|
27
27
|
import TMMergeToPdfForm from "../components/features/documents/TMMergeToPdfForm";
|
|
@@ -51,8 +51,8 @@ export const getAllFieldSelectedDcmtsOrFocused = (selectedItems, focusedItem, fi
|
|
|
51
51
|
return [];
|
|
52
52
|
};
|
|
53
53
|
export const useDocumentOperations = (props) => {
|
|
54
|
-
const { context, documentData, exportData, uiConfig, tasks, callbacks,
|
|
55
|
-
const { dtd, selectedItems, focusedItem, searchResult, currentSearchResults, currentMetadataValues, allUsers = [], datagridUtility, dcmtUtility, } = documentData;
|
|
54
|
+
const { context, documentData, exportData, uiConfig, tasks, callbacks, } = props;
|
|
55
|
+
const { dtd, selectedItems, focusedItem, searchResult, currentSearchResults, currentMetadataValues, allUsers = [], datagridUtility, dcmtUtility, fetchRemoteCertificates, } = documentData;
|
|
56
56
|
/** State for managing the document(s) to process */
|
|
57
57
|
const [selectedDcmtInfos, setSelectedDcmtInfos] = useState([]);
|
|
58
58
|
const [selectedItemsFull, setSelectedItemsFull] = useState([]);
|
|
@@ -210,6 +210,14 @@ export const useDocumentOperations = (props) => {
|
|
|
210
210
|
const isDisabledForMultiRow = () => {
|
|
211
211
|
return selectedDcmtInfos.length === 0 || selectedDcmtInfos.every(d => d.TID === undefined || d.DID === undefined);
|
|
212
212
|
};
|
|
213
|
+
const isDisabledForMultiRowCopyCompliant = () => {
|
|
214
|
+
let isNotSeletced = selectedDcmtInfos.length === 0 || selectedDcmtInfos.every(d => d.TID === undefined || d.DID === undefined);
|
|
215
|
+
if (isNotSeletced)
|
|
216
|
+
return true;
|
|
217
|
+
let isOnlyMetadata = selectedDcmtInfos.filter(d => d.FILEEXT === null).length === selectedDcmtInfos.length;
|
|
218
|
+
let isAllNotIsLex = selectedItemsFull.filter(d => d.ISLEX === null).length === selectedDcmtInfos.length;
|
|
219
|
+
return isOnlyMetadata || isAllNotIsLex;
|
|
220
|
+
};
|
|
213
221
|
const onRefreshBlog = async () => {
|
|
214
222
|
await onRefreshBlogForm?.();
|
|
215
223
|
await onRefreshBlogDatagrid?.();
|
|
@@ -475,7 +483,7 @@ export const useDocumentOperations = (props) => {
|
|
|
475
483
|
icon: _jsx(IconDownload, {}),
|
|
476
484
|
operationType: 'multiRow',
|
|
477
485
|
disabled: dtd?.perm?.canRetrieveFile !== AccessLevels.Yes ? true : isDisabledForMultiRow(),
|
|
478
|
-
name: SDKUI_Localizator.DownloadFile, onClick: () => downloadDcmtsAsync(selectedDcmtInfos, DownloadTypes.Dcmt, "download",
|
|
486
|
+
name: SDKUI_Localizator.DownloadFile, onClick: () => downloadDcmtsAsync({ inputDcmts: selectedDcmtInfos, downloadType: DownloadTypes.Dcmt, downloadMode: "download", skipConfirmation: true })
|
|
479
487
|
};
|
|
480
488
|
};
|
|
481
489
|
const downloadXMLAttachmentsMenuItem = () => {
|
|
@@ -484,7 +492,7 @@ export const useDocumentOperations = (props) => {
|
|
|
484
492
|
icon: _jsx(IconDownload, {}),
|
|
485
493
|
operationType: 'singleRow',
|
|
486
494
|
disabled: !isXMLFileExt(selectedDcmtInfos?.[0]?.FILEEXT) ? true : isDisabledForSingleRow(),
|
|
487
|
-
name: SDKUI_Localizator.DownloadXMLAttachments, onClick: () => downloadDcmtsAsync(selectedDcmtInfos, DownloadTypes.Attachment, "download",
|
|
495
|
+
name: SDKUI_Localizator.DownloadXMLAttachments, onClick: () => downloadDcmtsAsync({ inputDcmts: selectedDcmtInfos, downloadType: DownloadTypes.Attachment, downloadMode: "download", confirmAttachments: openConfirmAttachmentsDialog, skipConfirmation: true })
|
|
488
496
|
};
|
|
489
497
|
};
|
|
490
498
|
const duplicateDocumentMenuItem = () => {
|
|
@@ -610,6 +618,25 @@ export const useDocumentOperations = (props) => {
|
|
|
610
618
|
disabled: isDisabledForMultiRow(),
|
|
611
619
|
onClick: async () => { await runOperationAsync(selectedDcmtInfos, DcmtOperationTypes.VerifySign); }
|
|
612
620
|
},
|
|
621
|
+
{
|
|
622
|
+
id: 'sign-sync',
|
|
623
|
+
icon: _jsx(IconImport, {}),
|
|
624
|
+
name: SDKUI_Localizator.ImportCertificates,
|
|
625
|
+
operationType: 'multiRow',
|
|
626
|
+
// Visibile solo per tipo documento 'S4T_certificate_registry' con metadato 'email' e se la callback fetchRemoteCertificates è definita
|
|
627
|
+
visible: !!(dtd?.name?.toLowerCase() === S4T_USER_REGISTRY_MASTER
|
|
628
|
+
&& dtd?.metadata?.some(md => md.name?.toLowerCase() === 'email')
|
|
629
|
+
&& fetchRemoteCertificates !== undefined),
|
|
630
|
+
disabled: isDisabledForMultiRow(),
|
|
631
|
+
beginGroup: true,
|
|
632
|
+
onClick: async () => {
|
|
633
|
+
await runOperationAsync(selectedDcmtInfos, DcmtOperationTypes.ImportCertificates, async () => {
|
|
634
|
+
await onRefreshSearchAsyncDatagrid?.();
|
|
635
|
+
await updateCurrentDcmt?.();
|
|
636
|
+
}, // refresh
|
|
637
|
+
fetchRemoteCertificates);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
613
640
|
]
|
|
614
641
|
};
|
|
615
642
|
};
|
|
@@ -691,7 +718,7 @@ export const useDocumentOperations = (props) => {
|
|
|
691
718
|
rfo.cvtFormat = FileFormats.PDF;
|
|
692
719
|
rfo.invoiceRetrieveFormat = SDKUI_Globals.userSettings?.searchSettings.invoiceRetrieveFormat;
|
|
693
720
|
rfo.orderRetrieveFormat = SDKUI_Globals.userSettings?.searchSettings.orderRetrieveFormat;
|
|
694
|
-
await downloadDcmtsAsync(selectedDcmtInfos, DownloadTypes.Dcmt, "download", handlePrint,
|
|
721
|
+
await downloadDcmtsAsync({ inputDcmts: selectedDcmtInfos, downloadType: DownloadTypes.Dcmt, downloadMode: "download", onFileDownloaded: handlePrint, skipConfirmation: true, retrieveOptions: rfo, useCache: true, showSuccessAlert: false });
|
|
695
722
|
};
|
|
696
723
|
return {
|
|
697
724
|
id: 'print',
|
|
@@ -807,6 +834,16 @@ export const useDocumentOperations = (props) => {
|
|
|
807
834
|
],
|
|
808
835
|
};
|
|
809
836
|
};
|
|
837
|
+
const copyCompliantMenuItem = () => {
|
|
838
|
+
return {
|
|
839
|
+
id: 'copy-compliant',
|
|
840
|
+
icon: _jsx(IconCopy, {}),
|
|
841
|
+
name: SDKUI_Localizator.CopyCompliant,
|
|
842
|
+
operationType: 'multiRow',
|
|
843
|
+
disabled: isDisabledForMultiRowCopyCompliant(),
|
|
844
|
+
onClick: async () => { await runOperationAsync(selectedDcmtInfos, DcmtOperationTypes.CopyCompliant); }
|
|
845
|
+
};
|
|
846
|
+
};
|
|
810
847
|
const copyToFolderMenuItem = () => {
|
|
811
848
|
return {
|
|
812
849
|
id: 'copy-to-folder',
|
|
@@ -1153,6 +1190,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1153
1190
|
downloadFileMenuItem(),
|
|
1154
1191
|
downloadXMLAttachmentsMenuItem(),
|
|
1155
1192
|
duplicateDocumentMenuItem(),
|
|
1193
|
+
copyCompliantMenuItem(),
|
|
1156
1194
|
batchUpdateMenuItem(),
|
|
1157
1195
|
passToArchive(),
|
|
1158
1196
|
...(selectedDcmtInfos.length > 0 && isPdfEditorAvailable(dtd, selectedDcmtInfos[0]?.FILEEXT) && onOpenPdfEditorRequest ? [pdfEditorMenuItem(onOpenPdfEditorRequest)] : []),
|
|
@@ -1162,7 +1200,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1162
1200
|
signatureMenuItem(),
|
|
1163
1201
|
checkinMenuItem(),
|
|
1164
1202
|
copyToFolderMenuItem(),
|
|
1165
|
-
|
|
1203
|
+
mergeToPdfMenuItem(),
|
|
1166
1204
|
allowRelations ? relationsMenuItem() : null,
|
|
1167
1205
|
sharedDcmtsMenuItem(),
|
|
1168
1206
|
// shareMenuItem(),
|
|
@@ -1250,6 +1288,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1250
1288
|
...(SDK_Globals.tmSession?.SessionDescr?.appModuleID === AppModules.SURFER ? [createContextualTaskMenuItem()] : []),
|
|
1251
1289
|
downloadFileMenuItem(),
|
|
1252
1290
|
downloadXMLAttachmentsMenuItem(),
|
|
1291
|
+
copyCompliantMenuItem(),
|
|
1253
1292
|
...(selectedDcmtInfos.length > 0 && isPdfEditorAvailable(dtd, selectedDcmtInfos[0]?.FILEEXT) && onOpenPdfEditorRequest ? [pdfEditorMenuItem(onOpenPdfEditorRequest)] : []),
|
|
1254
1293
|
...(!isMobile ? [printMenuItem()] : [])
|
|
1255
1294
|
]
|
|
@@ -1307,7 +1346,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1307
1346
|
onTaskCreateRequest,
|
|
1308
1347
|
datagridUtility,
|
|
1309
1348
|
dcmtUtility,
|
|
1310
|
-
|
|
1349
|
+
fetchRemoteCertificates
|
|
1311
1350
|
};
|
|
1312
1351
|
const masterDetailMasterCommonProps = {
|
|
1313
1352
|
deviceType,
|
|
@@ -1335,7 +1374,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1335
1374
|
onTaskCreateRequest,
|
|
1336
1375
|
datagridUtility,
|
|
1337
1376
|
dcmtUtility,
|
|
1338
|
-
|
|
1377
|
+
fetchRemoteCertificates
|
|
1339
1378
|
};
|
|
1340
1379
|
const renderDcmtOperations = (_jsxs(_Fragment, { children: [(showExportForm && searchResult && dataColumns && dataSource && selectedRowKeys) && (_jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: () => setShowExportForm(false), searchResult: searchResult })), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: ((isOpenDcmtForm && focusedItem?.TID !== undefined && focusedItem?.DID !== undefined) &&
|
|
1341
1380
|
_jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID !== undefined), titleModal: dtd?.name ?? '', TID: focusedItem.TID, DID: focusedItem.DID, allowButtonsRefs: true, showTodoDcmtForm: showTodoDcmtForm, layoutMode: dcmtFormLayoutMode, count: visibleItems?.length, itemIndex: visibleItems ? visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1 : undefined, canNext: canNavigateHandler ? canNavigateHandler('next') : false, canPrev: canNavigateHandler ? canNavigateHandler('prev') : false, onNext: () => onNavigateHandler && onNavigateHandler('next'), onPrev: () => onNavigateHandler && onNavigateHandler('prev'), onClose: () => { (false); onDcmtFormOpenChange(false, LayoutModes.Update); }, onWFOperationCompleted: onWFOperationCompleted, onTaskCreateRequest: onTaskCreateRequest, onSavedAsyncCallback: onSavedAsyncCallback, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openFileUploaderPdfEditor: openFileUploaderPdfEditor, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.TID, focusedItem?.DID), showDcmtFormSidebar: showDcmtFormSidebar, datagridUtility: {
|
|
@@ -1344,7 +1383,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1344
1383
|
refreshFocusedDataRowAsync,
|
|
1345
1384
|
onRefreshBlogDatagrid,
|
|
1346
1385
|
onRefreshPreviewDatagrid
|
|
1347
|
-
} })) }), (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) &&
|
|
1386
|
+
}, fetchRemoteCertificates: fetchRemoteCertificates })) }), (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) &&
|
|
1348
1387
|
_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: isOpenDetails && _jsx(TMMasterDetailDcmts, { ...masterDetailDetailsCommonProps, onBack: () => setIsOpenDetails(false) }) }), 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: [isOpenMaster && _jsx(TMMasterDetailDcmts, { ...masterDetailMasterCommonProps, onBack: () => setIsOpenMaster(false) }), secondaryMasterDcmts.length > 0 && secondaryMasterDcmts.map((dcmt, index) => {
|
|
1349
1388
|
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { ...masterDetailMasterCommonProps, inputDcmts: [dcmt], allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID) }) }, `${index}-${dcmt.DID}`));
|
|
1350
1389
|
})] }), 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: () => {
|
|
@@ -1391,7 +1430,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1391
1430
|
TMSpinner.hide();
|
|
1392
1431
|
}
|
|
1393
1432
|
}, onClose: () => setShowManyToManyChooser(false), manageUseLocalizedName: false }), showPairDcmtsModal &&
|
|
1394
|
-
_jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, passToArchiveCallback: passToArchiveCallback, showTodoDcmtForm: showTodoDcmtForm, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: false, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter,
|
|
1433
|
+
_jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, passToArchiveCallback: passToArchiveCallback, showTodoDcmtForm: showTodoDcmtForm, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: false, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, fetchRemoteCertificates: fetchRemoteCertificates }) }), showPairSearchModal &&
|
|
1395
1434
|
_jsx(TMModal, { title: "Ricerca documenti", onClose: () => setShowPairSearchModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearch, { onlyShowSearchQueryPanel: true, inputTID: pairSearchModalTargetTID, inputMids: pairSearchModalInputMids, floatingActionConfig: pairSearchModalFloatingActionConfig, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), isOpenSharedArchive && _jsx(TMModal, { title: SDKUI_Localizator.SharedArchiving, onClose: () => {
|
|
1396
1435
|
setIsOpenSharedArchive(false);
|
|
1397
1436
|
}, width: isMobile ? '90%' : '60%', height: isMobile ? '90%' : '80%', children: _jsx(TMArchive, { inputDID: selectedDcmtInfos?.[0].DID, inputTID: selectedDcmtInfos?.[0].TID, inputMids: currentMetadataValues.filter(md => md.mid && md.mid > 100).map(md => ({ mid: md.mid, value: md.value ?? '' })), isSharedArchive: true, inputFile: sharedDcmtFile, onSavedAsyncCallback: async (tid, did) => {
|
|
@@ -1400,11 +1439,11 @@ export const useDocumentOperations = (props) => {
|
|
|
1400
1439
|
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), sharedDcmtSearchResults.length > 0 &&
|
|
1401
1440
|
_jsx(TMModal, { title: "Documenti condivisi", onClose: () => {
|
|
1402
1441
|
setSharedDcmtSearchResults([]);
|
|
1403
|
-
}, width: isMobile ? '90%' : '60%', height: isMobile ? '90%' : '80%', children: _jsx(TMSearchResult, { searchResults: sharedDcmtSearchResults, allowFloatingBar: false, showSelector: true, disableAccordionIfSingleCategory: true, showBackButton: isMobile, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers,
|
|
1442
|
+
}, width: isMobile ? '90%' : '60%', height: isMobile ? '90%' : '80%', children: _jsx(TMSearchResult, { searchResults: sharedDcmtSearchResults, allowFloatingBar: false, showSelector: true, disableAccordionIfSingleCategory: true, showBackButton: isMobile, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, fetchRemoteCertificates: fetchRemoteCertificates }) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${selectedDcmtInfos.length} documenti selezionati)`, inputDcmts: selectedDcmtInfos, TID: selectedDcmtInfos.length > 0 ? selectedDcmtInfos[0]?.TID : undefined, DID: selectedDcmtInfos.length > 0 ? selectedDcmtInfos[0]?.DID : undefined, onBack: () => updateBatchUpdateForm(false), onSavedCallbackAsync: async () => {
|
|
1404
1443
|
updateBatchUpdateForm(false);
|
|
1405
1444
|
setIsModifiedBatchUpdate(false);
|
|
1406
1445
|
await onRefreshDataRowsAsync?.();
|
|
1407
|
-
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, isReject: 0, onClose: () => updateShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, isReject: 1, onClose: () => updateShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, onClose: () => updateShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { fromDTD: dtd, TID: contextConfig.approvalTID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: handleWFOperationCompleted, onClose: () => updateShowMoreInfoPopup(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, triggerBlogRefresh: onRefreshBlogDatagrid }), openCopyToFolderForm.open && openCopyToFolderForm.operationType === 'mergeToPdf' && _jsx(TMMergeToPdfForm, { mode: openCopyToFolderForm.mode, selectedDcmtInfos: selectedDcmtInfos, onClose: () => setOpenCopyToFolderForm({ open: false, operationType: 'copyToFolder', mode: 'onlySelected' }), showTMRelationViewer: showTMRelationViewerInCopyToFolderForm,
|
|
1446
|
+
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, isReject: 0, onClose: () => updateShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, isReject: 1, onClose: () => updateShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, onClose: () => updateShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { fromDTD: dtd, TID: contextConfig.approvalTID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: handleWFOperationCompleted, onClose: () => updateShowMoreInfoPopup(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, triggerBlogRefresh: onRefreshBlogDatagrid }), openCopyToFolderForm.open && openCopyToFolderForm.operationType === 'mergeToPdf' && _jsx(TMMergeToPdfForm, { mode: openCopyToFolderForm.mode, selectedDcmtInfos: selectedDcmtInfos, selectedItemsFull: selectedItemsFull, onClose: () => setOpenCopyToFolderForm({ open: false, operationType: 'copyToFolder', mode: 'onlySelected' }), showTMRelationViewer: showTMRelationViewerInCopyToFolderForm, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), openCopyToFolderForm.open && openCopyToFolderForm.operationType === 'copyToFolder' && _jsx(TMCopyToFolderForm, { mode: openCopyToFolderForm.mode, selectedDcmtInfos: selectedDcmtInfos, onClose: () => setOpenCopyToFolderForm({ open: false, operationType: 'copyToFolder', mode: 'onlySelected' }), showTMRelationViewer: showTMRelationViewerInCopyToFolderForm, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), _jsx(FileSourceDialog, {}), taskFormDialogComponent, s4TViewerDialogComponent, currentCustomButton && _jsx(TMCustomButton, { button: currentCustomButton, formData: currentMetadataValues, selectedItems: selectedItemsFull, onClose: () => setCurrentCustomButton(undefined) })] }));
|
|
1408
1447
|
return {
|
|
1409
1448
|
operationItems: operationItems(),
|
|
1410
1449
|
renderFloatingBar,
|