Skip to content

Commit

Permalink
chore: Device Management version info at table and contextual bar (Ro…
Browse files Browse the repository at this point in the history
  • Loading branch information
hugocostadev authored Jul 3, 2023
1 parent 74aa677 commit 6493478
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
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

0 comments on commit 6493478

Please sign in to comment.