@cauca-911/management 3.0.1 → 13.0.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.
Files changed (60) hide show
  1. package/cauca-911-management.d.ts +5 -5
  2. package/esm2020/cauca-911-management.mjs +5 -0
  3. package/esm2020/lib/cauca-management-group/cauca-management-group.component.mjs +285 -0
  4. package/esm2020/lib/cauca-management-user/cauca-management-user.component.mjs +96 -0
  5. package/esm2020/lib/cauca-management.component.mjs +23 -0
  6. package/esm2020/lib/cauca-management.module.mjs +57 -0
  7. package/esm2020/lib/cauca-management.service.mjs +14 -0
  8. package/esm2020/lib/shared/models/group-model.mjs +8 -0
  9. package/esm2020/lib/shared/models/group-permission-model.mjs +9 -0
  10. package/esm2020/lib/shared/models/permission-model.mjs +8 -0
  11. package/esm2020/lib/shared/models/user-group-model.mjs +8 -0
  12. package/esm2020/lib/shared/models/user-model.mjs +11 -0
  13. package/esm2020/lib/shared/models/user-permission-model.mjs +9 -0
  14. package/esm2020/lib/shared/services/management-group.service.mjs +34 -0
  15. package/esm2020/lib/shared/services/management-permission.service.mjs +31 -0
  16. package/esm2020/lib/shared/services/management-user.service.mjs +49 -0
  17. package/esm2020/public-api.mjs +16 -0
  18. package/fesm2015/cauca-911-management.mjs +649 -0
  19. package/fesm2015/cauca-911-management.mjs.map +1 -0
  20. package/fesm2020/cauca-911-management.mjs +613 -0
  21. package/fesm2020/cauca-911-management.mjs.map +1 -0
  22. package/lib/cauca-management-group/cauca-management-group.component.d.ts +45 -42
  23. package/lib/cauca-management-user/cauca-management-user.component.d.ts +20 -17
  24. package/lib/cauca-management.component.d.ts +8 -5
  25. package/lib/cauca-management.module.d.ts +15 -2
  26. package/lib/cauca-management.service.d.ts +6 -3
  27. package/lib/shared/models/group-model.d.ts +9 -9
  28. package/lib/shared/models/group-permission-model.d.ts +7 -7
  29. package/lib/shared/models/permission-model.d.ts +7 -7
  30. package/lib/shared/models/user-group-model.d.ts +6 -6
  31. package/lib/shared/models/user-model.d.ts +14 -14
  32. package/lib/shared/models/user-permission-model.d.ts +7 -7
  33. package/lib/shared/services/management-group.service.d.ts +17 -14
  34. package/lib/shared/services/management-permission.service.d.ts +16 -13
  35. package/lib/shared/services/management-user.service.d.ts +23 -20
  36. package/package.json +27 -12
  37. package/public-api.d.ts +12 -12
  38. package/bundles/cauca-911-management.umd.js +0 -518
  39. package/bundles/cauca-911-management.umd.js.map +0 -1
  40. package/bundles/cauca-911-management.umd.min.js +0 -2
  41. package/bundles/cauca-911-management.umd.min.js.map +0 -1
  42. package/cauca-911-management.metadata.json +0 -1
  43. package/esm2015/cauca-911-management.js +0 -6
  44. package/esm2015/lib/cauca-management-group/cauca-management-group.component.js +0 -212
  45. package/esm2015/lib/cauca-management-user/cauca-management-user.component.js +0 -57
  46. package/esm2015/lib/cauca-management.component.js +0 -14
  47. package/esm2015/lib/cauca-management.module.js +0 -35
  48. package/esm2015/lib/cauca-management.service.js +0 -13
  49. package/esm2015/lib/shared/models/group-model.js +0 -8
  50. package/esm2015/lib/shared/models/group-permission-model.js +0 -9
  51. package/esm2015/lib/shared/models/permission-model.js +0 -8
  52. package/esm2015/lib/shared/models/user-group-model.js +0 -8
  53. package/esm2015/lib/shared/models/user-model.js +0 -11
  54. package/esm2015/lib/shared/models/user-permission-model.js +0 -9
  55. package/esm2015/lib/shared/services/management-group.service.js +0 -38
  56. package/esm2015/lib/shared/services/management-permission.service.js +0 -35
  57. package/esm2015/lib/shared/services/management-user.service.js +0 -53
  58. package/esm2015/public-api.js +0 -16
  59. package/fesm2015/cauca-911-management.js +0 -481
  60. package/fesm2015/cauca-911-management.js.map +0 -1
