Skip to content

Commit a0bede1

Browse files
committed
feat: show user device details
1 parent 6d732d3 commit a0bede1

File tree

5 files changed

+158
-21
lines changed

5 files changed

+158
-21
lines changed

admin-ui/app/locales/en/translation.json

+18-5
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"principal_type": "Principal Type",
102102
"webhook_name": "Webhook Name",
103103
"sessionTimeoutInMins": "Admin UI Session Timeout (In Minutes)",
104-
"gluuFlexVersion":"Gluu Flex Version",
104+
"gluuFlexVersion": "Gluu Flex Version",
105105
"adminui_default_acr": "Admin UI authentication method (ACR)",
106106
"download_summary": "Download Summary",
107107
"metadata_location": "Metadata Location",
@@ -541,7 +541,13 @@
541541
"updates_at_last_run": "Updates at the last run",
542542
"problems_at_last_run": "Problems at the last run",
543543
"mapping": "Mapping",
544-
"source": "Source"
544+
"source": "Source",
545+
"createdBy": "Created By",
546+
"deviceName": "Device Name",
547+
"OSName": "OS Name",
548+
"OSVersion": "OS Version",
549+
"platform": "Platform",
550+
"authType": "Auth Type"
545551
},
546552
"languages": {
547553
"french": "French",
@@ -567,7 +573,7 @@
567573
"default_acr": "Default ACR",
568574
"acrs": "ACRs",
569575
"aliases": "Aliases",
570-
"builtIn":"Built-In",
576+
"builtIn": "Built-In",
571577
"api": {
572578
"roles": "Access roles",
573579
"permissions": "Permissions",
@@ -1436,7 +1442,7 @@
14361442
},
14371443
"settings": {
14381444
"pageSize": "The default size for all list page.",
1439-
"gluuCurrentVersion":"Gluu Server current version",
1445+
"gluuCurrentVersion": "Gluu Server current version",
14401446
"darkMode": "Whether to enable or disable adrk mode.",
14411447
"configApiUrl": "The URL of the config api currently in used.",
14421448
"sessionTimeoutInMins": "Determines the duration of inactivity allowed before the current session expires.",
@@ -1529,7 +1535,14 @@
15291535
"INUM": "INUM",
15301536
"middleName": "Middle Name",
15311537
"sn": "Last Name",
1532-
"userConfirmPassword": "Confirm Password"
1538+
"userConfirmPassword": "Confirm Password",
1539+
"deviceName": "Device Name",
1540+
"OSName": "OS Name",
1541+
"OSVersion": "OS Version",
1542+
"platform": "Platform",
1543+
"createdBy": "Created By",
1544+
"type": "Type",
1545+
"domain": "Domain"
15331546
},
15341547
"saml": {
15351548
"name": "The alphanumeric ID string that is used to identify the Trust Relationship",

admin-ui/app/locales/fr/translation.json

+16-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"acrs": "ACRs",
4343
"aliases": "Aliases",
4444
"trust_relationships": "Relations de confiance",
45-
"builtIn" : "Intégré",
45+
"builtIn": "Intégré",
4646
"api": {
4747
"roles": "Rôles d'accès",
4848
"permissions": "Autorisations",
@@ -567,7 +567,13 @@
567567
"updates_at_last_run": "Mises à jour lors de la dernière exécution",
568568
"problems_at_last_run": "Problèmes lors de la dernière course",
569569
"mapping": "Mapeamento",
570-
"source": "Fonte"
570+
"source": "Fonte",
571+
"createdBy": "Créé par",
572+
"deviceName": "Nom de l'appareil",
573+
"OSName": "Nom du système d'exploitation",
574+
"OSVersion": "Version du système d'exploitation",
575+
"platform": "Plateforme",
576+
"authType": "Type d'authentification"
571577
},
572578
"messages": {
573579
"add_permission": "Ajouter une autorisation",
@@ -1468,6 +1474,13 @@
14681474
"INUM": "INUM",
14691475
"middleName": "Deuxième nom",
14701476
"sn": "Nom de famille",
1471-
"userConfirmPassword": "Confirmez le mot de passe"
1477+
"userConfirmPassword": "Confirmez le mot de passe",
1478+
"deviceName": "Nom de l'appareil",
1479+
"OSName": "Nom du système d'exploitation",
1480+
"OSVersion": "Version du système d'exploitation",
1481+
"platform": "Plateforme",
1482+
"createdBy": "Créé par",
1483+
"type": "Type",
1484+
"domain": "Domaine"
14721485
}
14731486
}

admin-ui/app/locales/pt/translation.json

+15-2
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,13 @@
562562
"updates_at_last_run": "Atualizações na última execução",
563563
"problems_at_last_run": "Problemas na última corrida",
564564
"mapping": "Mapeamento",
565-
"source": "Fonte"
565+
"source": "Fonte",
566+
"createdBy": "Criado por",
567+
"deviceName": "Nome do dispositivo",
568+
"OSName": "Nome do sistema operacional",
569+
"OSVersion": "Versão do sistema operacional",
570+
"platform": "Plataforma",
571+
"authType": "Tipo de autenticação"
566572
},
567573
"messages": {
568574
"add_permission": "Adicionar permissão",
@@ -1465,6 +1471,13 @@
14651471
"INUM": "INUM",
14661472
"middleName": "Nome do meio",
14671473
"sn": "Sobrenome",
1468-
"userConfirmPassword": "Confirme a Senha"
1474+
"userConfirmPassword": "Confirme a Senha",
1475+
"deviceName": "Nome do dispositivo",
1476+
"OSName": "Nome do sistema operacional",
1477+
"OSVersion": "Versão do sistema operacional",
1478+
"platform": "Plataforma",
1479+
"createdBy": "Criado por",
1480+
"type": "Tipo",
1481+
"domain": "Domínio"
14691482
}
14701483
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import React from "react";
2+
import { Container, Row, Col } from "Components";
3+
import GluuFormDetailRow from "Routes/Apps/Gluu/GluuFormDetailRow";
4+
5+
const UserDeviceDetailViewPage = ({ row }) => {
6+
const { rowData } = row;
7+
const DOC_SECTION = "user";
8+
9+
return (
10+
<Container style={{ backgroundColor: "#F5F5F5", minWidth: "100%" }}>
11+
<Row>
12+
<Col sm={6} xl={4}>
13+
<GluuFormDetailRow
14+
label="fields.domain"
15+
value={rowData.registrationData.domain}
16+
doc_category={DOC_SECTION}
17+
doc_entry="domain"
18+
/>
19+
</Col>
20+
<Col sm={6} xl={4}>
21+
<GluuFormDetailRow
22+
label="fields.type"
23+
value={rowData.registrationData.type}
24+
doc_category={DOC_SECTION}
25+
doc_entry="type"
26+
/>
27+
</Col>
28+
<Col sm={6} xl={4}>
29+
<GluuFormDetailRow
30+
label="fields.status"
31+
value={rowData.registrationData.status}
32+
doc_category={DOC_SECTION}
33+
doc_entry="status"
34+
/>
35+
</Col>
36+
<Col sm={6} xl={4}>
37+
<GluuFormDetailRow
38+
label="fields.createdBy"
39+
value={rowData.registrationData.createdBy}
40+
doc_category={DOC_SECTION}
41+
doc_entry="createdBy"
42+
/>
43+
</Col>
44+
</Row>
45+
46+
{rowData?.deviceData && (
47+
<Row>
48+
<h5 style={{ borderBottom: "2px solid", fontWeight: "bold" }}>
49+
Device Information
50+
</h5>
51+
<Col sm={6} xl={4}>
52+
<GluuFormDetailRow
53+
label="fields.deviceName"
54+
value={rowData.deviceData.name}
55+
doc_category={DOC_SECTION}
56+
doc_entry="deviceName"
57+
/>
58+
</Col>
59+
<Col sm={6} xl={4}>
60+
<GluuFormDetailRow
61+
label="fields.OSName"
62+
value={rowData.deviceData.os_name}
63+
doc_category={DOC_SECTION}
64+
doc_entry="OSName"
65+
/>
66+
</Col>
67+
<Col sm={6} xl={4}>
68+
<GluuFormDetailRow
69+
label="fields.OSVersion"
70+
value={rowData.deviceData.os_version}
71+
doc_category={DOC_SECTION}
72+
doc_entry="OSVersion"
73+
/>
74+
</Col>
75+
<Col sm={6} xl={4}>
76+
<GluuFormDetailRow
77+
label="fields.platform"
78+
value={rowData.deviceData.platform}
79+
doc_category={DOC_SECTION}
80+
doc_entry="platform"
81+
/>
82+
</Col>
83+
</Row>
84+
)}
85+
</Container>
86+
);
87+
};
88+
export default UserDeviceDetailViewPage;

