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