@@ -1,518 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('devextreme-angular/ui/check-box'), require('devextreme-angular/ui/list'), require('devextreme-angular/ui/tag-box'), require('@cauca-911/core'), require('@cauca-911/devextreme'), require('@angular/cdk/layout'), require('rxjs/operators'), require('@angular/common/http'), require('@angular/common')) :
3
- typeof define === 'function' && define.amd ? define('@cauca-911/management', ['exports', '@angular/core', 'devextreme-angular/ui/check-box', 'devextreme-angular/ui/list', 'devextreme-angular/ui/tag-box', '@cauca-911/core', '@cauca-911/devextreme', '@angular/cdk/layout', 'rxjs/operators', '@angular/common/http', '@angular/common'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['cauca-911'] = global['cauca-911'] || {}, global['cauca-911'].management = {}), global.ng.core, global.checkBox, global.list, global.tagBox, global.i1, global.devextreme, global.ng.cdk.layout, global.rxjs.operators, global.ng.common.http, global.ng.common));
5
- }(this, (function (exports, i0, checkBox, list, tagBox, i1, devextreme, layout, operators, i2, common) { 'use strict';
6
-
7
- var CaucaManagementService = /** @class */ (function () {
8
- function CaucaManagementService() {
9
- }
10
- return CaucaManagementService;
11
- }());
12
- CaucaManagementService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CaucaManagementService_Factory() { return new CaucaManagementService(); }, token: CaucaManagementService, providedIn: "root" });
13
- CaucaManagementService.decorators = [
14
- { type: i0.Injectable, args: [{
15
- providedIn: 'root'
16
- },] }
17
- ];
18
- CaucaManagementService.ctorParameters = function () { return []; };
19
-
20
- var CaucaManagementComponent = /** @class */ (function () {
21
- function CaucaManagementComponent() {
22
- }
23
- CaucaManagementComponent.prototype.ngOnInit = function () {
24
- };
25
- return CaucaManagementComponent;
26
- }());
27
- CaucaManagementComponent.decorators = [
28
- { type: i0.Component, args: [{
29
- selector: 'cauca-management',
30
- template: "<div>{{'core.noGenericComponentOnThisLibrary' | translate}}</div>"
31
- },] }
32
- ];
33
- CaucaManagementComponent.ctorParameters = function () { return []; };
34
-
35
- var ManagementGroupService = /** @class */ (function () {
36
- function ManagementGroupService(coreService, http) {
37
- this.http = http;
38
- this.config = coreService.getConfig();
39
- }
40
- ManagementGroupService.prototype.getAll = function () {
41
- return this.http.get(this.config.apiUrl + "GroupManagement");
42
- };
43
- ManagementGroupService.prototype.get = function (idGroup) {
44
- return this.http.get(this.config.apiUrl + "GroupManagement/" + idGroup);
45
- };
46
- ManagementGroupService.prototype.save = function (group) {
47
- return this.http.post(this.config.apiUrl + "GroupManagement", group);
48
- };
49
- ManagementGroupService.prototype.delete = function (idGroup) {
50
- return this.http.delete(this.config.apiUrl + "GroupManagement/" + idGroup);
51
- };
52
- ManagementGroupService.prototype.hasExistingGroupName = function (group) {
53
- return this.http.post(this.config.apiUrl + "GroupManagement/GroupNameAlreadyExist", group);
54
- };
55
- return ManagementGroupService;
56
- }());
57
- ManagementGroupService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ManagementGroupService_Factory() { return new ManagementGroupService(i0.ɵɵinject(i1.CaucaCoreService), i0.ɵɵinject(i2.HttpClient)); }, token: ManagementGroupService, providedIn: "root" });
58
- ManagementGroupService.decorators = [
59
- { type: i0.Injectable, args: [{
60
- providedIn: 'root'
61
- },] }
62
- ];
63
- ManagementGroupService.ctorParameters = function () { return [
64
- { type: i1.CaucaCoreService },
65
- { type: i2.HttpClient }
66
- ]; };
67
-
68
- var ManagementUserService = /** @class */ (function () {
69
- function ManagementUserService(coreService, http) {
70
- this.http = http;
71
- this.config = coreService.getConfig();
72
- }
73
- ManagementUserService.prototype.getAll = function () {
74
- return this.http.get(this.config.apiUrl + "UserManagement");
75
- };
76
- ManagementUserService.prototype.get = function (idUser) {
77
- return this.http.get(this.config.apiUrl + "UserManagement/" + idUser);
78
- };
79
- ManagementUserService.prototype.getGroup = function (idUser) {
80
- return this.http.get(this.config.apiUrl + "UserManagement/" + idUser + "/groups");
81
- };
82
- ManagementUserService.prototype.addGroup = function (userGroup) {
83
- return this.http.post(this.config.apiUrl + "UserManagement/group", userGroup);
84
- };
85
- ManagementUserService.prototype.deleteGroup = function (idUserGroup) {
86
- return this.http.delete(this.config.apiUrl + "UserManagement/groups/" + idUserGroup);
87
- };
88
- ManagementUserService.prototype.addPermission = function (userPermission) {
89
- return this.http.post(this.config.apiUrl + "UserManagement/permission", userPermission);
90
- };
91
- ManagementUserService.prototype.deletePermission = function (idUserPermission) {
92
- return this.http.delete(this.config.apiUrl + "UserManagement/groups/" + idUserPermission);
93
- };
94
- ManagementUserService.prototype.save = function (user) {
95
- return this.http.post(this.config.apiUrl + "UserManagement", user);
96
- };
97
- ManagementUserService.prototype.delete = function (idUser) {
98
- return this.http.delete(this.config.apiUrl + "UserManagement/" + idUser);
99
- };
100
- ManagementUserService.prototype.hasExistingUserName = function (user) {
101
- return this.http.post(this.config.apiUrl + "UserManagement/UserNameAlreadyExist", user);
102
- };
103
- return ManagementUserService;
104
- }());
105
- ManagementUserService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ManagementUserService_Factory() { return new ManagementUserService(i0.ɵɵinject(i1.CaucaCoreService), i0.ɵɵinject(i2.HttpClient)); }, token: ManagementUserService, providedIn: "root" });
106
- ManagementUserService.decorators = [
107
- { type: i0.Injectable, args: [{
108
- providedIn: 'root'
109
- },] }
110
- ];
111
- ManagementUserService.ctorParameters = function () { return [
112
- { type: i1.CaucaCoreService },
113
- { type: i2.HttpClient }
114
- ]; };
115
-
116
- var ManagementPermissionService = /** @class */ (function () {
117
- function ManagementPermissionService(coreService, http) {
118
- this.http = http;
119
- this.config = coreService.getConfig();
120
- }
121
- ManagementPermissionService.prototype.getAll = function () {
122
- return this.http.get(this.config.apiUrl + "PermissionManagement");
123
- };
124
- ManagementPermissionService.prototype.get = function (idPermission) {
125
- return this.http.get(this.config.apiUrl + "PermissionManagement/" + idPermission);
126
- };
127
- ManagementPermissionService.prototype.save = function (permission) {
128
- return this.http.post(this.config.apiUrl + "PermissionManagement", permission);
129
- };
130
- ManagementPermissionService.prototype.delete = function (idPermission) {
131
- return this.http.delete(this.config.apiUrl + "PermissionManagement/" + idPermission);
132
- };
133
- return ManagementPermissionService;
134
- }());
135
- ManagementPermissionService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ManagementPermissionService_Factory() { return new ManagementPermissionService(i0.ɵɵinject(i1.CaucaCoreService), i0.ɵɵinject(i2.HttpClient)); }, token: ManagementPermissionService, providedIn: "root" });
136
- ManagementPermissionService.decorators = [
137
- { type: i0.Injectable, args: [{
138
- providedIn: 'root'
139
- },] }
140
- ];
141
- ManagementPermissionService.ctorParameters = function () { return [
142
- { type: i1.CaucaCoreService },
143
- { type: i2.HttpClient }
144
- ]; };
145
-
146
- var CaucaManagementGroupComponent = /** @class */ (function () {
147
- function CaucaManagementGroupComponent(managementGroupService, managementUserService, managementPermissionService, breakpointObserver) {
148
- var _this = this;
149
- this.managementGroupService = managementGroupService;
150
- this.managementUserService = managementUserService;
151
- this.managementPermissionService = managementPermissionService;
152
- this.showPrintButton = true;
153
- this.hoverStatePermission = true;
154
- this.groups = [];
155
- this.users = [];
156
- this.permissions = [];
157
- this.userFullName = {};
158
- this.showColumn = true;
159
- this.showColumnXS = true;
160
- this.translations = [];
161
- this.calculateUsersCellValue = function (e) {
162
- var users = (e.users ? e.users : []);
163
- var usersNames = [];
164
- users.forEach(function (user) {
165
- var userGroup = _this.users.filter(function (u) { return u.id === user.idUser; });
166
- if (userGroup && userGroup[0]) {
167
- usersNames.push(userGroup[0].firstName + ' ' + userGroup[0].lastName);
168
- }
169
- });
170
- usersNames = usersNames.sort(function (one, two) { return (one < two ? -1 : 1); });
171
- return usersNames.join(', ');
172
- };
173
- this.groupNameAlreadyUsedValidation = function (e) {
174
- return _this.managementGroupService.hasExistingGroupName(e.data).pipe(operators.map(function (exist) {
175
- return !exist;
176
- })).toPromise();
177
- };
178
- breakpointObserver.observe(['(max-width: 1000px)']).subscribe(function (result) {
179
- _this.showColumn = !result.matches;
180
- });
181
- breakpointObserver.observe(['(max-width: 600px)']).subscribe(function (result) {
182
- _this.showColumnXS = !result.matches;
183
- });
184
- }
185
- CaucaManagementGroupComponent.prototype.ngOnInit = function () {
186
- var _this = this;
187
- this.managementUserService.getAll().subscribe(function (data) {
188
- _this.users = data;
189
- _this.users.forEach(function (user) {
190
- if (user.isActive) {
191
- if (user.firstName !== '' && user.lastName !== '') {
192
- _this.userFullName[user.id] = user.firstName + " " + user.lastName;
193
- }
194
- }
195
- });
196
- });
197
- this.managementPermissionService.getAll().subscribe(function (permissions) {
198
- var permissionIndex = permissions.findIndex(function (c) {
199
- return c.tag === 'CanAccessPermissions';
200
- });
201
- if (permissionIndex !== -1) {
202
- permissions.splice(permissionIndex, 1);
203
- }
204
- permissions.sort(function (a, b) {
205
- if (a.name < b.name) {
206
- return -1;
207
- }
208
- if (a.name > b.name) {
209
- return 1;
210
- }
211
- return 0;
212
- });
213
- _this.permissions = permissions;
214
- });
215
- this.getGroups();
216
- };
217
- CaucaManagementGroupComponent.prototype.fullName = function (data) {
218
- if (!data) {
219
- return '';
220
- }
221
- return data.firstName + " " + data.lastName;
222
- };
223
- CaucaManagementGroupComponent.prototype.getGroupUser = function (field, e) {
224
- var users = [];
225
- if (this.groupUsers) {
226
- this.groupUsers.forEach(function (user) {
227
- users.push(user.idUser);
228
- });
229
- }
230
- e.component.option('value', users);
231
- };
232
- CaucaManagementGroupComponent.prototype.setGroupUser = function (field, e) {
233
- var groupUser = [];
234
- e.value.forEach(function (idUser) {
235
- var groupIndex = (field.data.users || []).findIndex(function (g) { return g.idUser === idUser; });
236
- if (groupIndex === -1) {
237
- groupUser.push({ idUser: idUser, });
238
- }
239
- else {
240
- groupUser.push(field.data.users[groupIndex]);
241
- }
242
- });
243
- field.setValue(JSON.parse(JSON.stringify(groupUser)));
244
- };
245
- CaucaManagementGroupComponent.prototype.setGroupPermission = function (field, e) {
246
- var groupUser = [];
247
- e.value.forEach(function (idUser) {
248
- groupUser.push({
249
- idUser: idUser,
250
- });
251
- });
252
- field.setValue(JSON.parse(JSON.stringify(groupUser)));
253
- };
254
- CaucaManagementGroupComponent.prototype.getPermissionStatus = function (field, permission, e) {
255
- var groupPermission = (field.value || []).find(function (p) { return p.idModulePermission === permission.id; });
256
- if (groupPermission) {
257
- e.component.option('value', groupPermission.isAllowed);
258
- }
259
- else {
260
- e.component.option('value', undefined);
261
- }
262
- };
263
- CaucaManagementGroupComponent.prototype.checkBoxToggled = function (field, permission, e) {
264
- if (e.component.skipOnValueChanged) {
265
- e.component.skipOnValueChanged = false;
266
- return;
267
- }
268
- if (e.component.setUndefinedNextTime) {
269
- e.component.setUndefinedNextTime = false;
270
- e.component.skipOnValueChanged = true;
271
- e.component.option('value', undefined);
272
- this.setPermissionStatus(field, permission, undefined);
273
- return;
274
- }
275
- if (e.value === false) {
276
- e.component.setUndefinedNextTime = true;
277
- }
278
- this.setPermissionStatus(field, permission, e.value);
279
- };
280
- CaucaManagementGroupComponent.prototype.onRowInserted = function (e) {
281
- this.saveGroup(e.data);
282
- };
283
- CaucaManagementGroupComponent.prototype.onRowUpdated = function (e) {
284
- this.saveGroup(e.data);
285
- };
286
- CaucaManagementGroupComponent.prototype.onRowRemoved = function (e) {
287
- var _this = this;
288
- var group = e.data;
289
- this.managementGroupService.delete(group.id).subscribe(function (data) {
290
- _this.getGroups();
291
- });
292
- };
293
- CaucaManagementGroupComponent.prototype.onEditingStart = function (e) {
294
- this.groupUsers = e.data.users;
295
- };
296
- CaucaManagementGroupComponent.prototype.onInitNewRow = function () {
297
- this.groupUsers = [];
298
- };
299
- CaucaManagementGroupComponent.prototype.setPermissionStatus = function (field, permission, value) {
300
- var groupPermissions = field.value || [];
301
- var groupIndex = groupPermissions.findIndex(function (p) { return p.idModulePermission === permission.id; });
302
- if (groupIndex > -1) {
303
- groupPermissions[groupIndex].isAllowed = value;
304
- }
305
- else {
306
- groupPermissions.push({
307
- idModulePermission: permission.id,
308
- isAllowed: value,
309
- });
310
- }
311
- field.setValue(JSON.parse(JSON.stringify(groupPermissions)));
312
- };
313
- CaucaManagementGroupComponent.prototype.saveGroup = function (group) {
314
- var _this = this;
315
- this.removePermissionUndefined(group);
316
- if (group.users) {
317
- group.users.forEach(function (userGroup) {
318
- userGroup.idGroup = group.id;
319
- });
320
- }
321
- if (group.permissions) {
322
- group.permissions.forEach(function (groupPermission) {
323
- groupPermission.idGroup = group.id;
324
- });
325
- }
326
- this.managementGroupService.save(group).subscribe(function () {
327
- _this.getGroups();
328
- });
329
- this.groupUsers = [];
330
- };
331
- CaucaManagementGroupComponent.prototype.removePermissionUndefined = function (group) {
332
- group.permissions = group.permissions.filter(function (permission) { return permission.isAllowed !== undefined; });
333
- };
334
- CaucaManagementGroupComponent.prototype.getGroups = function () {
335
- var _this = this;
336
- this.managementGroupService.getAll().subscribe(function (data) { return _this.groups = data; });
337
- };
338
- return CaucaManagementGroupComponent;
339
- }());
340
- CaucaManagementGroupComponent.decorators = [
341
- { type: i0.Component, args: [{
342
- selector: 'cauca-management-group',
343
- template: "<cauca-dx-data-grid [allowPrint]=\"showPrintButton\" keyExpr=\"id\" [dataSource]=\"groups\"\n (onRowInserted)=\"onRowInserted($event)\" (onInitNewRow)=\"onInitNewRow()\" (onRowUpdated)=\"onRowUpdated($event)\"\n (onEditingStart)=\"onEditingStart($event)\" (onRowRemoved)=\"onRowRemoved($event)\">\n\n <dxi-column dataField=\"name\" [caption]=\"'management.name' | translate\">\n <dxi-validation-rule type=\"async\" [message]=\"'management.groupNameAlreadyUsed' | translate\"\n [validationCallback]=\"groupNameAlreadyUsedValidation\"></dxi-validation-rule>\n </dxi-column>\n <dxi-column dataField=\"users\" [caption]=\"'management.users' | translate\" editCellTemplate=\"usersEditTemplate\"\n [calculateCellValue]=\"calculateUsersCellValue\">\n </dxi-column>\n <dxi-column dataField=\"permissions\" [caption]=\"'management.permissions' | translate\" [visible]=\"false\"\n editCellTemplate=\"permissionsEditTemplate\">\n </dxi-column>\n <dxo-export [enabled]=\"false\"></dxo-export>\n <dxo-editing mode=\"popup\" [allowAdding]=\"true\" [allowUpdating]=\"true\" [allowDeleting]=\"true\" [useIcons]=\"true\">\n <dxo-popup [showTitle]=\"true\" [title]=\"'management.group' | translate\" [fullScreen]=\"!showColumn\"></dxo-popup>\n <dxo-form colCount=\"1\" [labelLocation]=\"showColumnXS ? 'left' : 'top'\">\n <dxi-item dataField=\"name\" [isRequired]=\"true\"></dxi-item>\n <dxi-item dataField=\"users\"></dxi-item>\n <dxi-item dataField=\"permissions\"></dxi-item>\n </dxo-form>\n </dxo-editing>\n\n <div *dxTemplate=\"let field of 'usersEditTemplate'\">\n <dx-tag-box valueExpr=\"id\" [displayExpr]=\"fullName\" [dataSource]=\"users\" [searchEnabled]=\"true\"\n [searchExpr]=\"fullName\" (onInitialized)=\"getGroupUser(field, $event)\"\n (onValueChanged)=\"setGroupUser(field, $event)\">\n </dx-tag-box>\n </div>\n <div *dxTemplate=\"let field of 'permissionsEditTemplate'\">\n <dx-list [dataSource]=\"permissions\" itemTemplate=\"rowTemplate\" [searchEnabled]=\"true\"\n [searchExpr]=\"['name', 'tag']\" [hoverStateEnabled]=\"hoverStatePermission\">\n <div *dxTemplate=\"let permission of 'rowTemplate'\">\n <dx-check-box [text]=\"permission.name\" (onInitialized)=\"getPermissionStatus(field, permission, $event)\"\n (onValueChanged)=\"checkBoxToggled(field, permission, $event)\">\n </dx-check-box>\n </div>\n </dx-list>\n </div>\n</cauca-dx-data-grid>",
344
- styles: [""]
345
- },] }
346
- ];
347
- CaucaManagementGroupComponent.ctorParameters = function () { return [
348
- { type: ManagementGroupService },
349
- { type: ManagementUserService },
350
- { type: ManagementPermissionService },
351
- { type: layout.BreakpointObserver }
352
- ]; };
353
- CaucaManagementGroupComponent.propDecorators = {
354
- showPrintButton: [{ type: i0.Input }],
355
- hoverStatePermission: [{ type: i0.Input }]
356
- };
357
-
358
- var UserModel = /** @class */ (function () {
359
- function UserModel() {
360
- this.userName = '';
361
- this.firstName = '';
362
- this.lastName = '';
363
- this.password = '';
364
- this.email = '';
365
- this.isActive = true;
366
- }
367
- return UserModel;
368
- }());
369
-
370
- var CaucaManagementUserComponent = /** @class */ (function () {
371
- function CaucaManagementUserComponent(managementUserService, breakpointObserver) {
372
- var _this = this;
373
- this.managementUserService = managementUserService;
374
- this.users = [
375
- new UserModel()
376
- ];
377
- this.showColumnXS = true;
378
- this.userNameAlreadyUsedValidation = function (e) {
379
- return _this.managementUserService.hasExistingUserName(e.data).pipe(operators.map(function (exist) {
380
- return !exist;
381
- })).toPromise();
382
- };
383
- breakpointObserver.observe(['(max-width: 600px)']).subscribe(function (result) {
384
- _this.showColumnXS = !result.matches;
385
- });
386
- }
387
- CaucaManagementUserComponent.prototype.ngOnInit = function () {
388
- this.getUsers();
389
- };
390
- CaucaManagementUserComponent.prototype.onRowInserted = function (e) {
391
- this.saveGroup(e.data);
392
- };
393
- CaucaManagementUserComponent.prototype.onRowUpdated = function (e) {
394
- this.saveGroup(e.key);
395
- };
396
- CaucaManagementUserComponent.prototype.onRowRemoved = function (e) {
397
- var _this = this;
398
- var user = e.data;
399
- this.managementUserService.delete(user.id).subscribe(function (data) {
400
- _this.getUsers();
401
- });
402
- };
403
- CaucaManagementUserComponent.prototype.saveGroup = function (user) {
404
- var _this = this;
405
- this.managementUserService.save(user).subscribe(function () {
406
- _this.getUsers();
407
- });
408
- };
409
- CaucaManagementUserComponent.prototype.getUsers = function () {
410
- var _this = this;
411
- this.managementUserService.getAll().subscribe(function (data) { return _this.users = data; });
412
- };
413
- return CaucaManagementUserComponent;
414
- }());
415
- CaucaManagementUserComponent.decorators = [
416
- { type: i0.Component, args: [{
417
- selector: 'cauca-management-user',
418
- template: "<cauca-dx-data-grid\n keyExpr=\"id\"\n [dataSource]=\"users\"\n (onRowInserted)=\"onRowInserted($event)\"\n (onRowUpdated)=\"onRowUpdated($event)\"\n (onRowRemoved)=\"onRowRemoved($event)\">\n\n <dxi-column dataField=\"userName\" [caption]=\"'management.userName' | translate\">\n <dxi-validation-rule type=\"async\" [message]=\"'management.userNameAlreadyUsed' | translate\" [validationCallback]=\"userNameAlreadyUsedValidation\"></dxi-validation-rule>\n </dxi-column>\n <dxi-column dataField=\"isActive\" [caption]=\"'management.isActive' | translate\" [visible]=\"false\"></dxi-column>\n <dxi-column dataField=\"firstName\" [caption]=\"'management.firstName' | translate\"></dxi-column>\n <dxi-column dataField=\"lastName\" [caption]=\"'management.lastName' | translate\"></dxi-column>\n <dxi-column dataField=\"groups\" [caption]=\"'management.group' | translate\"></dxi-column>\n\n <dxo-editing mode=\"popup\" [allowAdding]=\"true\" [allowUpdating]=\"true\" [allowDeleting]=\"true\" [useIcons]=\"true\">\n <dxo-popup [showTitle]=\"true\" [title]=\"'management.group' | translate\"></dxo-popup>\n <dxo-form colCount=\"2\" [labelLocation]=\"showColumnXS ? 'left' : 'top'\">\n <dxi-item dataField=\"userName\" [isRequired]=\"true\"></dxi-item>\n <dxi-item dataField=\"isActive\"></dxi-item>\n <dxi-item dataField=\"firstName\"></dxi-item>\n <dxi-item dataField=\"lastName\"></dxi-item>\n <dxi-item dataField=\"group\"></dxi-item>\n </dxo-form>\n </dxo-editing>\n</cauca-dx-data-grid>\n",
419
- styles: [""]
420
- },] }
421
- ];
422
- CaucaManagementUserComponent.ctorParameters = function () { return [
423
- { type: ManagementUserService },
424
- { type: layout.BreakpointObserver }
425
- ]; };
426
-
427
- var CaucaManagementModule = /** @class */ (function () {
428
- function CaucaManagementModule() {
429
- }
430
- return CaucaManagementModule;
431
- }());
432
- CaucaManagementModule.decorators = [
433
- { type: i0.NgModule, args: [{
434
- declarations: [
435
- CaucaManagementComponent,
436
- CaucaManagementGroupComponent,
437
- CaucaManagementUserComponent
438
- ],
439
- imports: [
440
- common.CommonModule,
441
- checkBox.DxCheckBoxModule,
442
- list.DxListModule,
443
- tagBox.DxTagBoxModule,
444
- i1.CaucaCoreForChildModule,
445
- devextreme.CaucaDevextremeModule,
446
- ],
447
- exports: [
448
- CaucaManagementComponent,
449
- CaucaManagementUserComponent,
450
- CaucaManagementGroupComponent,
451
- ]
452
- },] }
453
- ];
454
-
455
- var UserGroupModel = /** @class */ (function () {
456
- function UserGroupModel() {
457
- this.idUserGroup = '';
458
- this.idGroup = '';
459
- this.idUser = '';
460
- }
461
- return UserGroupModel;
462
- }());
463
-
464
- var UserPermissionModel = /** @class */ (function () {
465
- function UserPermissionModel() {
466
- this.idUserPermission = '';
467
- this.isAllowed = false;
468
- this.idUser = '';
469
- this.idModulePermission = '';
470
- }
471
- return UserPermissionModel;
472
- }());
473
-
474
- var GroupModel = /** @class */ (function () {
475
- function GroupModel() {
476
- this.name = '';
477
- this.users = [];
478
- this.permissions = [];
479
- }
480
- return GroupModel;
481
- }());
482
-
483
- var GroupPermissionModel = /** @class */ (function () {
484
- function GroupPermissionModel() {
485
- this.idGroupPermission = '';
486
- this.isAllowed = false;
487
- this.idGroup = '';
488
- this.idModulePermission = '';
489
- }
490
- return GroupPermissionModel;
491
- }());
492
-
493
- /*
494
- * Public API Surface of cauca-management
495
- */
496
-
497
- /**
498
- * Generated bundle index. Do not edit.
499
- */
500
-
501
- exports.CaucaManagementComponent = CaucaManagementComponent;
502
- exports.CaucaManagementGroupComponent = CaucaManagementGroupComponent;
503
- exports.CaucaManagementModule = CaucaManagementModule;
504
- exports.CaucaManagementService = CaucaManagementService;
505
- exports.CaucaManagementUserComponent = CaucaManagementUserComponent;
506
- exports.GroupModel = GroupModel;
507
- exports.GroupPermissionModel = GroupPermissionModel;
508
- exports.ManagementGroupService = ManagementGroupService;
509
- exports.ManagementUserService = ManagementUserService;
510
- exports.UserGroupModel = UserGroupModel;
511
- exports.UserModel = UserModel;
512
- exports.UserPermissionModel = UserPermissionModel;
513
- exports.ɵa = ManagementPermissionService;
514
-
515
- Object.defineProperty(exports, '__esModule', { value: true });
516
-
517
- })));
518
- //# sourceMappingURL=cauca-911-management.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cauca-911-management.umd.js","sources":["../../../projects/cauca-management/src/lib/cauca-management.service.ts","../../../projects/cauca-management/src/lib/cauca-management.component.ts","../../../projects/cauca-management/src/lib/shared/services/management-group.service.ts","../../../projects/cauca-management/src/lib/shared/services/management-user.service.ts","../../../projects/cauca-management/src/lib/shared/services/management-permission.service.ts","../../../projects/cauca-management/src/lib/cauca-management-group/cauca-management-group.component.ts","../../../projects/cauca-management/src/lib/shared/models/user-model.ts","../../../projects/cauca-management/src/lib/cauca-management-user/cauca-management-user.component.ts","../../../projects/cauca-management/src/lib/cauca-management.module.ts","../../../projects/cauca-management/src/lib/shared/models/user-group-model.ts","../../../projects/cauca-management/src/lib/shared/models/user-permission-model.ts","../../../projects/cauca-management/src/lib/shared/models/group-model.ts","../../../projects/cauca-management/src/lib/shared/models/group-permission-model.ts","../../../projects/cauca-management/src/public-api.ts","../../../projects/cauca-management/src/cauca-911-management.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CaucaManagementService {\n\n constructor() { }\n}\n","import { Component, OnInit } from '@angular/core';\n\n@Component({\n selector: 'cauca-management',\n templateUrl: './cauca-management.component.html',\n styles: []\n})\nexport class CaucaManagementComponent implements OnInit {\n\n constructor() { }\n\n public ngOnInit(): void {\n }\n\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable } from 'rxjs';\nimport { Configuration, CaucaCoreService } from '@cauca-911/core';\nimport { GroupModel } from '../models/group-model';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ManagementGroupService {\n private config: Configuration;\n\n constructor(\n coreService: CaucaCoreService,\n private http: HttpClient,\n ) {\n this.config = coreService.getConfig();\n }\n\n public getAll(): Observable<GroupModel[]> {\n return this.http.get<GroupModel[]>(`${this.config.apiUrl}GroupManagement`);\n }\n\n public get(idGroup: string): Observable<GroupModel> {\n return this.http.get<GroupModel>(`${this.config.apiUrl}GroupManagement/${idGroup}`);\n }\n\n public save(group: GroupModel): Observable<any> {\n return this.http.post(`${this.config.apiUrl}GroupManagement`, group);\n }\n\n public delete(idGroup: string): Observable<any> {\n return this.http.delete(`${this.config.apiUrl}GroupManagement/${idGroup}`);\n }\n\n public hasExistingGroupName(group: GroupModel): Observable<boolean> {\n return this.http.post<boolean>(`${this.config.apiUrl}GroupManagement/GroupNameAlreadyExist`, group);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable } from 'rxjs';\nimport { Configuration, CaucaCoreService } from '@cauca-911/core';\nimport { UserGroupModel } from '../models/user-group-model';\nimport { UserPermissionModel } from '../models/user-permission-model';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ManagementUserService {\n private config: Configuration;\n\n constructor(\n coreService: CaucaCoreService,\n protected http: HttpClient,\n ) {\n this.config = coreService.getConfig();\n }\n\n public getAll<TUser>(): Observable<TUser[]> {\n return this.http.get<TUser[]>(`${this.config.apiUrl}UserManagement`);\n }\n\n public get<TUser>(idUser: string): Observable<TUser> {\n return this.http.get<TUser>(`${this.config.apiUrl}UserManagement/${idUser}`);\n }\n\n public getGroup(idUser: string): Observable<any> {\n return this.http.get(`${this.config.apiUrl}UserManagement/${idUser}/groups`);\n }\n\n public addGroup(userGroup: UserGroupModel): Observable<any> {\n return this.http.post(`${this.config.apiUrl}UserManagement/group`, userGroup);\n }\n\n public deleteGroup(idUserGroup: string): Observable<any> {\n return this.http.delete(`${this.config.apiUrl}UserManagement/groups/${idUserGroup}`);\n }\n\n public addPermission(userPermission: UserPermissionModel): Observable<any> {\n return this.http.post(`${this.config.apiUrl}UserManagement/permission`, userPermission);\n }\n\n public deletePermission(idUserPermission: string): Observable<any> {\n return this.http.delete(`${this.config.apiUrl}UserManagement/groups/${idUserPermission}`);\n }\n\n public save<TUser>(user: TUser): Observable<any> {\n return this.http.post(`${this.config.apiUrl}UserManagement`, user);\n }\n\n public delete(idUser: string): Observable<any> {\n return this.http.delete(`${this.config.apiUrl}UserManagement/${idUser}`);\n }\n\n public hasExistingUserName<TUser>(user: TUser): Observable<boolean> {\n return this.http.post<boolean>(`${this.config.apiUrl}UserManagement/UserNameAlreadyExist`, user);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable } from 'rxjs';\nimport { Configuration, CaucaCoreService } from '@cauca-911/core';\nimport { PermissionModel } from '../models/permission-model';\n\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ManagementPermissionService {\n private config: Configuration;\n\n constructor(\n coreService: CaucaCoreService,\n private http: HttpClient,\n ) {\n this.config = coreService.getConfig();\n }\n\n public getAll(): Observable<PermissionModel[]> {\n return this.http.get<PermissionModel[]>(`${this.config.apiUrl}PermissionManagement`);\n }\n\n public get(idPermission: string): Observable<PermissionModel> {\n return this.http.get<PermissionModel>(`${this.config.apiUrl}PermissionManagement/${idPermission}`);\n }\n\n public save(permission: PermissionModel): Observable<any> {\n return this.http.post(`${this.config.apiUrl}PermissionManagement`, permission);\n }\n\n public delete(idPermission: string): Observable<any> {\n return this.http.delete(`${this.config.apiUrl}PermissionManagement/${idPermission}`);\n }\n}\n","import { Component, Input, OnInit } from '@angular/core';\nimport { BreakpointObserver } from '@angular/cdk/layout';\nimport { map } from 'rxjs/operators';\nimport { UserModel } from '../shared/models/user-model';\nimport { UserGroupModel } from '../shared/models/user-group-model';\nimport { GroupModel } from '../shared/models/group-model';\nimport { GroupPermissionModel } from '../shared/models/group-permission-model';\nimport { ManagementGroupService } from '../shared/services/management-group.service';\nimport { ManagementUserService } from '../shared/services/management-user.service';\nimport { PermissionModel } from '../shared/models/permission-model';\nimport { ManagementPermissionService } from '../shared/services/management-permission.service';\n\n@Component({\n selector: 'cauca-management-group',\n templateUrl: './cauca-management-group.component.html',\n styleUrls: ['./cauca-management-group.component.scss']\n})\nexport class CaucaManagementGroupComponent implements OnInit {\n private groupUsers: any;\n\n @Input()\n public showPrintButton: boolean = true;\n @Input()\n public hoverStatePermission = true;\n public groups: GroupModel[] = [];\n public users: UserModel[] = [];\n public permissions: PermissionModel[] = [];\n public userFullName: any = {};\n public showColumn = true;\n public showColumnXS = true;\n public translations: any = [];\n\n constructor(\n private managementGroupService: ManagementGroupService,\n private managementUserService: ManagementUserService,\n private managementPermissionService: ManagementPermissionService,\n breakpointObserver: BreakpointObserver,\n ) {\n breakpointObserver.observe(['(max-width: 1000px)']).subscribe(result => {\n this.showColumn = !result.matches;\n });\n breakpointObserver.observe(['(max-width: 600px)']).subscribe(result => {\n this.showColumnXS = !result.matches;\n });\n }\n\n public ngOnInit(): void {\n this.managementUserService.getAll<UserModel>().subscribe(data => {\n this.users = data;\n this.users.forEach(user => {\n if (user.isActive) {\n if (user.firstName !== '' && user.lastName !== '') {\n this.userFullName[user.id] = `${user.firstName} ${user.lastName}`;\n }\n }\n });\n });\n this.managementPermissionService.getAll().subscribe(permissions => {\n const permissionIndex = permissions.findIndex(c => {\n return c.tag === 'CanAccessPermissions';\n });\n if (permissionIndex !== -1) {\n permissions.splice(permissionIndex, 1);\n }\n permissions.sort((a: PermissionModel, b: PermissionModel) => {\n if (a.name < b.name) { return -1; }\n if (a.name > b.name) { return 1; }\n return 0;\n });\n this.permissions = permissions;\n });\n this.getGroups();\n }\n\n public fullName(data): string {\n if (!data) {\n return '';\n }\n\n return `${data.firstName} ${data.lastName}`;\n }\n\n public getGroupUser(field, e): void {\n const users: string[] = [];\n if (this.groupUsers) {\n this.groupUsers.forEach( user => {\n users.push(user.idUser);\n });\n }\n e.component.option('value', users);\n }\n\n public setGroupUser(field, e): void {\n const groupUser: UserGroupModel[] = [];\n\n e.value.forEach(idUser => {\n const groupIndex = (field.data.users || []).findIndex(g => g.idUser === idUser);\n\n if (groupIndex === -1) {\n groupUser.push({ idUser, } as UserGroupModel);\n } else {\n groupUser.push(field.data.users[groupIndex]);\n }\n });\n\n field.setValue(JSON.parse(JSON.stringify(groupUser)));\n }\n\n public setGroupPermission(field, e): void {\n const groupUser: UserGroupModel[] = [];\n\n e.value.forEach(idUser => {\n groupUser.push({\n idUser,\n } as UserGroupModel);\n });\n\n field.setValue(JSON.parse(JSON.stringify(groupUser)));\n }\n\n public getPermissionStatus(field, permission, e): void {\n const groupPermission = (field.value || []).find(p => p.idModulePermission === permission.id);\n\n if (groupPermission) {\n e.component.option('value', groupPermission.isAllowed);\n } else {\n e.component.option('value', undefined);\n }\n }\n\n public checkBoxToggled(field, permission, e): void {\n if (e.component.skipOnValueChanged) {\n e.component.skipOnValueChanged = false;\n return;\n }\n if (e.component.setUndefinedNextTime) {\n e.component.setUndefinedNextTime = false;\n e.component.skipOnValueChanged = true;\n e.component.option('value', undefined);\n this.setPermissionStatus(field, permission, undefined);\n return;\n }\n if (e.value === false) {\n e.component.setUndefinedNextTime = true;\n }\n\n this.setPermissionStatus(field, permission, e.value);\n }\n\n public onRowInserted(e): void {\n this.saveGroup(e.data as GroupModel);\n }\n\n public onRowUpdated(e): void {\n this.saveGroup(e.data as GroupModel);\n }\n\n public onRowRemoved(e): void {\n const group = (e.data as GroupModel);\n this.managementGroupService.delete(group.id).subscribe(data => {\n this.getGroups();\n });\n }\n\n public calculateUsersCellValue = (e): string => {\n const users = (e.users ? e.users as UserGroupModel[] : []);\n let usersNames: any[] = [];\n users.forEach(user => {\n const userGroup = this.users.filter(u => u.id === user.idUser);\n if (userGroup && userGroup[0]) {\n usersNames.push(userGroup[0].firstName + ' ' + userGroup[0].lastName);\n }\n });\n usersNames = usersNames.sort((one, two) => (one < two ? -1 : 1));\n return usersNames.join(', ');\n }\n\n public onEditingStart(e: any): void {\n this.groupUsers = e.data.users;\n }\n\n public onInitNewRow(): void {\n this.groupUsers = [];\n }\n\n public groupNameAlreadyUsedValidation = (e): Promise<boolean> => {\n return this.managementGroupService.hasExistingGroupName(e.data).pipe(\n map((exist: boolean) => {\n return !exist;\n })\n ).toPromise();\n }\n\n private setPermissionStatus(field: any, permission, value): void {\n const groupPermissions = field.value || [];\n const groupIndex = groupPermissions.findIndex(p => p.idModulePermission === permission.id);\n\n if (groupIndex > -1) {\n groupPermissions[groupIndex].isAllowed = value;\n } else {\n groupPermissions.push({\n idModulePermission: permission.id,\n isAllowed: value,\n } as GroupPermissionModel);\n }\n\n field.setValue(JSON.parse(JSON.stringify(groupPermissions)));\n }\n\n private saveGroup(group: GroupModel): void {\n this.removePermissionUndefined(group);\n if (group.users) {\n group.users.forEach((userGroup: UserGroupModel) => {\n userGroup.idGroup = group.id;\n });\n }\n if (group.permissions) {\n group.permissions.forEach((groupPermission: GroupPermissionModel) => {\n groupPermission.idGroup = group.id;\n });\n }\n this.managementGroupService.save(group).subscribe(() => {\n this.getGroups();\n });\n this.groupUsers = [];\n }\n\n private removePermissionUndefined(group: GroupModel): void {\n group.permissions = group.permissions.filter((permission: GroupPermissionModel) => permission.isAllowed !== undefined);\n }\n\n private getGroups(): void {\n this.managementGroupService.getAll().subscribe(data => this.groups = data);\n }\n}\n","import { UserGroupModel } from './user-group-model';\nimport { UserPermissionModel } from './user-permission-model';\n\nexport class UserModel {\n public id: string;\n public userName = '';\n public firstName = '';\n public lastName = '';\n public password = '';\n public email = '';\n public isActive = true;\n public groups: UserGroupModel[];\n public permissions: UserPermissionModel[];\n\n constructor() { }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { UserModel } from '../shared/models/user-model';\nimport { ManagementUserService } from '../shared/services/management-user.service';\nimport { BreakpointObserver, BreakpointState } from '@angular/cdk/layout';\nimport { map } from 'rxjs/operators';\n\n@Component({\n selector: 'cauca-management-user',\n templateUrl: './cauca-management-user.component.html',\n styleUrls: ['./cauca-management-user.component.scss']\n})\nexport class CaucaManagementUserComponent implements OnInit {\n public users: UserModel[] = [\n new UserModel()\n ];\n public showColumnXS = true;\n\n constructor(\n private managementUserService: ManagementUserService,\n breakpointObserver: BreakpointObserver,\n ) {\n breakpointObserver.observe(['(max-width: 600px)']).subscribe((result: BreakpointState) => {\n this.showColumnXS = !result.matches;\n });\n }\n\n public ngOnInit(): void {\n this.getUsers();\n }\n\n public onRowInserted(e: any): void {\n this.saveGroup(e.data as UserModel);\n }\n\n public onRowUpdated(e: any): void {\n this.saveGroup(e.key as UserModel);\n }\n\n public onRowRemoved(e: any): void {\n const user = (e.data as UserModel);\n this.managementUserService.delete(user.id).subscribe((data: any) => {\n this.getUsers();\n });\n }\n\n public userNameAlreadyUsedValidation = (e): Promise<boolean> => {\n return this.managementUserService.hasExistingUserName(e.data).pipe(\n map((exist: boolean) => {\n return !exist;\n })\n ).toPromise();\n }\n\n private saveGroup(user: UserModel): void {\n this.managementUserService.save<UserModel>(user).subscribe(() => {\n this.getUsers();\n });\n }\n\n private getUsers(): void {\n this.managementUserService.getAll<UserModel>().subscribe((data: any) => this.users = data);\n }\n}","import { NgModule } from '@angular/core';\nimport { DxCheckBoxModule } from 'devextreme-angular/ui/check-box';\nimport { DxListModule } from 'devextreme-angular/ui/list';\nimport { DxTagBoxModule } from 'devextreme-angular/ui/tag-box';\nimport { CaucaCoreForChildModule } from '@cauca-911/core';\nimport { CaucaDevextremeModule } from '@cauca-911/devextreme';\nimport { CaucaManagementComponent } from './cauca-management.component';\nimport { CaucaManagementGroupComponent } from './cauca-management-group/cauca-management-group.component';\nimport { CaucaManagementUserComponent } from './cauca-management-user/cauca-management-user.component';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n declarations: [\n CaucaManagementComponent,\n CaucaManagementGroupComponent,\n CaucaManagementUserComponent\n ],\n imports: [\n CommonModule,\n DxCheckBoxModule,\n DxListModule,\n DxTagBoxModule,\n CaucaCoreForChildModule,\n CaucaDevextremeModule,\n ],\n exports: [\n CaucaManagementComponent,\n CaucaManagementUserComponent,\n CaucaManagementGroupComponent,\n ]\n})\nexport class CaucaManagementModule { }\n","export class UserGroupModel {\n public idUserGroup = '';\n public idGroup = '';\n public idUser = '';\n\n constructor() { }\n}\n","export class UserPermissionModel {\n public idUserPermission = '';\n public isAllowed = false;\n public idUser = '';\n public idModulePermission = '';\n\n constructor() { }\n}\n","import {GroupPermissionModel} from './group-permission-model';\nimport {UserGroupModel} from './user-group-model';\n\nexport class GroupModel {\n public id: string;\n public name = '';\n public users: UserGroupModel[] = [];\n public permissions: GroupPermissionModel[] = [];\n\n constructor() { }\n}\n","export class GroupPermissionModel {\n public idGroupPermission = '';\n public isAllowed = false;\n public idGroup = '';\n public idModulePermission = '';\n\n constructor() { }\n}\n","/*\n * Public API Surface of cauca-management\n */\n\nexport * from './lib/cauca-management.service';\nexport * from './lib/cauca-management.component';\nexport * from './lib/cauca-management.module';\nexport * from './lib/cauca-management-group/cauca-management-group.component';\nexport * from './lib/cauca-management-user/cauca-management-user.component';\n\nexport { ManagementUserService } from './lib/shared/services/management-user.service';\nexport { ManagementGroupService } from './lib/shared/services/management-group.service';\nexport { UserModel } from './lib/shared/models/user-model';\nexport { UserGroupModel } from './lib/shared/models/user-group-model';\nexport { UserPermissionModel } from './lib/shared/models/user-permission-model';\nexport { GroupModel } from './lib/shared/models/group-model';\nexport { GroupPermissionModel } from './lib/shared/models/group-permission-model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {ManagementPermissionService as ɵa} from './lib/shared/services/management-permission.service';"],"names":["Injectable","Component","CaucaCoreService","HttpClient","map","BreakpointObserver","Input","NgModule","CommonModule","DxCheckBoxModule","DxListModule","DxTagBoxModule","CaucaCoreForChildModule","CaucaDevextremeModule"],"mappings":";;;;;;;QAOE;SAAiB;;;;;gBALlBA,aAAU,SAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;;;QCKC;SAAiB;QAEV,2CAAQ,GAAR;SACN;;;;gBAVFC,YAAS,SAAC;oBACT,QAAQ,EAAE,kBAAkB;oBAC5B,6EAAgD;iBAEjD;;;;;QCMG,gCACI,WAA6B,EACrB,IAAgB;YAAhB,SAAI,GAAJ,IAAI,CAAY;YAExB,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,SAAS,EAAE,CAAC;SACzC;QAEM,uCAAM,GAAN;YACH,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAkB,IAAI,CAAC,MAAM,CAAC,MAAM,oBAAiB,CAAC,CAAC;SAC9E;QAEM,oCAAG,GAAH,UAAI,OAAe;YACtB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAgB,IAAI,CAAC,MAAM,CAAC,MAAM,wBAAmB,OAAS,CAAC,CAAC;SACvF;QAEM,qCAAI,GAAJ,UAAK,KAAiB;YACzB,OAAO,IAAI,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AC;SAE/B;yBACpB;KAAA;;;QCJG;YALO,sBAAiB,GAAG,EAAE,CAAC;YACvB,cAAS,GAAG,KAAK,CAAC;YAClB,YAAO,GAAG,EAAE,CAAC;YACb,uBAAkB,GAAG,EAAE,CAAC;SAEd;mCACpB;KAAA;;ICPD;;;;ICAA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("devextreme-angular/ui/check-box"),require("devextreme-angular/ui/list"),require("devextreme-angular/ui/tag-box"),require("@cauca-911/core"),require("@cauca-911/devextreme"),require("@angular/cdk/layout"),require("rxjs/operators"),require("@angular/common/http"),require("@angular/common")):"function"==typeof define&&define.amd?define("@cauca-911/management",["exports","@angular/core","devextreme-angular/ui/check-box","devextreme-angular/ui/list","devextreme-angular/ui/tag-box","@cauca-911/core","@cauca-911/devextreme","@angular/cdk/layout","rxjs/operators","@angular/common/http","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["cauca-911"]=e["cauca-911"]||{},e["cauca-911"].management={}),e.ng.core,e.checkBox,e.list,e.tagBox,e.i1,e.devextreme,e.ng.cdk.layout,e.rxjs.operators,e.ng.common.http,e.ng.common)}(this,(function(e,t,n,i,o,r,a,s,u,p,d){"use strict";var c=function(){};c.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new c},token:c,providedIn:"root"}),c.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],c.ctorParameters=function(){return[]};var l=function(){function e(){}return e.prototype.ngOnInit=function(){},e}();l.decorators=[{type:t.Component,args:[{selector:"cauca-management",template:"<div>{{'core.noGenericComponentOnThisLibrary' | translate}}</div>"}]}],l.ctorParameters=function(){return[]};var m=function(){function e(e,t){this.http=t,this.config=e.getConfig()}return e.prototype.getAll=function(){return this.http.get(this.config.apiUrl+"GroupManagement")},e.prototype.get=function(e){return this.http.get(this.config.apiUrl+"GroupManagement/"+e)},e.prototype.save=function(e){return this.http.post(this.config.apiUrl+"GroupManagement",e)},e.prototype.delete=function(e){return this.http.delete(this.config.apiUrl+"GroupManagement/"+e)},e.prototype.hasExistingGroupName=function(e){return this.http.post(this.config.apiUrl+"GroupManagement/GroupNameAlreadyExist",e)},e}();m.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new m(t.ɵɵinject(r.CaucaCoreService),t.ɵɵinject(p.HttpClient))},token:m,providedIn:"root"}),m.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],m.ctorParameters=function(){return[{type:r.CaucaCoreService},{type:p.HttpClient}]};var g=function(){function e(e,t){this.http=t,this.config=e.getConfig()}return e.prototype.getAll=function(){return this.http.get(this.config.apiUrl+"UserManagement")},e.prototype.get=function(e){return this.http.get(this.config.apiUrl+"UserManagement/"+e)},e.prototype.getGroup=function(e){return this.http.get(this.config.apiUrl+"UserManagement/"+e+"/groups")},e.prototype.addGroup=function(e){return this.http.post(this.config.apiUrl+"UserManagement/group",e)},e.prototype.deleteGroup=function(e){return this.http.delete(this.config.apiUrl+"UserManagement/groups/"+e)},e.prototype.addPermission=function(e){return this.http.post(this.config.apiUrl+"UserManagement/permission",e)},e.prototype.deletePermission=function(e){return this.http.delete(this.config.apiUrl+"UserManagement/groups/"+e)},e.prototype.save=function(e){return this.http.post(this.config.apiUrl+"UserManagement",e)},e.prototype.delete=function(e){return this.http.delete(this.config.apiUrl+"UserManagement/"+e)},e.prototype.hasExistingUserName=function(e){return this.http.post(this.config.apiUrl+"UserManagement/UserNameAlreadyExist",e)},e}();g.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new g(t.ɵɵinject(r.CaucaCoreService),t.ɵɵinject(p.HttpClient))},token:g,providedIn:"root"}),g.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],g.ctorParameters=function(){return[{type:r.CaucaCoreService},{type:p.HttpClient}]};var f=function(){function e(e,t){this.http=t,this.config=e.getConfig()}return e.prototype.getAll=function(){return this.http.get(this.config.apiUrl+"PermissionManagement")},e.prototype.get=function(e){return this.http.get(this.config.apiUrl+"PermissionManagement/"+e)},e.prototype.save=function(e){return this.http.post(this.config.apiUrl+"PermissionManagement",e)},e.prototype.delete=function(e){return this.http.delete(this.config.apiUrl+"PermissionManagement/"+e)},e}();f.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new f(t.ɵɵinject(r.CaucaCoreService),t.ɵɵinject(p.HttpClient))},token:f,providedIn:"root"}),f.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],f.ctorParameters=function(){return[{type:r.CaucaCoreService},{type:p.HttpClient}]};var h=function(){function e(e,t,n,i){var o=this;this.managementGroupService=e,this.managementUserService=t,this.managementPermissionService=n,this.showPrintButton=!0,this.hoverStatePermission=!0,this.groups=[],this.users=[],this.permissions=[],this.userFullName={},this.showColumn=!0,this.showColumnXS=!0,this.translations=[],this.calculateUsersCellValue=function(e){var t=e.users?e.users:[],n=[];return t.forEach((function(e){var t=o.users.filter((function(t){return t.id===e.idUser}));t&&t[0]&&n.push(t[0].firstName+" "+t[0].lastName)})),(n=n.sort((function(e,t){return e<t?-1:1}))).join(", ")},this.groupNameAlreadyUsedValidation=function(e){return o.managementGroupService.hasExistingGroupName(e.data).pipe(u.map((function(e){return!e}))).toPromise()},i.observe(["(max-width: 1000px)"]).subscribe((function(e){o.showColumn=!e.matches})),i.observe(["(max-width: 600px)"]).subscribe((function(e){o.showColumnXS=!e.matches}))}return e.prototype.ngOnInit=function(){var e=this;this.managementUserService.getAll().subscribe((function(t){e.users=t,e.users.forEach((function(t){t.isActive&&""!==t.firstName&&""!==t.lastName&&(e.userFullName[t.id]=t.firstName+" "+t.lastName)}))})),this.managementPermissionService.getAll().subscribe((function(t){var n=t.findIndex((function(e){return"CanAccessPermissions"===e.tag}));-1!==n&&t.splice(n,1),t.sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})),e.permissions=t})),this.getGroups()},e.prototype.fullName=function(e){return e?e.firstName+" "+e.lastName:""},e.prototype.getGroupUser=function(e,t){var n=[];this.groupUsers&&this.groupUsers.forEach((function(e){n.push(e.idUser)})),t.component.option("value",n)},e.prototype.setGroupUser=function(e,t){var n=[];t.value.forEach((function(t){var i=(e.data.users||[]).findIndex((function(e){return e.idUser===t}));-1===i?n.push({idUser:t}):n.push(e.data.users[i])})),e.setValue(JSON.parse(JSON.stringify(n)))},e.prototype.setGroupPermission=function(e,t){var n=[];t.value.forEach((function(e){n.push({idUser:e})})),e.setValue(JSON.parse(JSON.stringify(n)))},e.prototype.getPermissionStatus=function(e,t,n){var i=(e.value||[]).find((function(e){return e.idModulePermission===t.id}));i?n.component.option("value",i.isAllowed):n.component.option("value",void 0)},e.prototype.checkBoxToggled=function(e,t,n){if(n.component.skipOnValueChanged)n.component.skipOnValueChanged=!1;else{if(n.component.setUndefinedNextTime)return n.component.setUndefinedNextTime=!1,n.component.skipOnValueChanged=!0,n.component.option("value",void 0),void this.setPermissionStatus(e,t,void 0);!1===n.value&&(n.component.setUndefinedNextTime=!0),this.setPermissionStatus(e,t,n.value)}},e.prototype.onRowInserted=function(e){this.saveGroup(e.data)},e.prototype.onRowUpdated=function(e){this.saveGroup(e.data)},e.prototype.onRowRemoved=function(e){var t=this,n=e.data;this.managementGroupService.delete(n.id).subscribe((function(e){t.getGroups()}))},e.prototype.onEditingStart=function(e){this.groupUsers=e.data.users},e.prototype.onInitNewRow=function(){this.groupUsers=[]},e.prototype.setPermissionStatus=function(e,t,n){var i=e.value||[],o=i.findIndex((function(e){return e.idModulePermission===t.id}));o>-1?i[o].isAllowed=n:i.push({idModulePermission:t.id,isAllowed:n}),e.setValue(JSON.parse(JSON.stringify(i)))},e.prototype.saveGroup=function(e){var t=this;this.removePermissionUndefined(e),e.users&&e.users.forEach((function(t){t.idGroup=e.id})),e.permissions&&e.permissions.forEach((function(t){t.idGroup=e.id})),this.managementGroupService.save(e).subscribe((function(){t.getGroups()})),this.groupUsers=[]},e.prototype.removePermissionUndefined=function(e){e.permissions=e.permissions.filter((function(e){return void 0!==e.isAllowed}))},e.prototype.getGroups=function(){var e=this;this.managementGroupService.getAll().subscribe((function(t){return e.groups=t}))},e}();h.decorators=[{type:t.Component,args:[{selector:"cauca-management-group",template:'<cauca-dx-data-grid [allowPrint]="showPrintButton" keyExpr="id" [dataSource]="groups"\n (onRowInserted)="onRowInserted($event)" (onInitNewRow)="onInitNewRow()" (onRowUpdated)="onRowUpdated($event)"\n (onEditingStart)="onEditingStart($event)" (onRowRemoved)="onRowRemoved($event)">\n\n <dxi-column dataField="name" [caption]="\'management.name\' | translate">\n <dxi-validation-rule type="async" [message]="\'management.groupNameAlreadyUsed\' | translate"\n [validationCallback]="groupNameAlreadyUsedValidation"></dxi-validation-rule>\n </dxi-column>\n <dxi-column dataField="users" [caption]="\'management.users\' | translate" editCellTemplate="usersEditTemplate"\n [calculateCellValue]="calculateUsersCellValue">\n </dxi-column>\n <dxi-column dataField="permissions" [caption]="\'management.permissions\' | translate" [visible]="false"\n editCellTemplate="permissionsEditTemplate">\n </dxi-column>\n <dxo-export [enabled]="false"></dxo-export>\n <dxo-editing mode="popup" [allowAdding]="true" [allowUpdating]="true" [allowDeleting]="true" [useIcons]="true">\n <dxo-popup [showTitle]="true" [title]="\'management.group\' | translate" [fullScreen]="!showColumn"></dxo-popup>\n <dxo-form colCount="1" [labelLocation]="showColumnXS ? \'left\' : \'top\'">\n <dxi-item dataField="name" [isRequired]="true"></dxi-item>\n <dxi-item dataField="users"></dxi-item>\n <dxi-item dataField="permissions"></dxi-item>\n </dxo-form>\n </dxo-editing>\n\n <div *dxTemplate="let field of \'usersEditTemplate\'">\n <dx-tag-box valueExpr="id" [displayExpr]="fullName" [dataSource]="users" [searchEnabled]="true"\n [searchExpr]="fullName" (onInitialized)="getGroupUser(field, $event)"\n (onValueChanged)="setGroupUser(field, $event)">\n </dx-tag-box>\n </div>\n <div *dxTemplate="let field of \'permissionsEditTemplate\'">\n <dx-list [dataSource]="permissions" itemTemplate="rowTemplate" [searchEnabled]="true"\n [searchExpr]="[\'name\', \'tag\']" [hoverStateEnabled]="hoverStatePermission">\n <div *dxTemplate="let permission of \'rowTemplate\'">\n <dx-check-box [text]="permission.name" (onInitialized)="getPermissionStatus(field, permission, $event)"\n (onValueChanged)="checkBoxToggled(field, permission, $event)">\n </dx-check-box>\n </div>\n </dx-list>\n </div>\n</cauca-dx-data-grid>',styles:[""]}]}],h.ctorParameters=function(){return[{type:m},{type:g},{type:f},{type:s.BreakpointObserver}]},h.propDecorators={showPrintButton:[{type:t.Input}],hoverStatePermission:[{type:t.Input}]};var v=function(){this.userName="",this.firstName="",this.lastName="",this.password="",this.email="",this.isActive=!0},x=function(){function e(e,t){var n=this;this.managementUserService=e,this.users=[new v],this.showColumnXS=!0,this.userNameAlreadyUsedValidation=function(e){return n.managementUserService.hasExistingUserName(e.data).pipe(u.map((function(e){return!e}))).toPromise()},t.observe(["(max-width: 600px)"]).subscribe((function(e){n.showColumnXS=!e.matches}))}return e.prototype.ngOnInit=function(){this.getUsers()},e.prototype.onRowInserted=function(e){this.saveGroup(e.data)},e.prototype.onRowUpdated=function(e){this.saveGroup(e.key)},e.prototype.onRowRemoved=function(e){var t=this,n=e.data;this.managementUserService.delete(n.id).subscribe((function(e){t.getUsers()}))},e.prototype.saveGroup=function(e){var t=this;this.managementUserService.save(e).subscribe((function(){t.getUsers()}))},e.prototype.getUsers=function(){var e=this;this.managementUserService.getAll().subscribe((function(t){return e.users=t}))},e}();x.decorators=[{type:t.Component,args:[{selector:"cauca-management-user",template:'<cauca-dx-data-grid\n keyExpr="id"\n [dataSource]="users"\n (onRowInserted)="onRowInserted($event)"\n (onRowUpdated)="onRowUpdated($event)"\n (onRowRemoved)="onRowRemoved($event)">\n\n <dxi-column dataField="userName" [caption]="\'management.userName\' | translate">\n <dxi-validation-rule type="async" [message]="\'management.userNameAlreadyUsed\' | translate" [validationCallback]="userNameAlreadyUsedValidation"></dxi-validation-rule>\n </dxi-column>\n <dxi-column dataField="isActive" [caption]="\'management.isActive\' | translate" [visible]="false"></dxi-column>\n <dxi-column dataField="firstName" [caption]="\'management.firstName\' | translate"></dxi-column>\n <dxi-column dataField="lastName" [caption]="\'management.lastName\' | translate"></dxi-column>\n <dxi-column dataField="groups" [caption]="\'management.group\' | translate"></dxi-column>\n\n <dxo-editing mode="popup" [allowAdding]="true" [allowUpdating]="true" [allowDeleting]="true" [useIcons]="true">\n <dxo-popup [showTitle]="true" [title]="\'management.group\' | translate"></dxo-popup>\n <dxo-form colCount="2" [labelLocation]="showColumnXS ? \'left\' : \'top\'">\n <dxi-item dataField="userName" [isRequired]="true"></dxi-item>\n <dxi-item dataField="isActive"></dxi-item>\n <dxi-item dataField="firstName"></dxi-item>\n <dxi-item dataField="lastName"></dxi-item>\n <dxi-item dataField="group"></dxi-item>\n </dxo-form>\n </dxo-editing>\n</cauca-dx-data-grid>\n',styles:[""]}]}],x.ctorParameters=function(){return[{type:g},{type:s.BreakpointObserver}]};var y=function(){};y.decorators=[{type:t.NgModule,args:[{declarations:[l,h,x],imports:[d.CommonModule,n.DxCheckBoxModule,i.DxListModule,o.DxTagBoxModule,r.CaucaCoreForChildModule,a.CaucaDevextremeModule],exports:[l,x,h]}]}];var U=function(){this.idUserGroup="",this.idGroup="",this.idUser=""},C=function(){this.idUserPermission="",this.isAllowed=!1,this.idUser="",this.idModulePermission=""},w=function(){this.name="",this.users=[],this.permissions=[]},b=function(){this.idGroupPermission="",this.isAllowed=!1,this.idGroup="",this.idModulePermission=""};e.CaucaManagementComponent=l,e.CaucaManagementGroupComponent=h,e.CaucaManagementModule=y,e.CaucaManagementService=c,e.CaucaManagementUserComponent=x,e.GroupModel=w,e.GroupPermissionModel=b,e.ManagementGroupService=m,e.ManagementUserService=g,e.UserGroupModel=U,e.UserModel=v,e.UserPermissionModel=C,e.ɵa=f,Object.defineProperty(e,"__esModule",{value:!0})}));
2
- //# sourceMappingURL=cauca-911-management.umd.min.js.map