@boarteam/boar-pack-users-frontend 2.3.2 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boarteam/boar-pack-users-frontend",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "Users frontend package for Boar Pack",
|
|
5
5
|
"repository": "git@github.com:boarteam/boar-pack.git",
|
|
6
6
|
"author": "Andrew Balakirev <balakirev.andrey@gmail.com>",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@ant-design/plots": "^2.3.2",
|
|
18
|
-
"@boarteam/boar-pack-common-frontend": "^2.
|
|
18
|
+
"@boarteam/boar-pack-common-frontend": "^2.8.0",
|
|
19
19
|
"@fortawesome/fontawesome-svg-core": "^6.6.0",
|
|
20
20
|
"@fortawesome/free-brands-svg-icons": "^6.6.0",
|
|
21
21
|
"@umijs/max": "^4.1.10",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"build": "tsc --project tsconfig.build.json",
|
|
35
35
|
"yalc:push": "yalc push"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "bff974a7a00f6c4d66ffbb035f36ce9e5a7496f9"
|
|
38
38
|
}
|
|
@@ -9,25 +9,15 @@ import {
|
|
|
9
9
|
UserOutlined,
|
|
10
10
|
WarningOutlined
|
|
11
11
|
} from "@ant-design/icons";
|
|
12
|
-
import { useEffect, useState } from "react";
|
|
12
|
+
import { useContext, useEffect, useState } from "react";
|
|
13
13
|
import UserAgentDisplay from "./UserAgentDisplay";
|
|
14
14
|
import apiClient from "@@api/apiClient";
|
|
15
15
|
import { getUserRoleIcon } from "./EventLogExplanation";
|
|
16
|
-
|
|
16
|
+
import { EventLogsContext } from "./eventLogsContext";
|
|
17
17
|
import { DateRange } from "@boarteam/boar-pack-common-frontend";
|
|
18
18
|
|
|
19
19
|
const { Text } = Typography;
|
|
20
20
|
|
|
21
|
-
const serviceNameToAbbreviation: Record<string, string> = {
|
|
22
|
-
'TID Main App': 'TID',
|
|
23
|
-
'Liquidity Manager': 'LM',
|
|
24
|
-
'Quotes Monitor': 'QM',
|
|
25
|
-
'Admin Panel - Main': 'ADM',
|
|
26
|
-
'Manager Panel - Main': 'MNG',
|
|
27
|
-
'Admin RealTimeData': 'ARTD',
|
|
28
|
-
'Manager RealTimeData': 'MRTD',
|
|
29
|
-
} as const;
|
|
30
|
-
|
|
31
21
|
const logTypes = {
|
|
32
22
|
[EventLog.logType.AUDIT]: {
|
|
33
23
|
text: 'Audit',
|
|
@@ -69,6 +59,8 @@ export const useEventLogsColumns = ({
|
|
|
69
59
|
onDateRangeChange: (start: string | undefined, end: string | undefined) => void;
|
|
70
60
|
}): ProColumns<EventLog>[] => {
|
|
71
61
|
const [users, setUsers] = useState<{ text: string, value: string }[]>([]);
|
|
62
|
+
const [serviceNames, setServiceNames] = useState<string[]>([]);
|
|
63
|
+
const eventLogsContext = useContext(EventLogsContext);
|
|
72
64
|
|
|
73
65
|
useEffect(() => {
|
|
74
66
|
apiClient.users.getManyBaseUsersControllerUser({
|
|
@@ -76,6 +68,11 @@ export const useEventLogsColumns = ({
|
|
|
76
68
|
}).then((users) => {
|
|
77
69
|
setUsers(users.data.map((item) => ({ text: item.name, value: item.id })));
|
|
78
70
|
});
|
|
71
|
+
|
|
72
|
+
apiClient.eventLogs.getServiceNames()
|
|
73
|
+
.then((names) => {
|
|
74
|
+
setServiceNames(names)
|
|
75
|
+
});
|
|
79
76
|
}, []);
|
|
80
77
|
|
|
81
78
|
return [
|
|
@@ -103,16 +100,16 @@ export const useEventLogsColumns = ({
|
|
|
103
100
|
title: 'Service',
|
|
104
101
|
dataIndex: 'service',
|
|
105
102
|
render(dom, record) {
|
|
106
|
-
return serviceNameToAbbreviation[record.service]
|
|
107
|
-
? <Tooltip title={record.service}>{serviceNameToAbbreviation[record.service]}</Tooltip>
|
|
103
|
+
return eventLogsContext?.serviceNameToAbbreviation?.[record.service]
|
|
104
|
+
? <Tooltip title={record.service}>{eventLogsContext.serviceNameToAbbreviation[record.service]}</Tooltip>
|
|
108
105
|
: record.service;
|
|
109
106
|
},
|
|
110
107
|
width: 10,
|
|
111
108
|
valueEnum: Object.fromEntries(
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
serviceNames.map((value) => [
|
|
110
|
+
value,
|
|
114
111
|
{
|
|
115
|
-
text:
|
|
112
|
+
text: eventLogsContext?.serviceNameToAbbreviation?.[value] ?? value
|
|
116
113
|
}
|
|
117
114
|
])
|
|
118
115
|
),
|
|
@@ -34,6 +34,16 @@ export class EventLogsService {
|
|
|
34
34
|
},
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* @returns string
|
|
39
|
+
* @throws ApiError
|
|
40
|
+
*/
|
|
41
|
+
public getServiceNames(): CancelablePromise<Array<string>> {
|
|
42
|
+
return this.httpRequest.request({
|
|
43
|
+
method: 'GET',
|
|
44
|
+
url: '/event-logs/service-names',
|
|
45
|
+
});
|
|
46
|
+
}
|
|
37
47
|
/**
|
|
38
48
|
* Retrieve multiple EventLogs
|
|
39
49
|
* @returns GetManyEventLogResponseDto Get paginated response
|