@topconsultnpm/sdkui-react-beta 6.11.27 → 6.11.28
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,8 +1,8 @@
|
|
|
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 { OwnershipLevels, SDK_Localizator, UserLevels, UserListCacheService
|
|
3
|
+
import { OwnershipLevels, SDK_Localizator, UserLevels, UserListCacheService } from '@topconsultnpm/sdk-ts-beta';
|
|
4
4
|
import { Column } from 'devextreme-react/cjs/data-grid';
|
|
5
|
-
import { SDKUI_Localizator, IconSearch, IconUserLevelMember, IconUserLevelAdministrator, IconUserLevelSystemAdministrator, IconUserLevelAutonomousAdministrator, IconWarning, LocalizeOwnershipLevels, LocalizeUserLevels
|
|
5
|
+
import { SDKUI_Localizator, IconSearch, IconUserLevelMember, IconUserLevelAdministrator, IconUserLevelSystemAdministrator, IconUserLevelAutonomousAdministrator, IconWarning, LocalizeOwnershipLevels, LocalizeUserLevels } from '../../helper';
|
|
6
6
|
import { StyledDivHorizontal, StyledTooltipContainer, StyledTooltipSeparatorItem } from '../base/Styled';
|
|
7
7
|
import TMSpinner from '../base/TMSpinner';
|
|
8
8
|
import TMTooltip from '../base/TMTooltip';
|
|
@@ -83,7 +83,7 @@ export const TMUserIcon = ({ ud }) => {
|
|
|
83
83
|
if (!ud)
|
|
84
84
|
return null;
|
|
85
85
|
let isExpired = User_IsExpired(ud);
|
|
86
|
-
let icon =
|
|
86
|
+
let icon = getUserIcon(ud.level, ud.ownershipLevel, isExpired);
|
|
87
87
|
return (_jsx(TMUserTooltip, { ud: ud, children: icon }));
|
|
88
88
|
};
|
|
89
89
|
export const TMUserTooltip = ({ ud, children }) => {
|
|
@@ -108,13 +108,6 @@ function User_IsExpired(d) {
|
|
|
108
108
|
const today = new Date();
|
|
109
109
|
return (ud.validFrom && today < ud.validFrom) || (ud.validTo && today > ud.validTo) || ud.disabled;
|
|
110
110
|
}
|
|
111
|
-
const getUserIconWithType = (userLevel, level, type, isExpired) => {
|
|
112
|
-
if (!type || type == UserTypes.TopMedia)
|
|
113
|
-
return (_jsxs(StyledDivHorizontal, { children: [getUserIcon(userLevel, level, isExpired), " ", _jsx(IconFactory, { fontSize: 16 })] }));
|
|
114
|
-
if (type && type == UserTypes.Windows)
|
|
115
|
-
return (_jsxs(StyledDivHorizontal, { children: [getUserIcon(userLevel, level, isExpired), " ", _jsx(IconWorkspace, { fontSize: 16 })] }));
|
|
116
|
-
return _jsx(_Fragment, {});
|
|
117
|
-
};
|
|
118
111
|
const getUserIcon = (userLevel, level, isExpired) => {
|
|
119
112
|
let ownershipColor = "";
|
|
120
113
|
if (isExpired)
|