@topconsultnpm/sdkui-react-beta 6.16.24 → 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.
@@ -3,4 +3,5 @@ import { DcmtTypeDescriptor, FileDescriptor, FileFormats, LayoutModes, WorkingGr
3
3
  import { TMDataGridContextMenuItem } from '../../base/TMDataGrid';
4
4
  import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes, SearchResultContext } from '../../../ts';
5
5
  export declare const getSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => DcmtInfo[];
6
+ export declare const signatureInformationCallback: (inputDcmts: DcmtInfo[] | undefined) => Promise<void>;
6
7
  export declare const getCommandsMenuItems: (isMobile: boolean, dtd: DcmtTypeDescriptor | undefined, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, showSearch: boolean, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, confirmAttachments: (list: FileDescriptor[]) => Promise<string[] | undefined>, openTaskFormHandler: () => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void, openExportForm: () => void, handleToggleSearch: () => void, handleSignApprove: () => void, openWGsCopyMoveForm?: ((mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void), openCommentFormCallback?: ((documents: Array<DcmtInfo>) => void), openEditPdf?: ((documents: Array<DcmtInfo>) => void), openAddDocumentForm?: () => void) => Array<TMDataGridContextMenuItem>;
@@ -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';
@@ -24,6 +24,55 @@ export const getSelectedDcmtsOrFocused = (selectedItems, focusedItem, fileFormat
24
24
  }
25
25
  return [];
26
26
  };
27
+ export const signatureInformationCallback = async (inputDcmts) => {
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
+ }
56
+ TMMessageBoxManager.show({
57
+ title: SDKUI_Localizator.SignatureInformation,
58
+ buttons: [ButtonNames.OK],
59
+ resizable: true,
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" })) }))
68
+ });
69
+ }
70
+ }
71
+ catch (error) {
72
+ console.error(error);
73
+ TMExceptionBoxManager.show({ exception: error });
74
+ }
75
+ };
27
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) => {
28
77
  // let ftExplanations = focusedItem?.FTExplanations;
29
78
  return [
@@ -163,7 +212,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
163
212
  text: SDKUI_Localizator.SignatureInformation,
164
213
  operationType: 'singleRow',
165
214
  disabled: disabledForSingleRow(selectedItems, focusedItem),
166
- onClick: () => ShowAlert({ message: "TODO Informazioni di firma", mode: 'info', title: `${"TODO"}`, duration: 3000 })
215
+ onClick: () => signatureInformationCallback(getSelectedDcmtsOrFocused(selectedItems, focusedItem))
167
216
  },
168
217
  {
169
218
  icon: svgToString(_jsx(IconSignature, {})),
@@ -86,8 +86,8 @@ const TMChooserForm = ({ children, title, allowMultipleSelection = false, allowA
86
86
  ...summaryItems ?? {}
87
87
  });
88
88
  }, [manageUseLocalizedName, summaryItems]);
89
- return (_jsx(TMModal, { title: renderTitle(), width: width ?? '550px', height: height ?? '600px', toolbar: _jsx(ToolbarButtons, {}), onClose: onClose, children: children ??
90
- filteredItems.length > 0
89
+ return (_jsx(TMModal, { title: renderTitle(), width: width ?? '550px', height: height ?? '600px', toolbar: _jsx(ToolbarButtons, {}), onClose: onClose, children: (children ??
90
+ filteredItems.length > 0)
91
91
  ? _jsx(TMDataGrid, { dataSource: filteredItems, keyExpr: keyName, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, searchPanelFocusStarting: true, headerFilter: { visible: true }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single', showCheckBoxesMode: 'always', selectAllMode: 'allPages' }, grouping: allowGrouping ? { autoExpandAll: false, expandMode: 'rowClick' } : undefined, summary: customSummary, onFocusedRowChanged: handleFocusedRowChange, onSelectionChanged: handleSelectionChanged, onRowDblClick: handleRowDoubleClick })
92
92
  : _jsx(TMLayoutContainer, { gap: 30, alignItems: 'center', justifyContent: 'center', children: _jsx(TMLayoutItem, { children: _jsx("p", { style: { height: "100%", color: TMColors.primaryColor, fontSize: "1.5rem", display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: SDKUI_Localizator.NoDataToDisplay }) }) }) }));
93
93
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.16.24",
3
+ "version": "6.16.26",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",