Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit c9f5d57

Browse files
author
Kerry
authored
Device manager - render extended device information (#9360)
* record device client inforamtion events on app start * matrix-client-information -> matrix_client_information * fix types * remove another unused export * add docs link * display device client information in device details * update snapshots * integration-ish test client information in metadata * tests * fix tests * export helper * DeviceClientInformation type * Device manager - select all devices (#9330) * add device selection that does nothing * multi select and sign out of sessions * test multiple selection * fix type after rebase * select all sessions * rename type * use ExtendedDevice type everywhere * rename clientName to appName for less collision with UA parser * fix bad find and replace * rename ExtendedDeviceInfo to ExtendedDeviceAppInfo * rename DeviceType comp to DeviceTypeIcon * update tests for new required property deviceType * add stubbed user agent parsing * setup test cases * detect device type correctly * 80% working ua parser * parse asera gents for device info * combine clientName/Version into one field, remove debug from tests * add new metadata to device details * render device info from UA
1 parent c4432a8 commit c9f5d57

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

src/components/views/settings/devices/DeviceDetails.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const DeviceDetails: React.FC<Props> = ({
6262
id: 'session',
6363
values: [
6464
{ label: _t('Session ID'), value: device.device_id },
65+
{ label: _t('Client'), value: device.client },
6566
{
6667
label: _t('Last activity'),
6768
value: device.last_seen_ts && formatDate(new Date(device.last_seen_ts)),
@@ -81,6 +82,8 @@ const DeviceDetails: React.FC<Props> = ({
8182
id: 'device',
8283
heading: _t('Device'),
8384
values: [
85+
{ label: _t('Model'), value: device.deviceModel },
86+
{ label: _t('Operating system'), value: device.deviceOperatingSystem },
8487
{ label: _t('IP address'), value: device.last_seen_ip },
8588
],
8689
},

src/i18n/strings/en_EN.json

+3
Original file line numberDiff line numberDiff line change
@@ -1719,11 +1719,14 @@
17191719
"Rename session": "Rename session",
17201720
"Please be aware that session names are also visible to people you communicate with": "Please be aware that session names are also visible to people you communicate with",
17211721
"Session ID": "Session ID",
1722+
"Client": "Client",
17221723
"Last activity": "Last activity",
17231724
"Application": "Application",
17241725
"Version": "Version",
17251726
"URL": "URL",
17261727
"Device": "Device",
1728+
"Model": "Model",
1729+
"Operating system": "Operating system",
17271730
"IP address": "IP address",
17281731
"Session details": "Session details",
17291732
"Toggle push notifications on this session.": "Toggle push notifications on this session.",

test/components/views/settings/devices/DeviceDetails-test.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ describe('<DeviceDetails />', () => {
6161
last_seen_ip: '123.456.789',
6262
last_seen_ts: now - 60000000,
6363
appName: 'Element Web',
64+
client: 'Firefox 100',
65+
deviceModel: 'Iphone X',
66+
deviceOperatingSystem: 'Windows 95',
6467
};
6568
const { container } = render(getComponent({ device }));
6669
expect(container).toMatchSnapshot();

test/components/views/settings/devices/__snapshots__/DeviceDetails-test.tsx.snap

+36
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,18 @@ exports[`<DeviceDetails /> renders device with metadata 1`] = `
181181
my-device
182182
</td>
183183
</tr>
184+
<tr>
185+
<td
186+
class="mxDeviceDetails_metadataLabel"
187+
>
188+
Client
189+
</td>
190+
<td
191+
class="mxDeviceDetails_metadataValue"
192+
>
193+
Firefox 100
194+
</td>
195+
</tr>
184196
<tr>
185197
<td
186198
class="mxDeviceDetails_metadataLabel"
@@ -233,6 +245,30 @@ exports[`<DeviceDetails /> renders device with metadata 1`] = `
233245
</tr>
234246
</thead>
235247
<tbody>
248+
<tr>
249+
<td
250+
class="mxDeviceDetails_metadataLabel"
251+
>
252+
Model
253+
</td>
254+
<td
255+
class="mxDeviceDetails_metadataValue"
256+
>
257+
Iphone X
258+
</td>
259+
</tr>
260+
<tr>
261+
<td
262+
class="mxDeviceDetails_metadataLabel"
263+
>
264+
Operating system
265+
</td>
266+
<td
267+
class="mxDeviceDetails_metadataValue"
268+
>
269+
Windows 95
270+
</td>
271+
</tr>
236272
<tr>
237273
<td
238274
class="mxDeviceDetails_metadataLabel"

0 commit comments

Comments
 (0)