@opengis/admin 0.2.98 → 0.2.100

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@
5
5
 
6
6
  </div>
7
7
  </div>
8
- {{#contentList table="log.table_changes" query="uid='{{id}}'" order="cdate desc" sql1=1}}
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}},
@@ -0,0 +1,14 @@
1
+ [
2
+ {
3
+ "id": "insert",
4
+ "text": "insert"
5
+ },
6
+ {
7
+ "id": "update",
8
+ "text": "update"
9
+ },
10
+ {
11
+ "id": "delete",
12
+ "text": "delete"
13
+ }
14
+ ]
@@ -25,8 +25,8 @@
25
25
  "en": "Routes"
26
26
  },
27
27
  {
28
- "path": "auth.logs",
29
- "table": "auth.logs.table",
28
+ "path": "log.table_changes",
29
+ "table": "log.table_changes.table",
30
30
  "ua": "Логи інтерфейсів"
31
31
  }
32
32
  ]
@@ -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
- "filter_list": [
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
- "type": "Text"
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
- "type": "Text "
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/admin",
3
- "version": "0.2.98",
3
+ "version": "0.2.100",
4
4
  "description": "This project Softpro Admin",
5
5
  "main": "dist/admin.js",
6
6
  "type": "module",
@@ -1,4 +1,4 @@
1
- import { config, pgClients } from '@opengis/fastify-table/utils.js';
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 && !users?.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 { config, addHook } from '@opengis/fastify-table/utils.js';
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(`${prefix}/test-email`, { config: { policy: ['user'] }, schema: emailSchema }, testEmail);
24
- fastify.get(`/notification`, { config: { policy: ['user'] }, schema: notificationSchema }, userNotifications);
25
- fastify.get(`/notification-read/:id?`, { config: { policy: ['user'] }, schema: notificationSchema }, readNotifications);
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
  }