@cauca-911/management 3.0.1 → 11.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +4 -4
  3. package/assets/i18n/cauca/en-management.json +16 -16
  4. package/assets/i18n/cauca/fr-management.json +16 -16
  5. package/bundles/cauca-911-management.umd.js +466 -465
  6. package/bundles/cauca-911-management.umd.js.map +1 -1
  7. package/bundles/cauca-911-management.umd.min.js +1 -1
  8. package/bundles/cauca-911-management.umd.min.js.map +1 -1
  9. package/cauca-911-management.d.ts +5 -5
  10. package/cauca-911-management.metadata.json +1 -1
  11. package/esm2015/cauca-911-management.js +6 -6
  12. package/esm2015/lib/cauca-management-group/cauca-management-group.component.js +212 -212
  13. package/esm2015/lib/cauca-management-user/cauca-management-user.component.js +57 -57
  14. package/esm2015/lib/cauca-management.component.js +14 -14
  15. package/esm2015/lib/cauca-management.module.js +35 -35
  16. package/esm2015/lib/cauca-management.service.js +13 -13
  17. package/esm2015/lib/shared/models/group-model.js +8 -8
  18. package/esm2015/lib/shared/models/group-permission-model.js +9 -9
  19. package/esm2015/lib/shared/models/permission-model.js +8 -8
  20. package/esm2015/lib/shared/models/user-group-model.js +8 -8
  21. package/esm2015/lib/shared/models/user-model.js +12 -11
  22. package/esm2015/lib/shared/models/user-permission-model.js +9 -9
  23. package/esm2015/lib/shared/services/management-group.service.js +38 -38
  24. package/esm2015/lib/shared/services/management-permission.service.js +35 -35
  25. package/esm2015/lib/shared/services/management-user.service.js +53 -53
  26. package/esm2015/public-api.js +16 -16
  27. package/fesm2015/cauca-911-management.js +439 -438
  28. package/fesm2015/cauca-911-management.js.map +1 -1
  29. package/lib/cauca-management-group/cauca-management-group.component.d.ts +42 -42
  30. package/lib/cauca-management-user/cauca-management-user.component.d.ts +17 -17
  31. package/lib/cauca-management.component.d.ts +5 -5
  32. package/lib/cauca-management.module.d.ts +2 -2
  33. package/lib/cauca-management.service.d.ts +3 -3
  34. package/lib/shared/models/group-model.d.ts +9 -9
  35. package/lib/shared/models/group-permission-model.d.ts +7 -7
  36. package/lib/shared/models/permission-model.d.ts +7 -7
  37. package/lib/shared/models/user-group-model.d.ts +6 -6
  38. package/lib/shared/models/user-model.d.ts +15 -14
  39. package/lib/shared/models/user-permission-model.d.ts +7 -7
  40. package/lib/shared/services/management-group.service.d.ts +14 -14
  41. package/lib/shared/services/management-permission.service.d.ts +13 -13
  42. package/lib/shared/services/management-user.service.d.ts +20 -20
  43. package/package.json +4 -4
  44. package/public-api.d.ts +12 -12
@@ -1,501 +1,502 @@
1
1
  (function (global, factory) {
2
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
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));
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['cauca-911'] = global['cauca-911'] || {}, global['cauca-911'].management = {}), global.ng.core, global['devextreme-angular/ui/check-box'], global['devextreme-angular/ui/list'], global['devextreme-angular/ui/tag-box'], global['@cauca-911/core'], global['@cauca-911/devextreme'], global.ng.cdk.layout, global.rxjs.operators, global.ng.common.http, global.ng.common));
5
5
  }(this, (function (exports, i0, checkBox, list, tagBox, i1, devextreme, layout, operators, i2, common) { 'use strict';
6
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
- ];
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
18
  CaucaManagementService.ctorParameters = function () { return []; };
19
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
- ];
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
33
  CaucaManagementComponent.ctorParameters = function () { return []; };
34
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 }
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
66
  ]; };
67
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 }
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
114
  ]; };
115
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 }
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
144
  ]; };
