Skip to content
Snippets Groups Projects
Unverified Commit 64934784 authored by Hugo Costa's avatar Hugo Costa Committed by GitHub
Browse files

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

parent 74aa6770
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ type DeviceRowProps = { ...@@ -17,6 +17,7 @@ type DeviceRowProps = {
deviceType?: string; deviceType?: string;
deviceOSName?: string; deviceOSName?: string;
loginAt: string; loginAt: string;
rcVersion?: string;
onReload: () => void; onReload: () => void;
}; };
...@@ -28,6 +29,7 @@ const DeviceManagementAdminRow = ({ ...@@ -28,6 +29,7 @@ const DeviceManagementAdminRow = ({
deviceType = 'browser', deviceType = 'browser',
deviceOSName = '', deviceOSName = '',
loginAt, loginAt,
rcVersion,
onReload, onReload,
}: DeviceRowProps): ReactElement => { }: DeviceRowProps): ReactElement => {
const t = useTranslation(); const t = useTranslation();
...@@ -69,6 +71,7 @@ const DeviceManagementAdminRow = ({ ...@@ -69,6 +71,7 @@ const DeviceManagementAdminRow = ({
{deviceName && <Box withTruncatedText>{deviceName}</Box>} {deviceName && <Box withTruncatedText>{deviceName}</Box>}
</Box> </Box>
</GenericTableCell> </GenericTableCell>
<GenericTableCell>{rcVersion}</GenericTableCell>
<GenericTableCell>{deviceOSName}</GenericTableCell> <GenericTableCell>{deviceOSName}</GenericTableCell>
<GenericTableCell withTruncatedText>{username}</GenericTableCell> <GenericTableCell withTruncatedText>{username}</GenericTableCell>
{mediaQuery && <GenericTableCell>{formatDateAndTime(loginAt)}</GenericTableCell>} {mediaQuery && <GenericTableCell>{formatDateAndTime(loginAt)}</GenericTableCell>}
......
...@@ -55,6 +55,7 @@ const DeviceManagementAdminTable = ({ reloadRef }: { reloadRef: MutableRefObject ...@@ -55,6 +55,7 @@ const DeviceManagementAdminTable = ({ reloadRef }: { reloadRef: MutableRefObject
<GenericTableHeaderCell key={'client'} direction={sortDirection} active={sortBy === 'client'} onClick={setSort} sort='client'> <GenericTableHeaderCell key={'client'} direction={sortDirection} active={sortBy === 'client'} onClick={setSort} sort='client'>
{t('Client')} {t('Client')}
</GenericTableHeaderCell>, </GenericTableHeaderCell>,
<GenericTableHeaderCell key={'rcVersion'}>{t('Version')}</GenericTableHeaderCell>,
<GenericTableHeaderCell key={'os'} direction={sortDirection} active={sortBy === 'os'} onClick={setSort} sort='os'> <GenericTableHeaderCell key={'os'} direction={sortDirection} active={sortBy === 'os'} onClick={setSort} sort='os'>
{t('OS')} {t('OS')}
</GenericTableHeaderCell>, </GenericTableHeaderCell>,
...@@ -91,6 +92,7 @@ const DeviceManagementAdminTable = ({ reloadRef }: { reloadRef: MutableRefObject ...@@ -91,6 +92,7 @@ const DeviceManagementAdminTable = ({ reloadRef }: { reloadRef: MutableRefObject
deviceName={session?.device?.name} deviceName={session?.device?.name}
deviceType={session?.device?.type} deviceType={session?.device?.type}
deviceOSName={session?.device?.os?.name} deviceOSName={session?.device?.os?.name}
rcVersion={session?.device?.version}
loginAt={session.loginAt} loginAt={session.loginAt}
onReload={reload} onReload={reload}
/> />
......
...@@ -29,7 +29,7 @@ const DeviceManagementInfo = ({ device, sessionId, loginAt, ip, userId, _user, o ...@@ -29,7 +29,7 @@ const DeviceManagementInfo = ({ device, sessionId, loginAt, ip, userId, _user, o
const handleDeviceLogout = useDeviceLogout(sessionId, '/v1/sessions/logout'); const handleDeviceLogout = useDeviceLogout(sessionId, '/v1/sessions/logout');
const { name: clientName, os } = device || {}; const { name: clientName, os, version: rcVersion } = device || {};
const { username, name } = _user || {}; const { username, name } = _user || {};
const userPresence = usePresence(userId); const userPresence = usePresence(userId);
...@@ -48,6 +48,11 @@ const DeviceManagementInfo = ({ device, sessionId, loginAt, ip, userId, _user, o ...@@ -48,6 +48,11 @@ const DeviceManagementInfo = ({ device, sessionId, loginAt, ip, userId, _user, o
<InfoPanel.Text>{clientName}</InfoPanel.Text> <InfoPanel.Text>{clientName}</InfoPanel.Text>
</InfoPanel.Field> </InfoPanel.Field>
<InfoPanel.Field>
<InfoPanel.Label>{t('Version')}</InfoPanel.Label>
<InfoPanel.Text>{rcVersion || ''}</InfoPanel.Text>
</InfoPanel.Field>
<InfoPanel.Field> <InfoPanel.Field>
<InfoPanel.Label>{t('OS')}</InfoPanel.Label> <InfoPanel.Label>{t('OS')}</InfoPanel.Label>
<InfoPanel.Text>{`${os?.name || ''} ${os?.version || ''}`}</InfoPanel.Text> <InfoPanel.Text>{`${os?.name || ''} ${os?.version || ''}`}</InfoPanel.Text>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment