@topconsultnpm/sdkui-react 6.21.0-dev3.8 → 6.21.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/TMContextMenu.js +28 -2
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +6 -6
- package/lib/components/base/TMAreaManager.js +11 -0
- package/lib/components/base/TMDataGrid.js +12 -2
- package/lib/components/base/TMDataGridExportForm.js +19 -8
- 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 +4 -2
- package/lib/components/base/TMSpinner.js +33 -6
- package/lib/components/choosers/TMDistinctValues.js +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.js +6 -1
- package/lib/components/choosers/TMGroupChooser.js +1 -1
- package/lib/components/editors/TMEditorStyled.d.ts +4 -4
- package/lib/components/editors/TMFormulaEditor.d.ts +1 -0
- package/lib/components/editors/TMFormulaEditor.js +98 -49
- 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/features/documents/TMDcmtForm.d.ts +2 -0
- package/lib/components/features/documents/TMDcmtForm.js +2 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +7 -4
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +2 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +91 -48
- package/lib/components/features/documents/TMRelationViewer.js +58 -5
- package/lib/components/features/documents/mergePdfUtils.d.ts +52 -0
- package/lib/components/features/documents/mergePdfUtils.js +268 -0
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +17 -0
- package/lib/components/features/search/TMMetadataOutputForm.js +225 -0
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +17 -0
- package/lib/components/features/search/TMMetadataSorterForm.js +243 -0
- package/lib/components/features/search/TMSearch.d.ts +2 -0
- 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 -0
- package/lib/components/features/search/TMSearchResult.js +77 -22
- package/lib/components/features/search/metadataFormHelper.d.ts +16 -0
- package/lib/components/features/search/metadataFormHelper.js +77 -0
- package/lib/components/forms/Login/TMLoginForm.js +15 -3
- 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/SDKUI_Localizator.d.ts +14 -0
- package/lib/helper/SDKUI_Localizator.js +152 -12
- package/lib/helper/certificateImportHelper.d.ts +43 -0
- package/lib/helper/certificateImportHelper.js +403 -0
- package/lib/helper/checkinCheckoutManager.js +10 -2
- package/lib/helper/helpers.d.ts +2 -1
- package/lib/helper/helpers.js +1 -0
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useDataUserIdItem.js +1 -1
- package/lib/hooks/useDcmtOperations.d.ts +2 -1
- package/lib/hooks/useDcmtOperations.js +177 -4
- package/lib/hooks/useDocumentOperations.d.ts +2 -0
- package/lib/hooks/useDocumentOperations.js +47 -6
- package/lib/services/platform_services.d.ts +4 -4
- package/lib/ts/types.d.ts +3 -1
- package/lib/ts/types.js +2 -0
- package/package.json +13 -7
|
@@ -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;
|
|
@@ -117,6 +119,144 @@ export const useDcmtOperations = () => {
|
|
|
117
119
|
const [waitPanelMaxValueSecondary, setWaitPanelMaxValueSecondary] = useState(0);
|
|
118
120
|
const { OpenFileDialog } = useFileDialog();
|
|
119
121
|
const [selectFileSource, FileSourceDialog] = useFileSourceDialog();
|
|
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
|
+
};
|
|
120
260
|
const _downloadDcmtsAsync = async (inputDcmts, downloadMode = "download", onFileDownloaded, skipConfirmation = false, retrieveOptions, useCache = true, showSuccessAlert = true, useInputFileName = false) => {
|
|
121
261
|
if (inputDcmts === undefined)
|
|
122
262
|
return;
|
|
@@ -496,7 +636,7 @@ export const useDcmtOperations = () => {
|
|
|
496
636
|
}
|
|
497
637
|
}
|
|
498
638
|
};
|
|
499
|
-
const runOperationAsync = async (inputDcmts, dcmtOperationType, actionAfterOperationAsync) => {
|
|
639
|
+
const runOperationAsync = async (inputDcmts, dcmtOperationType, actionAfterOperationAsync, fetchRemoteCertificates) => {
|
|
500
640
|
if (inputDcmts === undefined)
|
|
501
641
|
return;
|
|
502
642
|
if (inputDcmts.length <= 0)
|
|
@@ -527,6 +667,7 @@ export const useDcmtOperations = () => {
|
|
|
527
667
|
await uploadDcmtsAsync(inputDcmts, operationTitle, undefined, actionAfterOperationAsync);
|
|
528
668
|
return;
|
|
529
669
|
}
|
|
670
|
+
let zipEntries = [];
|
|
530
671
|
setShowWaitPanel(true);
|
|
531
672
|
setShowPrimary(true);
|
|
532
673
|
setShowSecondary(false);
|
|
@@ -575,6 +716,23 @@ export const useDcmtOperations = () => {
|
|
|
575
716
|
}
|
|
576
717
|
break;
|
|
577
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;
|
|
578
736
|
case DcmtOperationTypes.CheckFile:
|
|
579
737
|
await SDK_Globals.tmSession?.NewSearchEngine().CheckFileAsync(inputDcmts[i].TID, inputDcmts[i].DID);
|
|
580
738
|
break;
|
|
@@ -623,11 +781,23 @@ export const useDcmtOperations = () => {
|
|
|
623
781
|
}
|
|
624
782
|
break;
|
|
625
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
|
+
}
|
|
626
791
|
}
|
|
627
792
|
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.SUCCESS });
|
|
628
793
|
}
|
|
629
794
|
catch (ex) {
|
|
630
|
-
|
|
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 });
|
|
631
801
|
const err = ex;
|
|
632
802
|
if (err.name === 'CanceledError') {
|
|
633
803
|
ShowAlert({ message: err.message, mode: 'warning', duration: 3000, title: 'Abort' });
|
|
@@ -635,6 +805,9 @@ export const useDcmtOperations = () => {
|
|
|
635
805
|
}
|
|
636
806
|
setWaitPanelValuePrimary(i + 1);
|
|
637
807
|
}
|
|
808
|
+
if (zipEntries.length > 0) {
|
|
809
|
+
await zipDocuments(zipEntries, dcmtOperationType, inputDcmts[0].TID);
|
|
810
|
+
}
|
|
638
811
|
setWaitPanelMaxValuePrimary(0);
|
|
639
812
|
setWaitPanelValuePrimary(0);
|
|
640
813
|
setWaitPanelTextPrimary('');
|
|
@@ -6,6 +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 { IntesiCertificateData } from '../helper';
|
|
9
10
|
export interface DocumentDataProps {
|
|
10
11
|
dtd: DcmtTypeDescriptor | undefined;
|
|
11
12
|
selectedItems: Array<any>;
|
|
@@ -14,6 +15,7 @@ export interface DocumentDataProps {
|
|
|
14
15
|
currentMetadataValues: Array<MetadataValueDescriptorEx>;
|
|
15
16
|
allUsers?: Array<UserDescriptor>;
|
|
16
17
|
searchResult?: SearchResultDescriptor;
|
|
18
|
+
fetchRemoteCertificates?: (email: string) => Promise<IntesiCertificateData[]>;
|
|
17
19
|
datagridUtility?: {
|
|
18
20
|
visibleItems?: any[];
|
|
19
21
|
onRefreshSearchAsyncDatagrid?: () => Promise<void>;
|
|
@@ -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";
|
|
@@ -52,7 +52,7 @@ export const getAllFieldSelectedDcmtsOrFocused = (selectedItems, focusedItem, fi
|
|
|
52
52
|
};
|
|
53
53
|
export const useDocumentOperations = (props) => {
|
|
54
54
|
const { context, documentData, exportData, uiConfig, tasks, callbacks, } = props;
|
|
55
|
-
const { dtd, selectedItems, focusedItem, searchResult, currentSearchResults, currentMetadataValues, allUsers = [], datagridUtility, dcmtUtility, } = documentData;
|
|
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?.();
|
|
@@ -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
|
};
|
|
@@ -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)] : []),
|
|
@@ -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,6 +1346,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1307
1346
|
onTaskCreateRequest,
|
|
1308
1347
|
datagridUtility,
|
|
1309
1348
|
dcmtUtility,
|
|
1349
|
+
fetchRemoteCertificates
|
|
1310
1350
|
};
|
|
1311
1351
|
const masterDetailMasterCommonProps = {
|
|
1312
1352
|
deviceType,
|
|
@@ -1334,6 +1374,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1334
1374
|
onTaskCreateRequest,
|
|
1335
1375
|
datagridUtility,
|
|
1336
1376
|
dcmtUtility,
|
|
1377
|
+
fetchRemoteCertificates
|
|
1337
1378
|
};
|
|
1338
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) &&
|
|
1339
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: {
|
|
@@ -1342,7 +1383,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1342
1383
|
refreshFocusedDataRowAsync,
|
|
1343
1384
|
onRefreshBlogDatagrid,
|
|
1344
1385
|
onRefreshPreviewDatagrid
|
|
1345
|
-
} })) }), (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) &&
|
|
1346
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) => {
|
|
1347
1388
|
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { ...masterDetailMasterCommonProps, inputDcmts: [dcmt], allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID) }) }, `${index}-${dcmt.DID}`));
|
|
1348
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: () => {
|
|
@@ -1389,7 +1430,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1389
1430
|
TMSpinner.hide();
|
|
1390
1431
|
}
|
|
1391
1432
|
}, onClose: () => setShowManyToManyChooser(false), manageUseLocalizedName: false }), showPairDcmtsModal &&
|
|
1392
|
-
_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 }) }), showPairSearchModal &&
|
|
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 &&
|
|
1393
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: () => {
|
|
1394
1435
|
setIsOpenSharedArchive(false);
|
|
1395
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) => {
|
|
@@ -1398,11 +1439,11 @@ export const useDocumentOperations = (props) => {
|
|
|
1398
1439
|
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), sharedDcmtSearchResults.length > 0 &&
|
|
1399
1440
|
_jsx(TMModal, { title: "Documenti condivisi", onClose: () => {
|
|
1400
1441
|
setSharedDcmtSearchResults([]);
|
|
1401
|
-
}, 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 }) }), 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 () => {
|
|
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 () => {
|
|
1402
1443
|
updateBatchUpdateForm(false);
|
|
1403
1444
|
setIsModifiedBatchUpdate(false);
|
|
1404
1445
|
await onRefreshDataRowsAsync?.();
|
|
1405
|
-
}, 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, 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) })] }));
|
|
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) })] }));
|
|
1406
1447
|
return {
|
|
1407
1448
|
operationItems: operationItems(),
|
|
1408
1449
|
renderFloatingBar,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { JobTypes, ObjectClasses, ProcessDescriptor, DcmtTypeDescriptor } from "@topconsultnpm/sdk-ts";
|
|
2
2
|
export declare class PlatformObjectService {
|
|
3
|
-
static readonly retrieveAllAsync: (objClass: ObjectClasses, refreshCache?: boolean) => Promise<import("@topconsultnpm/sdk-ts").RelationDescriptor[] | import("@topconsultnpm/sdk-ts").
|
|
4
|
-
static readonly retrieveAsync: (objClass: ObjectClasses, id: number) => Promise<import("@topconsultnpm/sdk-ts").RelationDescriptor | import("@topconsultnpm/sdk-ts").
|
|
3
|
+
static readonly retrieveAllAsync: (objClass: ObjectClasses, refreshCache?: boolean) => Promise<import("@topconsultnpm/sdk-ts").RelationDescriptor[] | import("@topconsultnpm/sdk-ts").AreaDescriptor[] | import("@topconsultnpm/sdk-ts").NotificationDescriptor[] | import("@topconsultnpm/sdk-ts").TaskDescriptor[] | import("@topconsultnpm/sdk-ts").WorkingGroupDescriptor[] | undefined>;
|
|
4
|
+
static readonly retrieveAsync: (objClass: ObjectClasses, id: number) => Promise<import("@topconsultnpm/sdk-ts").RelationDescriptor | import("@topconsultnpm/sdk-ts").AreaDescriptor | import("@topconsultnpm/sdk-ts").BasketTypeDescriptor | import("@topconsultnpm/sdk-ts").NotificationDescriptor | import("@topconsultnpm/sdk-ts").TaskDescriptor | import("@topconsultnpm/sdk-ts").WorkingGroupDescriptor | undefined>;
|
|
5
5
|
private static readonly retrieveAllAdminJobsAsync;
|
|
6
|
-
static readonly retrieveAllAdminAsync: (objClass: ObjectClasses, jobType?: JobTypes) => Promise<import("@topconsultnpm/sdk-ts").UserDescriptor[] | import("@topconsultnpm/sdk-ts").RelationDescriptor[] |
|
|
6
|
+
static readonly retrieveAllAdminAsync: (objClass: ObjectClasses, jobType?: JobTypes) => Promise<import("@topconsultnpm/sdk-ts").UserDescriptor[] | DcmtTypeDescriptor[] | import("@topconsultnpm/sdk-ts").RelationDescriptor[] | import("@topconsultnpm/sdk-ts").GroupDescriptor[] | import("@topconsultnpm/sdk-ts").AreaDescriptor[] | import("@topconsultnpm/sdk-ts").FEDistillerJobDescriptor[] | import("@topconsultnpm/sdk-ts").DataListDescriptor[] | import("@topconsultnpm/sdk-ts").DiskDescriptor[] | import("@topconsultnpm/sdk-ts").LDAPDescriptor[] | import("@topconsultnpm/sdk-ts").NumeratorDescriptor[] | ProcessDescriptor[] | import("@topconsultnpm/sdk-ts").SAPLoginDescriptor[] | import("@topconsultnpm/sdk-ts").SignCertDescriptor[] | import("@topconsultnpm/sdk-ts").SignServerDescriptor[] | import("@topconsultnpm/sdk-ts").TreeDescriptor[] | import("@topconsultnpm/sdk-ts").TSADescriptor[] | import("@topconsultnpm/sdk-ts").WFDescriptor[] | undefined>;
|
|
7
7
|
private static readonly loadCacheForJobAsync;
|
|
8
8
|
private static readonly retrieveAdminJobAsync;
|
|
9
|
-
static readonly retrieveAdminAsync: (objClass: ObjectClasses, jobType: JobTypes, id: number) => Promise<import("@topconsultnpm/sdk-ts").UserDescriptor | import("@topconsultnpm/sdk-ts").WFDescriptor | DcmtTypeDescriptor | import("@topconsultnpm/sdk-ts").DataListDescriptor | import("@topconsultnpm/sdk-ts").RelationDescriptor | import("@topconsultnpm/sdk-ts").
|
|
9
|
+
static readonly retrieveAdminAsync: (objClass: ObjectClasses, jobType: JobTypes, id: number) => Promise<import("@topconsultnpm/sdk-ts").UserDescriptor | import("@topconsultnpm/sdk-ts").WFDescriptor | DcmtTypeDescriptor | import("@topconsultnpm/sdk-ts").DataListDescriptor | import("@topconsultnpm/sdk-ts").RelationDescriptor | import("@topconsultnpm/sdk-ts").GroupDescriptor | import("@topconsultnpm/sdk-ts").SavedQueryDescriptor | import("@topconsultnpm/sdk-ts").AreaDescriptor | import("@topconsultnpm/sdk-ts").BasketTypeDescriptor | import("@topconsultnpm/sdk-ts").TaskDescriptor | import("@topconsultnpm/sdk-ts").WorkingGroupDescriptor | import("@topconsultnpm/sdk-ts").BarcodeArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").BatchUpdaterJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoDoganaleJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoDoganalePlusJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoDoganaleDistillerJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoFiscaleQueryJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoFiscaleSenderJobDescriptor | import("@topconsultnpm/sdk-ts").CheckSequenceJobDescriptor | import("@topconsultnpm/sdk-ts").COSCheckerJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtConverterJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtCreatorJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtDeleterJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtNoteJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtPrinterJobDescriptor | import("@topconsultnpm/sdk-ts").FEAttacherJobDescriptor | import("@topconsultnpm/sdk-ts").FECreatorTxtJobDescriptor | import("@topconsultnpm/sdk-ts").FEDetacherJobDescriptor | import("@topconsultnpm/sdk-ts").FEDistillerJobDescriptor | import("@topconsultnpm/sdk-ts").FESenderWsJobDescriptor | import("@topconsultnpm/sdk-ts").FESplitterJobDescriptor | import("@topconsultnpm/sdk-ts").FEValidatorJobDescriptor | import("@topconsultnpm/sdk-ts").FileArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").FileCheckerJobDescriptor | import("@topconsultnpm/sdk-ts").FileExecJobDescriptor | import("@topconsultnpm/sdk-ts").FileExportJobDescriptor | import("@topconsultnpm/sdk-ts").FileMoverJobDescriptor | import("@topconsultnpm/sdk-ts").LexJobDescriptor | import("@topconsultnpm/sdk-ts").LinkerJobDescriptor | import("@topconsultnpm/sdk-ts").MailArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").MailQueryJobDescriptor | import("@topconsultnpm/sdk-ts").MailSenderJobDescriptor | import("@topconsultnpm/sdk-ts").MigrationJobDescriptor | import("@topconsultnpm/sdk-ts").OcrSixJobDescriptor | import("@topconsultnpm/sdk-ts").PdDCreatorJobDescriptor | import("@topconsultnpm/sdk-ts").PDFArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").PdVArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").PdVQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PdVSenderJobDescriptor | import("@topconsultnpm/sdk-ts").PeppolQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PeppolSenderJobDescriptor | import("@topconsultnpm/sdk-ts").PostelQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PostelSenderJobDescriptor | import("@topconsultnpm/sdk-ts").ReplicatorJobDescriptor | import("@topconsultnpm/sdk-ts").SAPAlignerJobDescriptor | import("@topconsultnpm/sdk-ts").SAPBarcodeJobDescriptor | import("@topconsultnpm/sdk-ts").SAPDataReaderJobDescriptor | import("@topconsultnpm/sdk-ts").SAPDataWriterJobDescriptor | import("@topconsultnpm/sdk-ts").SignerJobDescriptor | import("@topconsultnpm/sdk-ts").SpoolArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").UpdaterJobDescriptor | import("@topconsultnpm/sdk-ts").DiskDescriptor | import("@topconsultnpm/sdk-ts").LDAPDescriptor | import("@topconsultnpm/sdk-ts").NumeratorDescriptor | ProcessDescriptor | import("@topconsultnpm/sdk-ts").SAPLoginDescriptor | import("@topconsultnpm/sdk-ts").SignCertDescriptor | import("@topconsultnpm/sdk-ts").SignServerDescriptor | import("@topconsultnpm/sdk-ts").TreeDescriptor | import("@topconsultnpm/sdk-ts").TSADescriptor | undefined>;
|
|
10
10
|
private static readonly updateJobAsync;
|
|
11
11
|
static readonly updateAsync: (objClass: ObjectClasses, jobType: JobTypes, d: any, ...args: any[]) => Promise<number | undefined>;
|
|
12
12
|
private static readonly createJobAsync;
|
package/lib/ts/types.d.ts
CHANGED
|
@@ -36,7 +36,9 @@ export declare enum DcmtOperationTypes {
|
|
|
36
36
|
FreeSearchReindex = 12,
|
|
37
37
|
FreeSearchPurge = 13,
|
|
38
38
|
BatchUpdate = 14,
|
|
39
|
-
RemoveFromWorkgroup = 15
|
|
39
|
+
RemoveFromWorkgroup = 15,
|
|
40
|
+
CopyCompliant = 16,
|
|
41
|
+
ImportCertificates = 17
|
|
40
42
|
}
|
|
41
43
|
export declare enum DownloadTypes {
|
|
42
44
|
Dcmt = "Dcmt",
|
package/lib/ts/types.js
CHANGED
|
@@ -39,6 +39,8 @@ export var DcmtOperationTypes;
|
|
|
39
39
|
DcmtOperationTypes[DcmtOperationTypes["FreeSearchPurge"] = 13] = "FreeSearchPurge";
|
|
40
40
|
DcmtOperationTypes[DcmtOperationTypes["BatchUpdate"] = 14] = "BatchUpdate";
|
|
41
41
|
DcmtOperationTypes[DcmtOperationTypes["RemoveFromWorkgroup"] = 15] = "RemoveFromWorkgroup";
|
|
42
|
+
DcmtOperationTypes[DcmtOperationTypes["CopyCompliant"] = 16] = "CopyCompliant";
|
|
43
|
+
DcmtOperationTypes[DcmtOperationTypes["ImportCertificates"] = 17] = "ImportCertificates";
|
|
42
44
|
})(DcmtOperationTypes || (DcmtOperationTypes = {}));
|
|
43
45
|
export var DownloadTypes;
|
|
44
46
|
(function (DownloadTypes) {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react",
|
|
3
|
-
"version": "6.21.0-
|
|
3
|
+
"version": "6.21.0-dev4.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
-
"clean": "
|
|
8
|
-
"copy-files": "
|
|
7
|
+
"clean": "node -e \"const fs=require('fs');fs.rmSync('lib',{recursive:true,force:true});fs.mkdirSync('lib')\"",
|
|
8
|
+
"copy-files": "cpx \"src/{assets/*.*,assets/ImageLibrary/*.*,assets/thumbnails/*.*,assets/IconsS4t/*.*,assets/Metadata/*.*,css/tm-sdkui.css}\" lib",
|
|
9
9
|
"tm-build": "npm run clean && tsc && npm run copy-files",
|
|
10
10
|
"tm-watch": "tsc -w",
|
|
11
11
|
"tm-publish": "npm publish --tag latest",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@types/node": "^24.12.2",
|
|
25
25
|
"@types/react": "^18.3.3",
|
|
26
26
|
"@types/react-dom": "^18.3.3",
|
|
27
|
-
"
|
|
27
|
+
"cpx2": "^9.0.0",
|
|
28
28
|
"esbuild": "^0.25.0",
|
|
29
29
|
"react": "^18.3.1",
|
|
30
30
|
"react-dom": "^18.3.1",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"lib"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@topconsultnpm/sdk-ts": "6.21.0-
|
|
43
|
+
"@topconsultnpm/sdk-ts": "6.21.0-dev4.2",
|
|
44
44
|
"@zip.js/zip.js": "2.8.26",
|
|
45
45
|
"buffer": "^6.0.3",
|
|
46
46
|
"devextreme": "^25.2.6",
|
|
47
|
+
"devextreme-exceljs-fork": "^4.4.10",
|
|
47
48
|
"devextreme-react": "^25.2.6",
|
|
48
|
-
"exceljs": "^4.4.0",
|
|
49
49
|
"htmlparser2": "^10.0.0",
|
|
50
50
|
"pdf-lib": "^1.17.1",
|
|
51
51
|
"react-pdf": "^10.4.1",
|
|
@@ -53,6 +53,12 @@
|
|
|
53
53
|
"styled-components": "^6.1.1"
|
|
54
54
|
},
|
|
55
55
|
"overrides": {
|
|
56
|
-
"esbuild": "^0.25.0"
|
|
56
|
+
"esbuild": "^0.25.0",
|
|
57
|
+
"devextreme-exceljs-fork": {
|
|
58
|
+
"archiver": "^8.0.0"
|
|
59
|
+
},
|
|
60
|
+
"quill-delta": {
|
|
61
|
+
"lodash.isequal": "npm:fast-deep-equal@^3.1.3"
|
|
62
|
+
}
|
|
57
63
|
}
|
|
58
64
|
}
|