@topconsultnpm/sdkui-react-beta 6.17.33 → 6.17.35
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.
|
@@ -72,7 +72,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
72
72
|
// States for Related Documents
|
|
73
73
|
const [relatedDcmts, setRelatedDcmts] = useState(undefined);
|
|
74
74
|
const [showRelatedDcmtsChooser, setShowRelatedDcmtsChooser] = useState(false);
|
|
75
|
-
const [
|
|
75
|
+
const [archiveType, setArchiveType] = useState(undefined);
|
|
76
76
|
const [isOpenDetails, setIsOpenDetails] = useState(false);
|
|
77
77
|
const [isOpenMaster, setIsOpenMaster] = useState(false);
|
|
78
78
|
const [secondaryMasterDcmts, setSecondaryMasterDcmts] = useState([]);
|
|
@@ -410,14 +410,14 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
410
410
|
break;
|
|
411
411
|
}
|
|
412
412
|
};
|
|
413
|
+
//#region Related Documents Archive Section
|
|
413
414
|
const getAllRelationsAsync = async () => {
|
|
414
415
|
const tmSession = SDK_Globals.tmSession;
|
|
415
416
|
try {
|
|
416
417
|
TMSpinner.show({ description: SDKUI_Localizator.Loading });
|
|
417
418
|
let relations = await RelationCacheService.GetAllAsync(tmSession);
|
|
418
|
-
if (!relations)
|
|
419
|
+
if (!relations)
|
|
419
420
|
throw new Error("Impossibile caricare le relazioni.");
|
|
420
|
-
}
|
|
421
421
|
return relations;
|
|
422
422
|
}
|
|
423
423
|
catch (error) {
|
|
@@ -502,6 +502,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
502
502
|
}
|
|
503
503
|
setRelatedDcmts(withAssociations);
|
|
504
504
|
if (withAssociations.length > 1) {
|
|
505
|
+
setArchiveType(type);
|
|
505
506
|
setShowRelatedDcmtsChooser(true);
|
|
506
507
|
}
|
|
507
508
|
else {
|
|
@@ -521,6 +522,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
521
522
|
const archiveMasterDocuments = async (tid) => {
|
|
522
523
|
await archiveRelatedDocuments(tid, 'master');
|
|
523
524
|
};
|
|
525
|
+
//#endregion Related Documents Archive Section
|
|
524
526
|
const searchResutlToolbar = _jsxs(_Fragment, { children: [(dcmtsReturned != dcmtsFound) && _jsx("p", { style: { backgroundColor: `white`, color: TMColors.primaryColor, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${dcmtsReturned}/${dcmtsFound} restituiti` }), context === SearchResultContext.FAVORITES_AND_RECENTS &&
|
|
525
527
|
_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick: onRefreshSearchAsync }), _jsx(IconMenuVertical, { id: `commands-header-${id}`, color: 'white', cursor: 'pointer' }), _jsx(TMCommandsContextMenu, { target: `#commands-header-${id}`, showEvent: "click", menuItems: getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments) })] });
|
|
526
528
|
const middlePanelToolbar = _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [_jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, iconColor: TMColors.default_background, formMode: FormModes.ReadOnly, canPrev: canNavigateHandler('prev'), onPrev: () => onNavigateHandler('prev') }), _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, iconColor: TMColors.default_background, formMode: FormModes.ReadOnly, canNext: canNavigateHandler('next'), onNext: () => onNavigateHandler('next') })] });
|
|
@@ -547,7 +549,22 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
547
549
|
await refreshSelectionDataRowsAsync();
|
|
548
550
|
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), (showToppyForApprove && !showApprovePopup && !showRejectPopup && !showReAssignPopup && !showMoreInfoPopup && !openS4TViewer && !showTodoDcmtForm) &&
|
|
549
551
|
_jsx(ToppyHelpCenter, { deviceType: deviceType, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), approveDisable: disable, signApproveDisable: disableSignApproveDisable, rejectDisable: disable, reassignDisable: disable, infoDisable: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), showRelatedDcmtsChooser &&
|
|
550
|
-
_jsx(TMChooserForm, { dataSource: relatedDcmts, onChoose:
|
|
552
|
+
_jsx(TMChooserForm, { dataSource: relatedDcmts, onChoose: async (selectedRelation) => {
|
|
553
|
+
try {
|
|
554
|
+
setShowRelatedDcmtsChooser(false);
|
|
555
|
+
TMSpinner.show({ description: SDKUI_Localizator.Loading });
|
|
556
|
+
const relation = relatedDcmts?.find(r => r.id === selectedRelation[0]);
|
|
557
|
+
if (!relation || !archiveType)
|
|
558
|
+
return;
|
|
559
|
+
navigateToArchive(relation, archiveType);
|
|
560
|
+
}
|
|
561
|
+
catch (error) {
|
|
562
|
+
TMExceptionBoxManager.show({ exception: error });
|
|
563
|
+
}
|
|
564
|
+
finally {
|
|
565
|
+
TMSpinner.hide();
|
|
566
|
+
}
|
|
567
|
+
}, onClose: () => setShowRelatedDcmtsChooser(false), manageUseLocalizedName: false }), (floatingActionConfig && floatingActionConfig.isVisible) && _jsx(TMSearchResultFloatingActionButton, { selectedDcmtsOrFocused: getSelectedDcmtsOrFocused(selectedItems, focusedItem), config: floatingActionConfig })] }), [
|
|
551
568
|
searchResults,
|
|
552
569
|
selectedSearchResult,
|
|
553
570
|
lastUpdateSearchTime,
|
|
@@ -571,7 +588,6 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
571
588
|
openS4TViewer,
|
|
572
589
|
showRelatedDcmtsChooser,
|
|
573
590
|
relatedDcmts,
|
|
574
|
-
setSelectedRelatedDcmt,
|
|
575
591
|
setShowRelatedDcmtsChooser
|
|
576
592
|
]);
|
|
577
593
|
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: focusedItem?.TID, did: focusedItem?.DID }), [focusedItem]);
|
|
@@ -75,8 +75,20 @@ export const signatureInformationCallback = async (isMobile, inputDcmts) => {
|
|
|
75
75
|
TMExceptionBoxManager.show({ exception: error });
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
+
const PDF_EDITOR_ID = "60007";
|
|
79
|
+
const isWidgetEnabled = (widgetId, widgetsString) => {
|
|
80
|
+
const widgets = widgetsString.split(";").filter(Boolean);
|
|
81
|
+
return widgets.includes(widgetId);
|
|
82
|
+
};
|
|
83
|
+
const isPdfEditorEnabled = (widgetsString) => {
|
|
84
|
+
return isWidgetEnabled(PDF_EDITOR_ID, widgetsString);
|
|
85
|
+
};
|
|
78
86
|
export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments) => {
|
|
79
87
|
const isPdfEditorLicensed = SDK_Globals?.license?.dcmtArchiveLicenses?.[0]?.siX_60007?.status === LicenseModuleStatus.Licensed;
|
|
88
|
+
let pdfEditorAvailable = false;
|
|
89
|
+
if (dtd && dtd.widgets && dtd.widgets.length > 0) {
|
|
90
|
+
pdfEditorAvailable = isPdfEditorEnabled(dtd.widgets);
|
|
91
|
+
}
|
|
80
92
|
const addToFavoriteMenuItem = () => {
|
|
81
93
|
return {
|
|
82
94
|
icon: svgToString(_jsx(IconStar, {})),
|
|
@@ -615,7 +627,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
615
627
|
duplicateDocumentMenuItem(),
|
|
616
628
|
batchUpdateMenuItem(),
|
|
617
629
|
passToArchive(),
|
|
618
|
-
...((isPdfEditorLicensed && openEditPdf && getSelectedDcmtsOrFocused(selectedItems, focusedItem)?.[0]?.FILEEXT?.toLowerCase() === "pdf") ? [pdfEditorMenuItem(openEditPdf)] : []),
|
|
630
|
+
...((isPdfEditorLicensed && pdfEditorAvailable && openEditPdf && getSelectedDcmtsOrFocused(selectedItems, focusedItem)?.[0]?.FILEEXT?.toLowerCase() === "pdf") ? [pdfEditorMenuItem(openEditPdf)] : []),
|
|
619
631
|
]
|
|
620
632
|
},
|
|
621
633
|
signatureMenuItem(),
|