@cauca-911/management 12.0.0 → 13.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.
- package/LICENSE +20 -20
- package/README.md +4 -4
- package/assets/i18n/cauca/en-management.json +16 -16
- package/assets/i18n/cauca/fr-management.json +16 -16
- package/bundles/cauca-911-management.umd.js +663 -500
- package/bundles/cauca-911-management.umd.js.map +1 -1
- package/bundles/cauca-911-management.umd.min.js +2 -0
- package/bundles/cauca-911-management.umd.min.js.map +1 -0
- package/cauca-911-management.d.ts +5 -5
- package/esm2015/cauca-911-management.js +5 -6
- package/esm2015/lib/cauca-management-group/cauca-management-group.component.js +298 -212
- package/esm2015/lib/cauca-management-user/cauca-management-user.component.js +106 -57
- package/esm2015/lib/cauca-management.component.js +27 -14
- package/esm2015/lib/cauca-management.module.js +56 -35
- package/esm2015/lib/cauca-management.service.js +14 -13
- package/esm2015/lib/shared/models/group-model.js +8 -8
- package/esm2015/lib/shared/models/group-permission-model.js +9 -9
- package/esm2015/lib/shared/models/permission-model.js +8 -8
- package/esm2015/lib/shared/models/user-group-model.js +8 -8
- package/esm2015/lib/shared/models/user-model.js +12 -11
- package/esm2015/lib/shared/models/user-permission-model.js +9 -9
- package/esm2015/lib/shared/services/management-group.service.js +34 -38
- package/esm2015/lib/shared/services/management-permission.service.js +31 -35
- package/esm2015/lib/shared/services/management-user.service.js +49 -53
- package/esm2015/public-api.js +16 -16
- package/fesm2015/cauca-911-management.js +606 -456
- package/fesm2015/cauca-911-management.js.map +1 -1
- package/lib/cauca-management-group/cauca-management-group.component.d.ts +45 -42
- package/lib/cauca-management-user/cauca-management-user.component.d.ts +20 -17
- package/lib/cauca-management.component.d.ts +8 -5
- package/lib/cauca-management.module.d.ts +14 -2
- package/lib/cauca-management.service.d.ts +6 -3
- package/lib/shared/models/group-model.d.ts +9 -9
- package/lib/shared/models/group-permission-model.d.ts +7 -7
- package/lib/shared/models/permission-model.d.ts +7 -7
- package/lib/shared/models/user-group-model.d.ts +6 -6
- package/lib/shared/models/user-model.d.ts +15 -14
- package/lib/shared/models/user-permission-model.d.ts +7 -7
- package/lib/shared/services/management-group.service.d.ts +17 -14
- package/lib/shared/services/management-permission.service.d.ts +16 -13
- package/lib/shared/services/management-user.service.d.ts +23 -20
- package/package.json +9 -7
- package/public-api.d.ts +12 -12
- package/cauca-911-management.metadata.json +0 -1
|
@@ -1,523 +1,687 @@
|
|
|
1
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('
|
|
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', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global[
|
|
5
|
-
}
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ngx-translate/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('rxjs/operators'), require('@angular/common/http'), require('@angular/cdk/layout'), require('devextreme-angular/ui/nested'), require('devextreme-angular/core'), require('@angular/common')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@cauca-911/management', ['exports', '@angular/core', '@ngx-translate/core', 'devextreme-angular/ui/check-box', 'devextreme-angular/ui/list', 'devextreme-angular/ui/tag-box', '@cauca-911/core', '@cauca-911/devextreme', 'rxjs/operators', '@angular/common/http', '@angular/cdk/layout', 'devextreme-angular/ui/nested', 'devextreme-angular/core', '@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.i1, global.i10, global.i9, global.i8, global.i1$1, global.i5, global.rxjs.operators, global.ng.common.http, global.ng.cdk.layout, global.i6, global.i7, global.ng.common));
|
|
5
|
+
}(this, (function (exports, i0, i1, i10, i9, i8, i1$1, i5, operators, i2, i4, i6, i7, common) { 'use strict';
|
|
6
6
|
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return Object.freeze(n);
|
|
23
|
-
}
|
|
7
|
+
var CaucaManagementService = /** @class */ (function () {
|
|
8
|
+
function CaucaManagementService() {
|
|
9
|
+
}
|
|
10
|
+
return CaucaManagementService;
|
|
11
|
+
}());
|
|
12
|
+
CaucaManagementService.ɵfac = function CaucaManagementService_Factory(t) { return new (t || CaucaManagementService)(); };
|
|
13
|
+
CaucaManagementService.ɵprov = i0.ɵɵdefineInjectable({ token: CaucaManagementService, factory: CaucaManagementService.ɵfac, providedIn: 'root' });
|
|
14
|
+
/*@__PURE__*/ (function () {
|
|
15
|
+
i0.ɵsetClassMetadata(CaucaManagementService, [{
|
|
16
|
+
type: i0.Injectable,
|
|
17
|
+
args: [{
|
|
18
|
+
providedIn: 'root'
|
|
19
|
+
}]
|
|
20
|
+
}], function () { return []; }, null);
|
|
21
|
+
})();
|
|
24
22
|
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
var CaucaManagementComponent = /** @class */ (function () {
|
|
24
|
+
function CaucaManagementComponent() {
|
|
25
|
+
}
|
|
26
|
+
CaucaManagementComponent.prototype.ngOnInit = function () {
|
|
27
|
+
};
|
|
28
|
+
return CaucaManagementComponent;
|
|
29
|
+
}());
|
|
30
|
+
CaucaManagementComponent.ɵfac = function CaucaManagementComponent_Factory(t) { return new (t || CaucaManagementComponent)(); };
|
|
31
|
+
CaucaManagementComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaucaManagementComponent, selectors: [["cauca-management"]], decls: 3, vars: 3, template: function CaucaManagementComponent_Template(rf, ctx) {
|
|
32
|
+
if (rf & 1) {
|
|
33
|
+
i0.ɵɵelementStart(0, "div");
|
|
34
|
+
i0.ɵɵtext(1);
|
|
35
|
+
i0.ɵɵpipe(2, "translate");
|
|
36
|
+
i0.ɵɵelementEnd();
|
|
37
|
+
}
|
|
38
|
+
if (rf & 2) {
|
|
39
|
+
i0.ɵɵadvance(1);
|
|
40
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "core.noGenericComponentOnThisLibrary"));
|
|
41
|
+
}
|
|
42
|
+
}, pipes: [i1.TranslatePipe], encapsulation: 2 });
|
|
43
|
+
/*@__PURE__*/ (function () {
|
|
44
|
+
i0.ɵsetClassMetadata(CaucaManagementComponent, [{
|
|
45
|
+
type: i0.Component,
|
|
46
|
+
args: [{
|
|
47
|
+
selector: 'cauca-management',
|
|
48
|
+
templateUrl: './cauca-management.component.html',
|
|
49
|
+
styles: []
|
|
50
|
+
}]
|
|
51
|
+
}], function () { return []; }, null);
|
|
52
|
+
})();
|
|
28
53
|
|
|
29
|
-
var
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
function
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
ManagementGroupService.prototype.getAll = function () {
|
|
63
|
-
return this.http.get(this.config.apiUrl + "GroupManagement");
|
|
64
|
-
};
|
|
65
|
-
ManagementGroupService.prototype.get = function (idGroup) {
|
|
66
|
-
return this.http.get(this.config.apiUrl + "GroupManagement/" + idGroup);
|
|
67
|
-
};
|
|
68
|
-
ManagementGroupService.prototype.save = function (group) {
|
|
69
|
-
return this.http.post(this.config.apiUrl + "GroupManagement", group);
|
|
70
|
-
};
|
|
71
|
-
ManagementGroupService.prototype.delete = function (idGroup) {
|
|
72
|
-
return this.http.delete(this.config.apiUrl + "GroupManagement/" + idGroup);
|
|
73
|
-
};
|
|
74
|
-
ManagementGroupService.prototype.hasExistingGroupName = function (group) {
|
|
75
|
-
return this.http.post(this.config.apiUrl + "GroupManagement/GroupNameAlreadyExist", group);
|
|
76
|
-
};
|
|
77
|
-
return ManagementGroupService;
|
|
78
|
-
}());
|
|
79
|
-
ManagementGroupService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function ManagementGroupService_Factory() { return new ManagementGroupService(i0__namespace.ɵɵinject(i1__namespace.CaucaCoreService), i0__namespace.ɵɵinject(i2__namespace.HttpClient)); }, token: ManagementGroupService, providedIn: "root" });
|
|
80
|
-
ManagementGroupService.decorators = [
|
|
81
|
-
{ type: i0.Injectable, args: [{
|
|
82
|
-
providedIn: 'root'
|
|
83
|
-
},] }
|
|
84
|
-
];
|
|
85
|
-
ManagementGroupService.ctorParameters = function () { return [
|
|
86
|
-
{ type: i1.CaucaCoreService },
|
|
87
|
-
{ type: i2.HttpClient }
|
|
88
|
-
]; };
|
|
54
|
+
var ManagementGroupService = /** @class */ (function () {
|
|
55
|
+
function ManagementGroupService(coreService, http) {
|
|
56
|
+
this.http = http;
|
|
57
|
+
this.config = coreService.getConfig();
|
|
58
|
+
}
|
|
59
|
+
ManagementGroupService.prototype.getAll = function () {
|
|
60
|
+
return this.http.get(this.config.apiUrl + "GroupManagement");
|
|
61
|
+
};
|
|
62
|
+
ManagementGroupService.prototype.get = function (idGroup) {
|
|
63
|
+
return this.http.get(this.config.apiUrl + "GroupManagement/" + idGroup);
|
|
64
|
+
};
|
|
65
|
+
ManagementGroupService.prototype.save = function (group) {
|
|
66
|
+
return this.http.post(this.config.apiUrl + "GroupManagement", group);
|
|
67
|
+
};
|
|
68
|
+
ManagementGroupService.prototype.delete = function (idGroup) {
|
|
69
|
+
return this.http.delete(this.config.apiUrl + "GroupManagement/" + idGroup);
|
|
70
|
+
};
|
|
71
|
+
ManagementGroupService.prototype.hasExistingGroupName = function (group) {
|
|
72
|
+
return this.http.post(this.config.apiUrl + "GroupManagement/GroupNameAlreadyExist", group);
|
|
73
|
+
};
|
|
74
|
+
return ManagementGroupService;
|
|
75
|
+
}());
|
|
76
|
+
ManagementGroupService.ɵfac = function ManagementGroupService_Factory(t) { return new (t || ManagementGroupService)(i0.ɵɵinject(i1$1.CaucaCoreService), i0.ɵɵinject(i2.HttpClient)); };
|
|
77
|
+
ManagementGroupService.ɵprov = i0.ɵɵdefineInjectable({ token: ManagementGroupService, factory: ManagementGroupService.ɵfac, providedIn: 'root' });
|
|
78
|
+
/*@__PURE__*/ (function () {
|
|
79
|
+
i0.ɵsetClassMetadata(ManagementGroupService, [{
|
|
80
|
+
type: i0.Injectable,
|
|
81
|
+
args: [{
|
|
82
|
+
providedIn: 'root'
|
|
83
|
+
}]
|
|
84
|
+
}], function () { return [{ type: i1$1.CaucaCoreService }, { type: i2.HttpClient }]; }, null);
|
|
85
|
+
})();
|
|
89
86
|
|
|
90
|
-
var ManagementUserService = /** @class */ (function () {
|
|
91
|
-
function ManagementUserService(coreService, http) {
|
|
92
|
-
this.http = http;
|
|
93
|
-
this.config = coreService.getConfig();
|
|
94
|
-
}
|
|
95
|
-
ManagementUserService.prototype.getAll = function () {
|
|
96
|
-
return this.http.get(this.config.apiUrl + "UserManagement");
|
|
97
|
-
};
|
|
98
|
-
ManagementUserService.prototype.get = function (idUser) {
|
|
99
|
-
return this.http.get(this.config.apiUrl + "UserManagement/" + idUser);
|
|
100
|
-
};
|
|
101
|
-
ManagementUserService.prototype.getGroup = function (idUser) {
|
|
102
|
-
return this.http.get(this.config.apiUrl + "UserManagement/" + idUser + "/groups");
|
|
103
|
-
};
|
|
104
|
-
ManagementUserService.prototype.addGroup = function (userGroup) {
|
|
105
|
-
return this.http.post(this.config.apiUrl + "UserManagement/group", userGroup);
|
|
106
|
-
};
|
|
107
|
-
ManagementUserService.prototype.deleteGroup = function (idUserGroup) {
|
|
108
|
-
return this.http.delete(this.config.apiUrl + "UserManagement/groups/" + idUserGroup);
|
|
109
|
-
};
|
|
110
|
-
ManagementUserService.prototype.addPermission = function (userPermission) {
|
|
111
|
-
return this.http.post(this.config.apiUrl + "UserManagement/permission", userPermission);
|
|
112
|
-
};
|
|
113
|
-
ManagementUserService.prototype.deletePermission = function (idUserPermission) {
|
|
114
|
-
return this.http.delete(this.config.apiUrl + "UserManagement/groups/" + idUserPermission);
|
|
115
|
-
};
|
|
116
|
-
ManagementUserService.prototype.save = function (user) {
|
|
117
|
-
return this.http.post(this.config.apiUrl + "UserManagement", user);
|
|
118
|
-
};
|
|
119
|
-
ManagementUserService.prototype.delete = function (idUser) {
|
|
120
|
-
return this.http.delete(this.config.apiUrl + "UserManagement/" + idUser);
|
|
121
|
-
};
|
|
122
|
-
ManagementUserService.prototype.hasExistingUserName = function (user) {
|
|
123
|
-
return this.http.post(this.config.apiUrl + "UserManagement/UserNameAlreadyExist", user);
|
|
124
|
-
};
|
|
125
|
-
return ManagementUserService;
|
|
126
|
-
}());
|
|
127
|
-
ManagementUserService.ɵ
|
|
128
|
-
ManagementUserService
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
87
|
+
var ManagementUserService = /** @class */ (function () {
|
|
88
|
+
function ManagementUserService(coreService, http) {
|
|
89
|
+
this.http = http;
|
|
90
|
+
this.config = coreService.getConfig();
|
|
91
|
+
}
|
|
92
|
+
ManagementUserService.prototype.getAll = function () {
|
|
93
|
+
return this.http.get(this.config.apiUrl + "UserManagement");
|
|
94
|
+
};
|
|
95
|
+
ManagementUserService.prototype.get = function (idUser) {
|
|
96
|
+
return this.http.get(this.config.apiUrl + "UserManagement/" + idUser);
|
|
97
|
+
};
|
|
98
|
+
ManagementUserService.prototype.getGroup = function (idUser) {
|
|
99
|
+
return this.http.get(this.config.apiUrl + "UserManagement/" + idUser + "/groups");
|
|
100
|
+
};
|
|
101
|
+
ManagementUserService.prototype.addGroup = function (userGroup) {
|
|
102
|
+
return this.http.post(this.config.apiUrl + "UserManagement/group", userGroup);
|
|
103
|
+
};
|
|
104
|
+
ManagementUserService.prototype.deleteGroup = function (idUserGroup) {
|
|
105
|
+
return this.http.delete(this.config.apiUrl + "UserManagement/groups/" + idUserGroup);
|
|
106
|
+
};
|
|
107
|
+
ManagementUserService.prototype.addPermission = function (userPermission) {
|
|
108
|
+
return this.http.post(this.config.apiUrl + "UserManagement/permission", userPermission);
|
|
109
|
+
};
|
|
110
|
+
ManagementUserService.prototype.deletePermission = function (idUserPermission) {
|
|
111
|
+
return this.http.delete(this.config.apiUrl + "UserManagement/groups/" + idUserPermission);
|
|
112
|
+
};
|
|
113
|
+
ManagementUserService.prototype.save = function (user) {
|
|
114
|
+
return this.http.post(this.config.apiUrl + "UserManagement", user);
|
|
115
|
+
};
|
|
116
|
+
ManagementUserService.prototype.delete = function (idUser) {
|
|
117
|
+
return this.http.delete(this.config.apiUrl + "UserManagement/" + idUser);
|
|
118
|
+
};
|
|
119
|
+
ManagementUserService.prototype.hasExistingUserName = function (user) {
|
|
120
|
+
return this.http.post(this.config.apiUrl + "UserManagement/UserNameAlreadyExist", user);
|
|
121
|
+
};
|
|
122
|
+
return ManagementUserService;
|
|
123
|
+
}());
|
|
124
|
+
ManagementUserService.ɵfac = function ManagementUserService_Factory(t) { return new (t || ManagementUserService)(i0.ɵɵinject(i1$1.CaucaCoreService), i0.ɵɵinject(i2.HttpClient)); };
|
|
125
|
+
ManagementUserService.ɵprov = i0.ɵɵdefineInjectable({ token: ManagementUserService, factory: ManagementUserService.ɵfac, providedIn: 'root' });
|
|
126
|
+
/*@__PURE__*/ (function () {
|
|
127
|
+
i0.ɵsetClassMetadata(ManagementUserService, [{
|
|
128
|
+
type: i0.Injectable,
|
|
129
|
+
args: [{
|
|
130
|
+
providedIn: 'root'
|
|
131
|
+
}]
|
|
132
|
+
}], function () { return [{ type: i1$1.CaucaCoreService }, { type: i2.HttpClient }]; }, null);
|
|
133
|
+
})();
|
|
137
134
|
|
|
138
|
-
var ManagementPermissionService = /** @class */ (function () {
|
|
139
|
-
function ManagementPermissionService(coreService, http) {
|
|
140
|
-
this.http = http;
|
|
141
|
-
this.config = coreService.getConfig();
|
|
142
|
-
}
|
|
143
|
-
ManagementPermissionService.prototype.getAll = function () {
|
|
144
|
-
return this.http.get(this.config.apiUrl + "PermissionManagement");
|
|
145
|
-
};
|
|
146
|
-
ManagementPermissionService.prototype.get = function (idPermission) {
|
|
147
|
-
return this.http.get(this.config.apiUrl + "PermissionManagement/" + idPermission);
|
|
148
|
-
};
|
|
149
|
-
ManagementPermissionService.prototype.save = function (permission) {
|
|
150
|
-
return this.http.post(this.config.apiUrl + "PermissionManagement", permission);
|
|
151
|
-
};
|
|
152
|
-
ManagementPermissionService.prototype.delete = function (idPermission) {
|
|
153
|
-
return this.http.delete(this.config.apiUrl + "PermissionManagement/" + idPermission);
|
|
154
|
-
};
|
|
155
|
-
return ManagementPermissionService;
|
|
156
|
-
}());
|
|
157
|
-
ManagementPermissionService.ɵ
|
|
158
|
-
ManagementPermissionService
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
135
|
+
var ManagementPermissionService = /** @class */ (function () {
|
|
136
|
+
function ManagementPermissionService(coreService, http) {
|
|
137
|
+
this.http = http;
|
|
138
|
+
this.config = coreService.getConfig();
|
|
139
|
+
}
|
|
140
|
+
ManagementPermissionService.prototype.getAll = function () {
|
|
141
|
+
return this.http.get(this.config.apiUrl + "PermissionManagement");
|
|
142
|
+
};
|
|
143
|
+
ManagementPermissionService.prototype.get = function (idPermission) {
|
|
144
|
+
return this.http.get(this.config.apiUrl + "PermissionManagement/" + idPermission);
|
|
145
|
+
};
|
|
146
|
+
ManagementPermissionService.prototype.save = function (permission) {
|
|
147
|
+
return this.http.post(this.config.apiUrl + "PermissionManagement", permission);
|
|
148
|
+
};
|
|
149
|
+
ManagementPermissionService.prototype.delete = function (idPermission) {
|
|
150
|
+
return this.http.delete(this.config.apiUrl + "PermissionManagement/" + idPermission);
|
|
151
|
+
};
|
|
152
|
+
return ManagementPermissionService;
|
|
153
|
+
}());
|
|
154
|
+
ManagementPermissionService.ɵfac = function ManagementPermissionService_Factory(t) { return new (t || ManagementPermissionService)(i0.ɵɵinject(i1$1.CaucaCoreService), i0.ɵɵinject(i2.HttpClient)); };
|
|
155
|
+
ManagementPermissionService.ɵprov = i0.ɵɵdefineInjectable({ token: ManagementPermissionService, factory: ManagementPermissionService.ɵfac, providedIn: 'root' });
|
|
156
|
+
/*@__PURE__*/ (function () {
|
|
157
|
+
i0.ɵsetClassMetadata(ManagementPermissionService, [{
|
|
158
|
+
type: i0.Injectable,
|
|
159
|
+
args: [{
|
|
160
|
+
providedIn: 'root'
|
|
161
|
+
}]
|
|
162
|
+
}], function () { return [{ type: i1$1.CaucaCoreService }, { type: i2.HttpClient }]; }, null);
|
|
163
|
+
})();
|
|
167
164
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
var
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
var
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
this.
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
};
|
|
308
|
-
CaucaManagementGroupComponent.prototype.
|
|
309
|
-
var
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
if (
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
};
|
|
356
|
-
CaucaManagementGroupComponent.prototype.
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
165
|
+
function CaucaManagementGroupComponent_div_17_Template(rf, ctx) {
|
|
166
|
+
if (rf & 1) {
|
|
167
|
+
var _r4_1 = i0.ɵɵgetCurrentView();
|
|
168
|
+
i0.ɵɵelementStart(0, "div");
|
|
169
|
+
i0.ɵɵelementStart(1, "dx-tag-box", 13);
|
|
170
|
+
i0.ɵɵlistener("onInitialized", function CaucaManagementGroupComponent_div_17_Template_dx_tag_box_onInitialized_1_listener($event) { i0.ɵɵrestoreView(_r4_1); var field_r2 = ctx.$implicit; var ctx_r3 = i0.ɵɵnextContext(); return ctx_r3.getGroupUser(field_r2, $event); })("onValueChanged", function CaucaManagementGroupComponent_div_17_Template_dx_tag_box_onValueChanged_1_listener($event) { i0.ɵɵrestoreView(_r4_1); var field_r2 = ctx.$implicit; var ctx_r5 = i0.ɵɵnextContext(); return ctx_r5.setGroupUser(field_r2, $event); });
|
|
171
|
+
i0.ɵɵelementEnd();
|
|
172
|
+
i0.ɵɵelementEnd();
|
|
173
|
+
}
|
|
174
|
+
if (rf & 2) {
|
|
175
|
+
var ctx_r0 = i0.ɵɵnextContext();
|
|
176
|
+
i0.ɵɵadvance(1);
|
|
177
|
+
i0.ɵɵproperty("displayExpr", ctx_r0.fullName)("dataSource", ctx_r0.users)("searchEnabled", true)("searchExpr", ctx_r0.fullName);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function CaucaManagementGroupComponent_div_18_div_2_Template(rf, ctx) {
|
|
181
|
+
if (rf & 1) {
|
|
182
|
+
var _r11_1 = i0.ɵɵgetCurrentView();
|
|
183
|
+
i0.ɵɵelementStart(0, "div");
|
|
184
|
+
i0.ɵɵelementStart(1, "dx-check-box", 15);
|
|
185
|
+
i0.ɵɵlistener("onInitialized", function CaucaManagementGroupComponent_div_18_div_2_Template_dx_check_box_onInitialized_1_listener($event) { i0.ɵɵrestoreView(_r11_1); var permission_r8 = ctx.$implicit; var field_r6 = i0.ɵɵnextContext().$implicit; var ctx_r9 = i0.ɵɵnextContext(); return ctx_r9.getPermissionStatus(field_r6, permission_r8, $event); })("onValueChanged", function CaucaManagementGroupComponent_div_18_div_2_Template_dx_check_box_onValueChanged_1_listener($event) { i0.ɵɵrestoreView(_r11_1); var permission_r8 = ctx.$implicit; var field_r6 = i0.ɵɵnextContext().$implicit; var ctx_r12 = i0.ɵɵnextContext(); return ctx_r12.checkBoxToggled(field_r6, permission_r8, $event); });
|
|
186
|
+
i0.ɵɵelementEnd();
|
|
187
|
+
i0.ɵɵelementEnd();
|
|
188
|
+
}
|
|
189
|
+
if (rf & 2) {
|
|
190
|
+
var permission_r8 = ctx.$implicit;
|
|
191
|
+
i0.ɵɵadvance(1);
|
|
192
|
+
i0.ɵɵproperty("text", permission_r8.name);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
var _c0 = function () { return ["name", "tag"]; };
|
|
196
|
+
function CaucaManagementGroupComponent_div_18_Template(rf, ctx) {
|
|
197
|
+
if (rf & 1) {
|
|
198
|
+
i0.ɵɵelementStart(0, "div");
|
|
199
|
+
i0.ɵɵelementStart(1, "dx-list", 14);
|
|
200
|
+
i0.ɵɵtemplate(2, CaucaManagementGroupComponent_div_18_div_2_Template, 2, 1, "div", 12);
|
|
201
|
+
i0.ɵɵelementEnd();
|
|
202
|
+
i0.ɵɵelementEnd();
|
|
203
|
+
}
|
|
204
|
+
if (rf & 2) {
|
|
205
|
+
var ctx_r1 = i0.ɵɵnextContext();
|
|
206
|
+
i0.ɵɵadvance(1);
|
|
207
|
+
i0.ɵɵproperty("dataSource", ctx_r1.permissions)("searchEnabled", true)("searchExpr", i0.ɵɵpureFunction0(5, _c0))("hoverStateEnabled", ctx_r1.hoverStatePermission);
|
|
208
|
+
i0.ɵɵadvance(1);
|
|
209
|
+
i0.ɵɵproperty("dxTemplateOf", "rowTemplate");
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
var CaucaManagementGroupComponent = /** @class */ (function () {
|
|
213
|
+
function CaucaManagementGroupComponent(managementGroupService, managementUserService, managementPermissionService, breakpointObserver) {
|
|
214
|
+
var _this = this;
|
|
215
|
+
this.managementGroupService = managementGroupService;
|
|
216
|
+
this.managementUserService = managementUserService;
|
|
217
|
+
this.managementPermissionService = managementPermissionService;
|
|
218
|
+
this.showPrintButton = true;
|
|
219
|
+
this.hoverStatePermission = true;
|
|
220
|
+
this.groups = [];
|
|
221
|
+
this.users = [];
|
|
222
|
+
this.permissions = [];
|
|
223
|
+
this.userFullName = {};
|
|
224
|
+
this.showColumn = true;
|
|
225
|
+
this.showColumnXS = true;
|
|
226
|
+
this.translations = [];
|
|
227
|
+
this.calculateUsersCellValue = function (e) {
|
|
228
|
+
var users = (e.users ? e.users : []);
|
|
229
|
+
var usersNames = [];
|
|
230
|
+
users.forEach(function (user) {
|
|
231
|
+
var userGroup = _this.users.filter(function (u) { return u.id === user.idUser; });
|
|
232
|
+
if (userGroup && userGroup[0]) {
|
|
233
|
+
usersNames.push(userGroup[0].firstName + ' ' + userGroup[0].lastName);
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
usersNames = usersNames.sort(function (one, two) { return (one < two ? -1 : 1); });
|
|
237
|
+
return usersNames.join(', ');
|
|
238
|
+
};
|
|
239
|
+
this.groupNameAlreadyUsedValidation = function (e) { return _this.managementGroupService.hasExistingGroupName(e.data).pipe(operators.map(function (exist) { return !exist; })).toPromise(); };
|
|
240
|
+
breakpointObserver.observe(['(max-width: 1000px)']).subscribe(function (result) {
|
|
241
|
+
_this.showColumn = !result.matches;
|
|
242
|
+
});
|
|
243
|
+
breakpointObserver.observe(['(max-width: 600px)']).subscribe(function (result) {
|
|
244
|
+
_this.showColumnXS = !result.matches;
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
CaucaManagementGroupComponent.prototype.ngOnInit = function () {
|
|
248
|
+
var _this = this;
|
|
249
|
+
this.managementUserService.getAll().subscribe(function (data) {
|
|
250
|
+
_this.users = data;
|
|
251
|
+
_this.users.forEach(function (user) {
|
|
252
|
+
if (user.isActive) {
|
|
253
|
+
if (user.firstName !== '' && user.lastName !== '') {
|
|
254
|
+
_this.userFullName[user.id] = user.firstName + " " + user.lastName;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
this.managementPermissionService.getAll().subscribe(function (permissions) {
|
|
260
|
+
var permissionIndex = permissions.findIndex(function (c) { return c.tag === 'CanAccessPermissions'; });
|
|
261
|
+
if (permissionIndex !== -1) {
|
|
262
|
+
permissions.splice(permissionIndex, 1);
|
|
263
|
+
}
|
|
264
|
+
permissions.sort(function (a, b) {
|
|
265
|
+
if (a.name < b.name) {
|
|
266
|
+
return -1;
|
|
267
|
+
}
|
|
268
|
+
if (a.name > b.name) {
|
|
269
|
+
return 1;
|
|
270
|
+
}
|
|
271
|
+
return 0;
|
|
272
|
+
});
|
|
273
|
+
_this.permissions = permissions;
|
|
274
|
+
});
|
|
275
|
+
this.getGroups();
|
|
276
|
+
};
|
|
277
|
+
CaucaManagementGroupComponent.prototype.fullName = function (data) {
|
|
278
|
+
if (!data) {
|
|
279
|
+
return '';
|
|
280
|
+
}
|
|
281
|
+
return data.firstName + " " + data.lastName;
|
|
282
|
+
};
|
|
283
|
+
CaucaManagementGroupComponent.prototype.getGroupUser = function (field, e) {
|
|
284
|
+
var users = [];
|
|
285
|
+
if (this.groupUsers) {
|
|
286
|
+
this.groupUsers.forEach(function (user) {
|
|
287
|
+
users.push(user.idUser);
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
e.component.option('value', users);
|
|
291
|
+
};
|
|
292
|
+
CaucaManagementGroupComponent.prototype.setGroupUser = function (field, e) {
|
|
293
|
+
var groupUser = [];
|
|
294
|
+
e.value.forEach(function (idUser) {
|
|
295
|
+
var groupIndex = (field.data.users || []).findIndex(function (g) { return g.idUser === idUser; });
|
|
296
|
+
if (groupIndex === -1) {
|
|
297
|
+
groupUser.push({ idUser: idUser, });
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
groupUser.push(field.data.users[groupIndex]);
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
field.setValue(JSON.parse(JSON.stringify(groupUser)));
|
|
304
|
+
};
|
|
305
|
+
CaucaManagementGroupComponent.prototype.setGroupPermission = function (field, e) {
|
|
306
|
+
var groupUser = [];
|
|
307
|
+
e.value.forEach(function (idUser) {
|
|
308
|
+
groupUser.push({
|
|
309
|
+
idUser: idUser,
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
field.setValue(JSON.parse(JSON.stringify(groupUser)));
|
|
313
|
+
};
|
|
314
|
+
CaucaManagementGroupComponent.prototype.getPermissionStatus = function (field, permission, e) {
|
|
315
|
+
var groupPermission = (field.value || []).find(function (p) { return p.idModulePermission === permission.id; });
|
|
316
|
+
if (groupPermission) {
|
|
317
|
+
e.component.option('value', groupPermission.isAllowed);
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
e.component.option('value', undefined);
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
CaucaManagementGroupComponent.prototype.checkBoxToggled = function (field, permission, e) {
|
|
324
|
+
if (e.component.skipOnValueChanged) {
|
|
325
|
+
e.component.skipOnValueChanged = false;
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
if (e.component.setUndefinedNextTime) {
|
|
329
|
+
e.component.setUndefinedNextTime = false;
|
|
330
|
+
e.component.skipOnValueChanged = true;
|
|
331
|
+
e.component.option('value', undefined);
|
|
332
|
+
this.setPermissionStatus(field, permission, undefined);
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
if (e.value === false) {
|
|
336
|
+
e.component.setUndefinedNextTime = true;
|
|
337
|
+
}
|
|
338
|
+
this.setPermissionStatus(field, permission, e.value);
|
|
339
|
+
};
|
|
340
|
+
CaucaManagementGroupComponent.prototype.onRowInserted = function (e) {
|
|
341
|
+
this.saveGroup(e.data);
|
|
342
|
+
};
|
|
343
|
+
CaucaManagementGroupComponent.prototype.onRowUpdated = function (e) {
|
|
344
|
+
this.saveGroup(e.data);
|
|
345
|
+
};
|
|
346
|
+
CaucaManagementGroupComponent.prototype.onRowRemoved = function (e) {
|
|
347
|
+
var _this = this;
|
|
348
|
+
var group = e.data;
|
|
349
|
+
this.managementGroupService.delete(group.id).subscribe(function () {
|
|
350
|
+
_this.getGroups();
|
|
351
|
+
});
|
|
352
|
+
};
|
|
353
|
+
CaucaManagementGroupComponent.prototype.onEditingStart = function (e) {
|
|
354
|
+
this.groupUsers = e.data.users;
|
|
355
|
+
};
|
|
356
|
+
CaucaManagementGroupComponent.prototype.onInitNewRow = function () {
|
|
357
|
+
this.groupUsers = [];
|
|
358
|
+
};
|
|
359
|
+
CaucaManagementGroupComponent.prototype.setPermissionStatus = function (field, permission, value) {
|
|
360
|
+
var groupPermissions = field.value || [];
|
|
361
|
+
var groupIndex = groupPermissions.findIndex(function (p) { return p.idModulePermission === permission.id; });
|
|
362
|
+
if (groupIndex > -1) {
|
|
363
|
+
groupPermissions[groupIndex].isAllowed = value;
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
groupPermissions.push({
|
|
367
|
+
idModulePermission: permission.id,
|
|
368
|
+
isAllowed: value,
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
field.setValue(JSON.parse(JSON.stringify(groupPermissions)));
|
|
372
|
+
};
|
|
373
|
+
CaucaManagementGroupComponent.prototype.saveGroup = function (group) {
|
|
374
|
+
var _this = this;
|
|
375
|
+
this.removePermissionUndefined(group);
|
|
376
|
+
if (group.users) {
|
|
377
|
+
group.users.forEach(function (userGroup) {
|
|
378
|
+
userGroup.idGroup = group.id;
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
if (group.permissions) {
|
|
382
|
+
group.permissions.forEach(function (groupPermission) {
|
|
383
|
+
groupPermission.idGroup = group.id;
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
this.managementGroupService.save(group).subscribe(function () {
|
|
387
|
+
_this.getGroups();
|
|
388
|
+
});
|
|
389
|
+
this.groupUsers = [];
|
|
390
|
+
};
|
|
391
|
+
CaucaManagementGroupComponent.prototype.removePermissionUndefined = function (group) {
|
|
392
|
+
group.permissions = group.permissions.filter(function (permission) { return permission.isAllowed !== undefined; });
|
|
393
|
+
};
|
|
394
|
+
CaucaManagementGroupComponent.prototype.getGroups = function () {
|
|
395
|
+
var _this = this;
|
|
396
|
+
this.managementGroupService.getAll().subscribe(function (data) { return _this.groups = data; });
|
|
397
|
+
};
|
|
398
|
+
return CaucaManagementGroupComponent;
|
|
399
|
+
}());
|
|
400
|
+
CaucaManagementGroupComponent.ɵfac = function CaucaManagementGroupComponent_Factory(t) { return new (t || CaucaManagementGroupComponent)(i0.ɵɵdirectiveInject(ManagementGroupService), i0.ɵɵdirectiveInject(ManagementUserService), i0.ɵɵdirectiveInject(ManagementPermissionService), i0.ɵɵdirectiveInject(i4.BreakpointObserver)); };
|
|
401
|
+
CaucaManagementGroupComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaucaManagementGroupComponent, selectors: [["cauca-management-group"]], inputs: { showPrintButton: "showPrintButton", hoverStatePermission: "hoverStatePermission" }, decls: 19, vars: 31, consts: [["keyExpr", "id", 3, "allowPrint", "dataSource", "onRowInserted", "onInitNewRow", "onRowUpdated", "onEditingStart", "onRowRemoved"], ["dataField", "name", 3, "caption"], ["type", "async", 3, "message", "validationCallback"], ["dataField", "users", "editCellTemplate", "usersEditTemplate", 3, "caption", "calculateCellValue"], ["dataField", "permissions", "editCellTemplate", "permissionsEditTemplate", 3, "caption", "visible"], [3, "enabled"], ["mode", "popup", 3, "allowAdding", "allowUpdating", "allowDeleting", "useIcons"], [3, "showTitle", "title", "fullScreen"], ["colCount", "1", 3, "labelLocation"], ["dataField", "name", 3, "isRequired"], ["dataField", "users"], ["dataField", "permissions"], [4, "dxTemplate", "dxTemplateOf"], ["valueExpr", "id", 3, "displayExpr", "dataSource", "searchEnabled", "searchExpr", "onInitialized", "onValueChanged"], ["itemTemplate", "rowTemplate", 3, "dataSource", "searchEnabled", "searchExpr", "hoverStateEnabled"], [3, "text", "onInitialized", "onValueChanged"]], template: function CaucaManagementGroupComponent_Template(rf, ctx) {
|
|
402
|
+
if (rf & 1) {
|
|
403
|
+
i0.ɵɵelementStart(0, "cauca-dx-data-grid", 0);
|
|
404
|
+
i0.ɵɵlistener("onRowInserted", function CaucaManagementGroupComponent_Template_cauca_dx_data_grid_onRowInserted_0_listener($event) { return ctx.onRowInserted($event); })("onInitNewRow", function CaucaManagementGroupComponent_Template_cauca_dx_data_grid_onInitNewRow_0_listener() { return ctx.onInitNewRow(); })("onRowUpdated", function CaucaManagementGroupComponent_Template_cauca_dx_data_grid_onRowUpdated_0_listener($event) { return ctx.onRowUpdated($event); })("onEditingStart", function CaucaManagementGroupComponent_Template_cauca_dx_data_grid_onEditingStart_0_listener($event) { return ctx.onEditingStart($event); })("onRowRemoved", function CaucaManagementGroupComponent_Template_cauca_dx_data_grid_onRowRemoved_0_listener($event) { return ctx.onRowRemoved($event); });
|
|
405
|
+
i0.ɵɵelementStart(1, "dxi-column", 1);
|
|
406
|
+
i0.ɵɵpipe(2, "translate");
|
|
407
|
+
i0.ɵɵelement(3, "dxi-validation-rule", 2);
|
|
408
|
+
i0.ɵɵpipe(4, "translate");
|
|
409
|
+
i0.ɵɵelementEnd();
|
|
410
|
+
i0.ɵɵelement(5, "dxi-column", 3);
|
|
411
|
+
i0.ɵɵpipe(6, "translate");
|
|
412
|
+
i0.ɵɵelement(7, "dxi-column", 4);
|
|
413
|
+
i0.ɵɵpipe(8, "translate");
|
|
414
|
+
i0.ɵɵelement(9, "dxo-export", 5);
|
|
415
|
+
i0.ɵɵelementStart(10, "dxo-editing", 6);
|
|
416
|
+
i0.ɵɵelement(11, "dxo-popup", 7);
|
|
417
|
+
i0.ɵɵpipe(12, "translate");
|
|
418
|
+
i0.ɵɵelementStart(13, "dxo-form", 8);
|
|
419
|
+
i0.ɵɵelement(14, "dxi-item", 9);
|
|
420
|
+
i0.ɵɵelement(15, "dxi-item", 10);
|
|
421
|
+
i0.ɵɵelement(16, "dxi-item", 11);
|
|
422
|
+
i0.ɵɵelementEnd();
|
|
423
|
+
i0.ɵɵelementEnd();
|
|
424
|
+
i0.ɵɵtemplate(17, CaucaManagementGroupComponent_div_17_Template, 2, 4, "div", 12);
|
|
425
|
+
i0.ɵɵtemplate(18, CaucaManagementGroupComponent_div_18_Template, 3, 6, "div", 12);
|
|
426
|
+
i0.ɵɵelementEnd();
|
|
427
|
+
}
|
|
428
|
+
if (rf & 2) {
|
|
429
|
+
i0.ɵɵproperty("allowPrint", ctx.showPrintButton)("dataSource", ctx.groups);
|
|
430
|
+
i0.ɵɵadvance(1);
|
|
431
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(2, 21, "management.name"));
|
|
432
|
+
i0.ɵɵadvance(2);
|
|
433
|
+
i0.ɵɵproperty("message", i0.ɵɵpipeBind1(4, 23, "management.groupNameAlreadyUsed"))("validationCallback", ctx.groupNameAlreadyUsedValidation);
|
|
434
|
+
i0.ɵɵadvance(2);
|
|
435
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(6, 25, "management.users"))("calculateCellValue", ctx.calculateUsersCellValue);
|
|
436
|
+
i0.ɵɵadvance(2);
|
|
437
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(8, 27, "management.permissions"))("visible", false);
|
|
438
|
+
i0.ɵɵadvance(2);
|
|
439
|
+
i0.ɵɵproperty("enabled", false);
|
|
440
|
+
i0.ɵɵadvance(1);
|
|
441
|
+
i0.ɵɵproperty("allowAdding", true)("allowUpdating", true)("allowDeleting", true)("useIcons", true);
|
|
442
|
+
i0.ɵɵadvance(1);
|
|
443
|
+
i0.ɵɵproperty("showTitle", true)("title", i0.ɵɵpipeBind1(12, 29, "management.group"))("fullScreen", !ctx.showColumn);
|
|
444
|
+
i0.ɵɵadvance(2);
|
|
445
|
+
i0.ɵɵproperty("labelLocation", ctx.showColumnXS ? "left" : "top");
|
|
446
|
+
i0.ɵɵadvance(1);
|
|
447
|
+
i0.ɵɵproperty("isRequired", true);
|
|
448
|
+
i0.ɵɵadvance(3);
|
|
449
|
+
i0.ɵɵproperty("dxTemplateOf", "usersEditTemplate");
|
|
450
|
+
i0.ɵɵadvance(1);
|
|
451
|
+
i0.ɵɵproperty("dxTemplateOf", "permissionsEditTemplate");
|
|
452
|
+
}
|
|
453
|
+
}, directives: [i5.CaucaDataGridComponent, i6.DxiColumnComponent, i6.DxiValidationRuleComponent, i6.DxoExportComponent, i6.DxoEditingComponent, i6.DxoPopupComponent, i6.DxoFormComponent, i6.DxiItemComponent, i7.DxTemplateDirective, i8.DxTagBoxComponent, i9.DxListComponent, i10.DxCheckBoxComponent], pipes: [i1.TranslatePipe], styles: [""] });
|
|
454
|
+
/*@__PURE__*/ (function () {
|
|
455
|
+
i0.ɵsetClassMetadata(CaucaManagementGroupComponent, [{
|
|
456
|
+
type: i0.Component,
|
|
457
|
+
args: [{
|
|
458
|
+
selector: 'cauca-management-group',
|
|
459
|
+
templateUrl: './cauca-management-group.component.html',
|
|
460
|
+
styleUrls: ['./cauca-management-group.component.scss']
|
|
461
|
+
}]
|
|
462
|
+
}], function () { return [{ type: ManagementGroupService }, { type: ManagementUserService }, { type: ManagementPermissionService }, { type: i4.BreakpointObserver }]; }, { showPrintButton: [{
|
|
463
|
+
type: i0.Input
|
|
464
|
+
}], hoverStatePermission: [{
|
|
465
|
+
type: i0.Input
|
|
466
|
+
}] });
|
|
467
|
+
})();
|
|
379
468
|
|
|
380
|
-
var UserModel = /** @class */ (function () {
|
|
381
|
-
function UserModel() {
|
|
382
|
-
this.userName = '';
|
|
383
|
-
this.firstName = '';
|
|
384
|
-
this.lastName = '';
|
|
385
|
-
this.password = '';
|
|
386
|
-
this.email = '';
|
|
387
|
-
this.isActive = true;
|
|
388
|
-
|
|
389
|
-
|
|
469
|
+
var UserModel = /** @class */ (function () {
|
|
470
|
+
function UserModel() {
|
|
471
|
+
this.userName = '';
|
|
472
|
+
this.firstName = '';
|
|
473
|
+
this.lastName = '';
|
|
474
|
+
this.password = '';
|
|
475
|
+
this.email = '';
|
|
476
|
+
this.isActive = true;
|
|
477
|
+
this.twoFactorAuthenticatorEnabled = false;
|
|
478
|
+
}
|
|
479
|
+
return UserModel;
|
|
390
480
|
}());
|
|
391
481
|
|
|
392
|
-
var CaucaManagementUserComponent = /** @class */ (function () {
|
|
393
|
-
function CaucaManagementUserComponent(managementUserService, breakpointObserver) {
|
|
394
|
-
var _this = this;
|
|
395
|
-
this.managementUserService = managementUserService;
|
|
396
|
-
this.users = [
|
|
397
|
-
new UserModel()
|
|
398
|
-
];
|
|
399
|
-
this.showColumnXS = true;
|
|
400
|
-
this.userNameAlreadyUsedValidation = function (e) {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
});
|
|
430
|
-
};
|
|
431
|
-
CaucaManagementUserComponent
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
482
|
+
var CaucaManagementUserComponent = /** @class */ (function () {
|
|
483
|
+
function CaucaManagementUserComponent(managementUserService, breakpointObserver) {
|
|
484
|
+
var _this = this;
|
|
485
|
+
this.managementUserService = managementUserService;
|
|
486
|
+
this.users = [
|
|
487
|
+
new UserModel()
|
|
488
|
+
];
|
|
489
|
+
this.showColumnXS = true;
|
|
490
|
+
this.userNameAlreadyUsedValidation = function (e) { return _this.managementUserService.hasExistingUserName(e.data).pipe(operators.map(function (exist) { return !exist; })).toPromise(); };
|
|
491
|
+
breakpointObserver.observe(['(max-width: 600px)']).subscribe(function (result) {
|
|
492
|
+
_this.showColumnXS = !result.matches;
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
CaucaManagementUserComponent.prototype.ngOnInit = function () {
|
|
496
|
+
this.getUsers();
|
|
497
|
+
};
|
|
498
|
+
CaucaManagementUserComponent.prototype.onRowInserted = function (e) {
|
|
499
|
+
this.saveGroup(e.data);
|
|
500
|
+
};
|
|
501
|
+
CaucaManagementUserComponent.prototype.onRowUpdated = function (e) {
|
|
502
|
+
this.saveGroup(e.key);
|
|
503
|
+
};
|
|
504
|
+
CaucaManagementUserComponent.prototype.onRowRemoved = function (e) {
|
|
505
|
+
var _this = this;
|
|
506
|
+
var user = e.data;
|
|
507
|
+
this.managementUserService.delete(user.id).subscribe(function (data) {
|
|
508
|
+
_this.getUsers();
|
|
509
|
+
});
|
|
510
|
+
};
|
|
511
|
+
CaucaManagementUserComponent.prototype.saveGroup = function (user) {
|
|
512
|
+
var _this = this;
|
|
513
|
+
this.managementUserService.save(user).subscribe(function () {
|
|
514
|
+
_this.getUsers();
|
|
515
|
+
});
|
|
516
|
+
};
|
|
517
|
+
CaucaManagementUserComponent.prototype.getUsers = function () {
|
|
518
|
+
var _this = this;
|
|
519
|
+
this.managementUserService.getAll().subscribe(function (data) { return _this.users = data; });
|
|
520
|
+
};
|
|
521
|
+
return CaucaManagementUserComponent;
|
|
522
|
+
}());
|
|
523
|
+
CaucaManagementUserComponent.ɵfac = function CaucaManagementUserComponent_Factory(t) { return new (t || CaucaManagementUserComponent)(i0.ɵɵdirectiveInject(ManagementUserService), i0.ɵɵdirectiveInject(i4.BreakpointObserver)); };
|
|
524
|
+
CaucaManagementUserComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaucaManagementUserComponent, selectors: [["cauca-management-user"]], decls: 22, vars: 31, consts: [["keyExpr", "id", 3, "dataSource", "onRowInserted", "onRowUpdated", "onRowRemoved"], ["dataField", "userName", 3, "caption"], ["type", "async", 3, "message", "validationCallback"], ["dataField", "isActive", 3, "caption", "visible"], ["dataField", "firstName", 3, "caption"], ["dataField", "lastName", 3, "caption"], ["dataField", "groups", 3, "caption"], ["mode", "popup", 3, "allowAdding", "allowUpdating", "allowDeleting", "useIcons"], [3, "showTitle", "title"], ["colCount", "2", 3, "labelLocation"], ["dataField", "userName", 3, "isRequired"], ["dataField", "isActive"], ["dataField", "firstName"], ["dataField", "lastName"], ["dataField", "group"]], template: function CaucaManagementUserComponent_Template(rf, ctx) {
|
|
525
|
+
if (rf & 1) {
|
|
526
|
+
i0.ɵɵelementStart(0, "cauca-dx-data-grid", 0);
|
|
527
|
+
i0.ɵɵlistener("onRowInserted", function CaucaManagementUserComponent_Template_cauca_dx_data_grid_onRowInserted_0_listener($event) { return ctx.onRowInserted($event); })("onRowUpdated", function CaucaManagementUserComponent_Template_cauca_dx_data_grid_onRowUpdated_0_listener($event) { return ctx.onRowUpdated($event); })("onRowRemoved", function CaucaManagementUserComponent_Template_cauca_dx_data_grid_onRowRemoved_0_listener($event) { return ctx.onRowRemoved($event); });
|
|
528
|
+
i0.ɵɵelementStart(1, "dxi-column", 1);
|
|
529
|
+
i0.ɵɵpipe(2, "translate");
|
|
530
|
+
i0.ɵɵelement(3, "dxi-validation-rule", 2);
|
|
531
|
+
i0.ɵɵpipe(4, "translate");
|
|
532
|
+
i0.ɵɵelementEnd();
|
|
533
|
+
i0.ɵɵelement(5, "dxi-column", 3);
|
|
534
|
+
i0.ɵɵpipe(6, "translate");
|
|
535
|
+
i0.ɵɵelement(7, "dxi-column", 4);
|
|
536
|
+
i0.ɵɵpipe(8, "translate");
|
|
537
|
+
i0.ɵɵelement(9, "dxi-column", 5);
|
|
538
|
+
i0.ɵɵpipe(10, "translate");
|
|
539
|
+
i0.ɵɵelement(11, "dxi-column", 6);
|
|
540
|
+
i0.ɵɵpipe(12, "translate");
|
|
541
|
+
i0.ɵɵelementStart(13, "dxo-editing", 7);
|
|
542
|
+
i0.ɵɵelement(14, "dxo-popup", 8);
|
|
543
|
+
i0.ɵɵpipe(15, "translate");
|
|
544
|
+
i0.ɵɵelementStart(16, "dxo-form", 9);
|
|
545
|
+
i0.ɵɵelement(17, "dxi-item", 10);
|
|
546
|
+
i0.ɵɵelement(18, "dxi-item", 11);
|
|
547
|
+
i0.ɵɵelement(19, "dxi-item", 12);
|
|
548
|
+
i0.ɵɵelement(20, "dxi-item", 13);
|
|
549
|
+
i0.ɵɵelement(21, "dxi-item", 14);
|
|
550
|
+
i0.ɵɵelementEnd();
|
|
551
|
+
i0.ɵɵelementEnd();
|
|
552
|
+
i0.ɵɵelementEnd();
|
|
553
|
+
}
|
|
554
|
+
if (rf & 2) {
|
|
555
|
+
i0.ɵɵproperty("dataSource", ctx.users);
|
|
556
|
+
i0.ɵɵadvance(1);
|
|
557
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(2, 17, "management.userName"));
|
|
558
|
+
i0.ɵɵadvance(2);
|
|
559
|
+
i0.ɵɵproperty("message", i0.ɵɵpipeBind1(4, 19, "management.userNameAlreadyUsed"))("validationCallback", ctx.userNameAlreadyUsedValidation);
|
|
560
|
+
i0.ɵɵadvance(2);
|
|
561
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(6, 21, "management.isActive"))("visible", false);
|
|
562
|
+
i0.ɵɵadvance(2);
|
|
563
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(8, 23, "management.firstName"));
|
|
564
|
+
i0.ɵɵadvance(2);
|
|
565
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(10, 25, "management.lastName"));
|
|
566
|
+
i0.ɵɵadvance(2);
|
|
567
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(12, 27, "management.group"));
|
|
568
|
+
i0.ɵɵadvance(2);
|
|
569
|
+
i0.ɵɵproperty("allowAdding", true)("allowUpdating", true)("allowDeleting", true)("useIcons", true);
|
|
570
|
+
i0.ɵɵadvance(1);
|
|
571
|
+
i0.ɵɵproperty("showTitle", true)("title", i0.ɵɵpipeBind1(15, 29, "management.group"));
|
|
572
|
+
i0.ɵɵadvance(2);
|
|
573
|
+
i0.ɵɵproperty("labelLocation", ctx.showColumnXS ? "left" : "top");
|
|
574
|
+
i0.ɵɵadvance(1);
|
|
575
|
+
i0.ɵɵproperty("isRequired", true);
|
|
576
|
+
}
|
|
577
|
+
}, directives: [i5.CaucaDataGridComponent, i6.DxiColumnComponent, i6.DxiValidationRuleComponent, i6.DxoEditingComponent, i6.DxoPopupComponent, i6.DxoFormComponent, i6.DxiItemComponent], pipes: [i1.TranslatePipe], styles: [""] });
|
|
578
|
+
/*@__PURE__*/ (function () {
|
|
579
|
+
i0.ɵsetClassMetadata(CaucaManagementUserComponent, [{
|
|
580
|
+
type: i0.Component,
|
|
581
|
+
args: [{
|
|
582
|
+
selector: 'cauca-management-user',
|
|
583
|
+
templateUrl: './cauca-management-user.component.html',
|
|
584
|
+
styleUrls: ['./cauca-management-user.component.scss']
|
|
585
|
+
}]
|
|
586
|
+
}], function () { return [{ type: ManagementUserService }, { type: i4.BreakpointObserver }]; }, null);
|
|
587
|
+
})();
|
|
448
588
|
|
|
449
|
-
var CaucaManagementModule = /** @class */ (function () {
|
|
450
|
-
function CaucaManagementModule() {
|
|
451
|
-
}
|
|
452
|
-
return CaucaManagementModule;
|
|
453
|
-
}());
|
|
454
|
-
CaucaManagementModule
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
589
|
+
var CaucaManagementModule = /** @class */ (function () {
|
|
590
|
+
function CaucaManagementModule() {
|
|
591
|
+
}
|
|
592
|
+
return CaucaManagementModule;
|
|
593
|
+
}());
|
|
594
|
+
CaucaManagementModule.ɵmod = i0.ɵɵdefineNgModule({ type: CaucaManagementModule });
|
|
595
|
+
CaucaManagementModule.ɵinj = i0.ɵɵdefineInjector({ factory: function CaucaManagementModule_Factory(t) { return new (t || CaucaManagementModule)(); }, imports: [[
|
|
596
|
+
common.CommonModule,
|
|
597
|
+
i10.DxCheckBoxModule,
|
|
598
|
+
i9.DxListModule,
|
|
599
|
+
i8.DxTagBoxModule,
|
|
600
|
+
i1$1.CaucaCoreForChildModule,
|
|
601
|
+
i5.CaucaDevextremeModule,
|
|
602
|
+
]] });
|
|
603
|
+
(function () {
|
|
604
|
+
(typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CaucaManagementModule, { declarations: [CaucaManagementComponent,
|
|
605
|
+
CaucaManagementGroupComponent,
|
|
606
|
+
CaucaManagementUserComponent], imports: [common.CommonModule,
|
|
607
|
+
i10.DxCheckBoxModule,
|
|
608
|
+
i9.DxListModule,
|
|
609
|
+
i8.DxTagBoxModule,
|
|
610
|
+
i1$1.CaucaCoreForChildModule,
|
|
611
|
+
i5.CaucaDevextremeModule], exports: [CaucaManagementComponent,
|
|
612
|
+
CaucaManagementUserComponent,
|
|
613
|
+
CaucaManagementGroupComponent] });
|
|
614
|
+
})();
|
|
615
|
+
/*@__PURE__*/ (function () {
|
|
616
|
+
i0.ɵsetClassMetadata(CaucaManagementModule, [{
|
|
617
|
+
type: i0.NgModule,
|
|
618
|
+
args: [{
|
|
619
|
+
declarations: [
|
|
620
|
+
CaucaManagementComponent,
|
|
621
|
+
CaucaManagementGroupComponent,
|
|
622
|
+
CaucaManagementUserComponent
|
|
623
|
+
],
|
|
624
|
+
imports: [
|
|
625
|
+
common.CommonModule,
|
|
626
|
+
i10.DxCheckBoxModule,
|
|
627
|
+
i9.DxListModule,
|
|
628
|
+
i8.DxTagBoxModule,
|
|
629
|
+
i1$1.CaucaCoreForChildModule,
|
|
630
|
+
i5.CaucaDevextremeModule,
|
|
631
|
+
],
|
|
632
|
+
exports: [
|
|
633
|
+
CaucaManagementComponent,
|
|
634
|
+
CaucaManagementUserComponent,
|
|
635
|
+
CaucaManagementGroupComponent,
|
|
636
|
+
]
|
|
637
|
+
}]
|
|
638
|
+
}], null, null);
|
|
639
|
+
})();
|
|
476
640
|
|
|
477
|
-
var UserGroupModel = /** @class */ (function () {
|
|
478
|
-
function UserGroupModel() {
|
|
479
|
-
this.idUserGroup = '';
|
|
480
|
-
this.idGroup = '';
|
|
481
|
-
this.idUser = '';
|
|
482
|
-
}
|
|
483
|
-
return UserGroupModel;
|
|
641
|
+
var UserGroupModel = /** @class */ (function () {
|
|
642
|
+
function UserGroupModel() {
|
|
643
|
+
this.idUserGroup = '';
|
|
644
|
+
this.idGroup = '';
|
|
645
|
+
this.idUser = '';
|
|
646
|
+
}
|
|
647
|
+
return UserGroupModel;
|
|
484
648
|
}());
|
|
485
649
|
|
|
486
|
-
var UserPermissionModel = /** @class */ (function () {
|
|
487
|
-
function UserPermissionModel() {
|
|
488
|
-
this.idUserPermission = '';
|
|
489
|
-
this.isAllowed = false;
|
|
490
|
-
this.idUser = '';
|
|
491
|
-
this.idModulePermission = '';
|
|
492
|
-
}
|
|
493
|
-
return UserPermissionModel;
|
|
650
|
+
var UserPermissionModel = /** @class */ (function () {
|
|
651
|
+
function UserPermissionModel() {
|
|
652
|
+
this.idUserPermission = '';
|
|
653
|
+
this.isAllowed = false;
|
|
654
|
+
this.idUser = '';
|
|
655
|
+
this.idModulePermission = '';
|
|
656
|
+
}
|
|
657
|
+
return UserPermissionModel;
|
|
494
658
|
}());
|
|
495
659
|
|
|
496
|
-
var GroupModel = /** @class */ (function () {
|
|
497
|
-
function GroupModel() {
|
|
498
|
-
this.name = '';
|
|
499
|
-
this.users = [];
|
|
500
|
-
this.permissions = [];
|
|
501
|
-
}
|
|
502
|
-
return GroupModel;
|
|
660
|
+
var GroupModel = /** @class */ (function () {
|
|
661
|
+
function GroupModel() {
|
|
662
|
+
this.name = '';
|
|
663
|
+
this.users = [];
|
|
664
|
+
this.permissions = [];
|
|
665
|
+
}
|
|
666
|
+
return GroupModel;
|
|
503
667
|
}());
|
|
504
668
|
|
|
505
|
-
var GroupPermissionModel = /** @class */ (function () {
|
|
506
|
-
function GroupPermissionModel() {
|
|
507
|
-
this.idGroupPermission = '';
|
|
508
|
-
this.isAllowed = false;
|
|
509
|
-
this.idGroup = '';
|
|
510
|
-
this.idModulePermission = '';
|
|
511
|
-
}
|
|
512
|
-
return GroupPermissionModel;
|
|
669
|
+
var GroupPermissionModel = /** @class */ (function () {
|
|
670
|
+
function GroupPermissionModel() {
|
|
671
|
+
this.idGroupPermission = '';
|
|
672
|
+
this.isAllowed = false;
|
|
673
|
+
this.idGroup = '';
|
|
674
|
+
this.idModulePermission = '';
|
|
675
|
+
}
|
|
676
|
+
return GroupPermissionModel;
|
|
513
677
|
}());
|
|
514
678
|
|
|
515
|
-
/*
|
|
516
|
-
* Public API Surface of cauca-management
|
|
679
|
+
/*
|
|
680
|
+
* Public API Surface of cauca-management
|
|
517
681
|
*/
|
|
518
682
|
|
|
519
|
-
/**
|
|
520
|
-
* Generated bundle index. Do not edit.
|
|
683
|
+
/**
|
|
684
|
+
* Generated bundle index. Do not edit.
|
|
521
685
|
*/
|
|
522
686
|
|
|
523
687
|
exports.CaucaManagementComponent = CaucaManagementComponent;
|
|
@@ -532,9 +696,8 @@
|
|
|
532
696
|
exports.UserGroupModel = UserGroupModel;
|
|
533
697
|
exports.UserModel = UserModel;
|
|
534
698
|
exports.UserPermissionModel = UserPermissionModel;
|
|
535
|
-
exports["ɵa"] = ManagementPermissionService;
|
|
536
699
|
|
|
537
700
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
538
701
|
|
|
539
|
-
}));
|
|
702
|
+
})));
|
|
540
703
|
//# sourceMappingURL=cauca-911-management.umd.js.map
|