@topconsultnpm/sdkui-react 6.21.0-t2 → 6.21.0-t4
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/TMContextMenu.js +28 -2
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +4 -4
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +6 -6
- package/lib/components/base/Styled.d.ts +1 -1
- package/lib/components/base/TMAreaManager.js +11 -0
- 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/TMDataGrid.js +12 -2
- package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
- package/lib/components/base/TMDataGridExportForm.js +19 -8
- package/lib/components/base/TMFileManager.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.js +4 -4
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +3 -3
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +7 -0
- package/lib/components/base/TMFileManagerUtils.js +14 -1
- 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/TMModal.js +2 -2
- package/lib/components/base/TMPopUp.d.ts +1 -0
- package/lib/components/base/TMPopUp.js +59 -2
- package/lib/components/base/TMSpinner.d.ts +5 -2
- package/lib/components/base/TMSpinner.js +33 -6
- package/lib/components/base/TMTab.d.ts +4 -3
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +16 -13
- package/lib/components/base/TMTreeView.js +242 -79
- 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 +5 -2
- package/lib/components/base/TMWaitPanel.js +8 -6
- package/lib/components/choosers/TMDistinctValues.js +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.js +6 -1
- package/lib/components/choosers/TMGroupChooser.js +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.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 +6 -6
- package/lib/components/editors/TMFormulaEditor.d.ts +2 -1
- package/lib/components/editors/TMFormulaEditor.js +98 -49
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
- package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
- package/lib/components/editors/TMMetadataEditor.js +6 -2
- package/lib/components/editors/TMMetadataValues.js +23 -6
- package/lib/components/editors/TMTextBox.d.ts +1 -0
- package/lib/components/editors/TMTextBox.js +2 -1
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
- package/lib/components/features/blog/TMBlogCommentForm.js +5 -2
- package/lib/components/features/documents/TMCopyToFolderForm.js +46 -24
- package/lib/components/features/documents/TMDcmtForm.d.ts +2 -0
- package/lib/components/features/documents/TMDcmtForm.js +21 -10
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtIcon.d.ts +4 -1
- package/lib/components/features/documents/TMDcmtIcon.js +6 -33
- package/lib/components/features/documents/TMDcmtPreview.d.ts +1 -1
- 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 +1 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -2
- package/lib/components/features/documents/TMMasterDetailDcmts.js +55 -16
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +2 -3
- package/lib/components/features/documents/TMMergeToPdfForm.js +115 -56
- package/lib/components/features/documents/TMRelationViewer.d.ts +12 -10
- package/lib/components/features/documents/TMRelationViewer.js +405 -95
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +4 -16
- package/lib/components/features/documents/copyAndMergeDcmtsShared.js +47 -61
- package/lib/components/features/documents/mergePdfUtils.d.ts +52 -0
- package/lib/components/features/documents/mergePdfUtils.js +268 -0
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +18 -0
- package/lib/components/features/search/TMMetadataOutputForm.js +225 -0
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +18 -0
- package/lib/components/features/search/TMMetadataSorterForm.js +243 -0
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.d.ts +2 -2
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryEditor.js +14 -8
- package/lib/components/features/search/TMSearchQueryPanel.js +249 -58
- package/lib/components/features/search/TMSearchResult.d.ts +3 -2
- package/lib/components/features/search/TMSearchResult.js +94 -25
- 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/TMViewHistoryDcmt.d.ts +2 -1
- package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
- package/lib/components/features/search/metadataFormHelper.d.ts +16 -0
- package/lib/components/features/search/metadataFormHelper.js +77 -0
- 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/wg/TMWGsCopyMoveForm.d.ts +3 -2
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +8 -7
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/Login/TMLoginForm.js +15 -3
- package/lib/components/forms/TMChooserForm.d.ts +2 -1
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
- package/lib/components/grids/TMBlogAttachments.js +2 -2
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.js +5 -3
- package/lib/components/grids/TMBlogsPostUtils.d.ts +10 -9
- package/lib/components/grids/TMBlogsPostUtils.js +3 -1
- package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
- 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 +1 -1
- 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/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
- package/lib/components/sidebar/TMHeader.d.ts +3 -3
- 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/components/viewers/TMTidViewer.js +14 -2
- package/lib/components/wizard/TMWizard.d.ts +1 -0
- package/lib/components/wizard/TMWizard.js +5 -3
- package/lib/helper/Enum_Localizator.js +2 -0
- package/lib/helper/MergePdfManager.d.ts +45 -0
- package/lib/helper/MergePdfManager.js +148 -0
- package/lib/helper/SDKUI_Globals.d.ts +1 -0
- package/lib/helper/SDKUI_Globals.js +3 -1
- package/lib/helper/SDKUI_Localizator.d.ts +40 -0
- package/lib/helper/SDKUI_Localizator.js +412 -12
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +278 -278
- package/lib/helper/TMPdfViewer.d.ts +2 -1
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +57 -21
- package/lib/helper/TMUtils.js +159 -1
- package/lib/helper/certificateImportHelper.d.ts +43 -0
- package/lib/helper/certificateImportHelper.js +403 -0
- package/lib/helper/checkinCheckoutManager.d.ts +4 -3
- package/lib/helper/checkinCheckoutManager.js +29 -11
- package/lib/helper/helpers.d.ts +3 -2
- package/lib/helper/helpers.js +10 -0
- 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 +1 -1
- package/lib/hooks/useDcmtOperations.d.ts +20 -2
- package/lib/hooks/useDcmtOperations.js +244 -25
- package/lib/hooks/useDocumentOperations.d.ts +2 -2
- package/lib/hooks/useDocumentOperations.js +52 -13
- package/lib/hooks/useInputDialog.d.ts +2 -1
- package/lib/hooks/useRelatedDocuments.js +4 -4
- package/lib/services/platform_services.d.ts +7 -6
- package/lib/ts/types.d.ts +3 -1
- package/lib/ts/types.js +2 -0
- package/package.json +15 -7
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
interface TMPdfViewerProps {
|
|
2
3
|
pdfBlob: Blob;
|
|
3
4
|
title?: string;
|
|
4
5
|
isResizingActive?: boolean;
|
|
5
6
|
enableFitToWidth?: boolean;
|
|
6
7
|
}
|
|
7
|
-
declare const TMPdfViewer: (props: TMPdfViewerProps) =>
|
|
8
|
+
declare const TMPdfViewer: (props: TMPdfViewerProps) => React.JSX.Element;
|
|
8
9
|
export default TMPdfViewer;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
interface TMToppyMessageProps {
|
|
3
3
|
message: ReactNode;
|
|
4
4
|
titleTooltip?: string;
|
|
5
5
|
maxWidth?: string;
|
|
6
6
|
}
|
|
7
|
-
declare const TMToppyMessage: (props: TMToppyMessageProps) =>
|
|
7
|
+
declare const TMToppyMessage: (props: TMToppyMessageProps) => React.JSX.Element;
|
|
8
8
|
export default TMToppyMessage;
|
package/lib/helper/TMUtils.d.ts
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FileItem } from '../components';
|
|
3
|
-
import { AppModules, DataColumnDescriptor, DcmtTypeDescriptor, PdGs, SearchResultDescriptor } from '@topconsultnpm/sdk-ts';
|
|
4
|
-
|
|
3
|
+
import { AppModules, DataColumnDescriptor, DcmtTypeDescriptor, MetadataDescriptor, PdGs, SearchResultDescriptor } from '@topconsultnpm/sdk-ts';
|
|
4
|
+
/**
|
|
5
|
+
* Estensioni di firma/marca temporale note che possono avvolgere altre estensioni.
|
|
6
|
+
* Es: file.pdf.p7m, file.xml.p7m, file.docx.p7m, file.xml.p7m.ts
|
|
7
|
+
*/
|
|
8
|
+
export declare const SIGNATURE_EXTENSIONS: Set<string>;
|
|
9
|
+
/**
|
|
10
|
+
* Estrae l'estensione completa da un nome file, gestendo estensioni composite
|
|
11
|
+
* a più livelli come .PDF.P7M, .XML.P7M.TS, etc.
|
|
12
|
+
*
|
|
13
|
+
* Esempi:
|
|
14
|
+
* - "documento.pdf" -> ".pdf"
|
|
15
|
+
* - "DCMT_123.PDF.P7M" -> ".PDF.P7M"
|
|
16
|
+
* - "fattura.xml.p7m" -> ".xml.p7m"
|
|
17
|
+
* - "example.XML.P7M.TS" -> ".XML.P7M.TS"
|
|
18
|
+
* - "file.tar.gz" -> ".gz" (tar.gz non è gestito come firma)
|
|
19
|
+
* - "file" -> ""
|
|
20
|
+
*/
|
|
21
|
+
export declare const getFullFileExtension: (fileName: string, depth?: number) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Estrae l'estensione base da un'estensione che può includere firme digitali.
|
|
24
|
+
* Es: pdf.p7m.tsd → pdf, pdf.p7m → pdf, pdf → pdf
|
|
25
|
+
*/
|
|
26
|
+
export declare const getBaseExtension: (ext: string) => string;
|
|
27
|
+
export declare const getFileIcon: (fileExtension: string | undefined, fileCount: number | undefined, tooltipContent?: JSX.Element | string) => React.JSX.Element;
|
|
5
28
|
export declare function formatBytes(bytes: number | undefined, decimalPlaces?: number): string;
|
|
6
29
|
export interface RowData {
|
|
7
30
|
[key: string]: string | number | null;
|
|
@@ -53,24 +76,37 @@ type DcmtFormToolbarVisibility = {
|
|
|
53
76
|
tmDcmtTasks: boolean;
|
|
54
77
|
};
|
|
55
78
|
export declare const getDcmtFormToolbarVisibility: (appModuleID: AppModules) => DcmtFormToolbarVisibility;
|
|
56
|
-
export type MergePdfManagerType = {
|
|
57
|
-
merge: (files: File[], options?: {
|
|
58
|
-
onProgress?: (current: number, total: number, file: File) => void;
|
|
59
|
-
}) => Promise<{
|
|
60
|
-
bytes: Uint8Array;
|
|
61
|
-
blob: Blob;
|
|
62
|
-
pageCount: number;
|
|
63
|
-
}>;
|
|
64
|
-
mergeToFile: (files: File[], fileName?: string, options?: {
|
|
65
|
-
onProgress?: (current: number, total: number, file: File) => void;
|
|
66
|
-
}) => Promise<File>;
|
|
67
|
-
mergeAndDownload: (files: File[], fileName?: string, options?: {
|
|
68
|
-
onProgress?: (current: number, total: number, file: File) => void;
|
|
69
|
-
}) => Promise<{
|
|
70
|
-
bytes: Uint8Array;
|
|
71
|
-
blob: Blob;
|
|
72
|
-
pageCount: number;
|
|
73
|
-
}>;
|
|
74
|
-
};
|
|
75
79
|
export declare const isConvertibleToPdfExt: (ext: string | undefined | null) => boolean;
|
|
80
|
+
/** Valore metadato con descrittore (da searchResultToDataSource) */
|
|
81
|
+
export interface DcmtMetadataValue {
|
|
82
|
+
md?: MetadataDescriptor;
|
|
83
|
+
value: any;
|
|
84
|
+
}
|
|
85
|
+
/** Documento con metadati indicizzati per nome */
|
|
86
|
+
export interface DcmtMetadataMap {
|
|
87
|
+
[key: string]: DcmtMetadataValue;
|
|
88
|
+
rowIndex?: any;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Restituisce le chiavi dei metadati da visualizzare come descrizione documento.
|
|
92
|
+
* Priorità: 1) SYS_Abstract 2) isSpecialSearchOutput=true 3) primi 5 metadati non di sistema
|
|
93
|
+
*/
|
|
94
|
+
export declare const buildDcmtDisplayName: (obj: DcmtMetadataMap | null | undefined) => Array<string>;
|
|
95
|
+
/** Metodo utilizzato per determinare i metadati da visualizzare come descrizione documento */
|
|
96
|
+
export declare enum DcmtDisplayNameMethod {
|
|
97
|
+
/** Nessun metadato disponibile */
|
|
98
|
+
None = "None",
|
|
99
|
+
/** Campo SYS_Abstract presente */
|
|
100
|
+
SysAbstract = "SysAbstract",
|
|
101
|
+
/** Metadati con isSpecialSearchOutput = true */
|
|
102
|
+
SpecialSearchOutput = "SpecialSearchOutput",
|
|
103
|
+
/** Primi 5 metadati non di sistema con permesso canView */
|
|
104
|
+
FirstViewableMetadata = "FirstViewableMetadata"
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Analizza un DcmtTypeDescriptor e restituisce la stringa descrittiva del metodo di visualizzazione.
|
|
108
|
+
* Priorità: 1) SYS_Abstract 2) isSpecialSearchOutput=true 3) primi 5 metadati non di sistema (default)
|
|
109
|
+
* Se i metadati non sono presenti nel dtd, li recupera dalla cache.
|
|
110
|
+
*/
|
|
111
|
+
export declare const getDTDDisplayNameInfo: (dtd: DcmtTypeDescriptor | undefined) => Promise<string>;
|
|
76
112
|
export {};
|
package/lib/helper/TMUtils.js
CHANGED
|
@@ -2,8 +2,63 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { TMTooltip } from '../components';
|
|
4
4
|
import { IconCADossier, IconKey, IconMenuCAWorkingGroups } from './TMIcons';
|
|
5
|
-
import { AppModules, DataListCacheService, LicenseModuleStatus, MetadataDataDomains, PdGs, SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
5
|
+
import { AccessLevels, AppModules, DataListCacheService, DcmtTypeListCacheService, LicenseModuleStatus, MetadataDataDomains, PdGs, SDK_Globals, SystemMIDs } from '@topconsultnpm/sdk-ts';
|
|
6
6
|
import { SDKUI_Localizator } from './SDKUI_Localizator';
|
|
7
|
+
/**
|
|
8
|
+
* Estensioni di firma/marca temporale note che possono avvolgere altre estensioni.
|
|
9
|
+
* Es: file.pdf.p7m, file.xml.p7m, file.docx.p7m, file.xml.p7m.ts
|
|
10
|
+
*/
|
|
11
|
+
export const SIGNATURE_EXTENSIONS = new Set(['p7m', 'p7s', 'm7m', 'tsd', 'tsr', 'ts']);
|
|
12
|
+
/** Profondità massima di ricorsione per la ricerca di estensioni composite */
|
|
13
|
+
const MAX_EXTENSION_DEPTH = 5;
|
|
14
|
+
/**
|
|
15
|
+
* Estrae l'estensione completa da un nome file, gestendo estensioni composite
|
|
16
|
+
* a più livelli come .PDF.P7M, .XML.P7M.TS, etc.
|
|
17
|
+
*
|
|
18
|
+
* Esempi:
|
|
19
|
+
* - "documento.pdf" -> ".pdf"
|
|
20
|
+
* - "DCMT_123.PDF.P7M" -> ".PDF.P7M"
|
|
21
|
+
* - "fattura.xml.p7m" -> ".xml.p7m"
|
|
22
|
+
* - "example.XML.P7M.TS" -> ".XML.P7M.TS"
|
|
23
|
+
* - "file.tar.gz" -> ".gz" (tar.gz non è gestito come firma)
|
|
24
|
+
* - "file" -> ""
|
|
25
|
+
*/
|
|
26
|
+
export const getFullFileExtension = (fileName, depth = 0) => {
|
|
27
|
+
if (!fileName || depth > MAX_EXTENSION_DEPTH)
|
|
28
|
+
return '';
|
|
29
|
+
const lastDotIndex = fileName.lastIndexOf('.');
|
|
30
|
+
if (lastDotIndex <= 0)
|
|
31
|
+
return '';
|
|
32
|
+
const lastExtension = fileName.substring(lastDotIndex + 1).toLowerCase();
|
|
33
|
+
// Se l'ultima estensione è una firma/marca, cerca ricorsivamente le estensioni precedenti
|
|
34
|
+
if (SIGNATURE_EXTENSIONS.has(lastExtension)) {
|
|
35
|
+
const nameWithoutLastExt = fileName.substring(0, lastDotIndex);
|
|
36
|
+
const innerExtension = getFullFileExtension(nameWithoutLastExt, depth + 1);
|
|
37
|
+
if (innerExtension) {
|
|
38
|
+
// Concatena l'estensione interna con quella corrente
|
|
39
|
+
return innerExtension + fileName.substring(lastDotIndex);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// Estensione singola (o estensione base dopo le firme)
|
|
43
|
+
return fileName.substring(lastDotIndex);
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Estrae l'estensione base da un'estensione che può includere firme digitali.
|
|
47
|
+
* Es: pdf.p7m.tsd → pdf, pdf.p7m → pdf, pdf → pdf
|
|
48
|
+
*/
|
|
49
|
+
export const getBaseExtension = (ext) => {
|
|
50
|
+
if (!ext)
|
|
51
|
+
return '';
|
|
52
|
+
const parts = ext.toLowerCase().split('.');
|
|
53
|
+
// Trova la prima parte che non è un'estensione di firma
|
|
54
|
+
for (const part of parts) {
|
|
55
|
+
if (!SIGNATURE_EXTENSIONS.has(part)) {
|
|
56
|
+
return part;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Se tutte sono firme, ritorna la prima
|
|
60
|
+
return parts[0] || '';
|
|
61
|
+
};
|
|
7
62
|
const StyledIconFileContainer = styled.div `
|
|
8
63
|
height: 22px;
|
|
9
64
|
width: 18px;
|
|
@@ -375,3 +430,106 @@ export const isConvertibleToPdfExt = (ext) => {
|
|
|
375
430
|
'eml', 'msg'
|
|
376
431
|
].includes(normalized);
|
|
377
432
|
};
|
|
433
|
+
/**
|
|
434
|
+
* Restituisce le chiavi dei metadati da visualizzare come descrizione documento.
|
|
435
|
+
* Priorità: 1) SYS_Abstract 2) isSpecialSearchOutput=true 3) primi 5 metadati non di sistema
|
|
436
|
+
*/
|
|
437
|
+
export const buildDcmtDisplayName = (obj) => {
|
|
438
|
+
try {
|
|
439
|
+
if (!obj)
|
|
440
|
+
return [];
|
|
441
|
+
const sysAbstractKey = Object.keys(obj).find(k => k.toUpperCase() === 'SYS_ABSTRACT');
|
|
442
|
+
if (sysAbstractKey) {
|
|
443
|
+
if (obj[sysAbstractKey]?.value) {
|
|
444
|
+
return [sysAbstractKey];
|
|
445
|
+
}
|
|
446
|
+
// SYS_Abstract esiste ma è vuoto: usa DID se presente, altrimenti continua con la logica standard
|
|
447
|
+
const didKey = Object.keys(obj).find(k => k.toUpperCase() === 'DID');
|
|
448
|
+
if (didKey && obj[didKey]?.value) {
|
|
449
|
+
return [didKey];
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
const keys = Object.keys(obj);
|
|
453
|
+
const sysMIDs = Object.values(SystemMIDs).map(o => o.toUpperCase());
|
|
454
|
+
const viewableMetadataKeys = keys.filter(k => obj?.[k]?.value &&
|
|
455
|
+
obj?.[k]?.md?.perm?.canView === AccessLevels.Yes &&
|
|
456
|
+
!sysMIDs.includes(k.toUpperCase()) &&
|
|
457
|
+
k !== "rowIndex" &&
|
|
458
|
+
k !== "ISLEXPROT");
|
|
459
|
+
// Metadati con isSpecialSearchOutput = true
|
|
460
|
+
const specialOutputKeys = viewableMetadataKeys.filter(k => obj?.[k]?.md?.isSpecialSearchOutput === true);
|
|
461
|
+
if (specialOutputKeys.length > 0) {
|
|
462
|
+
return specialOutputKeys;
|
|
463
|
+
}
|
|
464
|
+
if (viewableMetadataKeys.length > 0) {
|
|
465
|
+
return viewableMetadataKeys.slice(0, 5);
|
|
466
|
+
}
|
|
467
|
+
// Fallback: se tutti i metadati personalizzati sono vuoti, usa DID
|
|
468
|
+
const didKey = Object.keys(obj).find(k => k.toUpperCase() === 'DID');
|
|
469
|
+
if (didKey && obj[didKey]?.value) {
|
|
470
|
+
return [didKey];
|
|
471
|
+
}
|
|
472
|
+
return [];
|
|
473
|
+
}
|
|
474
|
+
catch (error) {
|
|
475
|
+
console.error('buildDcmtDisplayName error:', error);
|
|
476
|
+
return [];
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
/** Metodo utilizzato per determinare i metadati da visualizzare come descrizione documento */
|
|
480
|
+
export var DcmtDisplayNameMethod;
|
|
481
|
+
(function (DcmtDisplayNameMethod) {
|
|
482
|
+
/** Nessun metadato disponibile */
|
|
483
|
+
DcmtDisplayNameMethod["None"] = "None";
|
|
484
|
+
/** Campo SYS_Abstract presente */
|
|
485
|
+
DcmtDisplayNameMethod["SysAbstract"] = "SysAbstract";
|
|
486
|
+
/** Metadati con isSpecialSearchOutput = true */
|
|
487
|
+
DcmtDisplayNameMethod["SpecialSearchOutput"] = "SpecialSearchOutput";
|
|
488
|
+
/** Primi 5 metadati non di sistema con permesso canView */
|
|
489
|
+
DcmtDisplayNameMethod["FirstViewableMetadata"] = "FirstViewableMetadata";
|
|
490
|
+
})(DcmtDisplayNameMethod || (DcmtDisplayNameMethod = {}));
|
|
491
|
+
/**
|
|
492
|
+
* Analizza un DcmtTypeDescriptor e restituisce la stringa descrittiva del metodo di visualizzazione.
|
|
493
|
+
* Priorità: 1) SYS_Abstract 2) isSpecialSearchOutput=true 3) primi 5 metadati non di sistema (default)
|
|
494
|
+
* Se i metadati non sono presenti nel dtd, li recupera dalla cache.
|
|
495
|
+
*/
|
|
496
|
+
export const getDTDDisplayNameInfo = async (dtd) => {
|
|
497
|
+
try {
|
|
498
|
+
if (!dtd) {
|
|
499
|
+
return SDKUI_Localizator.DisplayNameMethod_Top5;
|
|
500
|
+
}
|
|
501
|
+
// Recupera i metadati dalla cache se non presenti nel dtd
|
|
502
|
+
let metadata = dtd.metadata;
|
|
503
|
+
if (!metadata || metadata.length === 0) {
|
|
504
|
+
const cachedDtd = await DcmtTypeListCacheService.GetAsync(dtd.id);
|
|
505
|
+
metadata = cachedDtd?.metadata;
|
|
506
|
+
}
|
|
507
|
+
if (!metadata || metadata.length === 0) {
|
|
508
|
+
return SDKUI_Localizator.DisplayNameMethod_Top5;
|
|
509
|
+
}
|
|
510
|
+
const sysMIDs = Object.values(SystemMIDs).map(o => o.toUpperCase());
|
|
511
|
+
// 1) Cerca SYS_Abstract
|
|
512
|
+
const sysAbstract = metadata.find(md => md.name?.toUpperCase() === 'SYS_ABSTRACT');
|
|
513
|
+
if (sysAbstract) {
|
|
514
|
+
return SDKUI_Localizator.DisplayNameMethod_Abstract;
|
|
515
|
+
}
|
|
516
|
+
// Filtra metadati non di sistema con permesso canView
|
|
517
|
+
const viewableMetadata = metadata.filter(md => md.perm?.canView === AccessLevels.Yes &&
|
|
518
|
+
md.name &&
|
|
519
|
+
!sysMIDs.includes(md.name.toUpperCase()));
|
|
520
|
+
// 2) Cerca metadati con isSpecialSearchOutput = true
|
|
521
|
+
const specialOutputMetadata = viewableMetadata.filter(md => md.isSpecialSearchOutput === true);
|
|
522
|
+
if (specialOutputMetadata.length > 0) {
|
|
523
|
+
const metadataNames = specialOutputMetadata.map(md => md.nameLoc || md.name).filter(Boolean).join(', ');
|
|
524
|
+
const maxLength = 50;
|
|
525
|
+
const truncatedNames = metadataNames.length > maxLength ? metadataNames.substring(0, maxLength) + '...' : metadataNames;
|
|
526
|
+
return `${SDKUI_Localizator.Search_Special} (${truncatedNames})`;
|
|
527
|
+
}
|
|
528
|
+
// 3) Default: primi 5 metadati non di sistema
|
|
529
|
+
return SDKUI_Localizator.DisplayNameMethod_Top5;
|
|
530
|
+
}
|
|
531
|
+
catch (error) {
|
|
532
|
+
console.error('getDTDDisplayNameInfo error:', error);
|
|
533
|
+
return SDKUI_Localizator.DisplayNameMethod_Top5;
|
|
534
|
+
}
|
|
535
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ResultTypes } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { DcmtInfo } from '../ts';
|
|
3
|
+
export declare const S4T_USER_REGISTRY_MASTER: string;
|
|
4
|
+
export declare const S4T_CERTIFICATE_REGISTRY_DETAIL: string;
|
|
5
|
+
export interface IntesiCertificateData {
|
|
6
|
+
cid?: number;
|
|
7
|
+
alias?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
description?: any;
|
|
10
|
+
domain?: string;
|
|
11
|
+
providerName?: string;
|
|
12
|
+
providerDescription?: string;
|
|
13
|
+
loginAuth?: number;
|
|
14
|
+
creationDate?: any;
|
|
15
|
+
validFrom?: any;
|
|
16
|
+
validTo?: any;
|
|
17
|
+
certificateStatus?: any;
|
|
18
|
+
revokeDate?: any;
|
|
19
|
+
}
|
|
20
|
+
interface ImportResultInfo {
|
|
21
|
+
rowIndex: number;
|
|
22
|
+
id1: number;
|
|
23
|
+
id2: number;
|
|
24
|
+
resultType: typeof ResultTypes[keyof typeof ResultTypes];
|
|
25
|
+
description?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Importa i certificati remoti per il documento corrente.
|
|
29
|
+
* Verifica se esistono già certificati nel sistema e li aggiorna o crea nuovi.
|
|
30
|
+
* Aggiorna il documento master con i metadati di elaborazione.
|
|
31
|
+
*
|
|
32
|
+
* @returns Array di ImportResultInfo con eventuali warning, o undefined se tutto ok
|
|
33
|
+
*/
|
|
34
|
+
export declare const importCertificatesAsync: (inputDcmt: DcmtInfo, rowIndex: number, fetchRemoteCertificates: ((email: string) => Promise<Array<IntesiCertificateData>>) | undefined, abortSignal?: AbortSignal) => Promise<ImportResultInfo[] | undefined>;
|
|
35
|
+
export declare const archiveUserRegistryDocument: (abortSignal: AbortSignal, params: {
|
|
36
|
+
email: string;
|
|
37
|
+
fiscalCode: string;
|
|
38
|
+
phoneNumber: string;
|
|
39
|
+
name: string;
|
|
40
|
+
surname: string;
|
|
41
|
+
type: string;
|
|
42
|
+
}) => Promise<void>;
|
|
43
|
+
export {};
|