@topconsultnpm/sdkui-react 6.22.0-dev3.3 → 6.22.0-dev3.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +45 -43
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +67 -60
- package/lib/components/base/Styled.d.ts +93 -77
- package/lib/components/base/Styled.js +7 -5
- package/lib/components/base/TMAlert.js +6 -8
- package/lib/components/base/TMAreaManager.js +53 -55
- package/lib/components/base/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +2 -1
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.js +2 -2
- package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
- package/lib/components/base/TMFileManager.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +4 -6
- package/lib/components/base/TMLayout.d.ts +4 -4
- package/lib/components/base/TMList.d.ts +2 -1
- package/lib/components/base/TMListView.d.ts +1 -1
- package/lib/components/base/TMPanel.js +167 -167
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMTab.d.ts +4 -3
- package/lib/components/base/TMTabControl.d.ts +106 -0
- package/lib/components/base/TMTabControl.js +664 -0
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +14 -8
- package/lib/components/base/TMTreeView.js +33 -1
- package/lib/components/base/TMUserAvatar.d.ts +2 -1
- package/lib/components/base/TMVilViewer.d.ts +2 -1
- package/lib/components/base/TMWaitPanel.d.ts +3 -2
- package/lib/components/base/TMWaitPanel.js +1 -1
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +169 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.js +320 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +53 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.js +274 -0
- package/lib/components/base/waitPanel/index.d.ts +1 -0
- package/lib/components/base/waitPanel/index.js +1 -0
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMPathChooser.js +17 -34
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +2 -1
- package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
- package/lib/components/choosers/TMUserChooser.d.ts +2 -2
- package/lib/components/editors/TMEditorStyled.d.ts +20 -42
- package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
- package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
- package/lib/components/editors/TMMetadataValues.js +5 -5
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/archive/TMArchive.js +7 -2
- package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +28 -0
- package/lib/components/features/assistant/TMHelpOnLineChat.js +888 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
- package/lib/components/features/documents/TMBatchUpdateForm.js +3 -4
- package/lib/components/features/documents/TMCopyToFolderForm.js +50 -42
- package/lib/components/features/documents/TMDcmtForm.js +51 -62
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtIcon.d.ts +2 -3
- package/lib/components/features/documents/TMDcmtIcon.js +3 -5
- package/lib/components/features/documents/TMDcmtPreview.d.ts +8 -6
- package/lib/components/features/documents/TMDcmtPreview.js +5 -3
- package/lib/components/features/documents/TMDcmtTasks.d.ts +2 -1
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +26 -26
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +54 -129
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +2 -1
- package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +2 -1
- package/lib/components/features/documents/TMMergeToPdfForm.js +56 -54
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +2 -1
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +2 -5
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +5 -5
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +3 -3
- package/lib/components/features/documents/TMRelationViewer.d.ts +16 -9
- package/lib/components/features/documents/TMRelationViewer.js +238 -166
- package/lib/components/features/documents/relationTreeState.d.ts +32 -0
- package/lib/components/features/documents/relationTreeState.js +89 -0
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +2 -1
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.d.ts +1 -1
- package/lib/components/features/search/TMSearch.js +68 -9
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +9 -3
- package/lib/components/features/search/TMSearchResult.d.ts +5 -0
- package/lib/components/features/search/TMSearchResult.js +19 -12
- 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/TMTreeSelector.js +38 -36
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
- package/lib/components/features/search/TMViewHistoryDcmt.js +14 -25
- package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
- package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksView.js +96 -101
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +91 -91
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +8 -7
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +3 -1
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +3 -1
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/TMChooserForm.d.ts +2 -1
- package/lib/components/forms/TMResultDialog.js +1 -1
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.js +92 -96
- package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
- package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
- package/lib/components/index.d.ts +6 -0
- package/lib/components/index.js +5 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +5 -6
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
- package/lib/components/pages/TMPage.d.ts +1 -1
- package/lib/components/pages/TMPage.js +29 -31
- package/lib/components/query/TMQueryEditor.d.ts +17 -10
- package/lib/components/query/TMQueryEditor.js +2 -1
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
- package/lib/components/sidebar/TMHeader.d.ts +4 -3
- package/lib/components/sidebar/TMHeader.js +2 -2
- package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMMidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.d.ts +2 -2
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/SDKUI_Localizator.d.ts +24 -0
- package/lib/helper/SDKUI_Localizator.js +240 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +2 -1
- package/lib/helper/TMAppUpdatedModal.js +93 -93
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +280 -280
- package/lib/helper/TMPdfViewer.d.ts +2 -1
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +10 -4
- package/lib/helper/ZipManager.d.ts +1 -1
- package/lib/helper/ZipManager.js +2 -1
- package/lib/helper/dcmtsHelper.d.ts +2 -0
- package/lib/helper/dcmtsHelper.js +3 -1
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
- package/lib/hooks/useCheckInOutOperations.js +14 -34
- package/lib/hooks/useDcmtOperations.d.ts +3 -12
- package/lib/hooks/useDcmtOperations.js +187 -179
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +14 -25
- package/lib/hooks/useInputDialog.d.ts +2 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
- package/lib/hooks/useMultiMasterDetailDcmts.js +65 -67
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/services/caseflow/CaseFlowService.d.ts +36 -6
- package/lib/services/caseflow/CaseFlowService.js +55 -14
- package/lib/services/platform_services.d.ts +3 -2
- package/package.json +71 -71
|
@@ -2,14 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useState } from 'react';
|
|
3
3
|
import { DownloadTypes } from '../../../ts';
|
|
4
4
|
import { calcResponsiveSizes, getExceptionMessage, IconFolderOpen, IconPlay, IconUndo, SDKUI_Globals, SDKUI_Localizator, } from '../../../helper';
|
|
5
|
-
import { DcmtOpers, FileFormats, GeneralRetrieveFormats, InvoiceRetrieveFormats, OrderRetrieveFormats, ResultTypes,
|
|
5
|
+
import { DcmtOpers, FileFormats, GeneralRetrieveFormats, InvoiceRetrieveFormats, OrderRetrieveFormats, ResultTypes, ValidationItem, } from '@topconsultnpm/sdk-ts';
|
|
6
6
|
import TMModal from '../../base/TMModal';
|
|
7
7
|
import { useDeviceType } from '../../base/TMDeviceProvider';
|
|
8
8
|
import TMTextBox from '../../editors/TMTextBox';
|
|
9
9
|
import { ButtonNames, TMMessageBoxManager } from '../../base/TMPopUp';
|
|
10
10
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
11
|
-
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
|
12
11
|
import { TMSplitterLayout } from '../../base/TMLayout';
|
|
12
|
+
import TMWaitPanelManager from '../../base/waitPanel/TMWaitPanelManager';
|
|
13
13
|
import { TMColors } from '../../../utils/theme';
|
|
14
14
|
import TMDownloadRelationViewerSection from './TMDownloadRelationViewerSection';
|
|
15
15
|
import { getDcmtInfosToDownload, getFloatingLabelStyle, isDirectoryPickerSupported, MIN_PDF_FOR_MERGE, } from './copyAndMergeDcmtsShared';
|
|
@@ -50,16 +50,12 @@ const toPdfOrderRetrieveFormat = (format) => {
|
|
|
50
50
|
*/
|
|
51
51
|
const TMMergeToPdfForm = (props) => {
|
|
52
52
|
const { mode, selectedDcmtInfos, selectedItemsFull, onClose, showTMRelationViewer, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers } = props;
|
|
53
|
-
|
|
53
|
+
// Il wait panel del download lo apre e lo aggiorna l'hook: qui serve solo la funzione.
|
|
54
|
+
const { downloadDcmtsAsync } = useDcmtOperations();
|
|
54
55
|
const deviceType = useDeviceType();
|
|
55
56
|
const [pdfFileName, setPdfFileName] = useState(`${SDKUI_Localizator.Result.toLowerCase()}.pdf`);
|
|
56
57
|
const [destinationFolder, setDestinationFolder] = useState('Download');
|
|
57
58
|
const [selectedItemsRelationViewer, setSelectedItemsRelationViewer] = useState([]);
|
|
58
|
-
// ---- Stato per il merge PDF (progress bar) ----
|
|
59
|
-
const [isMergingPdf, setIsMergingPdf] = useState(false);
|
|
60
|
-
const [mergeProgressText, setMergeProgressText] = useState('');
|
|
61
|
-
const [mergeProgressValue, setMergeProgressValue] = useState(0);
|
|
62
|
-
const [mergeProgressMax, setMergeProgressMax] = useState(0);
|
|
63
59
|
// ---- Ref per la selezione cartella (File System Access API) ----
|
|
64
60
|
const folderHandleRef = useRef(null);
|
|
65
61
|
const skipSelectFolderRef = useRef(false);
|
|
@@ -156,32 +152,36 @@ const TMMergeToPdfForm = (props) => {
|
|
|
156
152
|
// Raccoglie gli errori come downloadDcmtsAsync
|
|
157
153
|
const metadataConversionResults = [];
|
|
158
154
|
if (metadataOnlyDcmts.length > 0) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
155
|
+
const metadataPanel = TMWaitPanelManager.show({
|
|
156
|
+
title: SDKUI_Localizator.MergeToPdf,
|
|
157
|
+
subtitle: 'Creazione PDF metadati...',
|
|
158
|
+
max: metadataOnlyDcmts.length,
|
|
159
|
+
});
|
|
163
160
|
for (let i = 0; i < metadataOnlyDcmts.length; i++) {
|
|
164
161
|
const dcmt = metadataOnlyDcmts[i];
|
|
165
162
|
try {
|
|
166
|
-
|
|
167
|
-
setMergeProgressText(`Creazione PDF metadati... (${i + 1}/${metadataOnlyDcmts.length})`);
|
|
163
|
+
metadataPanel.setSubtitle(`Creazione PDF metadati... (${i + 1}/${metadataOnlyDcmts.length})`);
|
|
168
164
|
const conversionResult = await createMetadataPdfFromDocument(dcmt);
|
|
169
165
|
if (conversionResult) {
|
|
170
166
|
pdfFilesMap.set(`${dcmt.TID}_${dcmt.DID}`, conversionResult.file);
|
|
171
167
|
metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.SUCCESS });
|
|
168
|
+
metadataPanel.ok();
|
|
172
169
|
}
|
|
173
170
|
else {
|
|
174
171
|
// createMetadataPdfFromDocument ha restituito null (errore interno loggato)
|
|
175
172
|
metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: 'Creazione PDF metadati fallita' });
|
|
173
|
+
metadataPanel.error();
|
|
176
174
|
}
|
|
177
175
|
}
|
|
178
176
|
catch (error) {
|
|
179
177
|
console.error(`Errore creazione PDF metadati per TID=${dcmt.TID}, DID=${dcmt.DID}`, error);
|
|
180
178
|
metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
179
|
+
metadataPanel.error();
|
|
181
180
|
}
|
|
181
|
+
// Avanza a conversione conclusa: con un solo documento la barra non parte dal 100%
|
|
182
|
+
await metadataPanel.step();
|
|
182
183
|
}
|
|
183
|
-
|
|
184
|
-
setIsMergingPdf(false);
|
|
184
|
+
metadataPanel.close();
|
|
185
185
|
// Mostra riepilogo errori se presenti (come downloadDcmtsAsync)
|
|
186
186
|
const hasErrors = metadataConversionResults.some(r => r.resultType === ResultTypes.ERROR);
|
|
187
187
|
if (hasErrors) {
|
|
@@ -190,12 +190,13 @@ const TMMergeToPdfForm = (props) => {
|
|
|
190
190
|
}
|
|
191
191
|
// Per i documenti con file, usa il download normale
|
|
192
192
|
if (dcmtsWithFile.length > 0) {
|
|
193
|
-
const rfo =
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
193
|
+
const rfo = {
|
|
194
|
+
retrieveReason: DcmtOpers.None,
|
|
195
|
+
generalRetrieveFormat: GeneralRetrieveFormats.OriginalUnsigned,
|
|
196
|
+
cvtFormat: FileFormats.PDF,
|
|
197
|
+
invoiceRetrieveFormat: toPdfInvoiceRetrieveFormat(SDKUI_Globals.userSettings?.searchSettings.invoiceRetrieveFormat),
|
|
198
|
+
orderRetrieveFormat: toPdfOrderRetrieveFormat(SDKUI_Globals.userSettings?.searchSettings.orderRetrieveFormat),
|
|
199
|
+
};
|
|
199
200
|
const collectFileForMerge = async (file, dcmtInfo) => {
|
|
200
201
|
pdfFilesMap.set(`${dcmtInfo.TID}_${dcmtInfo.DID}`, file);
|
|
201
202
|
};
|
|
@@ -226,16 +227,17 @@ const TMMergeToPdfForm = (props) => {
|
|
|
226
227
|
if (!pdfFiles)
|
|
227
228
|
return;
|
|
228
229
|
const finalName = pdfFileName.trim().toLowerCase().endsWith('.pdf') ? pdfFileName.trim() : pdfFileName.trim() + '.pdf';
|
|
229
|
-
//
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
230
|
+
// Il merge non e' interrompibile: pannello senza Interrompi.
|
|
231
|
+
const mergePanel = TMWaitPanelManager.show({
|
|
232
|
+
title: SDKUI_Localizator.MergeToPdf,
|
|
233
|
+
subtitle: SDKUI_Localizator.MergeToPdf,
|
|
234
|
+
max: pdfFiles.length,
|
|
235
|
+
showCounters: false,
|
|
236
|
+
});
|
|
234
237
|
try {
|
|
235
238
|
const mergeOptions = {
|
|
236
239
|
onProgress: (current, total, file) => {
|
|
237
|
-
|
|
238
|
-
setMergeProgressText(`${SDKUI_Localizator.MergeToPdf}: ${file.name}`);
|
|
240
|
+
mergePanel.update({ value: current, subtitle: `${SDKUI_Localizator.MergeToPdf}: ${file.name}` });
|
|
239
241
|
}
|
|
240
242
|
};
|
|
241
243
|
// Se c'è una cartella selezionata (non Download di default), salva direttamente nella cartella
|
|
@@ -259,7 +261,7 @@ const TMMergeToPdfForm = (props) => {
|
|
|
259
261
|
return;
|
|
260
262
|
}
|
|
261
263
|
finally {
|
|
262
|
-
|
|
264
|
+
mergePanel.close();
|
|
263
265
|
}
|
|
264
266
|
onClose();
|
|
265
267
|
};
|
|
@@ -360,29 +362,29 @@ const TMMergeToPdfForm = (props) => {
|
|
|
360
362
|
? SDKUI_Localizator.FileNotPdfWillBeExcluded.replaceParams(extLabel)
|
|
361
363
|
: SDKUI_Localizator.FilesNotPdfWillBeExcluded.replaceParams(nonPdfSelectedItems.length.toString(), extLabel);
|
|
362
364
|
})() }))] })] }))] })] }));
|
|
363
|
-
return (_jsx(
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
365
|
+
return (_jsx(TMModal, { width: calcResponsiveSizes(deviceType, showTMRelationViewer ? '90%' : '500px', showTMRelationViewer ? '90%' : '500px', '95%'), height: showTMRelationViewer ? '95%' : 'auto', title: getTitle(), onClose: onClose, showCloseButton: true, children: _jsxs("div", { onContextMenu: (e) => e.preventDefault(), style: { display: 'flex', flexDirection: 'column', gap: '16px', padding: '16px', width: '100%', height: '100%', boxSizing: 'border-box', overflow: 'hidden' }, children: [showTMRelationViewer ? (_jsx("div", { style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }, children: _jsxs(TMSplitterLayout, { direction: 'vertical', showSeparator: true, separatorSize: 8, separatorColor: 'transparent', separatorActiveColor: 'transparent', overflow: 'hidden', min: ["50", "50"], start: ["70%", "30%"], children: [_jsx(TMDownloadRelationViewerSection, { selectedDcmtInfos: selectedDcmtInfos, onSelectionChanged: setSelectedItemsRelationViewer, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), configSection] }, "TMMergeToPdf-relation-config") })) : (configSection), _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', flexShrink: 0, marginTop: '12px' }, children: _jsxs("button", { disabled: !isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0) || !hasEnoughPdfForMerge, onClick: run, style: {
|
|
366
|
+
display: 'flex',
|
|
367
|
+
alignItems: 'center',
|
|
368
|
+
justifyContent: 'center',
|
|
369
|
+
gap: '6px',
|
|
370
|
+
padding: '8px 20px',
|
|
371
|
+
fontSize: '0.95rem',
|
|
372
|
+
fontWeight: 600,
|
|
373
|
+
color: '#fff',
|
|
374
|
+
background: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0) || !hasEnoughPdfForMerge)
|
|
375
|
+
? '#b0b0b0'
|
|
376
|
+
: 'linear-gradient(135deg, #28a745 0%, #218838 100%)',
|
|
377
|
+
border: 'none',
|
|
378
|
+
borderRadius: '6px',
|
|
379
|
+
cursor: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0) || !hasEnoughPdfForMerge) ? 'not-allowed' : 'pointer',
|
|
380
|
+
boxShadow: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0) || !hasEnoughPdfForMerge)
|
|
381
|
+
? 'none'
|
|
382
|
+
: '0 2px 8px rgba(40, 167, 69, 0.35)',
|
|
383
|
+
transition: 'all 0.2s ease',
|
|
384
|
+
}, children: [_jsx(IconPlay, {}), _jsx("span", { children: mergeableSelectedCount === 0
|
|
385
|
+
? SDKUI_Localizator.MergeToPdf
|
|
386
|
+
: mergeableSelectedCount > 999
|
|
387
|
+
? _jsx(TMTooltip, { content: mergeableSelectedCount.toString(), children: SDKUI_Localizator.MergeFilesToPdf.replaceParams('999+') })
|
|
388
|
+
: SDKUI_Localizator.MergeFilesToPdf.replaceParams(mergeableSelectedCount.toString()) })] }) })] }) }));
|
|
387
389
|
};
|
|
388
390
|
export default TMMergeToPdfForm;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { DcmtTypeDescriptor, HomeBlogPost, ObjectRef, TaskDescriptor } from "@topconsultnpm/sdk-ts";
|
|
2
3
|
import { DcmtInfo, IGraphometricManagerProp, TaskContext } from "../../../ts";
|
|
3
4
|
import { IntesiCertificateData } from "../../../helper";
|
|
@@ -41,5 +42,5 @@ interface TMMultiMasterDetailDcmtsFormProps {
|
|
|
41
42
|
}>, tid?: number) => void;
|
|
42
43
|
openWGsCopyMoveForm?: (mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void;
|
|
43
44
|
}
|
|
44
|
-
declare const TMMultiMasterDetailDcmtsForm: (props: TMMultiMasterDetailDcmtsFormProps) =>
|
|
45
|
+
declare const TMMultiMasterDetailDcmtsForm: (props: TMMultiMasterDetailDcmtsFormProps) => React.JSX.Element | null;
|
|
45
46
|
export default TMMultiMasterDetailDcmtsForm;
|
|
@@ -6,7 +6,6 @@ import { SearchResultContext } from "../../../ts";
|
|
|
6
6
|
import { getFullFileExtension, getMultiDetailModalSize, getMultiDetailPanelStates, hasMultiDetailPanelStates, hoverStyle, IconArchive, IconArrowDown, IconArrowUp, IconDelete, IconDuplicate, IconEdit, IconEraser, IconInfo, IconMenuVertical, IconRefresh, IconSearch, IconSearchCheck, saveMultiDetailModalSize, saveMultiDetailPanelStates, SDKUI_Localizator } from "../../../helper";
|
|
7
7
|
import { TMColors } from "../../../utils/theme";
|
|
8
8
|
import { DeviceType, useDeviceType } from "../../base/TMDeviceProvider";
|
|
9
|
-
import { TMLayoutWaitingContainer } from "../../base/TMWaitPanel";
|
|
10
9
|
import TMModal from "../../base/TMModal";
|
|
11
10
|
import TMDataGrid from "../../base/TMDataGrid";
|
|
12
11
|
import TMTooltip from "../../base/TMTooltip";
|
|
@@ -48,7 +47,7 @@ const styles = {
|
|
|
48
47
|
const MOBILE_SECTION = 'archiveList';
|
|
49
48
|
const TMMultiMasterDetailDcmtsForm = (props) => {
|
|
50
49
|
const { dtd, masterDcmt, onClose, canNavigateMaster, onNavigateMaster, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, showDcmtFormSidebar, showTodoDcmtForm, openFileUploaderPdfEditor, graphometricManager, editPdfForm, openS4TViewer, showToppyDraggableHelpCenter, toppyHelpCenterUsePortal, fetchRemoteCertificates, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onReferenceClick, onTaskCreateRequest, onRefreshAfterAddDcmtToFavs, onFileOpened, passToArchiveCallback, openWGsCopyMoveForm } = props;
|
|
51
|
-
const { isLoading, isSummaryReady, phase, setPhase, detailRelationItems, selectedRelation, selectedItem, hasMultipleTypes, selectRelation, backToTypeSelection, isBackLocked, closeModal, isMasterNavigationEnabled, canNavigateMasterPrev, canNavigateMasterNext, navigateMaster, sectionsOpen, setSectionOpen, openAllSections, clearLayout, layoutResetToken, hasSavedLayout, setHasSavedLayout, canUpdateMaster, masterFieldsCount, getMasterMetadataAsync, masterInfoReloadToken, isOpenMasterForm, setIsOpenMasterForm, handleMasterSavedAsync, archivedDetailResults, archivedDetailsCount, isLoadingArchivedDetails, refreshArchivedDetailsAsync, detailColumns, detailSupportsFile, archiveRows, currentRows, focusedRowKey, setFocusedRowKey, selectedRowKeys, setSelectedRowKeys, isOpenAddForm, editingRowId, editingRow, formInputMids, openAddForm, openEditForm, closeAddForm, deleteRow, duplicateRow, upsertRow, updateRowValues, copyArchivedDetailToRows, stopOnFirstError, setStopOnFirstError, isArchiving, archiveAllAsync,
|
|
50
|
+
const { isLoading, isSummaryReady, phase, setPhase, detailRelationItems, selectedRelation, selectedItem, hasMultipleTypes, selectRelation, backToTypeSelection, isBackLocked, closeModal, isMasterNavigationEnabled, canNavigateMasterPrev, canNavigateMasterNext, navigateMaster, sectionsOpen, setSectionOpen, openAllSections, clearLayout, layoutResetToken, hasSavedLayout, setHasSavedLayout, canUpdateMaster, masterFieldsCount, getMasterMetadataAsync, masterInfoReloadToken, isOpenMasterForm, setIsOpenMasterForm, handleMasterSavedAsync, archivedDetailResults, archivedDetailsCount, isLoadingArchivedDetails, refreshArchivedDetailsAsync, detailColumns, detailSupportsFile, archiveRows, currentRows, focusedRowKey, setFocusedRowKey, selectedRowKeys, setSelectedRowKeys, isOpenAddForm, editingRowId, editingRow, formInputMids, openAddForm, openEditForm, closeAddForm, deleteRow, duplicateRow, upsertRow, updateRowValues, copyArchivedDetailToRows, stopOnFirstError, setStopOnFirstError, isArchiving, archiveAllAsync, } = useMultiMasterDetailDcmts({ dtd, masterDcmt, onClose, canNavigateMaster, onNavigateMaster });
|
|
52
51
|
const deviceType = useDeviceType();
|
|
53
52
|
// Su mobile il panel manager mostra un pannello alla volta: le sezioni si raggiungono dalla sua barra
|
|
54
53
|
const isMobile = useMemo(() => deviceType === DeviceType.MOBILE, [deviceType]);
|
|
@@ -301,9 +300,7 @@ const TMMultiMasterDetailDcmtsForm = (props) => {
|
|
|
301
300
|
// ----- Render principale --------------------------------------------------------------------
|
|
302
301
|
if (isLoading)
|
|
303
302
|
return null;
|
|
304
|
-
return _jsxs(_Fragment, { children: [_jsx(
|
|
305
|
-
// Cancellato il layout il popup torna alle dimensioni di default
|
|
306
|
-
sizeResetToken: layoutResetToken, title: modalTitle, hidePopup: false, askClosingConfirm: archiveRows.length > 0, recenterOnResize: true, titleActions: renderTitleActions(), children: _jsxs("div", { style: styles.content, children: [hasMultipleTypes && _jsx("div", { style: styles.header, children: renderStepper({
|
|
303
|
+
return _jsxs(_Fragment, { children: [_jsx("div", { style: { width: 0, height: 0 }, children: _jsx(TMModal, { width: modalSize.width, height: modalSize.height, onClose: closeModal, onResized: persistModalSize, sizeResetToken: layoutResetToken, title: modalTitle, hidePopup: false, askClosingConfirm: archiveRows.length > 0, recenterOnResize: true, titleActions: renderTitleActions(), children: _jsxs("div", { style: styles.content, children: [hasMultipleTypes && _jsx("div", { style: styles.header, children: renderStepper({
|
|
307
304
|
steps,
|
|
308
305
|
phase,
|
|
309
306
|
hasMultipleTypes,
|
|
@@ -87,7 +87,7 @@ export declare const toGridNumber: (value: unknown) => number | undefined;
|
|
|
87
87
|
* si rilegge nel form, si mostra in griglia e si archivia come una riga compilata a mano
|
|
88
88
|
*/
|
|
89
89
|
export declare const toArchiveRowValue: (value: MetadataScalarValue, dataType: MetadataDataTypes | undefined) => string;
|
|
90
|
-
/** Colonne della griglia di riepilogo dai metadati (utente) del tipo documento */
|
|
90
|
+
/** Colonne della griglia di riepilogo dai metadati (utente) del tipo documento, esclusi quelli che l'utente non può vedere */
|
|
91
91
|
export declare const buildColumnsFromDtd: (dtd: DcmtTypeDescriptor | undefined, renderDataListCell: (value: string | Date | number | undefined, dataListID: number, viewMode: DataListViewModes) => React.ReactElement) => Array<IColumnProps>;
|
|
92
92
|
export declare const getDetailDtdAsync: (detailTID: number | undefined) => Promise<DcmtTypeDescriptor | undefined>;
|
|
93
93
|
/** Nome visualizzato del tipo documento (localizzato se richiesto) */
|
|
@@ -312,7 +312,7 @@ export interface RenderStepperParams {
|
|
|
312
312
|
/** Click su uno step completato: riceve la fase di destinazione */
|
|
313
313
|
onStepClick: (phase: number) => void;
|
|
314
314
|
}
|
|
315
|
-
export declare const renderStepper: ({ steps, phase, hasMultipleTypes, isBackLocked, showBackArrow, onBack, onStepClick }: RenderStepperParams) =>
|
|
315
|
+
export declare const renderStepper: ({ steps, phase, hasMultipleTypes, isBackLocked, showBackArrow, onBack, onStepClick }: RenderStepperParams) => React.JSX.Element;
|
|
316
316
|
export interface RenderSelectDcmtTypeParams {
|
|
317
317
|
/** Relazioni di dettaglio fra cui scegliere */
|
|
318
318
|
detailRelationItems: Array<DetailRelationItem>;
|
|
@@ -321,7 +321,7 @@ export interface RenderSelectDcmtTypeParams {
|
|
|
321
321
|
/** Selezione di una relazione */
|
|
322
322
|
onSelectRelation: (item: DetailRelationItem) => void;
|
|
323
323
|
}
|
|
324
|
-
export declare const renderSelectDcmtType: ({ detailRelationItems, selectedRelation, onSelectRelation }: RenderSelectDcmtTypeParams) =>
|
|
324
|
+
export declare const renderSelectDcmtType: ({ detailRelationItems, selectedRelation, onSelectRelation }: RenderSelectDcmtTypeParams) => React.JSX.Element;
|
|
325
325
|
export interface RenderAccordionHeaderParams {
|
|
326
326
|
/** Sezione a cui appartiene la testata */
|
|
327
327
|
section: AccordionSection;
|
|
@@ -340,7 +340,7 @@ export interface RenderAccordionHeaderParams {
|
|
|
340
340
|
/** Apre/chiude la sezione */
|
|
341
341
|
onToggleOpen: (section: AccordionSection, isOpen: boolean) => void;
|
|
342
342
|
}
|
|
343
|
-
export declare const renderAccordionHeader: ({ section, isOpen, tooltip, count, title, actions, panel, onToggleOpen }: RenderAccordionHeaderParams) =>
|
|
343
|
+
export declare const renderAccordionHeader: ({ section, isOpen, tooltip, count, title, actions, panel, onToggleOpen }: RenderAccordionHeaderParams) => React.JSX.Element;
|
|
344
344
|
/**
|
|
345
345
|
* Contenuto di un pannello: il contesto del panel manager è leggibile solo dentro l'albero del
|
|
346
346
|
* provider, quindi è qui che si prende lo stato di ingrandimento da passare alla sezione
|
|
@@ -349,7 +349,7 @@ export declare const TMSummarySectionSlot: ({ section, render, onBeforeMaximize
|
|
|
349
349
|
section: AccordionSection;
|
|
350
350
|
render: (panel: SectionPanelState) => React.ReactNode;
|
|
351
351
|
onBeforeMaximize?: (section: AccordionSection) => void;
|
|
352
|
-
}) =>
|
|
352
|
+
}) => React.JSX.Element;
|
|
353
353
|
/**
|
|
354
354
|
* Segnala che l'utente ha spostato un separatore: è l'unico caso in cui le altezze dei pannelli sono
|
|
355
355
|
* una sua scelta, quindi la sola da salvare. Le quote calcolate all'apertura del riepilogo o al
|
|
@@ -2,7 +2,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import React, { useEffect, useRef } from 'react';
|
|
3
3
|
import { AccessLevelsEx, DataListViewModes, DcmtTypeListCacheService, MetadataDataDomains, MetadataDataTypes, SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { hoverStyle, IconChevronRight, IconWindowMaximize, IconWindowMinimize, SDKUI_Localizator } from '../../../helper';
|
|
5
|
-
import { formatScalarValue, getUserMetadataSorted } from '../../../helper/dcmtsHelper';
|
|
5
|
+
import { canViewMetadata, formatScalarValue, getUserMetadataSorted } from '../../../helper/dcmtsHelper';
|
|
6
6
|
import { TMColors } from '../../../utils/theme';
|
|
7
7
|
import { TMDcmtTypeIcon } from '../../viewers/TMTidViewer';
|
|
8
8
|
import TMTooltip from '../../base/TMTooltip';
|
|
@@ -71,8 +71,8 @@ export const toArchiveRowValue = (value, dataType) => {
|
|
|
71
71
|
}
|
|
72
72
|
return String(value);
|
|
73
73
|
};
|
|
74
|
-
/** Colonne della griglia di riepilogo dai metadati (utente) del tipo documento */
|
|
75
|
-
export const buildColumnsFromDtd = (dtd, renderDataListCell) => getUserMetadataSorted(dtd).map(md => {
|
|
74
|
+
/** Colonne della griglia di riepilogo dai metadati (utente) del tipo documento, esclusi quelli che l'utente non può vedere */
|
|
75
|
+
export const buildColumnsFromDtd = (dtd, renderDataListCell) => getUserMetadataSorted(dtd).filter(canViewMetadata).map(md => {
|
|
76
76
|
const dataListID = md.dataListID ?? 0;
|
|
77
77
|
const isDataList = md.dataDomain === MetadataDataDomains.DataList && dataListID > 0;
|
|
78
78
|
const viewMode = md.dataListViewMode ?? DataListViewModes.None;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DcmtTypeDescriptor, SearchResultDescriptor, DataColumnDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
3
|
import { DcmtMetadataMap } from '../../../helper';
|
|
4
|
-
import { DcmtInfo
|
|
4
|
+
import { DcmtInfo } from '../../../ts';
|
|
5
5
|
import { ITMTreeItem } from '../../base/TMTreeView';
|
|
6
|
+
import { RelationTreeState } from './relationTreeState';
|
|
6
7
|
/**
|
|
7
8
|
* Tree item structure for relations
|
|
8
9
|
*/
|
|
@@ -26,6 +27,7 @@ export interface RelationTreeItem extends ITMTreeItem {
|
|
|
26
27
|
fileExt?: string;
|
|
27
28
|
fileCount?: number;
|
|
28
29
|
}
|
|
30
|
+
export type { RelationTreeState } from './relationTreeState';
|
|
29
31
|
/**
|
|
30
32
|
* Props for TMRelationViewer component
|
|
31
33
|
*/
|
|
@@ -111,11 +113,6 @@ export interface TMRelationViewerProps {
|
|
|
111
113
|
* Use to show a context menu.
|
|
112
114
|
*/
|
|
113
115
|
onItemContextMenu?: (item: RelationTreeItem, e: React.MouseEvent) => void;
|
|
114
|
-
/**
|
|
115
|
-
* Metadata values for the focused item
|
|
116
|
-
* (used in master-detail context)
|
|
117
|
-
*/
|
|
118
|
-
focusedItemFormData?: MetadataValueDescriptorEx[];
|
|
119
116
|
/**
|
|
120
117
|
* If true, shows a toolbar button to expand/collapse all tree nodes.
|
|
121
118
|
* Default: false
|
|
@@ -143,8 +140,17 @@ export interface TMRelationViewerProps {
|
|
|
143
140
|
/**
|
|
144
141
|
* Callback invoked when the calculation has actually been stopped
|
|
145
142
|
* (loadData terminated after an abort request).
|
|
143
|
+
* Riceve quanti documenti di input sono stati completati sul totale.
|
|
144
|
+
*/
|
|
145
|
+
onCalculationStopped?: (loadedCount: number, totalCount: number) => void;
|
|
146
|
+
/**
|
|
147
|
+
* Stato dell'albero da ripristinare al primo caricamento, al posto dell'espansione
|
|
148
|
+
* iniziale predefinita: permette al padre di rimontare il viewer dopo un'operazione
|
|
149
|
+
* senza che l'albero torni allo stato di partenza. Se assente vale il default.
|
|
146
150
|
*/
|
|
147
|
-
|
|
151
|
+
initialTreeState?: RelationTreeState;
|
|
152
|
+
/** Notifica lo stato dell'albero, da restituire come `initialTreeState` dopo un refresh. */
|
|
153
|
+
onTreeStateChange?: (state: RelationTreeState) => void;
|
|
148
154
|
}
|
|
149
155
|
/**
|
|
150
156
|
* Check if document type has detail relations
|
|
@@ -160,8 +166,9 @@ export declare const hasMasterRelations: (dTID: number | undefined) => Promise<b
|
|
|
160
166
|
export declare const getDisplayValueByColumn: (col: DataColumnDescriptor | undefined, value: any) => any;
|
|
161
167
|
/**
|
|
162
168
|
* Convert SearchResultDescriptor to structured data source with metadata
|
|
163
|
-
*
|
|
164
|
-
*
|
|
169
|
+
* I valori dei documenti sono già presenti nelle righe restituite dalla ricerca:
|
|
170
|
+
* qui vengono solo abbinati ai rispettivi MetadataDescriptor (perm,
|
|
171
|
+
* isSpecialSearchOutput, ...), risolti una sola volta per tipo documento.
|
|
165
172
|
*/
|
|
166
173
|
export declare const searchResultToDataSource: (searchResult: SearchResultDescriptor | undefined, hideSysMetadata?: boolean, signal?: AbortSignal) => Promise<any[]>;
|
|
167
174
|
export declare const DEFAULT_RELATION_EXPAND_LEVEL = 4;
|