@topconsultnpm/sdkui-react 6.21.0-dev2.9 → 6.21.0-dev3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +4 -4
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +2 -2
- package/lib/components/base/TMAccordionNew.js +1 -0
- package/lib/components/base/TMAreaManager.js +19 -3
- package/lib/components/base/TMDataGrid.js +2 -2
- package/lib/components/base/TMFileManagerDataGridView.js +4 -4
- package/lib/components/base/TMFileManagerThumbnailItems.js +3 -3
- package/lib/components/base/TMFileManagerUtils.d.ts +7 -0
- package/lib/components/base/TMFileManagerUtils.js +14 -1
- package/lib/components/base/TMModal.d.ts +1 -0
- package/lib/components/base/TMModal.js +2 -2
- package/lib/components/base/TMPanel.d.ts +7 -4
- package/lib/components/base/TMPanel.js +58 -26
- package/lib/components/base/TMTreeView.js +24 -17
- package/lib/components/base/TMWaitPanel.d.ts +3 -1
- package/lib/components/base/TMWaitPanel.js +14 -9
- package/lib/components/choosers/TMDistinctValues.js +35 -21
- package/lib/components/choosers/TMDynDataListItemChooser.js +6 -1
- package/lib/components/choosers/TMUserChooser.d.ts +4 -0
- package/lib/components/choosers/TMUserChooser.js +7 -5
- package/lib/components/editors/TMEditorStyled.d.ts +6 -6
- package/lib/components/editors/TMFormulaEditor.d.ts +2 -0
- package/lib/components/editors/TMFormulaEditor.js +75 -21
- package/lib/components/editors/TMMetadataEditor.js +6 -2
- package/lib/components/editors/TMMetadataValues.js +2 -1
- package/lib/components/editors/TMRadioButton.js +7 -5
- package/lib/components/editors/TMTextBox.d.ts +2 -0
- package/lib/components/editors/TMTextBox.js +3 -3
- package/lib/components/features/archive/TMArchive.js +1 -1
- package/lib/components/features/blog/TMBlogCommentForm.js +5 -2
- package/lib/components/features/documents/TMCopyToFolderForm.d.ts +24 -0
- package/lib/components/features/documents/TMCopyToFolderForm.js +401 -0
- package/lib/components/features/documents/TMDcmtForm.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtForm.js +126 -38
- package/lib/components/features/documents/TMDcmtIcon.js +1 -1
- package/lib/components/features/documents/TMDcmtPreview.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtPreview.js +2 -2
- package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtTasks.js +2 -2
- package/lib/components/features/documents/TMDownloadRelationViewerSection.d.ts +23 -0
- package/lib/components/features/documents/TMDownloadRelationViewerSection.js +173 -0
- package/lib/components/features/documents/TMFileUploader.js +1 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +28 -9
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +24 -0
- package/lib/components/features/documents/TMMergeToPdfForm.js +309 -0
- package/lib/components/features/documents/TMRelationViewer.d.ts +13 -0
- package/lib/components/features/documents/TMRelationViewer.js +80 -6
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +58 -0
- package/lib/components/features/documents/copyAndMergeDcmtsShared.js +266 -0
- package/lib/components/features/search/SignatureParamsManager.d.ts +70 -0
- package/lib/components/features/search/SignatureParamsManager.js +145 -0
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSavedQuerySelector.js +3 -2
- package/lib/components/features/search/TMSearch.d.ts +4 -1
- package/lib/components/features/search/TMSearch.js +16 -10
- package/lib/components/features/search/TMSearchQueryEditor.js +14 -8
- package/lib/components/features/search/TMSearchQueryPanel.js +1 -1
- package/lib/components/features/search/TMSearchResult.d.ts +2 -0
- package/lib/components/features/search/TMSearchResult.js +118 -23
- package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
- package/lib/components/features/workflow/diagram/queryDescriptorParser.js +3 -6
- package/lib/components/forms/Login/TMLoginForm.d.ts +9 -0
- package/lib/components/forms/Login/TMLoginForm.js +61 -0
- package/lib/components/forms/TMResultDialog.d.ts +1 -1
- package/lib/components/forms/TMResultDialog.js +4 -2
- package/lib/components/grids/TMBlogAttachments.js +2 -2
- package/lib/components/grids/TMBlogsPost.js +5 -3
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +3 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/pages/TMPage.js +3 -1
- package/lib/components/query/TMQueryEditor.js +1 -1
- package/lib/components/viewers/TMTidViewer.js +1 -1
- package/lib/helper/MergePdfManager.d.ts +45 -0
- package/lib/helper/MergePdfManager.js +148 -0
- package/lib/helper/SDKUI_Globals.d.ts +15 -0
- package/lib/helper/SDKUI_Globals.js +16 -1
- package/lib/helper/SDKUI_Localizator.d.ts +108 -2
- package/lib/helper/SDKUI_Localizator.js +1080 -12
- package/lib/helper/TMPdfViewer.js +25 -24
- package/lib/helper/TMUtils.d.ts +24 -0
- package/lib/helper/TMUtils.js +72 -0
- package/lib/helper/ZipManager.d.ts +56 -0
- package/lib/helper/ZipManager.js +127 -0
- package/lib/helper/checkinCheckoutManager.d.ts +4 -3
- package/lib/helper/checkinCheckoutManager.js +29 -11
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +4 -3
- package/lib/hooks/useDataUserIdItem.js +6 -4
- package/lib/hooks/useDcmtOperations.d.ts +26 -2
- package/lib/hooks/useDcmtOperations.js +123 -34
- package/lib/hooks/useDocumentOperations.d.ts +3 -0
- package/lib/hooks/useDocumentOperations.js +235 -26
- package/lib/hooks/useForm.js +5 -2
- package/lib/hooks/useRelatedDocuments.js +4 -4
- package/lib/hooks/useResizeObserver.d.ts +1 -1
- package/lib/hooks/useResizeObserver.js +16 -15
- package/lib/services/platform_services.d.ts +4 -4
- package/package.json +4 -2
|
@@ -21,8 +21,10 @@ 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, isPdfEditorAvailable, 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, 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';
|
|
25
25
|
import { isXMLFileExt } from "../helper/dcmtsHelper";
|
|
26
|
+
import TMCopyToFolderForm from "../components/features/documents/TMCopyToFolderForm";
|
|
27
|
+
import TMMergeToPdfForm from "../components/features/documents/TMMergeToPdfForm";
|
|
26
28
|
export const getSelectedDcmtsOrFocused = (selectedItems, focusedItem, fileFormat) => {
|
|
27
29
|
if (selectedItems.length <= 0 && !focusedItem)
|
|
28
30
|
return [];
|
|
@@ -162,8 +164,15 @@ export const useDocumentOperations = (props) => {
|
|
|
162
164
|
const [showMoreInfoPopup, setShowMoreInfoPopup] = useState(false);
|
|
163
165
|
const [isOpenBatchUpdate, setIsOpenBatchUpdate] = useState(false);
|
|
164
166
|
const [isModifiedBatchUpdate, setIsModifiedBatchUpdate] = useState(false);
|
|
167
|
+
const [openCopyToFolderForm, setOpenCopyToFolderForm] = useState({ open: false, operationType: 'copyToFolder', mode: 'onlySelected' });
|
|
168
|
+
const [showTMRelationViewerInCopyToFolderForm, setShowTMRelationViewerInCopyToFolderForm] = useState(false);
|
|
169
|
+
// State to control modal opening for master/detail documents
|
|
170
|
+
const [isOpenDetailsModal, setIsOpenDetailsModal] = useState(false);
|
|
171
|
+
const [isOpenMasterModal, setIsOpenMasterModal] = useState(false);
|
|
165
172
|
const openDetailDcmtsFormHandler = (value) => { setIsOpenDetails(value); };
|
|
166
173
|
const openMasterDcmtsFormHandler = (value) => { setIsOpenMaster(value); };
|
|
174
|
+
const openDetailDcmtsModalHandler = (value) => { setIsOpenDetailsModal(value); };
|
|
175
|
+
const openMasterDcmtsModalHandler = (value) => { setIsOpenMasterModal(value); };
|
|
167
176
|
// State to control whether the export form (for exporting to Excel/CSV/txt and others) should be shown
|
|
168
177
|
const [showExportForm, setShowExportForm] = useState(false);
|
|
169
178
|
const updateShowApprovePopup = (value) => {
|
|
@@ -182,6 +191,9 @@ export const useDocumentOperations = (props) => {
|
|
|
182
191
|
setIsOpenDcmtForm(isOpen);
|
|
183
192
|
setDcmtFormLayoutMode(layoutMode);
|
|
184
193
|
};
|
|
194
|
+
const closeDcmtFormHandler = () => {
|
|
195
|
+
setIsOpenDcmtForm(false);
|
|
196
|
+
};
|
|
185
197
|
const handleAddItem = (tid, did) => {
|
|
186
198
|
let newItem = { TID: tid ?? 0, DID: did ?? 0 };
|
|
187
199
|
setSecondaryMasterDcmts((prevItems) => [...prevItems, newItem]);
|
|
@@ -256,14 +268,14 @@ export const useDocumentOperations = (props) => {
|
|
|
256
268
|
};
|
|
257
269
|
const openSharedArchiveHandler = async () => {
|
|
258
270
|
if (selectedDcmtInfos.length === 0) {
|
|
259
|
-
ShowAlert({ message:
|
|
271
|
+
ShowAlert({ message: SDKUI_Localizator.NoDcmtSelected, mode: "warning", title: SDKUI_Localizator.SharedArchiving, duration: 3000 });
|
|
260
272
|
return;
|
|
261
273
|
}
|
|
262
274
|
if (dtd?.perm?.canArchive !== AccessLevelsEx.Yes && dtd?.perm?.canArchive !== AccessLevelsEx.Mixed) {
|
|
263
275
|
ShowAlert({
|
|
264
276
|
message: "Non hai i permessi per archiviare documenti di questo tipo.",
|
|
265
277
|
mode: 'warning',
|
|
266
|
-
title:
|
|
278
|
+
title: SDKUI_Localizator.SharedArchiving,
|
|
267
279
|
duration: 5000
|
|
268
280
|
});
|
|
269
281
|
return;
|
|
@@ -273,7 +285,7 @@ export const useDocumentOperations = (props) => {
|
|
|
273
285
|
rfo.retrieveReason = DcmtOpers.None;
|
|
274
286
|
rfo.generalRetrieveFormat = GeneralRetrieveFormats.OriginalUnsigned;
|
|
275
287
|
const dcmt = selectedDcmtInfos[0];
|
|
276
|
-
let dcmtFile = await getDcmtFileAsync({ TID: dcmt?.TID, DID: dcmt?.DID }, rfo,
|
|
288
|
+
let dcmtFile = await getDcmtFileAsync({ TID: dcmt?.TID, DID: dcmt?.DID }, rfo, SDKUI_Localizator.SharedArchiving, false, true);
|
|
277
289
|
if (dcmtFile) {
|
|
278
290
|
setSharedDcmtFile(dcmtFile?.file);
|
|
279
291
|
}
|
|
@@ -286,7 +298,7 @@ export const useDocumentOperations = (props) => {
|
|
|
286
298
|
const showSharedDcmtsHandler = async () => {
|
|
287
299
|
try {
|
|
288
300
|
if (selectedDcmtInfos.length === 0) {
|
|
289
|
-
ShowAlert({ message:
|
|
301
|
+
ShowAlert({ message: SDKUI_Localizator.NoDcmtSelected, mode: "warning", title: SDKUI_Localizator.SharedArchiving, duration: 3000 });
|
|
290
302
|
return;
|
|
291
303
|
}
|
|
292
304
|
const dcmt = selectedDcmtInfos[0];
|
|
@@ -463,7 +475,7 @@ export const useDocumentOperations = (props) => {
|
|
|
463
475
|
icon: _jsx(IconDownload, {}),
|
|
464
476
|
operationType: 'multiRow',
|
|
465
477
|
disabled: dtd?.perm?.canRetrieveFile !== AccessLevels.Yes ? true : isDisabledForMultiRow(),
|
|
466
|
-
name: SDKUI_Localizator.DownloadFile, onClick: () => downloadDcmtsAsync(selectedDcmtInfos, DownloadTypes.Dcmt, "download",
|
|
478
|
+
name: SDKUI_Localizator.DownloadFile, onClick: () => downloadDcmtsAsync({ inputDcmts: selectedDcmtInfos, downloadType: DownloadTypes.Dcmt, downloadMode: "download", skipConfirmation: true })
|
|
467
479
|
};
|
|
468
480
|
};
|
|
469
481
|
const downloadXMLAttachmentsMenuItem = () => {
|
|
@@ -472,7 +484,7 @@ export const useDocumentOperations = (props) => {
|
|
|
472
484
|
icon: _jsx(IconDownload, {}),
|
|
473
485
|
operationType: 'singleRow',
|
|
474
486
|
disabled: !isXMLFileExt(selectedDcmtInfos?.[0]?.FILEEXT) ? true : isDisabledForSingleRow(),
|
|
475
|
-
name: SDKUI_Localizator.DownloadXMLAttachments, onClick: () => downloadDcmtsAsync(selectedDcmtInfos, DownloadTypes.Attachment, "download",
|
|
487
|
+
name: SDKUI_Localizator.DownloadXMLAttachments, onClick: () => downloadDcmtsAsync({ inputDcmts: selectedDcmtInfos, downloadType: DownloadTypes.Attachment, downloadMode: "download", confirmAttachments: openConfirmAttachmentsDialog, skipConfirmation: true })
|
|
476
488
|
};
|
|
477
489
|
};
|
|
478
490
|
const duplicateDocumentMenuItem = () => {
|
|
@@ -542,12 +554,10 @@ export const useDocumentOperations = (props) => {
|
|
|
542
554
|
const firstDoc = selectedDcmtInfos?.[0];
|
|
543
555
|
// Check if the selected document is a PDF
|
|
544
556
|
const isPdf = firstDoc?.FILEEXT?.toLowerCase() === "pdf";
|
|
545
|
-
// Check if the document has been signed
|
|
546
|
-
const isSigned = firstDoc?.ISSIGNED === 1;
|
|
547
557
|
// Check if the user has permission to substitute files
|
|
548
558
|
const canSubstitute = dtd?.perm?.canSubstFile === AccessLevels.Yes;
|
|
549
559
|
// Determine whether the menu item should be disabled
|
|
550
|
-
const isDisabled = !canSubstitute || isDisabledForSingleRow() || !isPdf
|
|
560
|
+
const isDisabled = !canSubstitute || isDisabledForSingleRow() || !isPdf;
|
|
551
561
|
return {
|
|
552
562
|
id: 'pdf-ed',
|
|
553
563
|
icon: _jsx(IconEdit, {}),
|
|
@@ -636,6 +646,80 @@ export const useDocumentOperations = (props) => {
|
|
|
636
646
|
return;
|
|
637
647
|
copyCheckoutPathToClipboardCallback(firstDoc, dtd?.name ?? SDKUI_Localizator.SearchResult);
|
|
638
648
|
};
|
|
649
|
+
const printMenuItem = () => {
|
|
650
|
+
// Take the first document (used for validation checks)
|
|
651
|
+
const firstDoc = selectedDcmtInfos?.[0];
|
|
652
|
+
// Check if the selected document is a PDF or can be converted to PDF by the backend
|
|
653
|
+
// Include signed PDFs (p7m, tsd, m7m) since generalRetrieveFormat is OriginalUnsigned
|
|
654
|
+
const fileExtLower = firstDoc?.FILEEXT?.toLowerCase();
|
|
655
|
+
const isPdf = fileExtLower === "pdf" || fileExtLower === "pdf.p7m" || fileExtLower === "pdf.tsd" || fileExtLower === "pdf.m7m";
|
|
656
|
+
const isConvertible = isConvertibleToPdfExt(firstDoc?.FILEEXT);
|
|
657
|
+
const canPrint = isPdf || isConvertible;
|
|
658
|
+
const executePrint = async () => {
|
|
659
|
+
const handlePrint = async (file, _dcmtInfo) => {
|
|
660
|
+
const fileURL = window.URL.createObjectURL(file);
|
|
661
|
+
// Usa un iframe nascosto con sandbox per:
|
|
662
|
+
// 1. Bloccare l'esecuzione di JavaScript nel PDF
|
|
663
|
+
// 2. Non aprire un nuovo tab
|
|
664
|
+
const printFrame = document.createElement('iframe');
|
|
665
|
+
printFrame.style.position = 'fixed';
|
|
666
|
+
printFrame.style.right = '0';
|
|
667
|
+
printFrame.style.bottom = '0';
|
|
668
|
+
printFrame.style.width = '0';
|
|
669
|
+
printFrame.style.height = '0';
|
|
670
|
+
printFrame.style.border = 'none';
|
|
671
|
+
printFrame.src = fileURL;
|
|
672
|
+
document.body.appendChild(printFrame);
|
|
673
|
+
printFrame.onload = () => {
|
|
674
|
+
try {
|
|
675
|
+
printFrame.contentWindow?.focus();
|
|
676
|
+
printFrame.contentWindow?.print();
|
|
677
|
+
}
|
|
678
|
+
catch (e) {
|
|
679
|
+
console.error('Errore durante la stampa:', e);
|
|
680
|
+
}
|
|
681
|
+
// Cleanup dopo un delay per permettere la stampa
|
|
682
|
+
setTimeout(() => {
|
|
683
|
+
document.body.removeChild(printFrame);
|
|
684
|
+
window.URL.revokeObjectURL(fileURL);
|
|
685
|
+
}, 60000);
|
|
686
|
+
};
|
|
687
|
+
};
|
|
688
|
+
const rfo = new RetrieveFileOptions();
|
|
689
|
+
rfo.retrieveReason = DcmtOpers.Print;
|
|
690
|
+
rfo.generalRetrieveFormat = GeneralRetrieveFormats.OriginalUnsigned;
|
|
691
|
+
rfo.cvtFormat = FileFormats.PDF;
|
|
692
|
+
rfo.invoiceRetrieveFormat = SDKUI_Globals.userSettings?.searchSettings.invoiceRetrieveFormat;
|
|
693
|
+
rfo.orderRetrieveFormat = SDKUI_Globals.userSettings?.searchSettings.orderRetrieveFormat;
|
|
694
|
+
await downloadDcmtsAsync({ inputDcmts: selectedDcmtInfos, downloadType: DownloadTypes.Dcmt, downloadMode: "download", onFileDownloaded: handlePrint, skipConfirmation: true, retrieveOptions: rfo, useCache: true, showSuccessAlert: false });
|
|
695
|
+
};
|
|
696
|
+
return {
|
|
697
|
+
id: 'print',
|
|
698
|
+
icon: _jsx("i", { className: "dx-icon-print", style: { fontSize: '20px' } }),
|
|
699
|
+
name: SDKUI_Localizator.Print,
|
|
700
|
+
operationType: 'singleRow',
|
|
701
|
+
disabled: !canPrint || isDisabledForSingleRow(),
|
|
702
|
+
onClick: canPrint ? async () => {
|
|
703
|
+
// Se non è un PDF nativo ma è convertibile, chiedi conferma
|
|
704
|
+
if (!isPdf && isConvertible) {
|
|
705
|
+
TMMessageBoxManager.show({
|
|
706
|
+
title: SDKUI_Localizator.Print,
|
|
707
|
+
message: (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '12px' }, children: [_jsx("p", { style: { margin: 0, color: '#333' }, children: SDKUI_Localizator.PrintConfirmConversion.split('PDF').map((part, i, arr) => (_jsxs("span", { children: [part, i < arr.length - 1 && _jsx("strong", { children: "PDF" })] }, i))) }), _jsx("p", { style: { margin: 0, fontWeight: 500, color: '#333' }, children: SDKUI_Localizator.PrintConfirmQuestion })] })),
|
|
708
|
+
buttons: [ButtonNames.YES, ButtonNames.NO],
|
|
709
|
+
showToppy: false,
|
|
710
|
+
onButtonClick: async (e) => {
|
|
711
|
+
if (e === ButtonNames.YES) {
|
|
712
|
+
await executePrint();
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
else {
|
|
718
|
+
await executePrint();
|
|
719
|
+
}
|
|
720
|
+
} : undefined,
|
|
721
|
+
};
|
|
722
|
+
};
|
|
639
723
|
const checkinMenuItem = () => {
|
|
640
724
|
// Take the first document (used for validation checks)
|
|
641
725
|
let dcmt = focusedItem;
|
|
@@ -694,7 +778,65 @@ export const useDocumentOperations = (props) => {
|
|
|
694
778
|
]
|
|
695
779
|
};
|
|
696
780
|
};
|
|
697
|
-
const
|
|
781
|
+
const mergeToPdfMenuItem = () => {
|
|
782
|
+
return {
|
|
783
|
+
id: 'merge-pdf',
|
|
784
|
+
icon: _jsx("i", { className: "dx-icon-pdffile", style: { fontSize: '18px' } }),
|
|
785
|
+
name: 'Unisci in un file PDF',
|
|
786
|
+
operationType: 'multiRow',
|
|
787
|
+
disabled: isDisabledForMultiRow(),
|
|
788
|
+
submenu: [
|
|
789
|
+
{
|
|
790
|
+
id: 'merge-pdf-only-selected',
|
|
791
|
+
icon: _jsx("i", { className: "dx-icon-pdffile", style: { fontSize: '18px' } }),
|
|
792
|
+
name: SDKUI_Localizator.SelectedDocuments,
|
|
793
|
+
onClick: () => {
|
|
794
|
+
setShowTMRelationViewerInCopyToFolderForm(false);
|
|
795
|
+
setOpenCopyToFolderForm({ open: true, operationType: 'mergeToPdf', mode: 'onlySelected' });
|
|
796
|
+
},
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
id: 'merge-pdf-customized',
|
|
800
|
+
icon: _jsx("i", { className: "dx-icon-pdffile", style: { fontSize: '18px' } }),
|
|
801
|
+
name: SDKUI_Localizator.SelectedDocumentsAndRelated,
|
|
802
|
+
onClick: () => {
|
|
803
|
+
setShowTMRelationViewerInCopyToFolderForm(true);
|
|
804
|
+
setOpenCopyToFolderForm({ open: true, operationType: 'mergeToPdf', mode: 'customized' });
|
|
805
|
+
},
|
|
806
|
+
},
|
|
807
|
+
],
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
const copyToFolderMenuItem = () => {
|
|
811
|
+
return {
|
|
812
|
+
id: 'copy-to-folder',
|
|
813
|
+
icon: _jsx(IconCopy, {}),
|
|
814
|
+
name: SDKUI_Localizator.CopyToFolder,
|
|
815
|
+
operationType: 'multiRow',
|
|
816
|
+
disabled: isDisabledForMultiRow(),
|
|
817
|
+
submenu: [
|
|
818
|
+
{
|
|
819
|
+
id: 'copy-to-folder-only-selected',
|
|
820
|
+
icon: _jsx(IconCopy, {}),
|
|
821
|
+
name: SDKUI_Localizator.SelectedDocuments,
|
|
822
|
+
onClick: () => {
|
|
823
|
+
setShowTMRelationViewerInCopyToFolderForm(false);
|
|
824
|
+
setOpenCopyToFolderForm({ open: true, operationType: 'copyToFolder', mode: 'onlySelected' });
|
|
825
|
+
},
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
id: 'copy-to-folder-customized',
|
|
829
|
+
icon: _jsx(IconCopy, {}),
|
|
830
|
+
name: SDKUI_Localizator.SelectedDocumentsAndRelated,
|
|
831
|
+
onClick: () => {
|
|
832
|
+
setShowTMRelationViewerInCopyToFolderForm(true);
|
|
833
|
+
setOpenCopyToFolderForm({ open: true, operationType: 'copyToFolder', mode: 'customized', });
|
|
834
|
+
},
|
|
835
|
+
},
|
|
836
|
+
],
|
|
837
|
+
};
|
|
838
|
+
};
|
|
839
|
+
const relationsMenuItem = (openInModal = false) => {
|
|
698
840
|
return {
|
|
699
841
|
id: 'rel',
|
|
700
842
|
icon: _jsx(IconRelation, {}),
|
|
@@ -743,7 +885,7 @@ export const useDocumentOperations = (props) => {
|
|
|
743
885
|
visible: true,
|
|
744
886
|
beginGroup: true,
|
|
745
887
|
disabled: !contextConfig.hasMasterRelations || !contextConfig.canShowRelations || isDisabledForMultiRow(),
|
|
746
|
-
onClick: () => openMasterDcmtsFormHandler(true)
|
|
888
|
+
onClick: () => openInModal ? openMasterDcmtsModalHandler(true) : openMasterDcmtsFormHandler(true)
|
|
747
889
|
},
|
|
748
890
|
{
|
|
749
891
|
id: 'rel-det',
|
|
@@ -752,7 +894,7 @@ export const useDocumentOperations = (props) => {
|
|
|
752
894
|
operationType: 'multiRow',
|
|
753
895
|
disabled: !contextConfig.hasDetailRelations || !contextConfig.canShowRelations || isDisabledForMultiRow(),
|
|
754
896
|
visible: true,
|
|
755
|
-
onClick: () => openDetailDcmtsFormHandler(true)
|
|
897
|
+
onClick: () => openInModal ? openDetailDcmtsModalHandler(true) : openDetailDcmtsFormHandler(true)
|
|
756
898
|
}
|
|
757
899
|
]
|
|
758
900
|
};
|
|
@@ -766,10 +908,10 @@ export const useDocumentOperations = (props) => {
|
|
|
766
908
|
submenu: [
|
|
767
909
|
{
|
|
768
910
|
icon: <IconShare />,
|
|
769
|
-
name:
|
|
911
|
+
name: SDKUI_Localizator.SharedArchiving,
|
|
770
912
|
operationType: 'multiRow',
|
|
771
913
|
disabled: fromDatagrid ? false : isDisabledForMultiRow(),
|
|
772
|
-
onClick: () => ShowAlert({ message: "TODO Archiviazione condivisa", mode: 'info', title: `${
|
|
914
|
+
onClick: () => ShowAlert({ message: "TODO Archiviazione condivisa", mode: 'info', title: `${SDKUI_Localizator.SharedArchiving}`, duration: 3000 })
|
|
773
915
|
},
|
|
774
916
|
{
|
|
775
917
|
icon: <IconSharedDcmt />,
|
|
@@ -975,7 +1117,7 @@ export const useDocumentOperations = (props) => {
|
|
|
975
1117
|
};
|
|
976
1118
|
const handleWFOperationCompleted = async () => {
|
|
977
1119
|
await onWFOperationCompleted?.();
|
|
978
|
-
if (
|
|
1120
|
+
if (!showMoreInfoPopup) {
|
|
979
1121
|
onCloseDcmtForm?.();
|
|
980
1122
|
}
|
|
981
1123
|
};
|
|
@@ -1014,10 +1156,13 @@ export const useDocumentOperations = (props) => {
|
|
|
1014
1156
|
batchUpdateMenuItem(),
|
|
1015
1157
|
passToArchive(),
|
|
1016
1158
|
...(selectedDcmtInfos.length > 0 && isPdfEditorAvailable(dtd, selectedDcmtInfos[0]?.FILEEXT) && onOpenPdfEditorRequest ? [pdfEditorMenuItem(onOpenPdfEditorRequest)] : []),
|
|
1159
|
+
...(!isMobile ? [printMenuItem()] : [])
|
|
1017
1160
|
]
|
|
1018
1161
|
},
|
|
1019
1162
|
signatureMenuItem(),
|
|
1020
1163
|
checkinMenuItem(),
|
|
1164
|
+
copyToFolderMenuItem(),
|
|
1165
|
+
mergeToPdfMenuItem(),
|
|
1021
1166
|
allowRelations ? relationsMenuItem() : null,
|
|
1022
1167
|
sharedDcmtsMenuItem(),
|
|
1023
1168
|
// shareMenuItem(),
|
|
@@ -1042,7 +1187,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1042
1187
|
];
|
|
1043
1188
|
};
|
|
1044
1189
|
const getArchivedWorkgroupMenuItems = () => {
|
|
1045
|
-
const
|
|
1190
|
+
const sortedItems = [
|
|
1046
1191
|
addReplaceFileOperation(),
|
|
1047
1192
|
openFormOperation(),
|
|
1048
1193
|
deletetionMenuItem(),
|
|
@@ -1053,9 +1198,15 @@ export const useDocumentOperations = (props) => {
|
|
|
1053
1198
|
copyFromWgMenuItem(),
|
|
1054
1199
|
movetofolderFromWgMenuItem(),
|
|
1055
1200
|
commentFromWgMenuItem(false),
|
|
1201
|
+
relationsMenuItem(true),
|
|
1056
1202
|
removeFromWgMenuItem(SDKUI_Localizator.RemoveFromWorkgroup),
|
|
1203
|
+
...(!isMobile ? [printMenuItem()] : [])
|
|
1204
|
+
].sort((a, b) => a.name.localeCompare(b.name));
|
|
1205
|
+
return [
|
|
1206
|
+
...sortedItems,
|
|
1207
|
+
{ ...copyToFolderMenuItem(), beginGroup: true },
|
|
1208
|
+
mergeToPdfMenuItem(),
|
|
1057
1209
|
];
|
|
1058
|
-
return items.sort((a, b) => a.name.localeCompare(b.name));
|
|
1059
1210
|
};
|
|
1060
1211
|
const getDcmtFormMenuItems = () => {
|
|
1061
1212
|
return [
|
|
@@ -1073,6 +1224,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1073
1224
|
downloadFileMenuItem(),
|
|
1074
1225
|
downloadXMLAttachmentsMenuItem(),
|
|
1075
1226
|
...(selectedDcmtInfos.length > 0 && isPdfEditorAvailable(dtd, selectedDcmtInfos[0]?.FILEEXT) && onOpenPdfEditorRequest ? [pdfEditorMenuItem(onOpenPdfEditorRequest)] : []),
|
|
1227
|
+
...(!isMobile ? [printMenuItem()] : [])
|
|
1076
1228
|
]
|
|
1077
1229
|
},
|
|
1078
1230
|
signatureMenuItem(),
|
|
@@ -1098,11 +1250,14 @@ export const useDocumentOperations = (props) => {
|
|
|
1098
1250
|
...(SDK_Globals.tmSession?.SessionDescr?.appModuleID === AppModules.SURFER ? [createContextualTaskMenuItem()] : []),
|
|
1099
1251
|
downloadFileMenuItem(),
|
|
1100
1252
|
downloadXMLAttachmentsMenuItem(),
|
|
1101
|
-
...(selectedDcmtInfos.length > 0 && isPdfEditorAvailable(dtd, selectedDcmtInfos[0]?.FILEEXT) && onOpenPdfEditorRequest ? [pdfEditorMenuItem(onOpenPdfEditorRequest)] : [])
|
|
1253
|
+
...(selectedDcmtInfos.length > 0 && isPdfEditorAvailable(dtd, selectedDcmtInfos[0]?.FILEEXT) && onOpenPdfEditorRequest ? [pdfEditorMenuItem(onOpenPdfEditorRequest)] : []),
|
|
1254
|
+
...(!isMobile ? [printMenuItem()] : [])
|
|
1102
1255
|
]
|
|
1103
1256
|
},
|
|
1104
1257
|
signatureMenuItem(),
|
|
1105
1258
|
checkinMenuItem(),
|
|
1259
|
+
copyToFolderMenuItem(),
|
|
1260
|
+
mergeToPdfMenuItem(),
|
|
1106
1261
|
...((inputDcmtFormLayoutMode === LayoutModes.Update) ? [fullTextSearchMenuItem()] : []),
|
|
1107
1262
|
];
|
|
1108
1263
|
};
|
|
@@ -1127,16 +1282,69 @@ export const useDocumentOperations = (props) => {
|
|
|
1127
1282
|
return addPinIconToItems(getOperationMenuItems());
|
|
1128
1283
|
};
|
|
1129
1284
|
const renderFloatingBar = (floatingBarContainerRef && floatingBarContainerRef.current && allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE) ? (_jsx(TMFloatingMenuBar, { containerRef: floatingBarContainerRef, contextMenuItems: operationItems(), isConstrained: true, defaultPosition: { x: 1, y: 88 }, defaultPinnedItems: ['rel-det', 'rel-mst', 'dl'], defaultOrientation: 'horizontal', hasContextMenu: false, pinnedItemIds: pinnedItemIds, onPinChange: setPinnedItemIds })) : null;
|
|
1285
|
+
const masterDetailDetailsCommonProps = {
|
|
1286
|
+
deviceType,
|
|
1287
|
+
isForMaster: false,
|
|
1288
|
+
inputDcmts: selectedDcmtInfos,
|
|
1289
|
+
allowNavigation: selectedDcmtInfos.length === 1,
|
|
1290
|
+
canNext: canNavigateHandler ? canNavigateHandler('next') : false,
|
|
1291
|
+
canPrev: canNavigateHandler ? canNavigateHandler('prev') : false,
|
|
1292
|
+
onNext: () => onNavigateHandler && onNavigateHandler('next'),
|
|
1293
|
+
onPrev: () => onNavigateHandler && onNavigateHandler('prev'),
|
|
1294
|
+
allTasks,
|
|
1295
|
+
getAllTasks,
|
|
1296
|
+
deleteTaskByIdsCallback,
|
|
1297
|
+
addTaskCallback,
|
|
1298
|
+
editTaskCallback,
|
|
1299
|
+
onReferenceClick,
|
|
1300
|
+
handleNavigateToWGs,
|
|
1301
|
+
handleNavigateToDossiers,
|
|
1302
|
+
editPdfForm,
|
|
1303
|
+
openS4TViewer,
|
|
1304
|
+
onOpenS4TViewerRequest,
|
|
1305
|
+
onOpenPdfEditorRequest,
|
|
1306
|
+
onRefreshAfterAddDcmtToFavs,
|
|
1307
|
+
onTaskCreateRequest,
|
|
1308
|
+
datagridUtility,
|
|
1309
|
+
dcmtUtility,
|
|
1310
|
+
};
|
|
1311
|
+
const masterDetailMasterCommonProps = {
|
|
1312
|
+
deviceType,
|
|
1313
|
+
isForMaster: true,
|
|
1314
|
+
inputDcmts: selectedDcmtInfos,
|
|
1315
|
+
allowNavigation: selectedDcmtInfos.length === 1,
|
|
1316
|
+
canNext: canNavigateHandler ? canNavigateHandler('next') : false,
|
|
1317
|
+
canPrev: canNavigateHandler ? canNavigateHandler('prev') : false,
|
|
1318
|
+
onNext: () => onNavigateHandler && onNavigateHandler('next'),
|
|
1319
|
+
onPrev: () => onNavigateHandler && onNavigateHandler('prev'),
|
|
1320
|
+
appendMasterDcmts: handleAddItem,
|
|
1321
|
+
allTasks,
|
|
1322
|
+
getAllTasks,
|
|
1323
|
+
deleteTaskByIdsCallback,
|
|
1324
|
+
addTaskCallback,
|
|
1325
|
+
editTaskCallback,
|
|
1326
|
+
onReferenceClick,
|
|
1327
|
+
handleNavigateToWGs,
|
|
1328
|
+
handleNavigateToDossiers,
|
|
1329
|
+
editPdfForm,
|
|
1330
|
+
openS4TViewer,
|
|
1331
|
+
onOpenS4TViewerRequest,
|
|
1332
|
+
onOpenPdfEditorRequest,
|
|
1333
|
+
onRefreshAfterAddDcmtToFavs,
|
|
1334
|
+
onTaskCreateRequest,
|
|
1335
|
+
datagridUtility,
|
|
1336
|
+
dcmtUtility,
|
|
1337
|
+
};
|
|
1130
1338
|
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) &&
|
|
1131
|
-
_jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID !== undefined), titleModal: dtd?.name ?? '', TID: focusedItem.TID, DID: focusedItem.DID, allowButtonsRefs: true, 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: {
|
|
1339
|
+
_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: {
|
|
1132
1340
|
onRefreshSearchAsyncDatagrid,
|
|
1133
1341
|
onRefreshDataRowsAsync,
|
|
1134
1342
|
refreshFocusedDataRowAsync,
|
|
1135
1343
|
onRefreshBlogDatagrid,
|
|
1136
1344
|
onRefreshPreviewDatagrid
|
|
1137
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) &&
|
|
1138
|
-
_jsx(TMDcmtCheckoutInfoForm, { dtdName: dtd.name ?? SDKUI_Localizator.SearchResult, selectedDcmtOrFocused: selectedDcmtInfos[0], onClose: hideCheckoutInformationFormCallback }), _jsx(
|
|
1139
|
-
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, {
|
|
1346
|
+
_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
|
+
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { ...masterDetailMasterCommonProps, inputDcmts: [dcmt], allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID) }) }, `${index}-${dcmt.DID}`));
|
|
1140
1348
|
})] }), 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: () => {
|
|
1141
1349
|
setIsOpenArchiveRelationForm(false);
|
|
1142
1350
|
setArchiveType(undefined);
|
|
@@ -1148,7 +1356,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1148
1356
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
1149
1357
|
setArchiveRelatedDcmtFormMids([]);
|
|
1150
1358
|
await onRefreshSearchAsyncDatagrid?.();
|
|
1151
|
-
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar, openFileUploaderPdfEditor: openFileUploaderPdfEditor }), showRelatedDcmtsChooser &&
|
|
1359
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar, openFileUploaderPdfEditor: openFileUploaderPdfEditor, showTodoDcmtForm: showTodoDcmtForm }), showRelatedDcmtsChooser &&
|
|
1152
1360
|
_jsx(TMChooserForm, { dataSource: relatedDcmtsChooserDataSource, onChoose: async (selectedRelation) => {
|
|
1153
1361
|
try {
|
|
1154
1362
|
setShowRelatedDcmtsChooser(false);
|
|
@@ -1182,7 +1390,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1182
1390
|
}
|
|
1183
1391
|
}, onClose: () => setShowManyToManyChooser(false), manageUseLocalizedName: false }), showPairDcmtsModal &&
|
|
1184
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 &&
|
|
1185
|
-
_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:
|
|
1393
|
+
_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: () => {
|
|
1186
1394
|
setIsOpenSharedArchive(false);
|
|
1187
1395
|
}, 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) => {
|
|
1188
1396
|
setIsOpenSharedArchive(false);
|
|
@@ -1194,7 +1402,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1194
1402
|
updateBatchUpdateForm(false);
|
|
1195
1403
|
setIsModifiedBatchUpdate(false);
|
|
1196
1404
|
await onRefreshDataRowsAsync?.();
|
|
1197
|
-
}, 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 }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), _jsx(FileSourceDialog, {}), taskFormDialogComponent, s4TViewerDialogComponent, currentCustomButton && _jsx(TMCustomButton, { button: currentCustomButton, formData: currentMetadataValues, selectedItems: selectedItemsFull, onClose: () => setCurrentCustomButton(undefined) })] }));
|
|
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) })] }));
|
|
1198
1406
|
return {
|
|
1199
1407
|
operationItems: operationItems(),
|
|
1200
1408
|
renderFloatingBar,
|
|
@@ -1209,6 +1417,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1209
1417
|
isOpenBatchUpdate,
|
|
1210
1418
|
isModifiedBatchUpdate,
|
|
1211
1419
|
updateBatchUpdateForm,
|
|
1420
|
+
closeDcmtFormHandler,
|
|
1212
1421
|
handleSignApprove,
|
|
1213
1422
|
checkoutInfo: {
|
|
1214
1423
|
showHistory,
|
|
@@ -1315,6 +1524,6 @@ export const useDocumentOperations = (props) => {
|
|
|
1315
1524
|
updateShowReAssignPopup,
|
|
1316
1525
|
updateShowMoreInfoPopup
|
|
1317
1526
|
}
|
|
1318
|
-
}
|
|
1527
|
+
},
|
|
1319
1528
|
};
|
|
1320
1529
|
};
|
package/lib/hooks/useForm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
2
|
import { FormModes } from "../ts";
|
|
3
3
|
import { TMExceptionBoxManager, TMSpinner } from "../components";
|
|
4
|
-
import { AreaEngine, BasketTypeEngine, DataListEngine, DcmtTypeEngine, DiskEngine, GroupEngine, JobEngine, JobTypes, LDAPDescriptor, LDAPProviders,
|
|
4
|
+
import { AreaEngine, BasketTypeEngine, DataListEngine, DcmtTypeEngine, DiskEngine, GroupEngine, JobEngine, JobTypes, LDAPDescriptor, LDAPProviders, NumeratorEngine, ObjectClasses, ProcessEngine, RelationEngine, ResultTypes, SAPEngine, SavedQueryEngine, SignCertDescriptor, TaskEngine, TreeDescriptor, TSADescriptor, UserEngine, WorkingGroupDescriptor } from "@topconsultnpm/sdk-ts";
|
|
5
5
|
import { PlatformObjectService } from "../services";
|
|
6
6
|
import { SDKUI_Localizator, calcIsModified } from "../helper";
|
|
7
7
|
export class SaveFormOptions {
|
|
@@ -42,7 +42,7 @@ export function useSaveForm(formMode, id, sfo, validator, onSaved, onStatusChang
|
|
|
42
42
|
case ObjectClasses.Disk: return DiskEngine.NewDiskDescriptor();
|
|
43
43
|
case ObjectClasses.Group: return GroupEngine.NewGroupDescriptor();
|
|
44
44
|
case ObjectClasses.LDAP: return normalizeLDAP(new LDAPDescriptor());
|
|
45
|
-
case ObjectClasses.Numerator: return
|
|
45
|
+
case ObjectClasses.Numerator: return NumeratorEngine.NewNormalizeNumeratorDescriptor();
|
|
46
46
|
case ObjectClasses.SignCert: return normalizeSignCert(new SignCertDescriptor());
|
|
47
47
|
case ObjectClasses.Tree: return new TreeDescriptor();
|
|
48
48
|
case ObjectClasses.TSA: return new TSADescriptor();
|
|
@@ -101,6 +101,9 @@ export function useSaveForm(formMode, id, sfo, validator, onSaved, onStatusChang
|
|
|
101
101
|
newId = await saveCustomAsync();
|
|
102
102
|
else
|
|
103
103
|
newId = await setDataAsync?.(formMode, formData, ...args);
|
|
104
|
+
if (newId <= 0) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
104
107
|
let newData;
|
|
105
108
|
if (sfo.loadDataAfterSave)
|
|
106
109
|
newData = await loadDataAsync(newId, FormModes.Update);
|
|
@@ -160,10 +160,10 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
|
|
|
160
160
|
setCanArchiveDetailRelation(false);
|
|
161
161
|
return;
|
|
162
162
|
}
|
|
163
|
-
const detailRelations = relations.filter(r => r.detailTID === tid);
|
|
163
|
+
const detailRelations = relations.filter(r => r.detailTID === tid && r.relationType !== RelationTypes.ManyToMany);
|
|
164
164
|
const hasMasterWithAssociations = detailRelations.some(rel => rel.associations && rel.associations.length > 0);
|
|
165
165
|
setCanArchiveMasterRelation(hasMasterWithAssociations);
|
|
166
|
-
const masterRelations = relations.filter(r => r.masterTID === tid);
|
|
166
|
+
const masterRelations = relations.filter(r => r.masterTID === tid && r.relationType !== RelationTypes.ManyToMany);
|
|
167
167
|
const hasDetailWithAssociations = masterRelations.some(rel => rel.associations && rel.associations.length > 0);
|
|
168
168
|
setCanArchiveDetailRelation(hasDetailWithAssociations);
|
|
169
169
|
}
|
|
@@ -196,8 +196,8 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
|
|
|
196
196
|
}, [selectedSearchResult?.fromTID]);
|
|
197
197
|
const filterRelationsByType = (relations, tid, type) => {
|
|
198
198
|
return type === 'detail'
|
|
199
|
-
? relations.filter(r => r.masterTID == tid)
|
|
200
|
-
: relations.filter(r => r.detailTID == tid);
|
|
199
|
+
? relations.filter(r => r.masterTID == tid && r.relationType !== RelationTypes.ManyToMany)
|
|
200
|
+
: relations.filter(r => r.detailTID == tid && r.relationType !== RelationTypes.ManyToMany);
|
|
201
201
|
};
|
|
202
202
|
const filterRelationsWithAssociations = (relations) => {
|
|
203
203
|
return relations.filter(rel => rel.associations && rel.associations.length > 0);
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
export const useResizeObserver = () => {
|
|
3
3
|
const [width, setWidth] = useState(0);
|
|
4
|
-
const
|
|
4
|
+
const [element, setElement] = useState(null);
|
|
5
|
+
// Callback ref: viene invocato quando l'elemento viene montato/smontato
|
|
6
|
+
const ref = useCallback((node) => {
|
|
7
|
+
setElement(node);
|
|
8
|
+
}, []);
|
|
5
9
|
useEffect(() => {
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
if (!element)
|
|
11
|
+
return;
|
|
12
|
+
// Imposta la larghezza iniziale
|
|
13
|
+
setWidth(element.getBoundingClientRect().width);
|
|
14
|
+
const observer = new ResizeObserver((entries) => {
|
|
15
|
+
if (entries[0]?.contentRect) {
|
|
8
16
|
setWidth(entries[0].contentRect.width);
|
|
9
17
|
}
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
return () => {
|
|
16
|
-
if (ref.current) {
|
|
17
|
-
observer.unobserve(ref.current);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}, []);
|
|
18
|
+
});
|
|
19
|
+
observer.observe(element);
|
|
20
|
+
return () => observer.disconnect();
|
|
21
|
+
}, [element]);
|
|
21
22
|
return { ref, width };
|
|
22
23
|
};
|