145
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 }]
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\"\r\n (onRowInserted)=\"onRowInserted($event)\" (onInitNewRow)=\"onInitNewRow()\" (onRowUpdated)=\"onRowUpdated($event)\"\r\n (onEditingStart)=\"onEditingStart($event)\" (onRowRemoved)=\"onRowRemoved($event)\">\r\n\r\n <dxi-column dataField=\"name\" [caption]=\"'management.name' | translate\">\r\n <dxi-validation-rule type=\"async\" [message]=\"'management.groupNameAlreadyUsed' | translate\"\r\n [validationCallback]=\"groupNameAlreadyUsedValidation\"></dxi-validation-rule>\r\n </dxi-column>\r\n <dxi-column dataField=\"users\" [caption]=\"'management.users' | translate\" editCellTemplate=\"usersEditTemplate\"\r\n [calculateCellValue]=\"calculateUsersCellValue\">\r\n </dxi-column>\r\n <dxi-column dataField=\"permissions\" [caption]=\"'management.permissions' | translate\" [visible]=\"false\"\r\n editCellTemplate=\"permissionsEditTemplate\">\r\n </dxi-column>\r\n <dxo-export [enabled]=\"false\"></dxo-export>\r\n <dxo-editing mode=\"popup\" [allowAdding]=\"true\" [allowUpdating]=\"true\" [allowDeleting]=\"true\" [useIcons]=\"true\">\r\n <dxo-popup [showTitle]=\"true\" [title]=\"'management.group' | translate\" [fullScreen]=\"!showColumn\"></dxo-popup>\r\n <dxo-form colCount=\"1\" [labelLocation]=\"showColumnXS ? 'left' : 'top'\">\r\n <dxi-item dataField=\"name\" [isRequired]=\"true\"></dxi-item>\r\n <dxi-item dataField=\"users\"></dxi-item>\r\n <dxi-item dataField=\"permissions\"></dxi-item>\r\n </dxo-form>\r\n </dxo-editing>\r\n\r\n <div *dxTemplate=\"let field of 'usersEditTemplate'\">\r\n <dx-tag-box valueExpr=\"id\" [displayExpr]=\"fullName\" [dataSource]=\"users\" [searchEnabled]=\"true\"\r\n [searchExpr]=\"fullName\" (onInitialized)=\"getGroupUser(field, $event)\"\r\n (onValueChanged)=\"setGroupUser(field, $event)\">\r\n </dx-tag-box>\r\n </div>\r\n <div *dxTemplate=\"let field of 'permissionsEditTemplate'\">\r\n <dx-list [dataSource]=\"permissions\" itemTemplate=\"rowTemplate\" [searchEnabled]=\"true\"\r\n [searchExpr]=\"['name', 'tag']\" [hoverStateEnabled]=\"hoverStatePermission\">\r\n <div *dxTemplate=\"let permission of 'rowTemplate'\">\r\n <dx-check-box [text]=\"permission.name\" (onInitialized)=\"getPermissionStatus(field, permission, $event)\"\r\n (onValueChanged)=\"checkBoxToggled(field, permission, $event)\">\r\n </dx-check-box>\r\n </div>\r\n </dx-list>\r\n </div>\r\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
356
  };
357
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;
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
+ this.twoFactorAuthenticatorEnabled = false;
367
+ }
368
+ return UserModel;
368
369
  }());
369
370
 
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 }
371
+ var CaucaManagementUserComponent = /** @class */ (function () {
372
+ function CaucaManagementUserComponent(managementUserService, breakpointObserver) {
373
+ var _this = this;
374
+ this.managementUserService = managementUserService;
375
+ this.users = [
376
+ new UserModel()
377
+ ];
378
+ this.showColumnXS = true;
379
+ this.userNameAlreadyUsedValidation = function (e) {
380
+ return _this.managementUserService.hasExistingUserName(e.data).pipe(operators.map(function (exist) {
381
+ return !exist;
382
+ })).toPromise();
383
+ };
384
+ breakpointObserver.observe(['(max-width: 600px)']).subscribe(function (result) {
385
+ _this.showColumnXS = !result.matches;
386
+ });
387
+ }
388
+ CaucaManagementUserComponent.prototype.ngOnInit = function () {
389
+ this.getUsers();
390
+ };
391
+ CaucaManagementUserComponent.prototype.onRowInserted = function (e) {
392
+ this.saveGroup(e.data);
393
+ };
394
+ CaucaManagementUserComponent.prototype.onRowUpdated = function (e) {
395
+ this.saveGroup(e.key);
396
+ };
397
+ CaucaManagementUserComponent.prototype.onRowRemoved = function (e) {
398
+ var _this = this;
399
+ var user = e.data;
400
+ this.managementUserService.delete(user.id).subscribe(function (data) {
401
+ _this.getUsers();
402
+ });
403
+ };
404
+ CaucaManagementUserComponent.prototype.saveGroup = function (user) {
405
+ var _this = this;
406
+ this.managementUserService.save(user).subscribe(function () {
407
+ _this.getUsers();
408
+ });
409
+ };
410
+ CaucaManagementUserComponent.prototype.getUsers = function () {
411
+ var _this = this;
412
+ this.managementUserService.getAll().subscribe(function (data) { return _this.users = data; });
413
+ };
414
+ return CaucaManagementUserComponent;
415
+ }());
416
+ CaucaManagementUserComponent.decorators = [
417
+ { type: i0.Component, args: [{
418
+ selector: 'cauca-management-user',
419
+ template: "<cauca-dx-data-grid\r\n keyExpr=\"id\"\r\n [dataSource]=\"users\"\r\n (onRowInserted)=\"onRowInserted($event)\"\r\n (onRowUpdated)=\"onRowUpdated($event)\"\r\n (onRowRemoved)=\"onRowRemoved($event)\">\r\n\r\n <dxi-column dataField=\"userName\" [caption]=\"'management.userName' | translate\">\r\n <dxi-validation-rule type=\"async\" [message]=\"'management.userNameAlreadyUsed' | translate\" [validationCallback]=\"userNameAlreadyUsedValidation\"></dxi-validation-rule>\r\n </dxi-column>\r\n <dxi-column dataField=\"isActive\" [caption]=\"'management.isActive' | translate\" [visible]=\"false\"></dxi-column>\r\n <dxi-column dataField=\"firstName\" [caption]=\"'management.firstName' | translate\"></dxi-column>\r\n <dxi-column dataField=\"lastName\" [caption]=\"'management.lastName' | translate\"></dxi-column>\r\n <dxi-column dataField=\"groups\" [caption]=\"'management.group' | translate\"></dxi-column>\r\n\r\n <dxo-editing mode=\"popup\" [allowAdding]=\"true\" [allowUpdating]=\"true\" [allowDeleting]=\"true\" [useIcons]=\"true\">\r\n <dxo-popup [showTitle]=\"true\" [title]=\"'management.group' | translate\"></dxo-popup>\r\n <dxo-form colCount=\"2\" [labelLocation]=\"showColumnXS ? 'left' : 'top'\">\r\n <dxi-item dataField=\"userName\" [isRequired]=\"true\"></dxi-item>\r\n <dxi-item dataField=\"isActive\"></dxi-item>\r\n <dxi-item dataField=\"firstName\"></dxi-item>\r\n <dxi-item dataField=\"lastName\"></dxi-item>\r\n <dxi-item dataField=\"group\"></dxi-item>\r\n </dxo-form>\r\n </dxo-editing>\r\n</cauca-dx-data-grid>\r\n",
420
+ styles: [""]
421
+ },] }
422
+ ];
423
+ CaucaManagementUserComponent.ctorParameters = function () { return [
424
+ { type: ManagementUserService },
425
+ { type: layout.BreakpointObserver }
425
426
  ]; };
