@opengis/admin 0.2.98 → 0.2.100
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/module/settings/card/admin.users.table/logs.hbs +1 -1
- package/module/settings/cls/change_type.json +14 -0
- package/module/settings/menu.json +2 -2
- package/module/settings/table/{auth.logs.table.json → log.table_changes.table.json} +17 -14
- package/package.json +1 -1
- package/server/routes/access/controllers/access.group.post.js +8 -3
- package/server/routes/notifications/index.mjs +4 -5
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
</div>
|
7
7
|
</div>
|
8
|
-
{{#contentList table="log.table_changes" query="
|
8
|
+
{{#contentList table="log.table_changes" query="change_user_id='{{id}}'" order="cdate desc" sql1=1}}
|
9
9
|
{{{tableList rows
|
10
10
|
columns="
|
11
11
|
Дата, {{formatDate cdate}},
|
@@ -4,6 +4,7 @@
|
|
4
4
|
"table": "log.table_changes",
|
5
5
|
"order": "cdate desc",
|
6
6
|
"card": false,
|
7
|
+
"access": "admin",
|
7
8
|
"meta": {
|
8
9
|
"title": "change_id",
|
9
10
|
"search": "change_id,change_type,change_user_id,entity_type,entity_id,uid"
|
@@ -67,32 +68,34 @@
|
|
67
68
|
"format": "text"
|
68
69
|
}
|
69
70
|
],
|
70
|
-
"
|
71
|
+
"filterList": [
|
72
|
+
{
|
73
|
+
"ua": "Дата створення запису",
|
74
|
+
"name": "cdate",
|
75
|
+
"type": "Date"
|
76
|
+
},
|
71
77
|
{
|
72
78
|
"ua": "Користувач",
|
73
|
-
"data": "admin.users",
|
74
79
|
"name": "change_user_id",
|
80
|
+
"data": "core.user_uid",
|
81
|
+
"apiPrefix": "api",
|
75
82
|
"type": "Autocomplete"
|
76
83
|
},
|
77
84
|
{
|
78
|
-
"ua": "Дата",
|
79
|
-
"name": "cdate",
|
80
|
-
"type": "Datepicker"
|
81
|
-
},
|
82
|
-
{
|
83
|
-
"name": "entity_type",
|
84
85
|
"ua": "Назва таблиці",
|
85
|
-
"
|
86
|
-
},
|
87
|
-
{
|
88
|
-
"name": "e",
|
89
|
-
"ua": "ID об'єкту",
|
86
|
+
"name": "entity_type",
|
90
87
|
"type": "Text"
|
91
88
|
},
|
92
89
|
{
|
93
90
|
"ua": "Дія",
|
94
91
|
"name": "change_type",
|
95
|
-
"
|
92
|
+
"data": "change_type",
|
93
|
+
"type": "Check"
|
94
|
+
},
|
95
|
+
{
|
96
|
+
"ua": "ID об'єкту",
|
97
|
+
"name": "entity_id",
|
98
|
+
"type": "Text"
|
96
99
|
}
|
97
100
|
]
|
98
101
|
}
|
package/package.json
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { pgClients } from '@opengis/fastify-table/utils.js';
|
2
2
|
|
3
3
|
import { getAdminAccess } from '../../../../utils.js';
|
4
4
|
import accessGroup from './access.group.js';
|
@@ -16,8 +16,13 @@ export default async function accessGroupPost({
|
|
16
16
|
|
17
17
|
const { users = [], routes = [] } = body;
|
18
18
|
|
19
|
-
if (!routes?.length
|
20
|
-
return { message: 'not enough params: users / routes', status: 400 };
|
19
|
+
if (!routes?.length) {
|
20
|
+
// return { message: 'not enough params: users / routes', status: 400 };
|
21
|
+
await pg.query(`delete from admin.role_access where role_id=$1`, [id]);
|
22
|
+
|
23
|
+
if (!users?.length) {
|
24
|
+
return { message: { id, routes }, status: 200 };
|
25
|
+
}
|
21
26
|
}
|
22
27
|
|
23
28
|
if (routes?.length) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { addHook } from '@opengis/fastify-table/utils.js';
|
2
2
|
|
3
3
|
// api
|
4
4
|
import testEmail from './controllers/testEmail.js';
|
@@ -15,13 +15,12 @@ import onWidgetSet from './hook/onWidgetSet.js'; // send notification on comment
|
|
15
15
|
import { notificationSchema, emailSchema } from './schema.js';
|
16
16
|
|
17
17
|
export default async function route(fastify) {
|
18
|
-
const prefix = config.prefix || '/api';
|
19
18
|
|
20
19
|
// fastify.decorate('addNotification', addNotification);
|
21
20
|
// fastify.decorate('notification', notification);
|
22
21
|
|
23
|
-
fastify.get(
|
24
|
-
fastify.get(
|
25
|
-
fastify.get(
|
22
|
+
fastify.get('/test-email', { config: { policy: ['user'] }, schema: emailSchema }, testEmail);
|
23
|
+
fastify.get('/notification', { config: { policy: ['user'] }, schema: notificationSchema }, userNotifications);
|
24
|
+
fastify.get('/notification-read/:id?', { config: { policy: ['user'] }, schema: notificationSchema }, readNotifications);
|
26
25
|
addHook('onWidgetSet', onWidgetSet);
|
27
26
|
}
|