@cauca-911/management 11.0.1 → 12.0.2
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/bundles/cauca-911-management.umd.js +329 -114
- package/bundles/cauca-911-management.umd.js.map +1 -1
- package/cauca-911-management.d.ts +1 -1
- package/esm2015/cauca-911-management.js +1 -2
- package/esm2015/lib/cauca-management-group/cauca-management-group.component.js +130 -44
- package/esm2015/lib/cauca-management-user/cauca-management-user.component.js +67 -18
- package/esm2015/lib/cauca-management.component.js +20 -7
- package/esm2015/lib/cauca-management.module.js +27 -5
- package/esm2015/lib/cauca-management.service.js +8 -7
- package/esm2015/lib/shared/models/group-model.js +1 -1
- package/esm2015/lib/shared/models/group-permission-model.js +1 -1
- package/esm2015/lib/shared/models/permission-model.js +1 -1
- package/esm2015/lib/shared/models/user-group-model.js +1 -1
- package/esm2015/lib/shared/models/user-model.js +1 -1
- package/esm2015/lib/shared/models/user-permission-model.js +1 -1
- package/esm2015/lib/shared/services/management-group.service.js +8 -12
- package/esm2015/lib/shared/services/management-permission.service.js +8 -12
- package/esm2015/lib/shared/services/management-user.service.js +8 -12
- package/esm2015/public-api.js +1 -1
- package/fesm2015/cauca-911-management.js +261 -102
- package/fesm2015/cauca-911-management.js.map +1 -1
- package/lib/cauca-management-group/cauca-management-group.component.d.ts +4 -1
- package/lib/cauca-management-user/cauca-management-user.component.d.ts +3 -0
- package/lib/cauca-management.component.d.ts +3 -0
- package/lib/cauca-management.module.d.ts +13 -0
- package/lib/cauca-management.service.d.ts +3 -0
- package/lib/shared/services/management-group.service.d.ts +3 -0
- package/lib/shared/services/management-permission.service.d.ts +3 -0
- package/lib/shared/services/management-user.service.d.ts +3 -0
- package/package.json +9 -7
- package/bundles/cauca-911-management.umd.min.js +0 -2
- package/bundles/cauca-911-management.umd.min.js.map +0 -1
- package/cauca-911-management.metadata.json +0 -1
|
@@ -1,37 +1,58 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Component, Input, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@ngx-translate/core';
|
|
4
|
+
import * as i10 from 'devextreme-angular/ui/check-box';
|
|
2
5
|
import { DxCheckBoxModule } from 'devextreme-angular/ui/check-box';
|
|
6
|
+
import * as i9 from 'devextreme-angular/ui/list';
|
|
3
7
|
import { DxListModule } from 'devextreme-angular/ui/list';
|
|
8
|
+
import * as i8 from 'devextreme-angular/ui/tag-box';
|
|
4
9
|
import { DxTagBoxModule } from 'devextreme-angular/ui/tag-box';
|
|
5
|
-
import
|
|
10
|
+
import * as i1$1 from '@cauca-911/core';
|
|
11
|
+
import { CaucaCoreForChildModule } from '@cauca-911/core';
|
|
12
|
+
import * as i5 from '@cauca-911/devextreme';
|
|
6
13
|
import { CaucaDevextremeModule } from '@cauca-911/devextreme';
|
|
7
|
-
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
8
14
|
import { map } from 'rxjs/operators';
|
|
9
|
-
import
|
|
15
|
+
import * as i2 from '@angular/common/http';
|
|
16
|
+
import * as i4 from '@angular/cdk/layout';
|
|
17
|
+
import * as i6 from 'devextreme-angular/ui/nested';
|
|
18
|
+
import * as i7 from 'devextreme-angular/core';
|
|
10
19
|
import { CommonModule } from '@angular/common';
|
|
11
20
|
|
|
12
21
|
class CaucaManagementService {
|
|
13
22
|
constructor() { }
|
|
14
23
|
}
|
|
15
|
-
CaucaManagementService.ɵ
|
|
16
|
-
CaucaManagementService
|
|
17
|
-
|
|
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: [{
|
|
18
29
|
providedIn: 'root'
|
|
19
|
-
}
|
|
20
|
-
];
|
|
21
|
-
CaucaManagementService.ctorParameters = () => [];
|
|
30
|
+
}]
|
|
31
|
+
}], function () { return []; }, null); })();
|
|
22
32
|
|
|
23
33
|
class CaucaManagementComponent {
|
|
24
34
|
constructor() { }
|
|
25
35
|
ngOnInit() {
|
|
26
36
|
}
|
|
27
37
|
}
|
|
28
|
-
CaucaManagementComponent
|
|
29
|
-
|
|
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
|
+
} }, pipes: [i1.TranslatePipe], encapsulation: 2 });
|
|
48
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaManagementComponent, [{
|
|
49
|
+
type: Component,
|
|
50
|
+
args: [{
|
|
30
51
|
selector: 'cauca-management',
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
]
|
|
34
|
-
|
|
52
|
+
templateUrl: './cauca-management.component.html',
|
|
53
|
+
styles: []
|
|
54
|
+
}]
|
|
55
|
+
}], function () { return []; }, null); })();
|
|
35
56
|
|
|
36
57
|
class ManagementGroupService {
|
|
37
58
|
constructor(coreService, http) {
|
|
@@ -54,16 +75,14 @@ class ManagementGroupService {
|
|
|
54
75
|
return this.http.post(`${this.config.apiUrl}GroupManagement/GroupNameAlreadyExist`, group);
|
|
55
76
|
}
|
|
56
77
|
}
|
|
57
|
-
ManagementGroupService.ɵ
|
|
58
|
-
ManagementGroupService
|
|
59
|
-
|
|
78
|
+
ManagementGroupService.ɵfac = function ManagementGroupService_Factory(t) { return new (t || ManagementGroupService)(i0.ɵɵinject(i1$1.CaucaCoreService), i0.ɵɵinject(i2.HttpClient)); };
|
|
79
|
+
ManagementGroupService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ManagementGroupService, factory: ManagementGroupService.ɵfac, providedIn: 'root' });
|
|
80
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ManagementGroupService, [{
|
|
81
|
+
type: Injectable,
|
|
82
|
+
args: [{
|
|
60
83
|
providedIn: 'root'
|
|
61
|
-
}
|
|
62
|
-
];
|
|
63
|
-
ManagementGroupService.ctorParameters = () => [
|
|
64
|
-
{ type: CaucaCoreService },
|
|
65
|
-
{ type: HttpClient }
|
|
66
|
-
];
|
|
84
|
+
}]
|
|
85
|
+
}], function () { return [{ type: i1$1.CaucaCoreService }, { type: i2.HttpClient }]; }, null); })();
|
|
67
86
|
|
|
68
87
|
class ManagementUserService {
|
|
69
88
|
constructor(coreService, http) {
|
|
@@ -101,16 +120,14 @@ class ManagementUserService {
|
|
|
101
120
|
return this.http.post(`${this.config.apiUrl}UserManagement/UserNameAlreadyExist`, user);
|
|
102
121
|
}
|
|
103
122
|
}
|
|
104
|
-
ManagementUserService.ɵ
|
|
105
|
-
ManagementUserService
|
|
106
|
-
|
|
123
|
+
ManagementUserService.ɵfac = function ManagementUserService_Factory(t) { return new (t || ManagementUserService)(i0.ɵɵinject(i1$1.CaucaCoreService), i0.ɵɵinject(i2.HttpClient)); };
|
|
124
|
+
ManagementUserService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ManagementUserService, factory: ManagementUserService.ɵfac, providedIn: 'root' });
|
|
125
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ManagementUserService, [{
|
|
126
|
+
type: Injectable,
|
|
127
|
+
args: [{
|
|
107
128
|
providedIn: 'root'
|
|
108
|
-
}
|
|
109
|
-
];
|
|
110
|
-
ManagementUserService.ctorParameters = () => [
|
|
111
|
-
{ type: CaucaCoreService },
|
|
112
|
-
{ type: HttpClient }
|
|
113
|
-
];
|
|
129
|
+
}]
|
|
130
|
+
}], function () { return [{ type: i1$1.CaucaCoreService }, { type: i2.HttpClient }]; }, null); })();
|
|
114
131
|
|
|
115
132
|
class ManagementPermissionService {
|
|
116
133
|
constructor(coreService, http) {
|
|
@@ -130,17 +147,53 @@ class ManagementPermissionService {
|
|
|
130
147
|
return this.http.delete(`${this.config.apiUrl}PermissionManagement/${idPermission}`);
|
|
131
148
|
}
|
|
132
149
|
}
|
|
133
|
-
ManagementPermissionService.ɵ
|
|
134
|
-
ManagementPermissionService
|
|
135
|
-
|
|
150
|
+
ManagementPermissionService.ɵfac = function ManagementPermissionService_Factory(t) { return new (t || ManagementPermissionService)(i0.ɵɵinject(i1$1.CaucaCoreService), i0.ɵɵinject(i2.HttpClient)); };
|
|
151
|
+
ManagementPermissionService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ManagementPermissionService, factory: ManagementPermissionService.ɵfac, providedIn: 'root' });
|
|
152
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ManagementPermissionService, [{
|
|
153
|
+
type: Injectable,
|
|
154
|
+
args: [{
|
|
136
155
|
providedIn: 'root'
|
|
137
|
-
}
|
|
138
|
-
];
|
|
139
|
-
ManagementPermissionService.ctorParameters = () => [
|
|
140
|
-
{ type: CaucaCoreService },
|
|
141
|
-
{ type: HttpClient }
|
|
142
|
-
];
|
|
156
|
+
}]
|
|
157
|
+
}], function () { return [{ type: i1$1.CaucaCoreService }, { type: i2.HttpClient }]; }, null); })();
|
|
143
158
|
|
|
159
|
+
function CaucaManagementGroupComponent_div_17_Template(rf, ctx) { if (rf & 1) {
|
|
160
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
161
|
+
i0.ɵɵelementStart(0, "div");
|
|
162
|
+
i0.ɵɵelementStart(1, "dx-tag-box", 13);
|
|
163
|
+
i0.ɵɵlistener("onInitialized", function CaucaManagementGroupComponent_div_17_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_17_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); });
|
|
164
|
+
i0.ɵɵelementEnd();
|
|
165
|
+
i0.ɵɵelementEnd();
|
|
166
|
+
} if (rf & 2) {
|
|
167
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
168
|
+
i0.ɵɵadvance(1);
|
|
169
|
+
i0.ɵɵproperty("displayExpr", ctx_r0.fullName)("dataSource", ctx_r0.users)("searchEnabled", true)("searchExpr", ctx_r0.fullName);
|
|
170
|
+
} }
|
|
171
|
+
function CaucaManagementGroupComponent_div_18_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
172
|
+
const _r11 = i0.ɵɵgetCurrentView();
|
|
173
|
+
i0.ɵɵelementStart(0, "div");
|
|
174
|
+
i0.ɵɵelementStart(1, "dx-check-box", 15);
|
|
175
|
+
i0.ɵɵlistener("onInitialized", function CaucaManagementGroupComponent_div_18_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_18_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); });
|
|
176
|
+
i0.ɵɵelementEnd();
|
|
177
|
+
i0.ɵɵelementEnd();
|
|
178
|
+
} if (rf & 2) {
|
|
179
|
+
const permission_r8 = ctx.$implicit;
|
|
180
|
+
i0.ɵɵadvance(1);
|
|
181
|
+
i0.ɵɵproperty("text", permission_r8.name);
|
|
182
|
+
} }
|
|
183
|
+
const _c0 = function () { return ["name", "tag"]; };
|
|
184
|
+
function CaucaManagementGroupComponent_div_18_Template(rf, ctx) { if (rf & 1) {
|
|
185
|
+
i0.ɵɵelementStart(0, "div");
|
|
186
|
+
i0.ɵɵelementStart(1, "dx-list", 14);
|
|
187
|
+
i0.ɵɵtemplate(2, CaucaManagementGroupComponent_div_18_div_2_Template, 2, 1, "div", 12);
|
|
188
|
+
i0.ɵɵelementEnd();
|
|
189
|
+
i0.ɵɵelementEnd();
|
|
190
|
+
} if (rf & 2) {
|
|
191
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
192
|
+
i0.ɵɵadvance(1);
|
|
193
|
+
i0.ɵɵproperty("dataSource", ctx_r1.permissions)("searchEnabled", true)("searchExpr", i0.ɵɵpureFunction0(5, _c0))("hoverStateEnabled", ctx_r1.hoverStatePermission);
|
|
194
|
+
i0.ɵɵadvance(1);
|
|
195
|
+
i0.ɵɵproperty("dxTemplateOf", "rowTemplate");
|
|
196
|
+
} }
|
|
144
197
|
class CaucaManagementGroupComponent {
|
|
145
198
|
constructor(managementGroupService, managementUserService, managementPermissionService, breakpointObserver) {
|
|
146
199
|
this.managementGroupService = managementGroupService;
|
|
@@ -158,8 +211,8 @@ class CaucaManagementGroupComponent {
|
|
|
158
211
|
this.calculateUsersCellValue = (e) => {
|
|
159
212
|
const users = (e.users ? e.users : []);
|
|
160
213
|
let usersNames = [];
|
|
161
|
-
users.forEach(user => {
|
|
162
|
-
const userGroup = this.users.filter(u => u.id === user.idUser);
|
|
214
|
+
users.forEach((user) => {
|
|
215
|
+
const userGroup = this.users.filter((u) => u.id === user.idUser);
|
|
163
216
|
if (userGroup && userGroup[0]) {
|
|
164
217
|
usersNames.push(userGroup[0].firstName + ' ' + userGroup[0].lastName);
|
|
165
218
|
}
|
|
@@ -167,22 +220,18 @@ class CaucaManagementGroupComponent {
|
|
|
167
220
|
usersNames = usersNames.sort((one, two) => (one < two ? -1 : 1));
|
|
168
221
|
return usersNames.join(', ');
|
|
169
222
|
};
|
|
170
|
-
this.groupNameAlreadyUsedValidation = (e) =>
|
|
171
|
-
|
|
172
|
-
return !exist;
|
|
173
|
-
})).toPromise();
|
|
174
|
-
};
|
|
175
|
-
breakpointObserver.observe(['(max-width: 1000px)']).subscribe(result => {
|
|
223
|
+
this.groupNameAlreadyUsedValidation = (e) => this.managementGroupService.hasExistingGroupName(e.data).pipe(map((exist) => !exist)).toPromise();
|
|
224
|
+
breakpointObserver.observe(['(max-width: 1000px)']).subscribe((result) => {
|
|
176
225
|
this.showColumn = !result.matches;
|
|
177
226
|
});
|
|
178
|
-
breakpointObserver.observe(['(max-width: 600px)']).subscribe(result => {
|
|
227
|
+
breakpointObserver.observe(['(max-width: 600px)']).subscribe((result) => {
|
|
179
228
|
this.showColumnXS = !result.matches;
|
|
180
229
|
});
|
|
181
230
|
}
|
|
182
231
|
ngOnInit() {
|
|
183
|
-
this.managementUserService.getAll().subscribe(data => {
|
|
232
|
+
this.managementUserService.getAll().subscribe((data) => {
|
|
184
233
|
this.users = data;
|
|
185
|
-
this.users.forEach(user => {
|
|
234
|
+
this.users.forEach((user) => {
|
|
186
235
|
if (user.isActive) {
|
|
187
236
|
if (user.firstName !== '' && user.lastName !== '') {
|
|
188
237
|
this.userFullName[user.id] = `${user.firstName} ${user.lastName}`;
|
|
@@ -190,10 +239,8 @@ class CaucaManagementGroupComponent {
|
|
|
190
239
|
}
|
|
191
240
|
});
|
|
192
241
|
});
|
|
193
|
-
this.managementPermissionService.getAll().subscribe(permissions => {
|
|
194
|
-
const permissionIndex = permissions.findIndex(c =>
|
|
195
|
-
return c.tag === 'CanAccessPermissions';
|
|
196
|
-
});
|
|
242
|
+
this.managementPermissionService.getAll().subscribe((permissions) => {
|
|
243
|
+
const permissionIndex = permissions.findIndex((c) => c.tag === 'CanAccessPermissions');
|
|
197
244
|
if (permissionIndex !== -1) {
|
|
198
245
|
permissions.splice(permissionIndex, 1);
|
|
199
246
|
}
|
|
@@ -219,7 +266,7 @@ class CaucaManagementGroupComponent {
|
|
|
219
266
|
getGroupUser(field, e) {
|
|
220
267
|
const users = [];
|
|
221
268
|
if (this.groupUsers) {
|
|
222
|
-
this.groupUsers.forEach(user => {
|
|
269
|
+
this.groupUsers.forEach((user) => {
|
|
223
270
|
users.push(user.idUser);
|
|
224
271
|
});
|
|
225
272
|
}
|
|
@@ -227,8 +274,8 @@ class CaucaManagementGroupComponent {
|
|
|
227
274
|
}
|
|
228
275
|
setGroupUser(field, e) {
|
|
229
276
|
const groupUser = [];
|
|
230
|
-
e.value.forEach(idUser => {
|
|
231
|
-
const groupIndex = (field.data.users || []).findIndex(g => g.idUser === idUser);
|
|
277
|
+
e.value.forEach((idUser) => {
|
|
278
|
+
const groupIndex = (field.data.users || []).findIndex((g) => g.idUser === idUser);
|
|
232
279
|
if (groupIndex === -1) {
|
|
233
280
|
groupUser.push({ idUser, });
|
|
234
281
|
}
|
|
@@ -240,7 +287,7 @@ class CaucaManagementGroupComponent {
|
|
|
240
287
|
}
|
|
241
288
|
setGroupPermission(field, e) {
|
|
242
289
|
const groupUser = [];
|
|
243
|
-
e.value.forEach(idUser => {
|
|
290
|
+
e.value.forEach((idUser) => {
|
|
244
291
|
groupUser.push({
|
|
245
292
|
idUser,
|
|
246
293
|
});
|
|
@@ -248,7 +295,7 @@ class CaucaManagementGroupComponent {
|
|
|
248
295
|
field.setValue(JSON.parse(JSON.stringify(groupUser)));
|
|
249
296
|
}
|
|
250
297
|
getPermissionStatus(field, permission, e) {
|
|
251
|
-
const groupPermission = (field.value || []).find(p => p.idModulePermission === permission.id);
|
|
298
|
+
const groupPermission = (field.value || []).find((p) => p.idModulePermission === permission.id);
|
|
252
299
|
if (groupPermission) {
|
|
253
300
|
e.component.option('value', groupPermission.isAllowed);
|
|
254
301
|
}
|
|
@@ -281,7 +328,7 @@ class CaucaManagementGroupComponent {
|
|
|
281
328
|
}
|
|
282
329
|
onRowRemoved(e) {
|
|
283
330
|
const group = e.data;
|
|
284
|
-
this.managementGroupService.delete(group.id).subscribe(
|
|
331
|
+
this.managementGroupService.delete(group.id).subscribe(() => {
|
|
285
332
|
this.getGroups();
|
|
286
333
|
});
|
|
287
334
|
}
|
|
@@ -293,7 +340,7 @@ class CaucaManagementGroupComponent {
|
|
|
293
340
|
}
|
|
294
341
|
setPermissionStatus(field, permission, value) {
|
|
295
342
|
const groupPermissions = field.value || [];
|
|
296
|
-
const groupIndex = groupPermissions.findIndex(p => p.idModulePermission === permission.id);
|
|
343
|
+
const groupIndex = groupPermissions.findIndex((p) => p.idModulePermission === permission.id);
|
|
297
344
|
if (groupIndex > -1) {
|
|
298
345
|
groupPermissions[groupIndex].isAllowed = value;
|
|
299
346
|
}
|
|
@@ -326,26 +373,72 @@ class CaucaManagementGroupComponent {
|
|
|
326
373
|
group.permissions = group.permissions.filter((permission) => permission.isAllowed !== undefined);
|
|
327
374
|
}
|
|
328
375
|
getGroups() {
|
|
329
|
-
this.managementGroupService.getAll().subscribe(data => this.groups = data);
|
|
376
|
+
this.managementGroupService.getAll().subscribe((data) => this.groups = data);
|
|
330
377
|
}
|
|
331
378
|
}
|
|
332
|
-
CaucaManagementGroupComponent
|
|
333
|
-
|
|
379
|
+
CaucaManagementGroupComponent.ɵfac = function CaucaManagementGroupComponent_Factory(t) { return new (t || CaucaManagementGroupComponent)(i0.ɵɵdirectiveInject(ManagementGroupService), i0.ɵɵdirectiveInject(ManagementUserService), i0.ɵɵdirectiveInject(ManagementPermissionService), i0.ɵɵdirectiveInject(i4.BreakpointObserver)); };
|
|
380
|
+
CaucaManagementGroupComponent.ɵcmp = /*@__PURE__*/ 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) { if (rf & 1) {
|
|
381
|
+
i0.ɵɵelementStart(0, "cauca-dx-data-grid", 0);
|
|
382
|
+
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); });
|
|
383
|
+
i0.ɵɵelementStart(1, "dxi-column", 1);
|
|
384
|
+
i0.ɵɵpipe(2, "translate");
|
|
385
|
+
i0.ɵɵelement(3, "dxi-validation-rule", 2);
|
|
386
|
+
i0.ɵɵpipe(4, "translate");
|
|
387
|
+
i0.ɵɵelementEnd();
|
|
388
|
+
i0.ɵɵelement(5, "dxi-column", 3);
|
|
389
|
+
i0.ɵɵpipe(6, "translate");
|
|
390
|
+
i0.ɵɵelement(7, "dxi-column", 4);
|
|
391
|
+
i0.ɵɵpipe(8, "translate");
|
|
392
|
+
i0.ɵɵelement(9, "dxo-export", 5);
|
|
393
|
+
i0.ɵɵelementStart(10, "dxo-editing", 6);
|
|
394
|
+
i0.ɵɵelement(11, "dxo-popup", 7);
|
|
395
|
+
i0.ɵɵpipe(12, "translate");
|
|
396
|
+
i0.ɵɵelementStart(13, "dxo-form", 8);
|
|
397
|
+
i0.ɵɵelement(14, "dxi-item", 9);
|
|
398
|
+
i0.ɵɵelement(15, "dxi-item", 10);
|
|
399
|
+
i0.ɵɵelement(16, "dxi-item", 11);
|
|
400
|
+
i0.ɵɵelementEnd();
|
|
401
|
+
i0.ɵɵelementEnd();
|
|
402
|
+
i0.ɵɵtemplate(17, CaucaManagementGroupComponent_div_17_Template, 2, 4, "div", 12);
|
|
403
|
+
i0.ɵɵtemplate(18, CaucaManagementGroupComponent_div_18_Template, 3, 6, "div", 12);
|
|
404
|
+
i0.ɵɵelementEnd();
|
|
405
|
+
} if (rf & 2) {
|
|
406
|
+
i0.ɵɵproperty("allowPrint", ctx.showPrintButton)("dataSource", ctx.groups);
|
|
407
|
+
i0.ɵɵadvance(1);
|
|
408
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(2, 21, "management.name"));
|
|
409
|
+
i0.ɵɵadvance(2);
|
|
410
|
+
i0.ɵɵproperty("message", i0.ɵɵpipeBind1(4, 23, "management.groupNameAlreadyUsed"))("validationCallback", ctx.groupNameAlreadyUsedValidation);
|
|
411
|
+
i0.ɵɵadvance(2);
|
|
412
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(6, 25, "management.users"))("calculateCellValue", ctx.calculateUsersCellValue);
|
|
413
|
+
i0.ɵɵadvance(2);
|
|
414
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(8, 27, "management.permissions"))("visible", false);
|
|
415
|
+
i0.ɵɵadvance(2);
|
|
416
|
+
i0.ɵɵproperty("enabled", false);
|
|
417
|
+
i0.ɵɵadvance(1);
|
|
418
|
+
i0.ɵɵproperty("allowAdding", true)("allowUpdating", true)("allowDeleting", true)("useIcons", true);
|
|
419
|
+
i0.ɵɵadvance(1);
|
|
420
|
+
i0.ɵɵproperty("showTitle", true)("title", i0.ɵɵpipeBind1(12, 29, "management.group"))("fullScreen", !ctx.showColumn);
|
|
421
|
+
i0.ɵɵadvance(2);
|
|
422
|
+
i0.ɵɵproperty("labelLocation", ctx.showColumnXS ? "left" : "top");
|
|
423
|
+
i0.ɵɵadvance(1);
|
|
424
|
+
i0.ɵɵproperty("isRequired", true);
|
|
425
|
+
i0.ɵɵadvance(3);
|
|
426
|
+
i0.ɵɵproperty("dxTemplateOf", "usersEditTemplate");
|
|
427
|
+
i0.ɵɵadvance(1);
|
|
428
|
+
i0.ɵɵproperty("dxTemplateOf", "permissionsEditTemplate");
|
|
429
|
+
} }, 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: [""] });
|
|
430
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaManagementGroupComponent, [{
|
|
431
|
+
type: Component,
|
|
432
|
+
args: [{
|
|
334
433
|
selector: 'cauca-management-group',
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
];
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
{ type: BreakpointObserver }
|
|
344
|
-
];
|
|
345
|
-
CaucaManagementGroupComponent.propDecorators = {
|
|
346
|
-
showPrintButton: [{ type: Input }],
|
|
347
|
-
hoverStatePermission: [{ type: Input }]
|
|
348
|
-
};
|
|
434
|
+
templateUrl: './cauca-management-group.component.html',
|
|
435
|
+
styleUrls: ['./cauca-management-group.component.scss']
|
|
436
|
+
}]
|
|
437
|
+
}], function () { return [{ type: ManagementGroupService }, { type: ManagementUserService }, { type: ManagementPermissionService }, { type: i4.BreakpointObserver }]; }, { showPrintButton: [{
|
|
438
|
+
type: Input
|
|
439
|
+
}], hoverStatePermission: [{
|
|
440
|
+
type: Input
|
|
441
|
+
}] }); })();
|
|
349
442
|
|
|
350
443
|
class UserModel {
|
|
351
444
|
constructor() {
|
|
@@ -366,11 +459,7 @@ class CaucaManagementUserComponent {
|
|
|
366
459
|
new UserModel()
|
|
367
460
|
];
|
|
368
461
|
this.showColumnXS = true;
|
|
369
|
-
this.userNameAlreadyUsedValidation = (e) =>
|
|
370
|
-
return this.managementUserService.hasExistingUserName(e.data).pipe(map((exist) => {
|
|
371
|
-
return !exist;
|
|
372
|
-
})).toPromise();
|
|
373
|
-
};
|
|
462
|
+
this.userNameAlreadyUsedValidation = (e) => this.managementUserService.hasExistingUserName(e.data).pipe(map((exist) => !exist)).toPromise();
|
|
374
463
|
breakpointObserver.observe(['(max-width: 600px)']).subscribe((result) => {
|
|
375
464
|
this.showColumnXS = !result.matches;
|
|
376
465
|
});
|
|
@@ -399,22 +488,82 @@ class CaucaManagementUserComponent {
|
|
|
399
488
|
this.managementUserService.getAll().subscribe((data) => this.users = data);
|
|
400
489
|
}
|
|
401
490
|
}
|
|
402
|
-
CaucaManagementUserComponent
|
|
403
|
-
|
|
491
|
+
CaucaManagementUserComponent.ɵfac = function CaucaManagementUserComponent_Factory(t) { return new (t || CaucaManagementUserComponent)(i0.ɵɵdirectiveInject(ManagementUserService), i0.ɵɵdirectiveInject(i4.BreakpointObserver)); };
|
|
492
|
+
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) {
|
|
493
|
+
i0.ɵɵelementStart(0, "cauca-dx-data-grid", 0);
|
|
494
|
+
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); });
|
|
495
|
+
i0.ɵɵelementStart(1, "dxi-column", 1);
|
|
496
|
+
i0.ɵɵpipe(2, "translate");
|
|
497
|
+
i0.ɵɵelement(3, "dxi-validation-rule", 2);
|
|
498
|
+
i0.ɵɵpipe(4, "translate");
|
|
499
|
+
i0.ɵɵelementEnd();
|
|
500
|
+
i0.ɵɵelement(5, "dxi-column", 3);
|
|
501
|
+
i0.ɵɵpipe(6, "translate");
|
|
502
|
+
i0.ɵɵelement(7, "dxi-column", 4);
|
|
503
|
+
i0.ɵɵpipe(8, "translate");
|
|
504
|
+
i0.ɵɵelement(9, "dxi-column", 5);
|
|
505
|
+
i0.ɵɵpipe(10, "translate");
|
|
506
|
+
i0.ɵɵelement(11, "dxi-column", 6);
|
|
507
|
+
i0.ɵɵpipe(12, "translate");
|
|
508
|
+
i0.ɵɵelementStart(13, "dxo-editing", 7);
|
|
509
|
+
i0.ɵɵelement(14, "dxo-popup", 8);
|
|
510
|
+
i0.ɵɵpipe(15, "translate");
|
|
511
|
+
i0.ɵɵelementStart(16, "dxo-form", 9);
|
|
512
|
+
i0.ɵɵelement(17, "dxi-item", 10);
|
|
513
|
+
i0.ɵɵelement(18, "dxi-item", 11);
|
|
514
|
+
i0.ɵɵelement(19, "dxi-item", 12);
|
|
515
|
+
i0.ɵɵelement(20, "dxi-item", 13);
|
|
516
|
+
i0.ɵɵelement(21, "dxi-item", 14);
|
|
517
|
+
i0.ɵɵelementEnd();
|
|
518
|
+
i0.ɵɵelementEnd();
|
|
519
|
+
i0.ɵɵelementEnd();
|
|
520
|
+
} if (rf & 2) {
|
|
521
|
+
i0.ɵɵproperty("dataSource", ctx.users);
|
|
522
|
+
i0.ɵɵadvance(1);
|
|
523
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(2, 17, "management.userName"));
|
|
524
|
+
i0.ɵɵadvance(2);
|
|
525
|
+
i0.ɵɵproperty("message", i0.ɵɵpipeBind1(4, 19, "management.userNameAlreadyUsed"))("validationCallback", ctx.userNameAlreadyUsedValidation);
|
|
526
|
+
i0.ɵɵadvance(2);
|
|
527
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(6, 21, "management.isActive"))("visible", false);
|
|
528
|
+
i0.ɵɵadvance(2);
|
|
529
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(8, 23, "management.firstName"));
|
|
530
|
+
i0.ɵɵadvance(2);
|
|
531
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(10, 25, "management.lastName"));
|
|
532
|
+
i0.ɵɵadvance(2);
|
|
533
|
+
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(12, 27, "management.group"));
|
|
534
|
+
i0.ɵɵadvance(2);
|
|
535
|
+
i0.ɵɵproperty("allowAdding", true)("allowUpdating", true)("allowDeleting", true)("useIcons", true);
|
|
536
|
+
i0.ɵɵadvance(1);
|
|
537
|
+
i0.ɵɵproperty("showTitle", true)("title", i0.ɵɵpipeBind1(15, 29, "management.group"));
|
|
538
|
+
i0.ɵɵadvance(2);
|
|
539
|
+
i0.ɵɵproperty("labelLocation", ctx.showColumnXS ? "left" : "top");
|
|
540
|
+
i0.ɵɵadvance(1);
|
|
541
|
+
i0.ɵɵproperty("isRequired", true);
|
|
542
|
+
} }, directives: [i5.CaucaDataGridComponent, i6.DxiColumnComponent, i6.DxiValidationRuleComponent, i6.DxoEditingComponent, i6.DxoPopupComponent, i6.DxoFormComponent, i6.DxiItemComponent], pipes: [i1.TranslatePipe], styles: [""] });
|
|
543
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaManagementUserComponent, [{
|
|
544
|
+
type: Component,
|
|
545
|
+
args: [{
|
|
404
546
|
selector: 'cauca-management-user',
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}
|
|
408
|
-
];
|
|
409
|
-
CaucaManagementUserComponent.ctorParameters = () => [
|
|
410
|
-
{ type: ManagementUserService },
|
|
411
|
-
{ type: BreakpointObserver }
|
|
412
|
-
];
|
|
547
|
+
templateUrl: './cauca-management-user.component.html',
|
|
548
|
+
styleUrls: ['./cauca-management-user.component.scss']
|
|
549
|
+
}]
|
|
550
|
+
}], function () { return [{ type: ManagementUserService }, { type: i4.BreakpointObserver }]; }, null); })();
|
|
413
551
|
|
|
414
552
|
class CaucaManagementModule {
|
|
415
553
|
}
|
|
416
|
-
CaucaManagementModule
|
|
417
|
-
|
|
554
|
+
CaucaManagementModule.ɵfac = function CaucaManagementModule_Factory(t) { return new (t || CaucaManagementModule)(); };
|
|
555
|
+
CaucaManagementModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: CaucaManagementModule });
|
|
556
|
+
CaucaManagementModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
|
|
557
|
+
CommonModule,
|
|
558
|
+
DxCheckBoxModule,
|
|
559
|
+
DxListModule,
|
|
560
|
+
DxTagBoxModule,
|
|
561
|
+
CaucaCoreForChildModule,
|
|
562
|
+
CaucaDevextremeModule,
|
|
563
|
+
]] });
|
|
564
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaManagementModule, [{
|
|
565
|
+
type: NgModule,
|
|
566
|
+
args: [{
|
|
418
567
|
declarations: [
|
|
419
568
|
CaucaManagementComponent,
|
|
420
569
|
CaucaManagementGroupComponent,
|
|
@@ -433,8 +582,18 @@ CaucaManagementModule.decorators = [
|
|
|
433
582
|
CaucaManagementUserComponent,
|
|
434
583
|
CaucaManagementGroupComponent,
|
|
435
584
|
]
|
|
436
|
-
}
|
|
437
|
-
];
|
|
585
|
+
}]
|
|
586
|
+
}], null, null); })();
|
|
587
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CaucaManagementModule, { declarations: [CaucaManagementComponent,
|
|
588
|
+
CaucaManagementGroupComponent,
|
|
589
|
+
CaucaManagementUserComponent], imports: [CommonModule,
|
|
590
|
+
DxCheckBoxModule,
|
|
591
|
+
DxListModule,
|
|
592
|
+
DxTagBoxModule,
|
|
593
|
+
CaucaCoreForChildModule,
|
|
594
|
+
CaucaDevextremeModule], exports: [CaucaManagementComponent,
|
|
595
|
+
CaucaManagementUserComponent,
|
|
596
|
+
CaucaManagementGroupComponent] }); })();
|
|
438
597
|
|
|
439
598
|
class UserGroupModel {
|
|
440
599
|
constructor() {
|
|
@@ -478,5 +637,5 @@ class GroupPermissionModel {
|
|
|
478
637
|
* Generated bundle index. Do not edit.
|
|
479
638
|
*/
|
|
480
639
|
|
|
481
|
-
export { CaucaManagementComponent, CaucaManagementGroupComponent, CaucaManagementModule, CaucaManagementService, CaucaManagementUserComponent, GroupModel, GroupPermissionModel, ManagementGroupService, ManagementUserService, UserGroupModel, UserModel, UserPermissionModel
|
|
640
|
+
export { CaucaManagementComponent, CaucaManagementGroupComponent, CaucaManagementModule, CaucaManagementService, CaucaManagementUserComponent, GroupModel, GroupPermissionModel, ManagementGroupService, ManagementUserService, UserGroupModel, UserModel, UserPermissionModel };
|
|
482
641
|
//# sourceMappingURL=cauca-911-management.js.map
|