426
427
 
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
- },] }
428
+ var CaucaManagementModule = /** @class */ (function () {
429
+ function CaucaManagementModule() {
430
+ }
431
+ return CaucaManagementModule;
432
+ }());
433
+ CaucaManagementModule.decorators = [
434
+ { type: i0.NgModule, args: [{
435
+ declarations: [
436
+ CaucaManagementComponent,
437
+ CaucaManagementGroupComponent,
438
+ CaucaManagementUserComponent
439
+ ],
440
+ imports: [
441
+ common.CommonModule,
442
+ checkBox.DxCheckBoxModule,
443
+ list.DxListModule,
444
+ tagBox.DxTagBoxModule,
445
+ i1.CaucaCoreForChildModule,
446
+ devextreme.CaucaDevextremeModule,
447
+ ],
448
+ exports: [
449
+ CaucaManagementComponent,
450
+ CaucaManagementUserComponent,
451
+ CaucaManagementGroupComponent,
452
+ ]
453
+ },] }
453
454
  ];
454
455
 
455
- var UserGroupModel = /** @class */ (function () {
456
- function UserGroupModel() {
457
- this.idUserGroup = '';
458
- this.idGroup = '';
459
- this.idUser = '';
460
- }
461
- return UserGroupModel;
456
+ var UserGroupModel = /** @class */ (function () {
457
+ function UserGroupModel() {
458
+ this.idUserGroup = '';
459
+ this.idGroup = '';
460
+ this.idUser = '';
461
+ }
462
+ return UserGroupModel;
462
463
  }());
463
464
 
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;
465
+ var UserPermissionModel = /** @class */ (function () {
466
+ function UserPermissionModel() {
467
+ this.idUserPermission = '';
468
+ this.isAllowed = false;
469
+ this.idUser = '';
470
+ this.idModulePermission = '';
471
+ }
472
+ return UserPermissionModel;
472
473
  }());
473
474
 
474
- var GroupModel = /** @class */ (function () {
475
- function GroupModel() {
476
- this.name = '';
477
- this.users = [];
478
- this.permissions = [];
479
- }
480
- return GroupModel;
475
+ var GroupModel = /** @class */ (function () {
476
+ function GroupModel() {
477
+ this.name = '';
478
+ this.users = [];
479
+ this.permissions = [];
480
+ }
481
+ return GroupModel;
481
482
  }());
482
483
 
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;
484
+ var GroupPermissionModel = /** @class */ (function () {
485
+ function GroupPermissionModel() {
486
+ this.idGroupPermission = '';
487
+ this.isAllowed = false;
488
+ this.idGroup = '';
489
+ this.idModulePermission = '';
490
+ }
491
+ return GroupPermissionModel;
491
492
  }());
492
493
 
493
- /*
494
- * Public API Surface of cauca-management
494
+ /*
495
+ * Public API Surface of cauca-management
495
496
  */
496
497
 
497
- /**
498
- * Generated bundle index. Do not edit.
498
+ /**
499
+ * Generated bundle index. Do not edit.
499
500
  */
500
501
 
501
502
  exports.CaucaManagementComponent = CaucaManagementComponent;