Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Device Management version info at table and contextual bar #29606

Merged
merged 10 commits into from
Jul 3, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type DeviceRowProps = {
deviceType?: string;
deviceOSName?: string;
loginAt: string;
rcVersion?: string;
onReload: () => void;
};

Expand All @@ -28,6 +29,7 @@ const DeviceManagementAdminRow = ({
deviceType = 'browser',
deviceOSName = '',
loginAt,
rcVersion,
onReload,
}: DeviceRowProps): ReactElement => {
const t = useTranslation();
Expand Down Expand Up @@ -69,6 +71,7 @@ const DeviceManagementAdminRow = ({
{deviceName && <Box withTruncatedText>{deviceName}</Box>}
</Box>
</GenericTableCell>
<GenericTableCell>{rcVersion}</GenericTableCell>
<GenericTableCell>{deviceOSName}</GenericTableCell>
<GenericTableCell withTruncatedText>{username}</GenericTableCell>
{mediaQuery && <GenericTableCell>{formatDateAndTime(loginAt)}</GenericTableCell>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const DeviceManagementAdminTable = ({ reloadRef }: { reloadRef: MutableRefObject
<GenericTableHeaderCell key={'client'} direction={sortDirection} active={sortBy === 'client'} onClick={setSort} sort='client'>
{t('Client')}
</GenericTableHeaderCell>,
<GenericTableHeaderCell key={'rcVersion'}>{t('Version')}</GenericTableHeaderCell>,
<GenericTableHeaderCell key={'os'} direction={sortDirection} active={sortBy === 'os'} onClick={setSort} sort='os'>
{t('OS')}
</GenericTableHeaderCell>,
Expand Down Expand Up @@ -91,6 +92,7 @@ const DeviceManagementAdminTable = ({ reloadRef }: { reloadRef: MutableRefObject
deviceName={session?.device?.name}
deviceType={session?.device?.type}
deviceOSName={session?.device?.os?.name}
rcVersion={session?.device?.version}
loginAt={session.loginAt}
onReload={reload}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const DeviceManagementInfo = ({ device, sessionId, loginAt, ip, userId, _user, o

const handleDeviceLogout = useDeviceLogout(sessionId, '/v1/sessions/logout');

const { name: clientName, os } = device || {};
const { name: clientName, os, version: rcVersion } = device || {};
const { username, name } = _user || {};
const userPresence = usePresence(userId);

Expand All @@ -48,6 +48,11 @@ const DeviceManagementInfo = ({ device, sessionId, loginAt, ip, userId, _user, o
<InfoPanel.Text>{clientName}</InfoPanel.Text>
</InfoPanel.Field>

<InfoPanel.Field>
<InfoPanel.Label>{t('Version')}</InfoPanel.Label>
<InfoPanel.Text>{rcVersion || '—'}</InfoPanel.Text>
</InfoPanel.Field>

<InfoPanel.Field>
<InfoPanel.Label>{t('OS')}</InfoPanel.Label>
<InfoPanel.Text>{`${os?.name || ''} ${os?.version || ''}`}</InfoPanel.Text>
Expand Down