1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

fix: device count flag without variant (#8773)

This commit is contained in:
Tymoteusz Czech 2024-11-15 13:05:50 +01:00 committed by GitHub
parent 2ffff25a4a
commit 6d4e2e991f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 9 deletions

View File

@ -2,20 +2,13 @@ import type { FC } from 'react';
import { IconCell } from 'component/common/Table/cells/IconCell/IconCell'; import { IconCell } from 'component/common/Table/cells/IconCell/IconCell';
import WarningIcon from '@mui/icons-material/WarningAmber'; import WarningIcon from '@mui/icons-material/WarningAmber';
import { Tooltip } from '@mui/material'; import { Tooltip } from '@mui/material';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { useVariant } from 'hooks/useVariant';
type UserSessionsCellProps = { type UserSessionsCellProps = {
count?: number; count?: number;
}; };
export const UserSessionsCell: FC<UserSessionsCellProps> = ({ count }) => { export const UserSessionsCell: FC<UserSessionsCellProps> = ({ count }) => {
const { uiConfig } = useUiConfig(); if (!count || count < 5) {
const minimumCountToShow = useVariant<number>(
uiConfig.flags.showUserDeviceCount,
);
if (!count || count < (minimumCountToShow ? minimumCountToShow : 5)) {
return null; return null;
} }

View File

@ -93,7 +93,7 @@ export type UiFlags = {
'enterprise-payg'?: boolean; 'enterprise-payg'?: boolean;
simplifyProjectOverview?: boolean; simplifyProjectOverview?: boolean;
productivityReportEmail?: boolean; productivityReportEmail?: boolean;
showUserDeviceCount?: Variant; showUserDeviceCount?: boolean;
flagOverviewRedesign?: boolean; flagOverviewRedesign?: boolean;
}; };

View File

@ -18,6 +18,7 @@ export interface IUser {
addedAt?: string; addedAt?: string;
accountType?: AccountType; accountType?: AccountType;
scimId?: string; scimId?: string;
activeSessions?: number;
} }
export interface IPermission { export interface IPermission {