@topconsultnpm/sdkui-react 6.22.0-dev4.13 → 6.22.0-dev4.14
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.
|
@@ -113,13 +113,13 @@ const getCompleteUserName = (domain, name) => {
|
|
|
113
113
|
return name;
|
|
114
114
|
return domain + "\\" + name;
|
|
115
115
|
};
|
|
116
|
-
|
|
116
|
+
export const User_IsExpired = (d) => {
|
|
117
117
|
if (d == undefined)
|
|
118
118
|
return false;
|
|
119
|
-
|
|
119
|
+
const ud = d;
|
|
120
120
|
const today = new Date();
|
|
121
121
|
return (ud.validFrom && today < ud.validFrom) || (ud.validTo && today > ud.validTo) || ud.disabled;
|
|
122
|
-
}
|
|
122
|
+
};
|
|
123
123
|
const getUserIcon = (userLevel, level, isExpired) => {
|
|
124
124
|
let ownershipColor = "";
|
|
125
125
|
if (isExpired)
|
|
@@ -16,6 +16,7 @@ import { DeviceType, useDeviceType } from "../base/TMDeviceProvider";
|
|
|
16
16
|
import { TMResultManager } from "../forms/TMResultDialog";
|
|
17
17
|
import TMWaitPanelManager from "../base/waitPanel/TMWaitPanelManager";
|
|
18
18
|
import TMToolbarCard from "../base/TMToolbarCard";
|
|
19
|
+
import { User_IsExpired } from "../choosers/TMUserChooser";
|
|
19
20
|
const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastRefreshTime, objType, listInsteadOfContent, detailInsteadOfContent, routePage, customButtons, customColumns, searchText, detailForm, detailTitlePathKeys, deps, onSelectionChanged, onCountersChanged }) => {
|
|
20
21
|
const deviceType = useDeviceType();
|
|
21
22
|
let gridInstance;
|
|
@@ -219,8 +220,8 @@ const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastR
|
|
|
219
220
|
setSelectedItems([row.data]);
|
|
220
221
|
setShowList(false);
|
|
221
222
|
}, showColumnLines: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.showColumnLines) === 1, showRowLines: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.showRowLines) === 1, onSelectionChanged: (e) => { setSelectedItems(e.selectedRowsData); onSelectionChanged?.(e.selectedRowsData); }, onRowPrepared: (e) => {
|
|
222
|
-
// Gli utenti disabilitati vengono visualizzati con il testo barrato
|
|
223
|
-
if (objClass == ObjectClasses.User && e.rowType === 'data' && e.data
|
|
223
|
+
// Gli utenti disabilitati o fuori dal periodo di validità (validFrom/validTo) vengono visualizzati con il testo barrato
|
|
224
|
+
if (objClass == ObjectClasses.User && e.rowType === 'data' && User_IsExpired(e.data))
|
|
224
225
|
e.rowElement.style.textDecoration = 'line-through';
|
|
225
226
|
}, children: [_jsx(GroupPanel, { visible: !!(deviceType !== DeviceType.MOBILE && showAllColumns) }), _jsx(SearchPanel, { visible: false }), _jsx(Grouping, { autoExpandAll: false }), _jsx(HeaderFilter, { visible: true }), _jsx(Selection, { mode: "multiple", showCheckBoxesMode: "onClick", selectAllMode: 'allPages' }), _jsx(Scrolling, { mode: "standard", useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 }), _jsx(Paging, { pageSize: 25 }), _jsx(Pager, { visible: true, showInfo: true, showNavigationButtons: true }), _jsx(LoadPanel, { enabled: true }), _jsx(Column, { width: 20, cellRender: cellRenderObjectIcon }), _jsx(Column, { width: 'auto', visible: showId, dataField: "id", caption: "ID" }), _jsx(Column, { width: 250, dataField: "name", caption: SDKUI_Localizator.Name, sortOrder: "asc" }), objClass == ObjectClasses.User ?
|
|
226
227
|
_jsxs(_Fragment, { children: [_jsx(Column, { width: 'auto', dataField: "type", caption: SDKUI_Localizator.Type }), _jsx(Column, { width: 'auto', dataField: "fn", caption: SDKUI_Localizator.User_FirstName }), _jsx(Column, { width: 'auto', dataField: "ln", caption: SDKUI_Localizator.User_LastName })] })
|