admin-ui/plugins/user-management/components/UserManagement/UserList.js

+21-11
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import GluuViewDetailModal from "../../../../app/routes/Apps/Gluu/GluuViewDetail
4242

4343
import moment from "moment";
4444
import { deleteFido2DeviceData } from "../../../fido/redux/features/fidoSlice";
45+
import UserDeviceDetailViewPage from "./UserDeviceDetailViewPage";
4546

4647
function UserList(props) {
4748
const dispatch = useDispatch();
@@ -110,8 +111,9 @@ function UserList(props) {
110111
});
111112
setOTPDevicesList(otpDevices);
112113

113-
114-
dispatch(getUser2FADetails({ username: row.givenName.toLowerCase(), token: token }));
114+
dispatch(
115+
getUser2FADetails({ username: row.givenName.toLowerCase(), token: token })
116+
);
115117
setIsDetailModalOpen(!isViewDetailModalOpen);
116118
}
117119

@@ -295,15 +297,16 @@ function UserList(props) {
295297
const attenstationRequest = JSON.parse(
296298
item.registrationData.attenstationRequest
297299
);
298-
if (item?.deviceData?.platform) {
299-
return {
300-
id: item?.deviceData?.uuid ?? "-",
301-
nickName: attenstationRequest.displayName ?? "-",
302-
modality: item?.deviceData?.platform ?? "-",
303-
dateAdded: moment(item.creationDate).format("YYYY-MM-DD HH:mm:ss"),
304-
type: "FIDO2",
305-
};
306-
}
300+
301+
return {
302+
id: item?.deviceData?.uuid ? item?.deviceData?.uuid : item.id,
303+
nickName: attenstationRequest.displayName ?? "-",
304+
modality: item?.deviceData?.platform ?? "-",
305+
dateAdded: moment(item.creationDate).format("YYYY-MM-DD HH:mm:ss"),
306+
type: item?.deviceData?.platform ? "SUPER GLUU" : "FIDO2",
307+
registrationData: item.registrationData,
308+
deviceData: item.deviceData,
309+
};
307310
});
308311
const removeNullValue = updatedDetails.filter((item) => item);
309312

@@ -319,6 +322,11 @@ function UserList(props) {
319322
return <UserDetailViewPage row={rowData} />;
320323
}, []);
321324

325+
const DetailPanelForDevices = useCallback((rowData) => {
326+
console.log("rowData", rowData);
327+
return <UserDeviceDetailViewPage row={rowData} />;
328+
}, []);
329+
322330
const DeleteOutlinedIcon = useCallback(() => <DeleteOutlined />, []);
323331

324332
const PaginationWrapper = useCallback(
@@ -350,6 +358,7 @@ function UserList(props) {
350358
{ title: `${t("fields.nickName")}`, field: "nickName" },
351359
{ title: `${t("fields.modality")}`, field: "modality" },
352360
{ title: `${t("fields.dateAdded")}`, field: "dateAdded" },
361+
{ title: `${t("fields.authType")}`, field: "type" },
353362
]}
354363
data={faDetails}
355364
isLoading={loading}
@@ -379,6 +388,7 @@ function UserList(props) {
379388
});
380389
},
381390
}}
391+
detailPanel={DetailPanelForDevices}
382392
/>
383393
</GluuViewDetailModal>
384394

0 commit comments

Comments
 (0)