@topconsultnpm/sdkui-react-beta 6.16.25 → 6.16.26
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { AccessLevels, AccessLevelsEx, AppModules, FileFormats, LayoutModes, SDK_Globals } from '@topconsultnpm/sdk-ts-beta';
|
|
3
3
|
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconInfo, IconPlatform, IconPreview, IconRelation, IconSearch, IconShow, IconSignature, IconStar, IconSubstFile, IconUndo, IconUserGroupOutline, SDKUI_Localizator, svgToString } from '../../../helper';
|
|
4
4
|
import ShowAlert from '../../base/TMAlert';
|
|
@@ -25,28 +25,52 @@ export const getSelectedDcmtsOrFocused = (selectedItems, focusedItem, fileFormat
|
|
|
25
25
|
return [];
|
|
26
26
|
};
|
|
27
27
|
export const signatureInformationCallback = async (inputDcmts) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
try {
|
|
29
|
+
if (!inputDcmts || inputDcmts.length === 0) {
|
|
30
|
+
ShowAlert({
|
|
31
|
+
message: SDKUI_Localizator.NoDcmtSelected,
|
|
32
|
+
mode: 'warning',
|
|
33
|
+
title: SDKUI_Localizator.SignatureInformation,
|
|
34
|
+
duration: 3000
|
|
35
|
+
});
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (inputDcmts.length > 1) {
|
|
39
|
+
ShowAlert({
|
|
40
|
+
message: "Selezionare un solo documento per visualizzare le informazioni di firma",
|
|
41
|
+
mode: 'warning',
|
|
42
|
+
title: SDKUI_Localizator.SignatureInformation,
|
|
43
|
+
duration: 3000
|
|
44
|
+
});
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const [inputDcmt] = inputDcmts;
|
|
48
|
+
let ue = SDK_Globals.tmSession?.NewUpdateEngineByID();
|
|
49
|
+
if (ue) {
|
|
50
|
+
ue.TID = inputDcmt.TID;
|
|
51
|
+
ue.DID = inputDcmt.DID;
|
|
52
|
+
const res = await ue.GetSignersAsync().catch((error) => { throw error; });
|
|
53
|
+
if (!res) {
|
|
54
|
+
throw new Error("Informazioni di firma non disponibili");
|
|
55
|
+
}
|
|
43
56
|
TMMessageBoxManager.show({
|
|
44
57
|
title: SDKUI_Localizator.SignatureInformation,
|
|
45
58
|
buttons: [ButtonNames.OK],
|
|
46
59
|
resizable: true,
|
|
47
|
-
message: _jsx("div", {})
|
|
60
|
+
message: (_jsx("div", { style: { fontFamily: "Arial, sans-serif", lineHeight: "1.4em" }, children: res.signers && res.signers.length > 0 ? (res.signers.map((signer, idx) => (_jsxs("div", { style: {
|
|
61
|
+
border: "1px solid #ccc",
|
|
62
|
+
borderRadius: "10px",
|
|
63
|
+
padding: "12px",
|
|
64
|
+
marginBottom: "12px",
|
|
65
|
+
background: "#f9f9f9",
|
|
66
|
+
boxShadow: "0 1px 3px rgba(0,0,0,0.1)"
|
|
67
|
+
}, children: [_jsxs("h3", { style: { margin: "0 0 8px", color: "#333" }, children: ["Firma ", signer.levelAndIndex] }), _jsxs("p", { style: { margin: "4px 0" }, children: [_jsx("strong", { children: "Info 1:" }), _jsx("br", {}), signer.info1?.replace(/\r\n/g, "<br/>")] }), _jsxs("p", { style: { margin: "4px 0" }, children: [_jsx("strong", { children: "Info 2:" }), _jsx("br", {}), signer.info2?.replace(/\r\n/g, "<br/>")] }), _jsxs("p", { style: { margin: "4px 0" }, children: [_jsx("strong", { children: "Info 3:" }), _jsx("br", {}), signer.info3?.replace(/\r\n/g, "<br/>")] })] }, idx)))) : (_jsx("p", { children: "Nessuna firma trovata" })) }))
|
|
48
68
|
});
|
|
49
|
-
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
console.error(error);
|
|
73
|
+
TMExceptionBoxManager.show({ exception: error });
|
|
50
74
|
}
|
|
51
75
|
};
|
|
52
76
|
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) => {
|