@acorex/modules 20.1.0 → 20.2.0-next.0
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/auth/index.d.ts +4 -57
- package/conversation/index.d.ts +69 -9
- package/dashboard-management/index.d.ts +2 -0
- package/fesm2022/{acorex-modules-auth-acorex-modules-auth-5TIjp5UG.mjs → acorex-modules-auth-acorex-modules-auth-y6rICHrT.mjs} +84 -201
- package/fesm2022/acorex-modules-auth-acorex-modules-auth-y6rICHrT.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-app-chooser.component-B0w1Xzx7.mjs → acorex-modules-auth-app-chooser.component-Cpy0VN6n.mjs} +4 -4
- package/fesm2022/{acorex-modules-auth-app-chooser.component-B0w1Xzx7.mjs.map → acorex-modules-auth-app-chooser.component-Cpy0VN6n.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-login.module-B8sVVZHV.mjs → acorex-modules-auth-login.module-ZEX4NMuJ.mjs} +4 -4
- package/fesm2022/{acorex-modules-auth-login.module-B8sVVZHV.mjs.map → acorex-modules-auth-login.module-ZEX4NMuJ.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-master.layout-CMKxj1Qo.mjs → acorex-modules-auth-master.layout-D-lIn4Pl.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-master.layout-CMKxj1Qo.mjs.map → acorex-modules-auth-master.layout-D-lIn4Pl.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-password.component-DH0qKunk.mjs → acorex-modules-auth-password.component-CafZfqKe.mjs} +7 -7
- package/fesm2022/{acorex-modules-auth-password.component-DH0qKunk.mjs.map → acorex-modules-auth-password.component-CafZfqKe.mjs.map} +1 -1
- package/fesm2022/acorex-modules-auth-password.component-DLCb0_6e.mjs +134 -0
- package/fesm2022/acorex-modules-auth-password.component-DLCb0_6e.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-routes-Q9zaIiBS.mjs → acorex-modules-auth-routes-D9-qfC3V.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-routes-Q9zaIiBS.mjs.map → acorex-modules-auth-routes-D9-qfC3V.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-tenant-chooser.component-wp7OOLsH.mjs → acorex-modules-auth-tenant-chooser.component-B1aE-TOD.mjs} +10 -13
- package/fesm2022/acorex-modules-auth-tenant-chooser.component-B1aE-TOD.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-two-factor-code.component-DSWd06bn.mjs → acorex-modules-auth-two-factor-code.component-BglerlU-.mjs} +6 -6
- package/fesm2022/{acorex-modules-auth-two-factor-code.component-DSWd06bn.mjs.map → acorex-modules-auth-two-factor-code.component-BglerlU-.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-two-factor.module-oRixkeAn.mjs → acorex-modules-auth-two-factor.module-D3N2XyOH.mjs} +3 -3
- package/fesm2022/{acorex-modules-auth-two-factor.module-oRixkeAn.mjs.map → acorex-modules-auth-two-factor.module-D3N2XyOH.mjs.map} +1 -1
- package/fesm2022/acorex-modules-auth.mjs +1 -1
- package/fesm2022/acorex-modules-conversation.mjs +487 -57
- package/fesm2022/acorex-modules-conversation.mjs.map +1 -1
- package/fesm2022/acorex-modules-notification-management.mjs +109 -3
- package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-security-management.mjs +301 -837
- package/fesm2022/acorex-modules-security-management.mjs.map +1 -1
- package/notification-management/index.d.ts +125 -29
- package/package.json +5 -5
- package/report-management/index.d.ts +2 -0
- package/security-management/index.d.ts +4 -13
- package/fesm2022/acorex-modules-auth-acorex-modules-auth-5TIjp5UG.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-oauth-callback.component-C95YLpI_.mjs +0 -101
- package/fesm2022/acorex-modules-auth-oauth-callback.component-C95YLpI_.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-password.component-Du0EBIiw.mjs +0 -239
- package/fesm2022/acorex-modules-auth-password.component-Du0EBIiw.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-tenant-chooser.component-wp7OOLsH.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-user-sessions.component-8wwWI0cQ.mjs +0 -135
- package/fesm2022/acorex-modules-auth-user-sessions.component-8wwWI0cQ.mjs.map +0 -1
@@ -1,22 +1,21 @@
|
|
1
|
-
import { createAllQueryView, AXPEntityCommandScope, AXPEntityQueryType, AXPSearchCommandProvider, AXPRefreshEvent, AXP_MENU_PROVIDER, AXP_SEARCH_PROVIDER } from '@acorex/platform/common';
|
2
|
-
import * as i2 from '@acorex/platform/layout/builder';
|
3
|
-
import { AXPWidgetsCatalog, AXPWidgetGroupEnum, AXPLayoutBuilderModule, AXPValueWidgetComponent, AXPColumnWidgetComponent, AXPLayoutWidgetComponent } from '@acorex/platform/layout/builder';
|
4
|
-
import { AXMDeviceSessionsService, AXMDeviceSessionsServiceImpl } from '@acorex/modules/auth';
|
5
|
-
import * as i0 from '@angular/core';
|
6
|
-
import { NgModule, Injectable, inject, Injector, signal, input, output, computed, ViewEncapsulation, Component, ViewChild, effect, ChangeDetectionStrategy } from '@angular/core';
|
7
1
|
import { AXMEntityCrudServiceImpl, AXPEntityService, AXPEntityResolver, AXPEntityDefinitionRegistryService, AXP_ENTITY_DEFINITION_LOADER } from '@acorex/platform/layout/entity';
|
2
|
+
import * as i0 from '@angular/core';
|
3
|
+
import { Injectable, inject, Injector, NgModule, signal, input, output, computed, ViewEncapsulation, Component, ViewChild, effect, ChangeDetectionStrategy } from '@angular/core';
|
4
|
+
import { AXPEntityCommandScope, AXPEntityQueryType, AXPSearchCommandProvider, AXPRefreshEvent, AXP_MENU_PROVIDER, AXP_SEARCH_PROVIDER } from '@acorex/platform/common';
|
8
5
|
import * as i1 from '@acorex/platform/workflow';
|
9
|
-
import {
|
6
|
+
import { AXPWorkflowAction, AXPWorkflowModule, createWorkFlowEvent, AXPWorkflowService } from '@acorex/platform/workflow';
|
7
|
+
import { AXP_DATASOURCE_DEFINITION_PROVIDER } from '@acorex/platform/core';
|
8
|
+
import { AXP_USER_AVATAR_PROVIDER, AXPThemeLayoutBlockComponent } from '@acorex/platform/layout/components';
|
9
|
+
import * as i2 from '@acorex/platform/layout/builder';
|
10
|
+
import { AXPWidgetsCatalog, AXPWidgetGroupEnum, AXPLayoutBuilderModule, AXPValueWidgetComponent, AXPColumnWidgetComponent, AXPLayoutWidgetComponent } from '@acorex/platform/layout/builder';
|
10
11
|
import { AXPSessionService, AXPPermissionDefinitionService } from '@acorex/platform/auth';
|
11
12
|
import { AXDataSource } from '@acorex/cdk/common';
|
12
|
-
import { AXDialogService } from '@acorex/components/dialog';
|
13
|
-
import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
|
14
|
-
import * as i3$1 from '@acorex/core/translation';
|
15
|
-
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
16
|
-
import { AXP_USER_AVATAR_PROVIDER, AXPThemeLayoutBlockComponent } from '@acorex/platform/layout/components';
|
17
13
|
import { AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY, AXP_DISABLED_PROPERTY } from '@acorex/platform/widgets';
|
18
14
|
import { AXPopupService } from '@acorex/components/popup';
|
19
|
-
import
|
15
|
+
import * as i3$1 from '@acorex/core/translation';
|
16
|
+
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
17
|
+
import { AXDialogService } from '@acorex/components/dialog';
|
18
|
+
import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
|
20
19
|
import * as i1$1 from '@angular/common';
|
21
20
|
import { CommonModule } from '@angular/common';
|
22
21
|
import { AXFormModule } from '@acorex/components/form';
|
@@ -28,591 +27,52 @@ import * as i3 from '@acorex/components/label';
|
|
28
27
|
import { AXLabelModule } from '@acorex/components/label';
|
29
28
|
import * as i6 from '@acorex/components/decorators';
|
30
29
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
31
|
-
import * as i5 from '@acorex/components/tabs';
|
32
|
-
import { AXTabsModule } from '@acorex/components/tabs';
|
33
|
-
import * as i7 from '@acorex/components/badge';
|
34
|
-
import { AXBadgeModule } from '@acorex/components/badge';
|
35
|
-
import * as i2$1 from '@angular/forms';
|
36
|
-
import { FormsModule } from '@angular/forms';
|
37
|
-
import { AXTooltipModule } from '@acorex/components/tooltip';
|
38
|
-
import { AXPPopupLayoutBaseComponent, AXPPopupLayoutComponent, AXPPopupLayoutBase } from '@acorex/platform/layout/views';
|
39
|
-
import { castArray } from 'lodash-es';
|
40
|
-
|
41
|
-
const config = {
|
42
|
-
i18n: 'security-management',
|
43
|
-
profileEntity: 'Profile',
|
44
|
-
};
|
45
|
-
const RootConfig = {
|
46
|
-
config,
|
47
|
-
module: {
|
48
|
-
route: 'security-management',
|
49
|
-
name: 'SecurityManagement',
|
50
|
-
title: `t('module-name', {scope:"${config.i18n}"})`,
|
51
|
-
icon: 'fa-light fa-file-invoice',
|
52
|
-
},
|
53
|
-
entities: {
|
54
|
-
deviceSessions: {
|
55
|
-
name: 'DeviceSessions',
|
56
|
-
title: `t("session", { scope: "${config.i18n}" })`,
|
57
|
-
titlePlural: `t("sessions", { scope: "${config.i18n}" })`,
|
58
|
-
icon: 'fa-light fa-default',
|
59
|
-
},
|
60
|
-
users: {
|
61
|
-
name: 'users',
|
62
|
-
title: `t("users", { scope: "${config.i18n}" })`,
|
63
|
-
icon: 'fa-light fa-users',
|
64
|
-
},
|
65
|
-
roles: {
|
66
|
-
name: 'roles',
|
67
|
-
title: `t("roles",{scope:"${config.i18n}"})`,
|
68
|
-
icon: 'fa-light fa-key',
|
69
|
-
},
|
70
|
-
profile: {
|
71
|
-
name: 'profile',
|
72
|
-
title: `t("profile",{scope:"${config.i18n}"})`,
|
73
|
-
icon: 'fa-light fa-user',
|
74
|
-
},
|
75
|
-
},
|
76
|
-
};
|
77
|
-
|
78
|
-
async function factory$3(injector) {
|
79
|
-
const dataService = injector.get(AXMDeviceSessionsService);
|
80
|
-
const i18n = RootConfig.config.i18n;
|
81
|
-
const entityDef = {
|
82
|
-
module: RootConfig.module.name,
|
83
|
-
name: RootConfig.entities.deviceSessions.name,
|
84
|
-
source: '',
|
85
|
-
title: RootConfig.entities.deviceSessions.title,
|
86
|
-
formats: {
|
87
|
-
individual: RootConfig.entities.deviceSessions.title,
|
88
|
-
plural: RootConfig.entities.deviceSessions.titlePlural,
|
89
|
-
searchResult: {
|
90
|
-
title: '{{ title }}',
|
91
|
-
description: RootConfig.module.title,
|
92
|
-
},
|
93
|
-
},
|
94
|
-
relatedEntities: [],
|
95
|
-
groups: [
|
96
|
-
{
|
97
|
-
id: 'section',
|
98
|
-
title: RootConfig.entities.deviceSessions.title,
|
99
|
-
},
|
100
|
-
{
|
101
|
-
id: 'device',
|
102
|
-
title: `t('device', { scope: "${i18n}" })`,
|
103
|
-
},
|
104
|
-
{
|
105
|
-
id: 'session',
|
106
|
-
title: `t('session', { scope: "${i18n}" })`,
|
107
|
-
},
|
108
|
-
],
|
109
|
-
properties: [
|
110
|
-
{
|
111
|
-
name: 'tenant.name',
|
112
|
-
title: `t('tenant', { scope: "${i18n}" })`,
|
113
|
-
groupId: 'section',
|
114
|
-
options: {
|
115
|
-
sort: {
|
116
|
-
enabled: true,
|
117
|
-
},
|
118
|
-
},
|
119
|
-
schema: {
|
120
|
-
dataType: 'string',
|
121
|
-
interface: {
|
122
|
-
type: AXPWidgetsCatalog.text,
|
123
|
-
},
|
124
|
-
},
|
125
|
-
validations: [
|
126
|
-
{
|
127
|
-
rule: 'required',
|
128
|
-
},
|
129
|
-
],
|
130
|
-
},
|
131
|
-
{
|
132
|
-
name: 'user.name',
|
133
|
-
title: `t('user', { scope: "${i18n}" })`,
|
134
|
-
groupId: 'section',
|
135
|
-
options: {
|
136
|
-
sort: {
|
137
|
-
enabled: true,
|
138
|
-
},
|
139
|
-
},
|
140
|
-
schema: {
|
141
|
-
dataType: 'string',
|
142
|
-
interface: {
|
143
|
-
type: AXPWidgetsCatalog.text,
|
144
|
-
},
|
145
|
-
},
|
146
|
-
validations: [
|
147
|
-
{
|
148
|
-
rule: 'required',
|
149
|
-
},
|
150
|
-
],
|
151
|
-
},
|
152
|
-
{
|
153
|
-
name: 'application.name',
|
154
|
-
title: `t('application', { scope: "${i18n}" })`,
|
155
|
-
groupId: 'section',
|
156
|
-
options: {
|
157
|
-
sort: {
|
158
|
-
enabled: true,
|
159
|
-
},
|
160
|
-
},
|
161
|
-
schema: {
|
162
|
-
dataType: 'string',
|
163
|
-
interface: {
|
164
|
-
type: AXPWidgetsCatalog.text,
|
165
|
-
},
|
166
|
-
},
|
167
|
-
validations: [
|
168
|
-
{
|
169
|
-
rule: 'required',
|
170
|
-
},
|
171
|
-
],
|
172
|
-
},
|
173
|
-
{
|
174
|
-
name: 'clientName',
|
175
|
-
title: `t('clientName', { scope: "${i18n}" })`,
|
176
|
-
groupId: 'section',
|
177
|
-
options: {
|
178
|
-
sort: {
|
179
|
-
enabled: true,
|
180
|
-
},
|
181
|
-
},
|
182
|
-
schema: {
|
183
|
-
dataType: 'string',
|
184
|
-
interface: {
|
185
|
-
type: AXPWidgetsCatalog.text,
|
186
|
-
},
|
187
|
-
},
|
188
|
-
validations: [
|
189
|
-
{
|
190
|
-
rule: 'required',
|
191
|
-
},
|
192
|
-
],
|
193
|
-
},
|
194
|
-
{
|
195
|
-
name: 'location',
|
196
|
-
title: `t('location', { scope: "${i18n}" })`,
|
197
|
-
groupId: 'device',
|
198
|
-
options: {
|
199
|
-
sort: {
|
200
|
-
enabled: true,
|
201
|
-
},
|
202
|
-
},
|
203
|
-
schema: {
|
204
|
-
dataType: 'string',
|
205
|
-
interface: {
|
206
|
-
type: AXPWidgetsCatalog.text,
|
207
|
-
},
|
208
|
-
},
|
209
|
-
validations: [
|
210
|
-
{
|
211
|
-
rule: 'required',
|
212
|
-
},
|
213
|
-
],
|
214
|
-
},
|
215
|
-
{
|
216
|
-
name: 'ipAddress',
|
217
|
-
title: `t('ipAddress', { scope: "${i18n}" })`,
|
218
|
-
groupId: 'device',
|
219
|
-
options: {
|
220
|
-
sort: {
|
221
|
-
enabled: true,
|
222
|
-
},
|
223
|
-
},
|
224
|
-
schema: {
|
225
|
-
dataType: 'string',
|
226
|
-
interface: {
|
227
|
-
type: AXPWidgetsCatalog.text,
|
228
|
-
},
|
229
|
-
},
|
230
|
-
validations: [
|
231
|
-
{
|
232
|
-
rule: 'required',
|
233
|
-
},
|
234
|
-
],
|
235
|
-
},
|
236
|
-
{
|
237
|
-
name: 'lastLoginDate',
|
238
|
-
title: `t('lastLoginDate', { scope: "${i18n}" })`,
|
239
|
-
groupId: 'session',
|
240
|
-
options: {
|
241
|
-
sort: {
|
242
|
-
enabled: true,
|
243
|
-
},
|
244
|
-
},
|
245
|
-
schema: {
|
246
|
-
dataType: 'dateTime',
|
247
|
-
interface: {
|
248
|
-
type: AXPWidgetsCatalog.dateTime,
|
249
|
-
options: {
|
250
|
-
format: 'MM/DD/YYYY hh:mm a',
|
251
|
-
},
|
252
|
-
},
|
253
|
-
},
|
254
|
-
validations: [
|
255
|
-
{
|
256
|
-
rule: 'required',
|
257
|
-
},
|
258
|
-
],
|
259
|
-
},
|
260
|
-
{
|
261
|
-
name: 'operatingSystem',
|
262
|
-
title: `t('operatingSystem', { scope: "${i18n}" })`,
|
263
|
-
groupId: 'device',
|
264
|
-
options: {
|
265
|
-
sort: {
|
266
|
-
enabled: true,
|
267
|
-
},
|
268
|
-
},
|
269
|
-
schema: {
|
270
|
-
dataType: 'string',
|
271
|
-
interface: {
|
272
|
-
type: AXPWidgetsCatalog.text,
|
273
|
-
},
|
274
|
-
},
|
275
|
-
validations: [
|
276
|
-
{
|
277
|
-
rule: 'required',
|
278
|
-
},
|
279
|
-
],
|
280
|
-
},
|
281
|
-
{
|
282
|
-
name: 'deviceName',
|
283
|
-
title: `t('deviceName', { scope: "${i18n}" })`,
|
284
|
-
groupId: 'device',
|
285
|
-
options: {
|
286
|
-
sort: {
|
287
|
-
enabled: true,
|
288
|
-
},
|
289
|
-
},
|
290
|
-
schema: {
|
291
|
-
dataType: 'string',
|
292
|
-
interface: {
|
293
|
-
type: AXPWidgetsCatalog.text,
|
294
|
-
},
|
295
|
-
},
|
296
|
-
validations: [
|
297
|
-
{
|
298
|
-
rule: 'required',
|
299
|
-
},
|
300
|
-
],
|
301
|
-
},
|
302
|
-
],
|
303
|
-
columns: [
|
304
|
-
{ name: 'tenant.name' },
|
305
|
-
{ name: 'user.name' },
|
306
|
-
{ name: 'application.name' },
|
307
|
-
{ name: 'clientName' },
|
308
|
-
{ name: 'location' },
|
309
|
-
{ name: 'deviceName' },
|
310
|
-
{ name: 'lastLoginDate' },
|
311
|
-
{ name: 'operatingSystem' },
|
312
|
-
],
|
313
|
-
commands: {
|
314
|
-
create: {
|
315
|
-
execute: async (data) => {
|
316
|
-
const res = await dataService.insertOne(data);
|
317
|
-
return { id: res };
|
318
|
-
},
|
319
|
-
},
|
320
|
-
delete: {
|
321
|
-
execute: async (id) => {
|
322
|
-
return await dataService.deleteOne(id);
|
323
|
-
},
|
324
|
-
},
|
325
|
-
update: {
|
326
|
-
execute: async (data) => {
|
327
|
-
return await dataService.updateOne(data.id, data);
|
328
|
-
},
|
329
|
-
},
|
330
|
-
terminate: {
|
331
|
-
execute: async (id) => {
|
332
|
-
const x = await dataService.terminate(id);
|
333
|
-
return x;
|
334
|
-
},
|
335
|
-
},
|
336
|
-
},
|
337
|
-
queries: {
|
338
|
-
byKey: {
|
339
|
-
execute: async (id) => {
|
340
|
-
return await dataService.getOne(id);
|
341
|
-
},
|
342
|
-
type: AXPEntityQueryType.Single,
|
343
|
-
},
|
344
|
-
list: {
|
345
|
-
execute: async (e) => {
|
346
|
-
const res = await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
|
347
|
-
console.log('res', res);
|
348
|
-
return res;
|
349
|
-
},
|
350
|
-
type: AXPEntityQueryType.List,
|
351
|
-
},
|
352
|
-
},
|
353
|
-
interfaces: {
|
354
|
-
master: {
|
355
|
-
create: {
|
356
|
-
sections: [
|
357
|
-
{
|
358
|
-
id: 'section',
|
359
|
-
},
|
360
|
-
],
|
361
|
-
properties: [
|
362
|
-
{
|
363
|
-
name: 'clientName',
|
364
|
-
layout: {
|
365
|
-
positions: {
|
366
|
-
lg: {
|
367
|
-
colSpan: 6,
|
368
|
-
},
|
369
|
-
},
|
370
|
-
},
|
371
|
-
},
|
372
|
-
{
|
373
|
-
name: 'title',
|
374
|
-
layout: {
|
375
|
-
positions: {
|
376
|
-
lg: {
|
377
|
-
colSpan: 6,
|
378
|
-
},
|
379
|
-
},
|
380
|
-
},
|
381
|
-
},
|
382
|
-
],
|
383
|
-
},
|
384
|
-
update: {
|
385
|
-
sections: [
|
386
|
-
{
|
387
|
-
id: 'section',
|
388
|
-
},
|
389
|
-
],
|
390
|
-
properties: [
|
391
|
-
{
|
392
|
-
name: 'ClientName',
|
393
|
-
layout: {
|
394
|
-
positions: {
|
395
|
-
lg: {
|
396
|
-
colSpan: 6,
|
397
|
-
},
|
398
|
-
},
|
399
|
-
},
|
400
|
-
},
|
401
|
-
{
|
402
|
-
name: 'title',
|
403
|
-
layout: {
|
404
|
-
positions: {
|
405
|
-
lg: {
|
406
|
-
colSpan: 6,
|
407
|
-
},
|
408
|
-
},
|
409
|
-
},
|
410
|
-
},
|
411
|
-
],
|
412
|
-
},
|
413
|
-
single: {
|
414
|
-
title: '{{user.name}}',
|
415
|
-
sections: [
|
416
|
-
{
|
417
|
-
id: 'session',
|
418
|
-
layout: {
|
419
|
-
positions: {
|
420
|
-
lg: {
|
421
|
-
colSpan: 12,
|
422
|
-
},
|
423
|
-
},
|
424
|
-
},
|
425
|
-
},
|
426
|
-
{
|
427
|
-
id: 'section',
|
428
|
-
layout: {
|
429
|
-
positions: {
|
430
|
-
lg: {
|
431
|
-
colSpan: 12,
|
432
|
-
},
|
433
|
-
},
|
434
|
-
},
|
435
|
-
},
|
436
|
-
{
|
437
|
-
id: 'device',
|
438
|
-
layout: {
|
439
|
-
positions: {
|
440
|
-
lg: {
|
441
|
-
colSpan: 12,
|
442
|
-
},
|
443
|
-
},
|
444
|
-
},
|
445
|
-
},
|
446
|
-
],
|
447
|
-
properties: [
|
448
|
-
{
|
449
|
-
name: 'tenant.name',
|
450
|
-
layout: {
|
451
|
-
positions: {
|
452
|
-
lg: {
|
453
|
-
colSpan: 6,
|
454
|
-
},
|
455
|
-
},
|
456
|
-
},
|
457
|
-
},
|
458
|
-
{
|
459
|
-
name: 'user.name',
|
460
|
-
layout: {
|
461
|
-
positions: {
|
462
|
-
lg: {
|
463
|
-
colSpan: 6,
|
464
|
-
},
|
465
|
-
},
|
466
|
-
},
|
467
|
-
},
|
468
|
-
{
|
469
|
-
name: 'application.name',
|
470
|
-
layout: {
|
471
|
-
positions: {
|
472
|
-
lg: {
|
473
|
-
colSpan: 6,
|
474
|
-
},
|
475
|
-
},
|
476
|
-
},
|
477
|
-
},
|
478
|
-
{
|
479
|
-
name: 'clientName',
|
480
|
-
layout: {
|
481
|
-
positions: {
|
482
|
-
lg: {
|
483
|
-
colSpan: 6,
|
484
|
-
},
|
485
|
-
},
|
486
|
-
},
|
487
|
-
},
|
488
|
-
{
|
489
|
-
name: 'location',
|
490
|
-
layout: {
|
491
|
-
positions: {
|
492
|
-
lg: {
|
493
|
-
colSpan: 6,
|
494
|
-
},
|
495
|
-
},
|
496
|
-
},
|
497
|
-
},
|
498
|
-
{
|
499
|
-
name: 'ipAddress',
|
500
|
-
layout: {
|
501
|
-
positions: {
|
502
|
-
lg: {
|
503
|
-
colSpan: 6,
|
504
|
-
},
|
505
|
-
},
|
506
|
-
},
|
507
|
-
},
|
508
|
-
{
|
509
|
-
name: 'lastLoginDate',
|
510
|
-
layout: {
|
511
|
-
positions: {
|
512
|
-
lg: {
|
513
|
-
colSpan: 6,
|
514
|
-
},
|
515
|
-
},
|
516
|
-
},
|
517
|
-
},
|
518
|
-
{
|
519
|
-
name: 'operatingSystem',
|
520
|
-
layout: {
|
521
|
-
positions: {
|
522
|
-
lg: {
|
523
|
-
colSpan: 6,
|
524
|
-
},
|
525
|
-
},
|
526
|
-
},
|
527
|
-
},
|
528
|
-
{
|
529
|
-
name: 'deviceName',
|
530
|
-
layout: {
|
531
|
-
positions: {
|
532
|
-
lg: {
|
533
|
-
colSpan: 6,
|
534
|
-
},
|
535
|
-
},
|
536
|
-
},
|
537
|
-
},
|
538
|
-
],
|
539
|
-
actions: [],
|
540
|
-
},
|
541
|
-
list: {
|
542
|
-
actions: [
|
543
|
-
// {
|
544
|
-
// title: `t("create", { scope: "common" })`,
|
545
|
-
// command: 'create-entity',
|
546
|
-
// priority: 'primary',
|
547
|
-
// type: 'create',
|
548
|
-
// scope: AXPEntityCommandScope.TypeLevel,
|
549
|
-
// },
|
550
|
-
// {
|
551
|
-
// title: 't("deleteItems", { scope: "common" })',
|
552
|
-
// command: 'delete-entity',
|
553
|
-
// priority: 'primary',
|
554
|
-
// type: 'delete',
|
555
|
-
// scope: AXPEntityCommandScope.Selected,
|
556
|
-
// },
|
557
|
-
{
|
558
|
-
title: 't("terminate.Selected", { scope: "common" })',
|
559
|
-
command: 'terminate-entity',
|
560
|
-
priority: 'primary',
|
561
|
-
type: 'delete',
|
562
|
-
scope: AXPEntityCommandScope.Selected,
|
563
|
-
},
|
564
|
-
{
|
565
|
-
title: 't("detail", { scope: "common" })',
|
566
|
-
command: 'open-entity',
|
567
|
-
priority: 'secondary',
|
568
|
-
type: 'view',
|
569
|
-
scope: AXPEntityCommandScope.Individual,
|
570
|
-
},
|
571
|
-
{
|
572
|
-
title: 't("terminate", { scope: "common" })',
|
573
|
-
command: 'terminate-entity',
|
574
|
-
priority: 'secondary',
|
575
|
-
type: 'delete',
|
576
|
-
scope: AXPEntityCommandScope.Individual,
|
577
|
-
},
|
578
|
-
],
|
579
|
-
views: [createAllQueryView({ sorts: [{ name: 'title', dir: 'asc' }] })],
|
580
|
-
},
|
581
|
-
},
|
582
|
-
},
|
583
|
-
};
|
584
|
-
return entityDef;
|
585
|
-
}
|
586
|
-
|
587
|
-
var deviceSessions_entity = /*#__PURE__*/Object.freeze({
|
588
|
-
__proto__: null,
|
589
|
-
factory: factory$3
|
590
|
-
});
|
30
|
+
import * as i5 from '@acorex/components/tabs';
|
31
|
+
import { AXTabsModule } from '@acorex/components/tabs';
|
32
|
+
import * as i7 from '@acorex/components/badge';
|
33
|
+
import { AXBadgeModule } from '@acorex/components/badge';
|
34
|
+
import * as i2$1 from '@angular/forms';
|
35
|
+
import { FormsModule } from '@angular/forms';
|
36
|
+
import { AXTooltipModule } from '@acorex/components/tooltip';
|
37
|
+
import { AXPPopupLayoutBaseComponent, AXPPopupLayoutComponent, AXPPopupLayoutBase } from '@acorex/platform/layout/views';
|
38
|
+
import { castArray } from 'lodash-es';
|
591
39
|
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
}
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
}
|
40
|
+
const config = {
|
41
|
+
i18n: 'security-management',
|
42
|
+
profileEntity: 'Profile',
|
43
|
+
};
|
44
|
+
const RootConfig = {
|
45
|
+
config,
|
46
|
+
module: {
|
47
|
+
route: 'security-management',
|
48
|
+
name: 'SecurityManagement',
|
49
|
+
title: `t('module-name', {scope:"${config.i18n}"})`,
|
50
|
+
icon: 'fa-light fa-file-invoice',
|
51
|
+
},
|
52
|
+
entities: {
|
53
|
+
deviceSessions: {
|
54
|
+
name: 'DeviceSessions',
|
55
|
+
title: `t("session", { scope: "${config.i18n}" })`,
|
56
|
+
titlePlural: `t("sessions", { scope: "${config.i18n}" })`,
|
57
|
+
icon: 'fa-light fa-default',
|
58
|
+
},
|
59
|
+
users: {
|
60
|
+
name: 'users',
|
61
|
+
title: `t("users", { scope: "${config.i18n}" })`,
|
62
|
+
icon: 'fa-light fa-users',
|
63
|
+
},
|
64
|
+
roles: {
|
65
|
+
name: 'roles',
|
66
|
+
title: `t("roles",{scope:"${config.i18n}"})`,
|
67
|
+
icon: 'fa-light fa-key',
|
68
|
+
},
|
69
|
+
profile: {
|
70
|
+
name: 'profile',
|
71
|
+
title: `t("profile",{scope:"${config.i18n}"})`,
|
72
|
+
icon: 'fa-light fa-user',
|
73
|
+
},
|
74
|
+
},
|
75
|
+
};
|
616
76
|
|
617
77
|
class AXMSecurityManagementRolesEntityService extends AXMEntityCrudServiceImpl {
|
618
78
|
}
|
@@ -640,6 +100,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
640
100
|
type: Injectable
|
641
101
|
}], ctorParameters: () => [] });
|
642
102
|
|
103
|
+
// export * from './device-sessions';
|
104
|
+
|
643
105
|
const key = 'security-management';
|
644
106
|
var AXPSecurityManagementMenuKeys;
|
645
107
|
(function (AXPSecurityManagementMenuKeys) {
|
@@ -667,8 +129,8 @@ class AXMEntityProvider {
|
|
667
129
|
return (await Promise.resolve().then(function () { return roles_entity; })).factory(this.injector);
|
668
130
|
case RootConfig.entities.profile.name:
|
669
131
|
return (await Promise.resolve().then(function () { return profile_entity; })).factory(this.injector);
|
670
|
-
case RootConfig.entities.deviceSessions.name:
|
671
|
-
|
132
|
+
// case RootConfig.entities.deviceSessions.name:
|
133
|
+
// return (await import('./entities/device-sessions/device-sessions.entity')).factory(this.injector);
|
672
134
|
}
|
673
135
|
}
|
674
136
|
return null;
|
@@ -717,16 +179,16 @@ class AXMMenuProvider {
|
|
717
179
|
// requiredPermission: 'demo.admin.settings',
|
718
180
|
},
|
719
181
|
},
|
720
|
-
{
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
},
|
182
|
+
// {
|
183
|
+
// priority: 9005,
|
184
|
+
// text: `t('deviceSessions', { scope: "${scope}" })`,
|
185
|
+
// path: this.entityService.createPath(moduleName, RootConfig.entities.deviceSessions.name),
|
186
|
+
// icon: 'fa-light fa-key',
|
187
|
+
// name: AXPSecurityManagementMenuKeys.DeviceSessions,
|
188
|
+
// data: {
|
189
|
+
// // requiredPermission: 'demo.admin.settings',
|
190
|
+
// },
|
191
|
+
// },
|
730
192
|
],
|
731
193
|
},
|
732
194
|
]);
|
@@ -1918,233 +1380,83 @@ async function factory(injector) {
|
|
1918
1380
|
priority: 'secondary',
|
1919
1381
|
type: 'delete',
|
1920
1382
|
scope: AXPEntityCommandScope.Individual,
|
1921
|
-
},
|
1922
|
-
{
|
1923
|
-
title: `@security-management:features.permissions.actions.assign.title`,
|
1924
|
-
command: 'assign-permissions',
|
1925
|
-
priority: 'secondary',
|
1926
|
-
type: 'view',
|
1927
|
-
scope: AXPEntityCommandScope.Individual,
|
1928
|
-
},
|
1929
|
-
{
|
1930
|
-
title: '@activity-log:actions.view-history',
|
1931
|
-
command: {
|
1932
|
-
name: 'show-version-history-popup',
|
1933
|
-
options: {
|
1934
|
-
refId: '{{ context.eval("id") }}',
|
1935
|
-
refType: RootConfig.module.name + '.' + RootConfig.entities.roles.name,
|
1936
|
-
}
|
1937
|
-
},
|
1938
|
-
priority: 'secondary',
|
1939
|
-
type: 'version-history',
|
1940
|
-
scope: AXPEntityCommandScope.Individual,
|
1941
|
-
},
|
1942
|
-
{
|
1943
|
-
title: 'Compare',
|
1944
|
-
command: {
|
1945
|
-
name: 'show-entity-records-compare',
|
1946
|
-
},
|
1947
|
-
priority: 'secondary',
|
1948
|
-
type: 'version-history',
|
1949
|
-
scope: AXPEntityCommandScope.Selected
|
1950
|
-
}
|
1951
|
-
],
|
1952
|
-
views: [
|
1953
|
-
{
|
1954
|
-
name: 'all',
|
1955
|
-
title: `allItem`,
|
1956
|
-
fixed: true,
|
1957
|
-
columns: [],
|
1958
|
-
conditions: [],
|
1959
|
-
sorts: [],
|
1960
|
-
},
|
1961
|
-
],
|
1962
|
-
},
|
1963
|
-
},
|
1964
|
-
},
|
1965
|
-
};
|
1966
|
-
return entityDef;
|
1967
|
-
}
|
1968
|
-
|
1969
|
-
var roles_entity = /*#__PURE__*/Object.freeze({
|
1970
|
-
__proto__: null,
|
1971
|
-
factory: factory
|
1972
|
-
});
|
1973
|
-
|
1974
|
-
class AXMSecurityManagementRolesEntityModule {
|
1975
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMSecurityManagementRolesEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
1976
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: AXMSecurityManagementRolesEntityModule }); }
|
1977
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMSecurityManagementRolesEntityModule, providers: [
|
1978
|
-
{
|
1979
|
-
provide: AXMSecurityManagementRolesEntityService,
|
1980
|
-
useClass: AXMSecurityManagementRolesEntityServiceImpl,
|
1981
|
-
},
|
1982
|
-
] }); }
|
1983
|
-
}
|
1984
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMSecurityManagementRolesEntityModule, decorators: [{
|
1985
|
-
type: NgModule,
|
1986
|
-
args: [{
|
1987
|
-
imports: [],
|
1988
|
-
exports: [],
|
1989
|
-
declarations: [],
|
1990
|
-
providers: [
|
1991
|
-
{
|
1992
|
-
provide: AXMSecurityManagementRolesEntityService,
|
1993
|
-
useClass: AXMSecurityManagementRolesEntityServiceImpl,
|
1994
|
-
},
|
1995
|
-
],
|
1996
|
-
}]
|
1997
|
-
}] });
|
1998
|
-
|
1999
|
-
class AXMSearchCommandProvider extends AXPSearchCommandProvider {
|
2000
|
-
constructor() {
|
2001
|
-
super(...arguments);
|
2002
|
-
this.commands = [
|
2003
|
-
{
|
2004
|
-
id: 'create-security-user',
|
2005
|
-
group: 'command',
|
2006
|
-
title: 'New User',
|
2007
|
-
icon: RootConfig.entities.users.icon,
|
2008
|
-
description: 'Create a new user entity in the system.', // Added meaningful description
|
2009
|
-
command: {
|
2010
|
-
// 'create-entity': {
|
2011
|
-
// entity: `${RootConfig.module.name}.${RootConfig.entities.users.name}`,
|
2012
|
-
// },
|
2013
|
-
name: 'create-entity',
|
2014
|
-
options: {
|
2015
|
-
entity: `${RootConfig.module.name}.${RootConfig.entities.users.name}`
|
2016
|
-
}
|
2017
|
-
},
|
2018
|
-
},
|
2019
|
-
{
|
2020
|
-
id: 'create-security-role',
|
2021
|
-
group: 'command',
|
2022
|
-
title: 'New Security Role',
|
2023
|
-
icon: RootConfig.entities.roles.icon,
|
2024
|
-
description: 'Define a new security role to manage permissions.', // Added meaningful description
|
2025
|
-
command: {
|
2026
|
-
// 'create-entity': {
|
2027
|
-
// entity: `${RootConfig.module.name}.${RootConfig.entities.roles.name}`,
|
2028
|
-
// },
|
2029
|
-
name: 'create-entity',
|
2030
|
-
options: {
|
2031
|
-
entity: `${RootConfig.module.name}.${RootConfig.entities.roles.name}`,
|
2032
|
-
}
|
2033
|
-
},
|
2034
|
-
},
|
2035
|
-
];
|
2036
|
-
}
|
2037
|
-
}
|
2038
|
-
|
2039
|
-
const AXPSessionTerminateEvent = createWorkFlowEvent('[Entity] Terminated!');
|
2040
|
-
class AXPSessionTerminatePopupAction extends AXPWorkflowAction {
|
2041
|
-
constructor() {
|
2042
|
-
super(...arguments);
|
2043
|
-
this.entityRegistery = inject(AXPEntityDefinitionRegistryService);
|
2044
|
-
this.dialogService = inject(AXDialogService);
|
2045
|
-
this.loadingDialog = inject(AXLoadingDialogService);
|
2046
|
-
this.translationService = inject(AXTranslationService);
|
2047
|
-
}
|
2048
|
-
async execute(context) {
|
2049
|
-
const moduleEntity = context.getVariable('entity');
|
2050
|
-
const [moduleName, entityName] = moduleEntity.split('.');
|
2051
|
-
const data = context.getVariable('data');
|
2052
|
-
const meta = context.getVariable('meta');
|
2053
|
-
const ids = Array.isArray(data) ? data.map((c) => c.id) : [data.id];
|
2054
|
-
const entity = await this.entityRegistery.resolve(moduleName, entityName);
|
2055
|
-
if (entity.parentKey && data[entity.parentKey]) {
|
2056
|
-
context.setVariable('meta', { ...meta, refreshTargetId: data[entity.parentKey] });
|
2057
|
-
}
|
2058
|
-
context.setVariable('terminateSuccessful', false);
|
2059
|
-
const dialog = this.loadingDialog.show({
|
2060
|
-
title: await this.translationService.translateAsync('workflow.terminating'),
|
2061
|
-
mode: 'determinate',
|
2062
|
-
status: 'Terminating...',
|
2063
|
-
progressValue: 0,
|
2064
|
-
text: `0/${ids.length}`,
|
2065
|
-
buttons: [
|
2066
|
-
{
|
2067
|
-
text: await this.translationService.translateAsync('cancel'),
|
2068
|
-
color: 'danger',
|
2069
|
-
onClick: () => {
|
2070
|
-
dialog.close();
|
2071
|
-
},
|
2072
|
-
},
|
2073
|
-
],
|
2074
|
-
});
|
2075
|
-
if (entity.commands.terminate != null) {
|
2076
|
-
const terminateExec = entity.commands.terminate?.execute;
|
2077
|
-
let faildCounter = 0;
|
2078
|
-
for (const element of ids) {
|
2079
|
-
const res = await terminateExec(element);
|
2080
|
-
if (!res) {
|
2081
|
-
faildCounter++;
|
2082
|
-
await this.dialogService.alert(await this.translationService.translateAsync('workflow.fail-delete-title'), await this.translationService.translateAsync('workflow.fail-delete-body', {
|
2083
|
-
params: { item: 1 },
|
2084
|
-
}), 'danger');
|
2085
|
-
}
|
2086
|
-
}
|
2087
|
-
context.setOutput('result', faildCounter == 0 ? true : false);
|
2088
|
-
setTimeout(() => {
|
2089
|
-
dialog.close();
|
2090
|
-
this.dispatch(AXPRefreshEvent({ entity: moduleEntity, meta: context.getVariable('meta') }));
|
2091
|
-
}, 300);
|
2092
|
-
}
|
2093
|
-
}
|
2094
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPSessionTerminatePopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
2095
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPSessionTerminatePopupAction }); }
|
2096
|
-
}
|
2097
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPSessionTerminatePopupAction, decorators: [{
|
2098
|
-
type: Injectable
|
2099
|
-
}] });
|
2100
|
-
const AXPSessionTerminateWorkflow = {
|
2101
|
-
startStepId: 'show-popup',
|
2102
|
-
steps: {
|
2103
|
-
'show-popup': {
|
2104
|
-
action: 'AXPSessionTerminatePopupAction',
|
2105
|
-
nextSteps: [
|
2106
|
-
{
|
2107
|
-
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
|
2108
|
-
nextStepId: 'show-toast',
|
1383
|
+
},
|
1384
|
+
{
|
1385
|
+
title: `@security-management:features.permissions.actions.assign.title`,
|
1386
|
+
command: 'assign-permissions',
|
1387
|
+
priority: 'secondary',
|
1388
|
+
type: 'view',
|
1389
|
+
scope: AXPEntityCommandScope.Individual,
|
1390
|
+
},
|
1391
|
+
{
|
1392
|
+
title: '@activity-log:actions.view-history',
|
1393
|
+
command: {
|
1394
|
+
name: 'show-version-history-popup',
|
1395
|
+
options: {
|
1396
|
+
refId: '{{ context.eval("id") }}',
|
1397
|
+
refType: RootConfig.module.name + '.' + RootConfig.entities.roles.name,
|
1398
|
+
}
|
1399
|
+
},
|
1400
|
+
priority: 'secondary',
|
1401
|
+
type: 'version-history',
|
1402
|
+
scope: AXPEntityCommandScope.Individual,
|
1403
|
+
},
|
1404
|
+
{
|
1405
|
+
title: 'Compare',
|
1406
|
+
command: {
|
1407
|
+
name: 'show-entity-records-compare',
|
1408
|
+
},
|
1409
|
+
priority: 'secondary',
|
1410
|
+
type: 'version-history',
|
1411
|
+
scope: AXPEntityCommandScope.Selected
|
1412
|
+
}
|
1413
|
+
],
|
1414
|
+
views: [
|
1415
|
+
{
|
1416
|
+
name: 'all',
|
1417
|
+
title: `allItem`,
|
1418
|
+
fixed: true,
|
1419
|
+
columns: [],
|
1420
|
+
conditions: [],
|
1421
|
+
sorts: [],
|
1422
|
+
},
|
1423
|
+
],
|
2109
1424
|
},
|
2110
|
-
],
|
2111
|
-
},
|
2112
|
-
'show-toast': {
|
2113
|
-
action: 'AXPToastAction',
|
2114
|
-
input: {
|
2115
|
-
color: 'success',
|
2116
|
-
title: 'workflow.session-terminated',
|
2117
|
-
content: 'workflow.session-terminated-body',
|
2118
1425
|
},
|
2119
|
-
nextSteps: [
|
2120
|
-
{
|
2121
|
-
conditions: [],
|
2122
|
-
nextStepId: 'dispatch-event',
|
2123
|
-
},
|
2124
|
-
],
|
2125
1426
|
},
|
2126
|
-
}
|
2127
|
-
|
1427
|
+
};
|
1428
|
+
return entityDef;
|
1429
|
+
}
|
2128
1430
|
|
2129
|
-
|
2130
|
-
|
2131
|
-
|
2132
|
-
|
2133
|
-
|
2134
|
-
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2138
|
-
|
2139
|
-
|
2140
|
-
|
2141
|
-
|
2142
|
-
|
2143
|
-
status: 'online',
|
2144
|
-
avatarUrl: 'https://via.placeholder.com/150',
|
2145
|
-
};
|
2146
|
-
}
|
1431
|
+
var roles_entity = /*#__PURE__*/Object.freeze({
|
1432
|
+
__proto__: null,
|
1433
|
+
factory: factory
|
1434
|
+
});
|
1435
|
+
|
1436
|
+
class AXMSecurityManagementRolesEntityModule {
|
1437
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMSecurityManagementRolesEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
1438
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: AXMSecurityManagementRolesEntityModule }); }
|
1439
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMSecurityManagementRolesEntityModule, providers: [
|
1440
|
+
{
|
1441
|
+
provide: AXMSecurityManagementRolesEntityService,
|
1442
|
+
useClass: AXMSecurityManagementRolesEntityServiceImpl,
|
1443
|
+
},
|
1444
|
+
] }); }
|
2147
1445
|
}
|
1446
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMSecurityManagementRolesEntityModule, decorators: [{
|
1447
|
+
type: NgModule,
|
1448
|
+
args: [{
|
1449
|
+
imports: [],
|
1450
|
+
exports: [],
|
1451
|
+
declarations: [],
|
1452
|
+
providers: [
|
1453
|
+
{
|
1454
|
+
provide: AXMSecurityManagementRolesEntityService,
|
1455
|
+
useClass: AXMSecurityManagementRolesEntityServiceImpl,
|
1456
|
+
},
|
1457
|
+
],
|
1458
|
+
}]
|
1459
|
+
}] });
|
2148
1460
|
|
2149
1461
|
const AXPPermissionsWidget = {
|
2150
1462
|
name: "permissions-editor",
|
@@ -2368,9 +1680,160 @@ class AXMUsersDataSourceDefinition {
|
|
2368
1680
|
}
|
2369
1681
|
}
|
2370
1682
|
|
1683
|
+
class AXMSearchCommandProvider extends AXPSearchCommandProvider {
|
1684
|
+
constructor() {
|
1685
|
+
super(...arguments);
|
1686
|
+
this.commands = [
|
1687
|
+
{
|
1688
|
+
id: 'create-security-user',
|
1689
|
+
group: 'command',
|
1690
|
+
title: 'New User',
|
1691
|
+
icon: RootConfig.entities.users.icon,
|
1692
|
+
description: 'Create a new user entity in the system.', // Added meaningful description
|
1693
|
+
command: {
|
1694
|
+
// 'create-entity': {
|
1695
|
+
// entity: `${RootConfig.module.name}.${RootConfig.entities.users.name}`,
|
1696
|
+
// },
|
1697
|
+
name: 'create-entity',
|
1698
|
+
options: {
|
1699
|
+
entity: `${RootConfig.module.name}.${RootConfig.entities.users.name}`
|
1700
|
+
}
|
1701
|
+
},
|
1702
|
+
},
|
1703
|
+
{
|
1704
|
+
id: 'create-security-role',
|
1705
|
+
group: 'command',
|
1706
|
+
title: 'New Security Role',
|
1707
|
+
icon: RootConfig.entities.roles.icon,
|
1708
|
+
description: 'Define a new security role to manage permissions.', // Added meaningful description
|
1709
|
+
command: {
|
1710
|
+
// 'create-entity': {
|
1711
|
+
// entity: `${RootConfig.module.name}.${RootConfig.entities.roles.name}`,
|
1712
|
+
// },
|
1713
|
+
name: 'create-entity',
|
1714
|
+
options: {
|
1715
|
+
entity: `${RootConfig.module.name}.${RootConfig.entities.roles.name}`,
|
1716
|
+
}
|
1717
|
+
},
|
1718
|
+
},
|
1719
|
+
];
|
1720
|
+
}
|
1721
|
+
}
|
1722
|
+
|
1723
|
+
class AXMUserAvatarProvider {
|
1724
|
+
constructor() {
|
1725
|
+
this.userService = inject(AXMUsersEntityService);
|
1726
|
+
}
|
1727
|
+
async provide(userId) {
|
1728
|
+
const user = await this.userService.getOne(userId);
|
1729
|
+
if (!user) {
|
1730
|
+
throw new Error(`User not found for ${userId}`);
|
1731
|
+
}
|
1732
|
+
return {
|
1733
|
+
id: user.id,
|
1734
|
+
username: user.username,
|
1735
|
+
firstName: user.firstName,
|
1736
|
+
lastName: user.lastName,
|
1737
|
+
status: 'online',
|
1738
|
+
avatarUrl: 'https://via.placeholder.com/150',
|
1739
|
+
};
|
1740
|
+
}
|
1741
|
+
}
|
1742
|
+
|
1743
|
+
const AXPSessionTerminateEvent = createWorkFlowEvent('[Entity] Terminated!');
|
1744
|
+
class AXPSessionTerminatePopupAction extends AXPWorkflowAction {
|
1745
|
+
constructor() {
|
1746
|
+
super(...arguments);
|
1747
|
+
this.entityRegistery = inject(AXPEntityDefinitionRegistryService);
|
1748
|
+
this.dialogService = inject(AXDialogService);
|
1749
|
+
this.loadingDialog = inject(AXLoadingDialogService);
|
1750
|
+
this.translationService = inject(AXTranslationService);
|
1751
|
+
}
|
1752
|
+
async execute(context) {
|
1753
|
+
const moduleEntity = context.getVariable('entity');
|
1754
|
+
const [moduleName, entityName] = moduleEntity.split('.');
|
1755
|
+
const data = context.getVariable('data');
|
1756
|
+
const meta = context.getVariable('meta');
|
1757
|
+
const ids = Array.isArray(data) ? data.map((c) => c.id) : [data.id];
|
1758
|
+
const entity = await this.entityRegistery.resolve(moduleName, entityName);
|
1759
|
+
if (entity.parentKey && data[entity.parentKey]) {
|
1760
|
+
context.setVariable('meta', { ...meta, refreshTargetId: data[entity.parentKey] });
|
1761
|
+
}
|
1762
|
+
context.setVariable('terminateSuccessful', false);
|
1763
|
+
const dialog = this.loadingDialog.show({
|
1764
|
+
title: await this.translationService.translateAsync('workflow.terminating'),
|
1765
|
+
mode: 'determinate',
|
1766
|
+
status: 'Terminating...',
|
1767
|
+
progressValue: 0,
|
1768
|
+
text: `0/${ids.length}`,
|
1769
|
+
buttons: [
|
1770
|
+
{
|
1771
|
+
text: await this.translationService.translateAsync('cancel'),
|
1772
|
+
color: 'danger',
|
1773
|
+
onClick: () => {
|
1774
|
+
dialog.close();
|
1775
|
+
},
|
1776
|
+
},
|
1777
|
+
],
|
1778
|
+
});
|
1779
|
+
if (entity.commands.terminate != null) {
|
1780
|
+
const terminateExec = entity.commands.terminate?.execute;
|
1781
|
+
let faildCounter = 0;
|
1782
|
+
for (const element of ids) {
|
1783
|
+
const res = await terminateExec(element);
|
1784
|
+
if (!res) {
|
1785
|
+
faildCounter++;
|
1786
|
+
await this.dialogService.alert(await this.translationService.translateAsync('workflow.fail-delete-title'), await this.translationService.translateAsync('workflow.fail-delete-body', {
|
1787
|
+
params: { item: 1 },
|
1788
|
+
}), 'danger');
|
1789
|
+
}
|
1790
|
+
}
|
1791
|
+
context.setOutput('result', faildCounter == 0 ? true : false);
|
1792
|
+
setTimeout(() => {
|
1793
|
+
dialog.close();
|
1794
|
+
this.dispatch(AXPRefreshEvent({ entity: moduleEntity, meta: context.getVariable('meta') }));
|
1795
|
+
}, 300);
|
1796
|
+
}
|
1797
|
+
}
|
1798
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPSessionTerminatePopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
1799
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPSessionTerminatePopupAction }); }
|
1800
|
+
}
|
1801
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPSessionTerminatePopupAction, decorators: [{
|
1802
|
+
type: Injectable
|
1803
|
+
}] });
|
1804
|
+
const AXPSessionTerminateWorkflow = {
|
1805
|
+
startStepId: 'show-popup',
|
1806
|
+
steps: {
|
1807
|
+
'show-popup': {
|
1808
|
+
action: 'AXPSessionTerminatePopupAction',
|
1809
|
+
nextSteps: [
|
1810
|
+
{
|
1811
|
+
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
|
1812
|
+
nextStepId: 'show-toast',
|
1813
|
+
},
|
1814
|
+
],
|
1815
|
+
},
|
1816
|
+
'show-toast': {
|
1817
|
+
action: 'AXPToastAction',
|
1818
|
+
input: {
|
1819
|
+
color: 'success',
|
1820
|
+
title: 'workflow.session-terminated',
|
1821
|
+
content: 'workflow.session-terminated-body',
|
1822
|
+
},
|
1823
|
+
nextSteps: [
|
1824
|
+
{
|
1825
|
+
conditions: [],
|
1826
|
+
nextStepId: 'dispatch-event',
|
1827
|
+
},
|
1828
|
+
],
|
1829
|
+
},
|
1830
|
+
},
|
1831
|
+
};
|
1832
|
+
|
2371
1833
|
class AXMSecurityManagementModule {
|
2372
1834
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMSecurityManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
2373
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: AXMSecurityManagementModule, imports: [
|
1835
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: AXMSecurityManagementModule, imports: [
|
1836
|
+
// AXMSecurityManagementDeviceSessionsEntityModule,
|
2374
1837
|
AXMSecurityManagementProfileEntityModule,
|
2375
1838
|
AXMSecurityManagementRolesEntityModule,
|
2376
1839
|
AXMSecurityManagementUsersEntityModule,
|
@@ -2400,14 +1863,15 @@ class AXMSecurityManagementModule {
|
|
2400
1863
|
useClass: AXMUsersDataSourceDefinition,
|
2401
1864
|
multi: true,
|
2402
1865
|
},
|
2403
|
-
], imports: [
|
1866
|
+
], imports: [
|
1867
|
+
// AXMSecurityManagementDeviceSessionsEntityModule,
|
2404
1868
|
AXMSecurityManagementProfileEntityModule,
|
2405
1869
|
AXMSecurityManagementRolesEntityModule,
|
2406
1870
|
AXMSecurityManagementUsersEntityModule,
|
2407
1871
|
AXMPermissionsModule,
|
2408
1872
|
AXPWorkflowModule.forChild({
|
2409
1873
|
actions: {
|
2410
|
-
AXPSessionTerminatePopupAction
|
1874
|
+
AXPSessionTerminatePopupAction,
|
2411
1875
|
},
|
2412
1876
|
workflows: {
|
2413
1877
|
'terminate-entity': AXPSessionTerminateWorkflow,
|
@@ -2419,14 +1883,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
2419
1883
|
type: NgModule,
|
2420
1884
|
args: [{
|
2421
1885
|
imports: [
|
2422
|
-
AXMSecurityManagementDeviceSessionsEntityModule,
|
1886
|
+
// AXMSecurityManagementDeviceSessionsEntityModule,
|
2423
1887
|
AXMSecurityManagementProfileEntityModule,
|
2424
1888
|
AXMSecurityManagementRolesEntityModule,
|
2425
1889
|
AXMSecurityManagementUsersEntityModule,
|
2426
1890
|
AXMPermissionsModule,
|
2427
1891
|
AXPWorkflowModule.forChild({
|
2428
1892
|
actions: {
|
2429
|
-
AXPSessionTerminatePopupAction
|
1893
|
+
AXPSessionTerminatePopupAction,
|
2430
1894
|
},
|
2431
1895
|
workflows: {
|
2432
1896
|
'terminate-entity': AXPSessionTerminateWorkflow,
|
@@ -2982,5 +2446,5 @@ var permissionsWidgetDesigner_component = /*#__PURE__*/Object.freeze({
|
|
2982
2446
|
* Generated bundle index. Do not edit.
|
2983
2447
|
*/
|
2984
2448
|
|
2985
|
-
export { AXMPermissionsModule,
|
2449
|
+
export { AXMPermissionsModule, AXMSecurityManagementModule, AXMSecurityManagementRolesEntityService, AXMSecurityManagementRolesEntityServiceImpl, AXMUsersEntityService, AXMUsersEntityServiceImpl, AXPPermissionsEditorComponent, AXPPermissionsEditorPopupComponent, AXPPermissionsWidget, AXPPermissionsWidgetColumnComponent, AXPPermissionsWidgetDesignerComponent, AXPPermissionsWidgetEditComponent, AXPPermissionsWidgetPrintComponent, AXPPermissionsWidgetViewComponent, AXPSecurityManagementMenuKeys, RootConfig };
|
2986
2450
|
//# sourceMappingURL=acorex-modules-security-management.mjs.map
|