@topconsultnpm/sdkui-react 6.19.0-dev1.5 → 6.19.0-dev1.7
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,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { AccessLevels, AccessLevelsEx, AppModules, FileFormats, LayoutModes, SDK_Globals, DcmtTypeListCacheService, LicenseModuleStatus } from '@topconsultnpm/sdk-ts';
|
|
3
|
-
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconInfo, IconMenuCAArchive, IconPlatform, IconPreview, IconRelation, IconSearch, IconShow, IconStar, IconSubstFile, IconUndo, IconUserGroupOutline, SDKUI_Localizator, svgToString, searchResultToMetadataValues, IconSignaturePencil, IconArchiveMaster, IconArchiveDetail, IconDetailDcmts } from '../../../helper';
|
|
3
|
+
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconInfo, IconMenuCAArchive, IconPlatform, IconPreview, IconRelation, IconSearch, IconShow, IconStar, IconSubstFile, IconUndo, IconUserGroupOutline, SDKUI_Localizator, svgToString, searchResultToMetadataValues, IconSignaturePencil, IconArchiveMaster, IconArchiveDetail, IconDetailDcmts, isPdfEditorEnabled } from '../../../helper';
|
|
4
4
|
import ShowAlert from '../../base/TMAlert';
|
|
5
5
|
import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
6
6
|
import TMSpinner from '../../base/TMSpinner';
|
|
@@ -75,14 +75,6 @@ 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
|
-
};
|
|
86
78
|
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, hasMasterRelation, hasDetailRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToManyDocuments) => {
|
|
87
79
|
const isPdfEditorLicensed = SDK_Globals?.license?.dcmtArchiveLicenses?.[0]?.siX_60007?.status === LicenseModuleStatus.Licensed;
|
|
88
80
|
let pdfEditorAvailable = false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
|
-
import { IconDcmtType, IconDcmtTypeOnlyMetadata, IconLocked, IconView, LocalizeArchiveConstraints, LocalizeParametricFilterTypes, SDKUI_Localizator, TMImageLibrary } from '../../helper';
|
|
3
|
+
import { IconDcmtType, IconDcmtTypeOnlyMetadata, IconLocked, IconView, isCreateCertificateEnabled, isPdfEditorEnabled, isSign4TopEnabled, LocalizeArchiveConstraints, LocalizeParametricFilterTypes, SDKUI_Localizator, TMImageLibrary } from '../../helper';
|
|
4
4
|
import { ArchiveConstraints, DcmtTypeListCacheService, OwnershipLevels, ParametricFilterTypes, SDK_Globals, SDK_Localizator, TemplateTIDs } from '@topconsultnpm/sdk-ts';
|
|
5
5
|
import TMSpinner from '../base/TMSpinner';
|
|
6
6
|
import { StyledDivHorizontal, StyledTooltipContainer, StyledTooltipItem, StyledTooltipSeparatorItem } from '../base/Styled';
|
|
@@ -314,5 +314,5 @@ export const renderDTDTooltipContent = (dtd) => {
|
|
|
314
314
|
_jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${dtd.perm.canArchive}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${dtd.perm.canView}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${dtd.perm.canSearch}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${dtd.perm.canUpdate}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${dtd.perm.canRetrieveFile}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${dtd.perm.canSubstFile}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${dtd.perm.canLogicalDelete}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${dtd.perm.canPhysicalDelete}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${dtd.perm.canReadBlog}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${dtd.perm.canWriteBlog}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${dtd.perm.canCICO}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${dtd.perm.canDelChron}` })] })
|
|
315
315
|
: dtd.ownershipLevel == OwnershipLevels.DirectOwner || dtd.ownershipLevel == OwnershipLevels.IndirectOwner ?
|
|
316
316
|
_jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${SDKUI_Localizator.Yes}` })] })
|
|
317
|
-
: _jsx(_Fragment, {})] })] }));
|
|
317
|
+
: _jsx(_Fragment, {}), (dtd.widgets && dtd.widgets.length > 0) ? _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: "Widgets" }), _jsx(StyledTooltipSeparatorItem, {}), _jsxs(StyledTooltipItem, { children: ["Sign4 Top: ", isSign4TopEnabled(dtd.widgets) ? SDKUI_Localizator.Yes : SDKUI_Localizator.No] }), _jsxs(StyledTooltipItem, { children: ["Create Certificate: ", isCreateCertificateEnabled(dtd.widgets) ? SDKUI_Localizator.Yes : SDKUI_Localizator.No] }), _jsxs(StyledTooltipItem, { children: ["PDF Editor: ", isPdfEditorEnabled(dtd.widgets) ? SDKUI_Localizator.Yes : SDKUI_Localizator.No] })] }) : (_jsxs(_Fragment, { children: [_jsx(StyledTooltipSeparatorItem, {}), _jsxs(StyledTooltipItem, { children: ["Widgets: ", SDKUI_Localizator.No] })] }))] })] }));
|
|
318
318
|
};
|
package/lib/helper/TMUtils.d.ts
CHANGED
|
@@ -11,3 +11,10 @@ export declare const buildValueToLabelMapFromDataColumns: (columns: Array<DataCo
|
|
|
11
11
|
}>;
|
|
12
12
|
export declare const getAvatarColor: (name: string) => string;
|
|
13
13
|
export declare const extractInitialsFromName: (name: string) => string;
|
|
14
|
+
export declare const SIGN4_TOP_WIDGET_ID = "60003";
|
|
15
|
+
export declare const CREATE_CERTIFICATE_WIDGET_ID = "60003_1";
|
|
16
|
+
export declare const PDF_EDITOR_ID = "60007";
|
|
17
|
+
export declare const isWidgetEnabled: (widgetId: string, widgetsString: string) => boolean;
|
|
18
|
+
export declare const isSign4TopEnabled: (widgetsString: string) => boolean;
|
|
19
|
+
export declare const isCreateCertificateEnabled: (widgetsString: string) => boolean;
|
|
20
|
+
export declare const isPdfEditorEnabled: (widgetsString: string) => boolean;
|
package/lib/helper/TMUtils.js
CHANGED
|
@@ -158,3 +158,19 @@ export const extractInitialsFromName = (name) => {
|
|
|
158
158
|
}
|
|
159
159
|
return lettersOnly.substring(0, 2).toUpperCase();
|
|
160
160
|
};
|
|
161
|
+
export const SIGN4_TOP_WIDGET_ID = "60003";
|
|
162
|
+
export const CREATE_CERTIFICATE_WIDGET_ID = "60003_1";
|
|
163
|
+
export const PDF_EDITOR_ID = "60007";
|
|
164
|
+
export const isWidgetEnabled = (widgetId, widgetsString) => {
|
|
165
|
+
const widgets = widgetsString.split(";").filter(Boolean);
|
|
166
|
+
return widgets.includes(widgetId);
|
|
167
|
+
};
|
|
168
|
+
export const isSign4TopEnabled = (widgetsString) => {
|
|
169
|
+
return isWidgetEnabled(SIGN4_TOP_WIDGET_ID, widgetsString);
|
|
170
|
+
};
|
|
171
|
+
export const isCreateCertificateEnabled = (widgetsString) => {
|
|
172
|
+
return isWidgetEnabled(CREATE_CERTIFICATE_WIDGET_ID, widgetsString);
|
|
173
|
+
};
|
|
174
|
+
export const isPdfEditorEnabled = (widgetsString) => {
|
|
175
|
+
return isWidgetEnabled(PDF_EDITOR_ID, widgetsString);
|
|
176
|
+
};
|