From 6d4e2e991ffeb4d514d5759392084a43d2ccbf80 Mon Sep 17 00:00:00 2001 From: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:05:50 +0100 Subject: [PATCH] fix: device count flag without variant (#8773) --- .../UsersList/UserSessionsCell/UserSessionsCell.tsx | 9 +-------- frontend/src/interfaces/uiConfig.ts | 2 +- frontend/src/interfaces/user.ts | 1 + 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/frontend/src/component/admin/users/UsersList/UserSessionsCell/UserSessionsCell.tsx b/frontend/src/component/admin/users/UsersList/UserSessionsCell/UserSessionsCell.tsx index d146276160f0..d10570d6baa5 100644 --- a/frontend/src/component/admin/users/UsersList/UserSessionsCell/UserSessionsCell.tsx +++ b/frontend/src/component/admin/users/UsersList/UserSessionsCell/UserSessionsCell.tsx @@ -2,20 +2,13 @@ import type { FC } from 'react'; import { IconCell } from 'component/common/Table/cells/IconCell/IconCell'; import WarningIcon from '@mui/icons-material/WarningAmber'; import { Tooltip } from '@mui/material'; -import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; -import { useVariant } from 'hooks/useVariant'; type UserSessionsCellProps = { count?: number; }; export const UserSessionsCell: FC = ({ count }) => { - const { uiConfig } = useUiConfig(); - const minimumCountToShow = useVariant( - uiConfig.flags.showUserDeviceCount, - ); - - if (!count || count < (minimumCountToShow ? minimumCountToShow : 5)) { + if (!count || count < 5) { return null; } diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index f6c86fe14cab..965a667e34e1 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -93,7 +93,7 @@ export type UiFlags = { 'enterprise-payg'?: boolean; simplifyProjectOverview?: boolean; productivityReportEmail?: boolean; - showUserDeviceCount?: Variant; + showUserDeviceCount?: boolean; flagOverviewRedesign?: boolean; }; diff --git a/frontend/src/interfaces/user.ts b/frontend/src/interfaces/user.ts index 764717ffce57..9cdf4bfb87df 100644 --- a/frontend/src/interfaces/user.ts +++ b/frontend/src/interfaces/user.ts @@ -18,6 +18,7 @@ export interface IUser { addedAt?: string; accountType?: AccountType; scimId?: string; + activeSessions?: number; } export interface IPermission {