@firestitch/app-acl 13.0.0 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/app/components/acl-entries/acl-entries.component.d.ts +33 -33
  2. package/app/components/acl-entry/acl-entry.component.d.ts +31 -31
  3. package/app/components/acl-object-roles/acl-object-roles.component.d.ts +18 -18
  4. package/app/components/acl-permission-popover/acl-permission-popover.component.d.ts +12 -12
  5. package/app/components/acl-role/acl-role.component.d.ts +56 -56
  6. package/app/components/acl-role-popover/acl-role-popover.component.d.ts +13 -13
  7. package/app/components/acl-roles/acl-roles.component.d.ts +38 -38
  8. package/app/consts/acl-role-accesses.d.ts +5 -5
  9. package/app/enums/acl-role-access.d.ts +6 -6
  10. package/app/fs-app-acl.module.d.ts +33 -33
  11. package/app/injectors/app-acl-config.injector.d.ts +2 -2
  12. package/app/interfaces/acl-entry-data.d.ts +11 -11
  13. package/app/interfaces/acl-entry.d.ts +18 -18
  14. package/app/interfaces/acl-level.d.ts +3 -3
  15. package/app/interfaces/acl-object-entry.d.ts +11 -11
  16. package/app/interfaces/acl-object-role.d.ts +6 -6
  17. package/app/interfaces/acl-object.d.ts +4 -4
  18. package/app/interfaces/acl-permission.d.ts +7 -7
  19. package/app/interfaces/acl-role-config.d.ts +5 -5
  20. package/app/interfaces/acl-role.d.ts +16 -16
  21. package/app/interfaces/app-acl-config.d.ts +7 -7
  22. package/app/interfaces/index.d.ts +2 -2
  23. package/app/interfaces/name-value.d.ts +4 -4
  24. package/app/interfaces/role-config.d.ts +12 -12
  25. package/app/pipes/acl-role-permission-available.pipe.d.ts +7 -7
  26. package/app/pipes/bulk-options-filter.pipe.d.ts +13 -13
  27. package/app/pipes/index.d.ts +2 -2
  28. package/app/services/app-acl.service.d.ts +16 -16
  29. package/esm2020/app/components/acl-entries/acl-entries.component.mjs +173 -173
  30. package/esm2020/app/components/acl-entry/acl-entry.component.mjs +92 -92
  31. package/esm2020/app/components/acl-object-roles/acl-object-roles.component.mjs +52 -52
  32. package/esm2020/app/components/acl-permission-popover/acl-permission-popover.component.mjs +28 -28
  33. package/esm2020/app/components/acl-role/acl-role.component.mjs +253 -253
  34. package/esm2020/app/components/acl-role-popover/acl-role-popover.component.mjs +33 -33
  35. package/esm2020/app/components/acl-roles/acl-roles.component.mjs +169 -169
  36. package/esm2020/app/consts/acl-role-accesses.mjs +7 -7
  37. package/esm2020/app/enums/acl-role-access.mjs +7 -7
  38. package/esm2020/app/fs-app-acl.module.mjs +127 -129
  39. package/esm2020/app/injectors/app-acl-config.injector.mjs +2 -2
  40. package/esm2020/app/interfaces/acl-entry-data.mjs +1 -1
  41. package/esm2020/app/interfaces/acl-entry.mjs +1 -1
  42. package/esm2020/app/interfaces/acl-level.mjs +1 -1
  43. package/esm2020/app/interfaces/acl-object-entry.mjs +1 -1
  44. package/esm2020/app/interfaces/acl-object-role.mjs +1 -1
  45. package/esm2020/app/interfaces/acl-object.mjs +1 -1
  46. package/esm2020/app/interfaces/acl-permission.mjs +1 -1
  47. package/esm2020/app/interfaces/acl-role-config.mjs +1 -1
  48. package/esm2020/app/interfaces/acl-role.mjs +1 -1
  49. package/esm2020/app/interfaces/app-acl-config.mjs +1 -1
  50. package/esm2020/app/interfaces/index.mjs +2 -2
  51. package/esm2020/app/interfaces/name-value.mjs +1 -1
  52. package/esm2020/app/interfaces/role-config.mjs +1 -1
  53. package/esm2020/app/pipes/acl-role-permission-available.pipe.mjs +20 -20
  54. package/esm2020/app/pipes/bulk-options-filter.pipe.mjs +26 -26
  55. package/esm2020/app/pipes/index.mjs +2 -2
  56. package/esm2020/app/services/app-acl.service.mjs +50 -50
  57. package/esm2020/firestitch-app-acl.mjs +4 -4
  58. package/esm2020/public_api.mjs +10 -10
  59. package/fesm2015/firestitch-app-acl.mjs +887 -889
  60. package/fesm2015/firestitch-app-acl.mjs.map +1 -1
  61. package/fesm2020/firestitch-app-acl.mjs +900 -902
  62. package/fesm2020/firestitch-app-acl.mjs.map +1 -1
  63. package/{firestitch-app-acl.d.ts → index.d.ts} +5 -5
  64. package/package.json +3 -3
  65. package/public_api.d.ts +20 -20
@@ -1,964 +1,962 @@
1
- import * as i18 from '@angular/material/input';
1
+ import * as i12 from '@angular/material/input';
2
2
  import { MatInputModule } from '@angular/material/input';
3
- import * as i8 from '@angular/material/radio';
3
+ import * as i11 from '@angular/material/radio';
4
4
  import { MatRadioModule } from '@angular/material/radio';
5
- import * as i14 from '@angular/material/button';
5
+ import * as i10 from '@angular/material/button';
6
6
  import { MatButtonModule } from '@angular/material/button';
7
- import * as i10 from '@angular/material/select';
7
+ import * as i8 from '@angular/material/select';
8
8
  import { MatSelectModule } from '@angular/material/select';
9
- import * as i9 from '@angular/material/checkbox';
9
+ import * as i7 from '@angular/material/checkbox';
10
10
  import { MatCheckboxModule } from '@angular/material/checkbox';
11
11
  import * as i2 from '@angular/material/dialog';
12
12
  import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
13
13
  import * as i0 from '@angular/core';
14
14
  import { InjectionToken, Injectable, Inject, Pipe, Component, ChangeDetectionStrategy, ViewChild, Input, QueryList, ViewChildren, EventEmitter, Output, NgModule } from '@angular/core';
15
- import * as i7$1 from '@angular/common';
15
+ import * as i4 from '@angular/common';
16
16
  import { CommonModule } from '@angular/common';
17
- import * as i12 from '@firestitch/list';
17
+ import * as i13 from '@firestitch/list';
18
18
  import { FsListComponent, FsListModule } from '@firestitch/list';
19
19
  import * as i2$1 from '@firestitch/popover';
20
20
  import { FsPopoverModule } from '@firestitch/popover';
21
- import * as i4 from '@firestitch/dialog';
21
+ import * as i14 from '@firestitch/dialog';
22
22
  import { FsDialogModule } from '@firestitch/dialog';
23
- import * as i16 from '@firestitch/form';
23
+ import * as i15 from '@firestitch/form';
24
24
  import { FsFormModule } from '@firestitch/form';
25
- import * as i6 from '@firestitch/label';
25
+ import * as i16 from '@firestitch/label';
26
26
  import { FsLabelModule } from '@firestitch/label';
27
- import * as i7 from '@firestitch/radiogroup';
27
+ import * as i17 from '@firestitch/radiogroup';
28
28
  import { FsRadioGroupModule } from '@firestitch/radiogroup';
29
- import * as i5$1 from '@firestitch/badge';
29
+ import * as i6$1 from '@firestitch/badge';
30
30
  import { FsBadgeModule } from '@firestitch/badge';
31
- import * as i1 from '@firestitch/checkboxgroup';
31
+ import * as i8$1 from '@firestitch/checkboxgroup';
32
32
  import { FsCheckboxGroupModule } from '@firestitch/checkboxgroup';
33
- import * as i13 from '@firestitch/menu';
33
+ import * as i18 from '@firestitch/menu';
34
34
  import { FsMenuModule } from '@firestitch/menu';
35
35
  import { map, tap, takeUntil, filter } from 'rxjs/operators';
36
36
  import { ItemType } from '@firestitch/filter';
37
37
  import { list } from '@firestitch/common';
38
38
  import { ReplaySubject, Subject, forkJoin, of, Observable } from 'rxjs';
39
39
  import * as i3 from '@firestitch/message';
40
- import * as i5 from '@angular/material/form-field';
41
- import { MatFormFieldModule } from '@angular/material/form-field';
42
- import * as i11 from '@angular/material/core';
43
- import * as i15 from '@angular/forms';
40
+ import * as i5 from '@angular/forms';
44
41
  import { ControlContainer, NgForm, FormsModule } from '@angular/forms';
42
+ import * as i6 from '@angular/material/form-field';
43
+ import { MatFormFieldModule } from '@angular/material/form-field';
44
+ import * as i9 from '@angular/material/core';
45
45
  import { groupBy, sortBy } from 'lodash-es';
46
46
  import * as i3$1 from '@firestitch/prompt';
47
47
 
48
- var AclRoleAccess;
49
- (function (AclRoleAccess) {
50
- AclRoleAccess[AclRoleAccess["None"] = 0] = "None";
51
- AclRoleAccess[AclRoleAccess["Read"] = 5] = "Read";
52
- AclRoleAccess[AclRoleAccess["Write"] = 10] = "Write";
53
- AclRoleAccess[AclRoleAccess["Full"] = 15] = "Full";
48
+ var AclRoleAccess;
49
+ (function (AclRoleAccess) {
50
+ AclRoleAccess[AclRoleAccess["None"] = 0] = "None";
51
+ AclRoleAccess[AclRoleAccess["Read"] = 5] = "Read";
52
+ AclRoleAccess[AclRoleAccess["Write"] = 10] = "Write";
53
+ AclRoleAccess[AclRoleAccess["Full"] = 15] = "Full";
54
54
  })(AclRoleAccess || (AclRoleAccess = {}));
55
55
 
56
- const AclRoleAccesses = [
57
- { name: 'None', value: AclRoleAccess.None },
58
- { name: 'Read', value: AclRoleAccess.Read },
59
- { name: 'Write', value: AclRoleAccess.Write },
60
- { name: 'Full', value: AclRoleAccess.Full }
56
+ const AclRoleAccesses = [
57
+ { name: 'None', value: AclRoleAccess.None },
58
+ { name: 'Read', value: AclRoleAccess.Read },
59
+ { name: 'Write', value: AclRoleAccess.Write },
60
+ { name: 'Full', value: AclRoleAccess.Full }
61
61
  ];
62
62
 
63
63
  const FS_APP_ACL_CONFIG = new InjectionToken('fs-app-acl-config');
64
64
 
65
- class FsAppAclService {
66
- constructor(_appAclConfig) {
67
- this._appAclConfig = _appAclConfig;
68
- }
69
- getPermissions() {
70
- if (!this._permissions$) {
71
- this._permissions$ = new ReplaySubject();
72
- this._appAclConfig.permissions
73
- .subscribe((permissions) => {
74
- this._permissions$.next(permissions);
75
- this._permissions$.complete();
76
- });
77
- }
78
- return this._permissions$;
79
- }
80
- getLevels() {
81
- if (!this._levels$) {
82
- this._levels$ = new ReplaySubject();
83
- this._appAclConfig.levels
84
- .subscribe((levels) => {
85
- this._levels$.next(levels);
86
- this._levels$.complete();
87
- });
88
- }
89
- return this._levels$;
90
- }
91
- getIndexedLevels() {
92
- return this.getLevels()
93
- .pipe(map((data) => {
94
- return list(data, 'name', 'value');
95
- }));
96
- }
97
- }
98
- FsAppAclService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppAclService, deps: [{ token: FS_APP_ACL_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
99
- FsAppAclService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppAclService, providedIn: 'root' });
100
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppAclService, decorators: [{
101
- type: Injectable,
102
- args: [{
103
- providedIn: 'root',
104
- }]
105
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
106
- type: Inject,
107
- args: [FS_APP_ACL_CONFIG]
65
+ class FsAppAclService {
66
+ constructor(_appAclConfig) {
67
+ this._appAclConfig = _appAclConfig;
68
+ }
69
+ getPermissions() {
70
+ if (!this._permissions$) {
71
+ this._permissions$ = new ReplaySubject();
72
+ this._appAclConfig.permissions
73
+ .subscribe((permissions) => {
74
+ this._permissions$.next(permissions);
75
+ this._permissions$.complete();
76
+ });
77
+ }
78
+ return this._permissions$;
79
+ }
80
+ getLevels() {
81
+ if (!this._levels$) {
82
+ this._levels$ = new ReplaySubject();
83
+ this._appAclConfig.levels
84
+ .subscribe((levels) => {
85
+ this._levels$.next(levels);
86
+ this._levels$.complete();
87
+ });
88
+ }
89
+ return this._levels$;
90
+ }
91
+ getIndexedLevels() {
92
+ return this.getLevels()
93
+ .pipe(map((data) => {
94
+ return list(data, 'name', 'value');
95
+ }));
96
+ }
97
+ }
98
+ FsAppAclService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppAclService, deps: [{ token: FS_APP_ACL_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
99
+ FsAppAclService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppAclService, providedIn: 'root' });
100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppAclService, decorators: [{
101
+ type: Injectable,
102
+ args: [{
103
+ providedIn: 'root',
104
+ }]
105
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
106
+ type: Inject,
107
+ args: [FS_APP_ACL_CONFIG]
108
108
  }] }]; } });
109
109
 
110
- class BulkOptionsFilterPipe {
111
- transform(rolesList, children) {
112
- const accessLevels = this._uniqListOfAccessLevels(children);
113
- return rolesList.filter((permission) => {
114
- return permission.value === 0 || accessLevels.has(permission.value);
115
- });
116
- }
117
- _uniqListOfAccessLevels(children) {
118
- return children.reduce((acc, value) => {
119
- value.accesses.forEach((access) => {
120
- acc.add(access);
121
- });
122
- return acc;
123
- }, (new Set));
124
- }
125
- }
126
- BulkOptionsFilterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BulkOptionsFilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
127
- BulkOptionsFilterPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BulkOptionsFilterPipe, name: "builkOptionsFilter" });
128
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: BulkOptionsFilterPipe, decorators: [{
129
- type: Pipe,
130
- args: [{
131
- name: 'builkOptionsFilter'
132
- }]
110
+ class BulkOptionsFilterPipe {
111
+ transform(rolesList, children) {
112
+ const accessLevels = this._uniqListOfAccessLevels(children);
113
+ return rolesList.filter((permission) => {
114
+ return permission.value === 0 || accessLevels.has(permission.value);
115
+ });
116
+ }
117
+ _uniqListOfAccessLevels(children) {
118
+ return children.reduce((acc, value) => {
119
+ value.accesses.forEach((access) => {
120
+ acc.add(access);
121
+ });
122
+ return acc;
123
+ }, (new Set));
124
+ }
125
+ }
126
+ BulkOptionsFilterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BulkOptionsFilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
127
+ BulkOptionsFilterPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: BulkOptionsFilterPipe, name: "builkOptionsFilter" });
128
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BulkOptionsFilterPipe, decorators: [{
129
+ type: Pipe,
130
+ args: [{
131
+ name: 'builkOptionsFilter'
132
+ }]
133
133
  }] });
134
134
 
135
- class AclRolePermissionAvailablePipe {
136
- transform(permission, aclRolePermissions) {
137
- if (permission.requires && permission.requires.length) {
138
- const exists = permission.requires
139
- .every((item) => aclRolePermissions[item]);
140
- return exists;
141
- }
142
- return true;
143
- }
144
- }
145
- AclRolePermissionAvailablePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: AclRolePermissionAvailablePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
146
- AclRolePermissionAvailablePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: AclRolePermissionAvailablePipe, name: "aclRolePermissionAvailable" });
147
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: AclRolePermissionAvailablePipe, decorators: [{
148
- type: Pipe,
149
- args: [{
150
- name: 'aclRolePermissionAvailable'
151
- }]
135
+ class AclRolePermissionAvailablePipe {
136
+ transform(permission, aclRolePermissions) {
137
+ if (permission.requires && permission.requires.length) {
138
+ const exists = permission.requires
139
+ .every((item) => aclRolePermissions[item]);
140
+ return exists;
141
+ }
142
+ return true;
143
+ }
144
+ }
145
+ AclRolePermissionAvailablePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AclRolePermissionAvailablePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
146
+ AclRolePermissionAvailablePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: AclRolePermissionAvailablePipe, name: "aclRolePermissionAvailable" });
147
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AclRolePermissionAvailablePipe, decorators: [{
148
+ type: Pipe,
149
+ args: [{
150
+ name: 'aclRolePermissionAvailable'
151
+ }]
152
152
  }] });
153
153
 
154
- class FsAclRoleComponent {
155
- constructor(_data, _appAclService, _dialogRef, _message, _cdRef) {
156
- this._data = _data;
157
- this._appAclService = _appAclService;
158
- this._dialogRef = _dialogRef;
159
- this._message = _message;
160
- this._cdRef = _cdRef;
161
- this.aclRole = null;
162
- this.permissions = [];
163
- this.levelPermissions = [];
164
- this.AclRoleAccesses = AclRoleAccesses;
165
- this.indexedAccesses = {};
166
- this.aclLevels = [];
167
- this.indexedAclLevels = {};
168
- this.onlyFullAccess = false;
169
- this.AclLevels = {};
170
- this.roleConfigs = [];
171
- this.aclRoleConfigValues = {};
172
- this.aclRolePermissions = {};
173
- this._destroy$ = new Subject();
174
- this.save = () => {
175
- const aclRoleConfigs = this.roleConfigs
176
- .map((roleConfig) => {
177
- return {
178
- name: roleConfig.name,
179
- value: this.aclRoleConfigValues[roleConfig.name],
180
- };
181
- });
182
- const aclRole = {
183
- ...this.aclRole,
184
- permissions: this.levelPermissions.map((permission) => {
185
- return {
186
- value: permission.value,
187
- access: this.aclRolePermissions[permission.value] || 0,
188
- };
189
- }),
190
- aclRoleConfigs,
191
- };
192
- return this._data.saveAclRole(aclRole)
193
- .pipe(tap((response) => {
194
- this._message.success('Saved Changes');
195
- this.close(response);
196
- }));
197
- };
198
- }
199
- ngOnInit() {
200
- forkJoin(this.getRole(), this._appAclService.getPermissions())
201
- .pipe(takeUntil(this._destroy$))
202
- .subscribe(([aclRole, aclPermissions,]) => {
203
- this.permissions = aclPermissions;
204
- this.aclLevels = this._data.aclLevels;
205
- this.disabled = this._data.disabled;
206
- this.indexedAclLevels = list(this.aclLevels, 'name', 'value');
207
- this.indexedAccesses = list(AclRoleAccesses, 'name', 'value');
208
- this.aclRole = {
209
- ...{
210
- aclPermissions: [],
211
- allPermissions: true,
212
- aclRoleConfigs: [],
213
- permissions: {},
214
- level: this.aclLevels[0].value,
215
- },
216
- ...aclRole,
217
- };
218
- this.aclRoleConfigValues = (aclRole.aclRoleConfigs || [])
219
- .reduce((accum, aclRoleConfig) => {
220
- return {
221
- ...accum,
222
- [aclRoleConfig.name]: aclRoleConfig.value,
223
- };
224
- }, {});
225
- if (this.aclRole.id) {
226
- this.permissions.forEach((permission) => {
227
- let access = 0;
228
- const aclPermission = this.aclRole.aclPermissions.find((item) => {
229
- return item.permission === permission.value;
230
- });
231
- if (aclPermission) {
232
- access = aclPermission.access;
233
- }
234
- this.aclRolePermissions[permission.value] = access;
235
- });
236
- }
237
- if (this.aclRole.allPermissions) {
238
- this._applyMaxPermissionAccess();
239
- }
240
- this._updatePermissions();
241
- this._updateRoleConfigs();
242
- this._cdRef.markForCheck();
243
- });
244
- this.listConfig = {
245
- status: false,
246
- paging: false,
247
- rowHighlight: false,
248
- noResults: {
249
- message: '',
250
- },
251
- group: {
252
- initialExpand: true,
253
- groupBy: (data) => {
254
- return data;
255
- },
256
- compareBy: (data) => {
257
- return data.category || 'General';
258
- },
259
- },
260
- fetch: () => {
261
- return of({
262
- data: this.levelPermissions.sort((a, b) => {
263
- a = a.name.toUpperCase();
264
- b = b.name.toUpperCase();
265
- if (a < b) {
266
- return -1;
267
- }
268
- else if (a > b) {
269
- return 1;
270
- }
271
- return 0;
272
- }),
273
- });
274
- },
275
- };
276
- }
277
- bulkChange(value, groupChildren, group) {
278
- groupChildren
279
- .forEach((permission) => {
280
- const access = permission.accesses
281
- .find((access) => value === access);
282
- if (access || !value) {
283
- this.aclRolePermissions[permission.value] = value;
284
- }
285
- });
286
- setTimeout(() => {
287
- this.submitButton.disabled = false;
288
- this.permissionChange();
289
- });
290
- }
291
- permissionChange() {
292
- this.aclRolePermissions = {
293
- ...this.aclRolePermissions,
294
- };
295
- this._cdRef.markForCheck();
296
- }
297
- levelChange() {
298
- this._updatePermissions();
299
- this._updateRoleConfigs();
300
- this.list.reload();
301
- }
302
- getRole() {
303
- if (!this._data.aclRole.id) {
304
- return of(this._data.aclRole);
305
- }
306
- const query = {
307
- aclPermissions: true,
308
- aclRoleConfigs: true,
309
- };
310
- if (!this.environment) {
311
- query.environmentId = null;
312
- }
313
- return this._data.loadAclRole(this._data.aclRole, query);
314
- }
315
- close(data = null) {
316
- this._dialogRef.close(data);
317
- }
318
- allPermissionsChange(all) {
319
- this._updatePermissions();
320
- if (all) {
321
- this._applyMaxPermissionAccess();
322
- }
323
- else {
324
- this._applyNonePermissionAccess();
325
- }
326
- }
327
- ngOnDestroy() {
328
- this._destroy$.next();
329
- this._destroy$.complete();
330
- }
331
- _updatePermissions() {
332
- this.levelPermissions = this.permissions
333
- .filter((permission) => {
334
- return permission.levels.some((item) => {
335
- return item === this.aclRole.level;
336
- });
337
- });
338
- }
339
- _updateRoleConfigs() {
340
- if (this._data.loadRoleConfigs) {
341
- this._data.loadRoleConfigs()
342
- .subscribe((roleConfigs) => {
343
- this.roleConfigs = roleConfigs
344
- .filter((roleConfig) => roleConfig.level === this.aclRole.level);
345
- this._cdRef.markForCheck();
346
- });
347
- }
348
- }
349
- _applyMaxPermissionAccess() {
350
- this.permissions.forEach((permission) => {
351
- this.aclRolePermissions[permission.value] = Math.max(...permission.accesses);
352
- });
353
- }
354
- _applyNonePermissionAccess() {
355
- this.permissions.forEach((permission) => {
356
- this.aclRolePermissions[permission.value] = AclRoleAccess.None;
357
- });
358
- }
359
- }
360
- FsAclRoleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAclRoleComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: FsAppAclService }, { token: i2.MatDialogRef }, { token: i3.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
361
- FsAclRoleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsAclRoleComponent, selector: "ng-component", viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true }, { propertyName: "submitButton", first: true, predicate: ["submit"], descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <ng-container *ngIf=\"aclRole\">\n <div mat-dialog-title>\n <ng-container *ngIf=\"!disabled\">{{ aclRole.id ? 'Edit' : 'Create' }}</ng-container>\n <ng-container *ngIf=\"disabled\">View</ng-container>\n Role\n </div>\n <mat-dialog-content>\n <div class=\"fs-row.gap-large.align-start\">\n <div class=\"fs-column left-column\">\n <mat-form-field> \n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"aclRole.name\"\n [disabled]=\"disabled\"\n name=\"name\"\n fsFormRequired>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Description</mat-label>\n <input\n matInput\n [(ngModel)]=\"aclRole.description\"\n [disabled]=\"disabled\"\n name=\"description\">\n </mat-form-field>\n\n <fs-label-field *ngIf=\"aclRole.id || aclLevels.length === 1; else levels\">\n <fs-label>Level</fs-label>\n {{indexedAclLevels[aclRole.level]}}\n </fs-label-field>\n\n <ng-template #levels>\n <div class=\"level\">\n <fs-radio-group\n [(ngModel)]=\"aclRole.level\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"levelChange()\"\n fsFormRequired\n label=\"Level\"\n orientation=\"vertical\"\n name=\"level\">\n <mat-radio-button\n *ngFor=\"let item of aclLevels\"\n [value]=\"item.value\"\n [disabled]=\"!!aclRole.protected\">\n {{ item.name }}\n </mat-radio-button>\n </fs-radio-group>\n </div>\n </ng-template>\n\n <fs-label-field *ngIf=\"levelPermissions.length\">\n <fs-label>All Permissions</fs-label>\n <mat-checkbox\n [(ngModel)]=\"aclRole.allPermissions\"\n (ngModelChange)=\"allPermissionsChange($event)\"\n [disabled]=\"!!aclRole.protected || disabled\"\n name=\"allPermissions\">\n Enable\n </mat-checkbox>\n </fs-label-field>\n\n <div class=\"fs-column\" *ngFor=\"let roleConfig of roleConfigs\">\n <fs-label-field *ngIf=\"roleConfig.type === 'checkbox'\">\n <fs-label>{{roleConfig.label}}</fs-label>\n <mat-checkbox\n [(ngModel)]=\"aclRoleConfigValues[roleConfig.name]\"\n [disabled]=\"disabled\"\n [name]=\"roleConfig.name\">\n Enable\n </mat-checkbox>\n <fs-label-message>\n <mat-hint>{{roleConfig.description}}</mat-hint>\n </fs-label-message>\n </fs-label-field>\n\n <mat-form-field *ngIf=\"roleConfig.type === 'select'\">\n <mat-select\n [(ngModel)]=\"aclRoleConfigValues[roleConfig.name]\"\n [name]=\"roleConfig.name\"\n [required]=\"roleConfig.required\"\n [disabled]=\"disabled\"\n [placeholder]=\"roleConfig.label\">\n <mat-option\n *ngFor=\"let item of roleConfig.values\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n <mat-hint>{{roleConfig.description}}</mat-hint>\n </mat-form-field>\n </div>\n </div>\n\n <div *ngIf=\"aclRole.level\" [hidden]=\"!levelPermissions.length\" class=\"permissions fs-column\">\n <fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Permissions\">\n <ng-template fs-list-group-cell let-row=\"row\" class=\"permission-group\">\n <div class=\"permission-group\">{{row.category || 'General'}}</div>\n </ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permission\">{{ row.name }}</div>\n <div class=\"description small\">{{ row.description }}</div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Access\" width=\"1%\" class=\"access\">\n <ng-template \n fs-list-group-cell\n let-row=\"row\"\n let-group=\"group\"\n let-groupChildren=\"groupChildren\"\n class=\"permission-group\"\n align=\"right\">\n <ng-container *ngIf=\"!aclRole.allPermissions && !disabled\">\n <fs-menu>\n <ng-container *ngFor=\"let access of AclRoleAccesses | builkOptionsFilter: groupChildren\">\n <ng-template\n fs-menu-item\n (click)=\"bulkChange(access.value, groupChildren, group)\">\n {{ access.name }}\n </ng-template>\n </ng-container>\n </fs-menu>\n </ng-container>\n </ng-template>\n <ng-template fs-list-cell let-row=\"permission\" let-permission=\"row\">\n <span *ngIf=\"aclRole.allPermissions || disabled; else elseAll\">\n {{indexedAccesses[aclRolePermissions[permission.value]]}}\n </span>\n <ng-template #elseAll>\n <ng-container *ngIf=\"permission|aclRolePermissionAvailable:aclRolePermissions; else permissionRequires\">\n <mat-form-field>\n <mat-select\n [(ngModel)]=\"aclRolePermissions[permission.value]\"\n [disabled]=\"!!aclRole.protected\"\n required\n [name]=\"'access-' + permission.value\"\n (ngModelChange)=\"permissionChange()\">\n <ng-container *ngFor=\"let access of AclRoleAccesses\">\n <mat-option\n *ngIf=\"access.value === 0 || permission.accesses.indexOf(access.value) !== -1\"\n [value]=\"access.value\">\n {{access.name}}\n </mat-option>\n </ng-container>\n </mat-select>\n </mat-form-field>\n </ng-container>\n <ng-template #permissionRequires>\n Unavailable\n </ng-template>\n </ng-template>\n </ng-template>\n </fs-list-column>\n </fs-list>\n </div>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n *ngIf=\"!disabled\"\n #submit\n mat-button\n type=\"submit\"\n color=\"primary\">\n {{ aclRole.id ? 'Save' : 'Create' }}\n </button>\n <button mat-button [mat-dialog-close]=\"null\" type=\"button\">{{ disabled ? 'Done' : 'Cancel' }}</button>\n </mat-dialog-actions>\n </ng-container>\n </fs-dialog>\n</form>\n", styles: [".permissions{flex:1}.permissions ::ng-deep .fs-list-row-group{background-color:#e4e4e4;font-size:112%}.permissions ::ng-deep fs-list .access{white-space:nowrap}.permissions ::ng-deep .mat-form-field{width:100px}.permissions ::ng-deep .mat-form-field .mat-form-field-wrapper{padding-bottom:0}.permissions ::ng-deep .mat-form-field .mat-form-field-infix{border-top:0}.permissions ::ng-deep .mat-form-field .mat-form-field-underline{bottom:0}.permissions ::ng-deep fs-radio-group{width:100%}.permissions ::ng-deep fs-label-field{width:100%}.permissions .level{width:100%}.left-column{width:40%;max-width:400px}\n"], components: [{ type: i4.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i6.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i6.FsLabelComponent, selector: "fs-label" }, { type: i7.FsRadioGroupComponent, selector: "fs-radio-group", inputs: ["orientation", "label", "name", "disabled", "radioPosition", "compareWith", "required"] }, { type: i8.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i6.FsLabelMessageComponent, selector: "fs-label-message" }, { type: i10.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i11.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i12.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i13.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass", "buttonType", "buttonColor"], outputs: ["opened", "closed"] }, { type: i14.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i15.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i15.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i15.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i16.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i5.MatLabel, selector: "mat-label" }, { type: i18.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i15.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i16.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i15.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i15.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i16.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i15.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i12.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { type: i12.FsListGroupHeaderDirective, selector: "[fs-list-group-cell],[fs-list-group-header]" }, { type: i12.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i13.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]" }, { type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i16.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "builkOptionsFilter": BulkOptionsFilterPipe, "aclRolePermissionAvailable": AclRolePermissionAvailablePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
362
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAclRoleComponent, decorators: [{
363
- type: Component,
364
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <ng-container *ngIf=\"aclRole\">\n <div mat-dialog-title>\n <ng-container *ngIf=\"!disabled\">{{ aclRole.id ? 'Edit' : 'Create' }}</ng-container>\n <ng-container *ngIf=\"disabled\">View</ng-container>\n Role\n </div>\n <mat-dialog-content>\n <div class=\"fs-row.gap-large.align-start\">\n <div class=\"fs-column left-column\">\n <mat-form-field> \n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"aclRole.name\"\n [disabled]=\"disabled\"\n name=\"name\"\n fsFormRequired>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Description</mat-label>\n <input\n matInput\n [(ngModel)]=\"aclRole.description\"\n [disabled]=\"disabled\"\n name=\"description\">\n </mat-form-field>\n\n <fs-label-field *ngIf=\"aclRole.id || aclLevels.length === 1; else levels\">\n <fs-label>Level</fs-label>\n {{indexedAclLevels[aclRole.level]}}\n </fs-label-field>\n\n <ng-template #levels>\n <div class=\"level\">\n <fs-radio-group\n [(ngModel)]=\"aclRole.level\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"levelChange()\"\n fsFormRequired\n label=\"Level\"\n orientation=\"vertical\"\n name=\"level\">\n <mat-radio-button\n *ngFor=\"let item of aclLevels\"\n [value]=\"item.value\"\n [disabled]=\"!!aclRole.protected\">\n {{ item.name }}\n </mat-radio-button>\n </fs-radio-group>\n </div>\n </ng-template>\n\n <fs-label-field *ngIf=\"levelPermissions.length\">\n <fs-label>All Permissions</fs-label>\n <mat-checkbox\n [(ngModel)]=\"aclRole.allPermissions\"\n (ngModelChange)=\"allPermissionsChange($event)\"\n [disabled]=\"!!aclRole.protected || disabled\"\n name=\"allPermissions\">\n Enable\n </mat-checkbox>\n </fs-label-field>\n\n <div class=\"fs-column\" *ngFor=\"let roleConfig of roleConfigs\">\n <fs-label-field *ngIf=\"roleConfig.type === 'checkbox'\">\n <fs-label>{{roleConfig.label}}</fs-label>\n <mat-checkbox\n [(ngModel)]=\"aclRoleConfigValues[roleConfig.name]\"\n [disabled]=\"disabled\"\n [name]=\"roleConfig.name\">\n Enable\n </mat-checkbox>\n <fs-label-message>\n <mat-hint>{{roleConfig.description}}</mat-hint>\n </fs-label-message>\n </fs-label-field>\n\n <mat-form-field *ngIf=\"roleConfig.type === 'select'\">\n <mat-select\n [(ngModel)]=\"aclRoleConfigValues[roleConfig.name]\"\n [name]=\"roleConfig.name\"\n [required]=\"roleConfig.required\"\n [disabled]=\"disabled\"\n [placeholder]=\"roleConfig.label\">\n <mat-option\n *ngFor=\"let item of roleConfig.values\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n <mat-hint>{{roleConfig.description}}</mat-hint>\n </mat-form-field>\n </div>\n </div>\n\n <div *ngIf=\"aclRole.level\" [hidden]=\"!levelPermissions.length\" class=\"permissions fs-column\">\n <fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Permissions\">\n <ng-template fs-list-group-cell let-row=\"row\" class=\"permission-group\">\n <div class=\"permission-group\">{{row.category || 'General'}}</div>\n </ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permission\">{{ row.name }}</div>\n <div class=\"description small\">{{ row.description }}</div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Access\" width=\"1%\" class=\"access\">\n <ng-template \n fs-list-group-cell\n let-row=\"row\"\n let-group=\"group\"\n let-groupChildren=\"groupChildren\"\n class=\"permission-group\"\n align=\"right\">\n <ng-container *ngIf=\"!aclRole.allPermissions && !disabled\">\n <fs-menu>\n <ng-container *ngFor=\"let access of AclRoleAccesses | builkOptionsFilter: groupChildren\">\n <ng-template\n fs-menu-item\n (click)=\"bulkChange(access.value, groupChildren, group)\">\n {{ access.name }}\n </ng-template>\n </ng-container>\n </fs-menu>\n </ng-container>\n </ng-template>\n <ng-template fs-list-cell let-row=\"permission\" let-permission=\"row\">\n <span *ngIf=\"aclRole.allPermissions || disabled; else elseAll\">\n {{indexedAccesses[aclRolePermissions[permission.value]]}}\n </span>\n <ng-template #elseAll>\n <ng-container *ngIf=\"permission|aclRolePermissionAvailable:aclRolePermissions; else permissionRequires\">\n <mat-form-field>\n <mat-select\n [(ngModel)]=\"aclRolePermissions[permission.value]\"\n [disabled]=\"!!aclRole.protected\"\n required\n [name]=\"'access-' + permission.value\"\n (ngModelChange)=\"permissionChange()\">\n <ng-container *ngFor=\"let access of AclRoleAccesses\">\n <mat-option\n *ngIf=\"access.value === 0 || permission.accesses.indexOf(access.value) !== -1\"\n [value]=\"access.value\">\n {{access.name}}\n </mat-option>\n </ng-container>\n </mat-select>\n </mat-form-field>\n </ng-container>\n <ng-template #permissionRequires>\n Unavailable\n </ng-template>\n </ng-template>\n </ng-template>\n </fs-list-column>\n </fs-list>\n </div>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n *ngIf=\"!disabled\"\n #submit\n mat-button\n type=\"submit\"\n color=\"primary\">\n {{ aclRole.id ? 'Save' : 'Create' }}\n </button>\n <button mat-button [mat-dialog-close]=\"null\" type=\"button\">{{ disabled ? 'Done' : 'Cancel' }}</button>\n </mat-dialog-actions>\n </ng-container>\n </fs-dialog>\n</form>\n", styles: [".permissions{flex:1}.permissions ::ng-deep .fs-list-row-group{background-color:#e4e4e4;font-size:112%}.permissions ::ng-deep fs-list .access{white-space:nowrap}.permissions ::ng-deep .mat-form-field{width:100px}.permissions ::ng-deep .mat-form-field .mat-form-field-wrapper{padding-bottom:0}.permissions ::ng-deep .mat-form-field .mat-form-field-infix{border-top:0}.permissions ::ng-deep .mat-form-field .mat-form-field-underline{bottom:0}.permissions ::ng-deep fs-radio-group{width:100%}.permissions ::ng-deep fs-label-field{width:100%}.permissions .level{width:100%}.left-column{width:40%;max-width:400px}\n"] }]
365
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
366
- type: Inject,
367
- args: [MAT_DIALOG_DATA]
368
- }] }, { type: FsAppAclService }, { type: i2.MatDialogRef }, { type: i3.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { list: [{
369
- type: ViewChild,
370
- args: [FsListComponent]
371
- }], submitButton: [{
372
- type: ViewChild,
373
- args: ['submit', { static: false }]
154
+ class FsAclRoleComponent {
155
+ constructor(_data, _appAclService, _dialogRef, _message, _cdRef) {
156
+ this._data = _data;
157
+ this._appAclService = _appAclService;
158
+ this._dialogRef = _dialogRef;
159
+ this._message = _message;
160
+ this._cdRef = _cdRef;
161
+ this.aclRole = null;
162
+ this.permissions = [];
163
+ this.levelPermissions = [];
164
+ this.AclRoleAccesses = AclRoleAccesses;
165
+ this.indexedAccesses = {};
166
+ this.aclLevels = [];
167
+ this.indexedAclLevels = {};
168
+ this.onlyFullAccess = false;
169
+ this.AclLevels = {};
170
+ this.roleConfigs = [];
171
+ this.aclRoleConfigValues = {};
172
+ this.aclRolePermissions = {};
173
+ this._destroy$ = new Subject();
174
+ this.save = () => {
175
+ const aclRoleConfigs = this.roleConfigs
176
+ .map((roleConfig) => {
177
+ return {
178
+ name: roleConfig.name,
179
+ value: this.aclRoleConfigValues[roleConfig.name],
180
+ };
181
+ });
182
+ const aclRole = {
183
+ ...this.aclRole,
184
+ permissions: this.levelPermissions.map((permission) => {
185
+ return {
186
+ value: permission.value,
187
+ access: this.aclRolePermissions[permission.value] || 0,
188
+ };
189
+ }),
190
+ aclRoleConfigs,
191
+ };
192
+ return this._data.saveAclRole(aclRole)
193
+ .pipe(tap((response) => {
194
+ this._message.success('Saved Changes');
195
+ this.close(response);
196
+ }));
197
+ };
198
+ }
199
+ ngOnInit() {
200
+ forkJoin(this.getRole(), this._appAclService.getPermissions())
201
+ .pipe(takeUntil(this._destroy$))
202
+ .subscribe(([aclRole, aclPermissions,]) => {
203
+ this.permissions = aclPermissions;
204
+ this.aclLevels = this._data.aclLevels;
205
+ this.disabled = this._data.disabled;
206
+ this.indexedAclLevels = list(this.aclLevels, 'name', 'value');
207
+ this.indexedAccesses = list(AclRoleAccesses, 'name', 'value');
208
+ this.aclRole = {
209
+ ...{
210
+ aclPermissions: [],
211
+ allPermissions: true,
212
+ aclRoleConfigs: [],
213
+ permissions: {},
214
+ level: this.aclLevels[0].value,
215
+ },
216
+ ...aclRole,
217
+ };
218
+ this.aclRoleConfigValues = (aclRole.aclRoleConfigs || [])
219
+ .reduce((accum, aclRoleConfig) => {
220
+ return {
221
+ ...accum,
222
+ [aclRoleConfig.name]: aclRoleConfig.value,
223
+ };
224
+ }, {});
225
+ if (this.aclRole.id) {
226
+ this.permissions.forEach((permission) => {
227
+ let access = 0;
228
+ const aclPermission = this.aclRole.aclPermissions.find((item) => {
229
+ return item.permission === permission.value;
230
+ });
231
+ if (aclPermission) {
232
+ access = aclPermission.access;
233
+ }
234
+ this.aclRolePermissions[permission.value] = access;
235
+ });
236
+ }
237
+ if (this.aclRole.allPermissions) {
238
+ this._applyMaxPermissionAccess();
239
+ }
240
+ this._updatePermissions();
241
+ this._updateRoleConfigs();
242
+ this._cdRef.markForCheck();
243
+ });
244
+ this.listConfig = {
245
+ status: false,
246
+ paging: false,
247
+ rowHighlight: false,
248
+ noResults: {
249
+ message: '',
250
+ },
251
+ group: {
252
+ initialExpand: true,
253
+ groupBy: (data) => {
254
+ return data;
255
+ },
256
+ compareBy: (data) => {
257
+ return data.category || 'General';
258
+ },
259
+ },
260
+ fetch: () => {
261
+ return of({
262
+ data: this.levelPermissions.sort((a, b) => {
263
+ a = a.name.toUpperCase();
264
+ b = b.name.toUpperCase();
265
+ if (a < b) {
266
+ return -1;
267
+ }
268
+ else if (a > b) {
269
+ return 1;
270
+ }
271
+ return 0;
272
+ }),
273
+ });
274
+ },
275
+ };
276
+ }
277
+ bulkChange(value, groupChildren, group) {
278
+ groupChildren
279
+ .forEach((permission) => {
280
+ const access = permission.accesses
281
+ .find((access) => value === access);
282
+ if (access || !value) {
283
+ this.aclRolePermissions[permission.value] = value;
284
+ }
285
+ });
286
+ setTimeout(() => {
287
+ this.submitButton.disabled = false;
288
+ this.permissionChange();
289
+ });
290
+ }
291
+ permissionChange() {
292
+ this.aclRolePermissions = {
293
+ ...this.aclRolePermissions,
294
+ };
295
+ this._cdRef.markForCheck();
296
+ }
297
+ levelChange() {
298
+ this._updatePermissions();
299
+ this._updateRoleConfigs();
300
+ this.list.reload();
301
+ }
302
+ getRole() {
303
+ if (!this._data.aclRole.id) {
304
+ return of(this._data.aclRole);
305
+ }
306
+ const query = {
307
+ aclPermissions: true,
308
+ aclRoleConfigs: true,
309
+ };
310
+ if (!this.environment) {
311
+ query.environmentId = null;
312
+ }
313
+ return this._data.loadAclRole(this._data.aclRole, query);
314
+ }
315
+ close(data = null) {
316
+ this._dialogRef.close(data);
317
+ }
318
+ allPermissionsChange(all) {
319
+ this._updatePermissions();
320
+ if (all) {
321
+ this._applyMaxPermissionAccess();
322
+ }
323
+ else {
324
+ this._applyNonePermissionAccess();
325
+ }
326
+ }
327
+ ngOnDestroy() {
328
+ this._destroy$.next();
329
+ this._destroy$.complete();
330
+ }
331
+ _updatePermissions() {
332
+ this.levelPermissions = this.permissions
333
+ .filter((permission) => {
334
+ return permission.levels.some((item) => {
335
+ return item === this.aclRole.level;
336
+ });
337
+ });
338
+ }
339
+ _updateRoleConfigs() {
340
+ if (this._data.loadRoleConfigs) {
341
+ this._data.loadRoleConfigs()
342
+ .subscribe((roleConfigs) => {
343
+ this.roleConfigs = roleConfigs
344
+ .filter((roleConfig) => roleConfig.level === this.aclRole.level);
345
+ this._cdRef.markForCheck();
346
+ });
347
+ }
348
+ }
349
+ _applyMaxPermissionAccess() {
350
+ this.permissions.forEach((permission) => {
351
+ this.aclRolePermissions[permission.value] = Math.max(...permission.accesses);
352
+ });
353
+ }
354
+ _applyNonePermissionAccess() {
355
+ this.permissions.forEach((permission) => {
356
+ this.aclRolePermissions[permission.value] = AclRoleAccess.None;
357
+ });
358
+ }
359
+ }
360
+ FsAclRoleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAclRoleComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: FsAppAclService }, { token: i2.MatDialogRef }, { token: i3.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
361
+ FsAclRoleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FsAclRoleComponent, selector: "ng-component", viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true }, { propertyName: "submitButton", first: true, predicate: ["submit"], descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <ng-container *ngIf=\"aclRole\">\n <div mat-dialog-title>\n <ng-container *ngIf=\"!disabled\">{{ aclRole.id ? 'Edit' : 'Create' }}</ng-container>\n <ng-container *ngIf=\"disabled\">View</ng-container>\n Role\n </div>\n <mat-dialog-content>\n <div class=\"fs-row.gap-large.align-start\">\n <div class=\"fs-column left-column\">\n <mat-form-field> \n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"aclRole.name\"\n [disabled]=\"disabled\"\n name=\"name\"\n fsFormRequired>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Description</mat-label>\n <input\n matInput\n [(ngModel)]=\"aclRole.description\"\n [disabled]=\"disabled\"\n name=\"description\">\n </mat-form-field>\n\n <fs-label-field *ngIf=\"aclRole.id || aclLevels.length === 1; else levels\">\n <fs-label>Level</fs-label>\n {{indexedAclLevels[aclRole.level]}}\n </fs-label-field>\n\n <ng-template #levels>\n <div class=\"level\">\n <fs-radio-group\n [(ngModel)]=\"aclRole.level\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"levelChange()\"\n fsFormRequired\n label=\"Level\"\n orientation=\"vertical\"\n name=\"level\">\n <mat-radio-button\n *ngFor=\"let item of aclLevels\"\n [value]=\"item.value\"\n [disabled]=\"!!aclRole.protected\">\n {{ item.name }}\n </mat-radio-button>\n </fs-radio-group>\n </div>\n </ng-template>\n\n <fs-label-field *ngIf=\"levelPermissions.length\">\n <fs-label>All Permissions</fs-label>\n <mat-checkbox\n [(ngModel)]=\"aclRole.allPermissions\"\n (ngModelChange)=\"allPermissionsChange($event)\"\n [disabled]=\"!!aclRole.protected || disabled\"\n name=\"allPermissions\">\n Enable\n </mat-checkbox>\n </fs-label-field>\n\n <div class=\"fs-column\" *ngFor=\"let roleConfig of roleConfigs\">\n <fs-label-field *ngIf=\"roleConfig.type === 'checkbox'\">\n <fs-label>{{roleConfig.label}}</fs-label>\n <mat-checkbox\n [(ngModel)]=\"aclRoleConfigValues[roleConfig.name]\"\n [disabled]=\"disabled\"\n [name]=\"roleConfig.name\">\n Enable\n </mat-checkbox>\n <fs-label-message>\n <mat-hint>{{roleConfig.description}}</mat-hint>\n </fs-label-message>\n </fs-label-field>\n\n <mat-form-field *ngIf=\"roleConfig.type === 'select'\">\n <mat-select\n [(ngModel)]=\"aclRoleConfigValues[roleConfig.name]\"\n [name]=\"roleConfig.name\"\n [required]=\"roleConfig.required\"\n [disabled]=\"disabled\"\n [placeholder]=\"roleConfig.label\">\n <mat-option\n *ngFor=\"let item of roleConfig.values\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n <mat-hint>{{roleConfig.description}}</mat-hint>\n </mat-form-field>\n </div>\n </div>\n\n <div *ngIf=\"aclRole.level\" [hidden]=\"!levelPermissions.length\" class=\"permissions fs-column\">\n <fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Permissions\">\n <ng-template fs-list-group-cell let-row=\"row\" class=\"permission-group\">\n <div class=\"permission-group\">{{row.category || 'General'}}</div>\n </ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permission\">{{ row.name }}</div>\n <div class=\"description small\">{{ row.description }}</div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Access\" width=\"1%\" class=\"access\">\n <ng-template \n fs-list-group-cell\n let-row=\"row\"\n let-group=\"group\"\n let-groupChildren=\"groupChildren\"\n class=\"permission-group\"\n align=\"right\">\n <ng-container *ngIf=\"!aclRole.allPermissions && !disabled\">\n <fs-menu>\n <ng-container *ngFor=\"let access of AclRoleAccesses | builkOptionsFilter: groupChildren\">\n <ng-template\n fs-menu-item\n (click)=\"bulkChange(access.value, groupChildren, group)\">\n {{ access.name }}\n </ng-template>\n </ng-container>\n </fs-menu>\n </ng-container>\n </ng-template>\n <ng-template fs-list-cell let-row=\"permission\" let-permission=\"row\">\n <span *ngIf=\"aclRole.allPermissions || disabled; else elseAll\">\n {{indexedAccesses[aclRolePermissions[permission.value]]}}\n </span>\n <ng-template #elseAll>\n <ng-container *ngIf=\"permission|aclRolePermissionAvailable:aclRolePermissions; else permissionRequires\">\n <mat-form-field>\n <mat-select\n [(ngModel)]=\"aclRolePermissions[permission.value]\"\n [disabled]=\"!!aclRole.protected\"\n required\n [name]=\"'access-' + permission.value\"\n (ngModelChange)=\"permissionChange()\">\n <ng-container *ngFor=\"let access of AclRoleAccesses\">\n <mat-option\n *ngIf=\"access.value === 0 || permission.accesses.indexOf(access.value) !== -1\"\n [value]=\"access.value\">\n {{access.name}}\n </mat-option>\n </ng-container>\n </mat-select>\n </mat-form-field>\n </ng-container>\n <ng-template #permissionRequires>\n Unavailable\n </ng-template>\n </ng-template>\n </ng-template>\n </fs-list-column>\n </fs-list>\n </div>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n *ngIf=\"!disabled\"\n #submit\n mat-button\n type=\"submit\"\n color=\"primary\">\n {{ aclRole.id ? 'Save' : 'Create' }}\n </button>\n <button mat-button [mat-dialog-close]=\"null\" type=\"button\">{{ disabled ? 'Done' : 'Cancel' }}</button>\n </mat-dialog-actions>\n </ng-container>\n </fs-dialog>\n</form>\n", styles: [".permissions{flex:1}.permissions ::ng-deep .fs-list-row-group{background-color:#e4e4e4;font-size:112%}.permissions ::ng-deep fs-list .access{white-space:nowrap}.permissions ::ng-deep .mat-form-field{width:100px}.permissions ::ng-deep .mat-form-field .mat-form-field-wrapper{padding-bottom:0}.permissions ::ng-deep .mat-form-field .mat-form-field-infix{border-top:0}.permissions ::ng-deep .mat-form-field .mat-form-field-underline{bottom:0}.permissions ::ng-deep fs-radio-group{width:100%}.permissions ::ng-deep fs-label-field{width:100%}.permissions .level{width:100%}.left-column{width:40%;max-width:400px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "component", type: i7.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i8.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i9.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i10.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i11.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { kind: "directive", type: i12.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i13.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i13.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i13.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "directive", type: i13.FsListGroupHeaderDirective, selector: "[fs-list-group-cell],[fs-list-group-header]" }, { kind: "component", type: i14.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { kind: "directive", type: i15.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { kind: "directive", type: i15.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { kind: "directive", type: i15.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { kind: "directive", type: i15.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { kind: "component", type: i16.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i16.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "component", type: i16.FsLabelMessageComponent, selector: "fs-label-message" }, { kind: "component", type: i17.FsRadioGroupComponent, selector: "fs-radio-group", inputs: ["orientation", "label", "name", "disabled", "radioPosition", "compareWith", "required"] }, { kind: "component", type: i18.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass", "buttonType", "buttonColor"], outputs: ["opened", "closed"] }, { kind: "directive", type: i18.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]" }, { kind: "pipe", type: BulkOptionsFilterPipe, name: "builkOptionsFilter" }, { kind: "pipe", type: AclRolePermissionAvailablePipe, name: "aclRolePermissionAvailable" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
362
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAclRoleComponent, decorators: [{
363
+ type: Component,
364
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <ng-container *ngIf=\"aclRole\">\n <div mat-dialog-title>\n <ng-container *ngIf=\"!disabled\">{{ aclRole.id ? 'Edit' : 'Create' }}</ng-container>\n <ng-container *ngIf=\"disabled\">View</ng-container>\n Role\n </div>\n <mat-dialog-content>\n <div class=\"fs-row.gap-large.align-start\">\n <div class=\"fs-column left-column\">\n <mat-form-field> \n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"aclRole.name\"\n [disabled]=\"disabled\"\n name=\"name\"\n fsFormRequired>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Description</mat-label>\n <input\n matInput\n [(ngModel)]=\"aclRole.description\"\n [disabled]=\"disabled\"\n name=\"description\">\n </mat-form-field>\n\n <fs-label-field *ngIf=\"aclRole.id || aclLevels.length === 1; else levels\">\n <fs-label>Level</fs-label>\n {{indexedAclLevels[aclRole.level]}}\n </fs-label-field>\n\n <ng-template #levels>\n <div class=\"level\">\n <fs-radio-group\n [(ngModel)]=\"aclRole.level\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"levelChange()\"\n fsFormRequired\n label=\"Level\"\n orientation=\"vertical\"\n name=\"level\">\n <mat-radio-button\n *ngFor=\"let item of aclLevels\"\n [value]=\"item.value\"\n [disabled]=\"!!aclRole.protected\">\n {{ item.name }}\n </mat-radio-button>\n </fs-radio-group>\n </div>\n </ng-template>\n\n <fs-label-field *ngIf=\"levelPermissions.length\">\n <fs-label>All Permissions</fs-label>\n <mat-checkbox\n [(ngModel)]=\"aclRole.allPermissions\"\n (ngModelChange)=\"allPermissionsChange($event)\"\n [disabled]=\"!!aclRole.protected || disabled\"\n name=\"allPermissions\">\n Enable\n </mat-checkbox>\n </fs-label-field>\n\n <div class=\"fs-column\" *ngFor=\"let roleConfig of roleConfigs\">\n <fs-label-field *ngIf=\"roleConfig.type === 'checkbox'\">\n <fs-label>{{roleConfig.label}}</fs-label>\n <mat-checkbox\n [(ngModel)]=\"aclRoleConfigValues[roleConfig.name]\"\n [disabled]=\"disabled\"\n [name]=\"roleConfig.name\">\n Enable\n </mat-checkbox>\n <fs-label-message>\n <mat-hint>{{roleConfig.description}}</mat-hint>\n </fs-label-message>\n </fs-label-field>\n\n <mat-form-field *ngIf=\"roleConfig.type === 'select'\">\n <mat-select\n [(ngModel)]=\"aclRoleConfigValues[roleConfig.name]\"\n [name]=\"roleConfig.name\"\n [required]=\"roleConfig.required\"\n [disabled]=\"disabled\"\n [placeholder]=\"roleConfig.label\">\n <mat-option\n *ngFor=\"let item of roleConfig.values\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n <mat-hint>{{roleConfig.description}}</mat-hint>\n </mat-form-field>\n </div>\n </div>\n\n <div *ngIf=\"aclRole.level\" [hidden]=\"!levelPermissions.length\" class=\"permissions fs-column\">\n <fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Permissions\">\n <ng-template fs-list-group-cell let-row=\"row\" class=\"permission-group\">\n <div class=\"permission-group\">{{row.category || 'General'}}</div>\n </ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permission\">{{ row.name }}</div>\n <div class=\"description small\">{{ row.description }}</div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Access\" width=\"1%\" class=\"access\">\n <ng-template \n fs-list-group-cell\n let-row=\"row\"\n let-group=\"group\"\n let-groupChildren=\"groupChildren\"\n class=\"permission-group\"\n align=\"right\">\n <ng-container *ngIf=\"!aclRole.allPermissions && !disabled\">\n <fs-menu>\n <ng-container *ngFor=\"let access of AclRoleAccesses | builkOptionsFilter: groupChildren\">\n <ng-template\n fs-menu-item\n (click)=\"bulkChange(access.value, groupChildren, group)\">\n {{ access.name }}\n </ng-template>\n </ng-container>\n </fs-menu>\n </ng-container>\n </ng-template>\n <ng-template fs-list-cell let-row=\"permission\" let-permission=\"row\">\n <span *ngIf=\"aclRole.allPermissions || disabled; else elseAll\">\n {{indexedAccesses[aclRolePermissions[permission.value]]}}\n </span>\n <ng-template #elseAll>\n <ng-container *ngIf=\"permission|aclRolePermissionAvailable:aclRolePermissions; else permissionRequires\">\n <mat-form-field>\n <mat-select\n [(ngModel)]=\"aclRolePermissions[permission.value]\"\n [disabled]=\"!!aclRole.protected\"\n required\n [name]=\"'access-' + permission.value\"\n (ngModelChange)=\"permissionChange()\">\n <ng-container *ngFor=\"let access of AclRoleAccesses\">\n <mat-option\n *ngIf=\"access.value === 0 || permission.accesses.indexOf(access.value) !== -1\"\n [value]=\"access.value\">\n {{access.name}}\n </mat-option>\n </ng-container>\n </mat-select>\n </mat-form-field>\n </ng-container>\n <ng-template #permissionRequires>\n Unavailable\n </ng-template>\n </ng-template>\n </ng-template>\n </fs-list-column>\n </fs-list>\n </div>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n *ngIf=\"!disabled\"\n #submit\n mat-button\n type=\"submit\"\n color=\"primary\">\n {{ aclRole.id ? 'Save' : 'Create' }}\n </button>\n <button mat-button [mat-dialog-close]=\"null\" type=\"button\">{{ disabled ? 'Done' : 'Cancel' }}</button>\n </mat-dialog-actions>\n </ng-container>\n </fs-dialog>\n</form>\n", styles: [".permissions{flex:1}.permissions ::ng-deep .fs-list-row-group{background-color:#e4e4e4;font-size:112%}.permissions ::ng-deep fs-list .access{white-space:nowrap}.permissions ::ng-deep .mat-form-field{width:100px}.permissions ::ng-deep .mat-form-field .mat-form-field-wrapper{padding-bottom:0}.permissions ::ng-deep .mat-form-field .mat-form-field-infix{border-top:0}.permissions ::ng-deep .mat-form-field .mat-form-field-underline{bottom:0}.permissions ::ng-deep fs-radio-group{width:100%}.permissions ::ng-deep fs-label-field{width:100%}.permissions .level{width:100%}.left-column{width:40%;max-width:400px}\n"] }]
365
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
366
+ type: Inject,
367
+ args: [MAT_DIALOG_DATA]
368
+ }] }, { type: FsAppAclService }, { type: i2.MatDialogRef }, { type: i3.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { list: [{
369
+ type: ViewChild,
370
+ args: [FsListComponent]
371
+ }], submitButton: [{
372
+ type: ViewChild,
373
+ args: ['submit', { static: false }]
374
374
  }] } });
375
375
 
376
- class FsAclPermissionPopoverComponent {
377
- constructor(_appAclService) {
378
- this._appAclService = _appAclService;
379
- }
380
- ngOnInit() {
381
- this._appAclService.getPermissions()
382
- .subscribe(permissions => {
383
- this.description = permissions.filter(item => {
384
- return item.value === this.permission.value;
385
- }).map(item => {
386
- return item.description;
387
- })[0];
388
- });
389
- }
390
- }
391
- FsAclPermissionPopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAclPermissionPopoverComponent, deps: [{ token: FsAppAclService }], target: i0.ɵɵFactoryTarget.Component });
392
- FsAclPermissionPopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsAclPermissionPopoverComponent, selector: "acl-permission-popover", inputs: { permission: "permission" }, ngImport: i0, template: "\n<fs-popover [template]=\"popover\" [maxWidth]=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n {{permission.name}}\n <div class=\"small\">{{description}}</div>\n</ng-template>\n\n", styles: [":host{cursor:pointer}\n"], components: [{ type: i2$1.FsPopoverComponent, selector: "fs-popover" }] });
393
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAclPermissionPopoverComponent, decorators: [{
394
- type: Component,
395
- args: [{ selector: 'acl-permission-popover', template: "\n<fs-popover [template]=\"popover\" [maxWidth]=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n {{permission.name}}\n <div class=\"small\">{{description}}</div>\n</ng-template>\n\n", styles: [":host{cursor:pointer}\n"] }]
396
- }], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { permission: [{
397
- type: Input
376
+ class FsAclPermissionPopoverComponent {
377
+ constructor(_appAclService) {
378
+ this._appAclService = _appAclService;
379
+ }
380
+ ngOnInit() {
381
+ this._appAclService.getPermissions()
382
+ .subscribe(permissions => {
383
+ this.description = permissions.filter(item => {
384
+ return item.value === this.permission.value;
385
+ }).map(item => {
386
+ return item.description;
387
+ })[0];
388
+ });
389
+ }
390
+ }
391
+ FsAclPermissionPopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAclPermissionPopoverComponent, deps: [{ token: FsAppAclService }], target: i0.ɵɵFactoryTarget.Component });
392
+ FsAclPermissionPopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FsAclPermissionPopoverComponent, selector: "acl-permission-popover", inputs: { permission: "permission" }, ngImport: i0, template: "\n<fs-popover [template]=\"popover\" [maxWidth]=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n {{permission.name}}\n <div class=\"small\">{{description}}</div>\n</ng-template>\n\n", styles: [":host{cursor:pointer}\n"], dependencies: [{ kind: "component", type: i2$1.FsPopoverComponent, selector: "fs-popover" }] });
393
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAclPermissionPopoverComponent, decorators: [{
394
+ type: Component,
395
+ args: [{ selector: 'acl-permission-popover', template: "\n<fs-popover [template]=\"popover\" [maxWidth]=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n {{permission.name}}\n <div class=\"small\">{{description}}</div>\n</ng-template>\n\n", styles: [":host{cursor:pointer}\n"] }]
396
+ }], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { permission: [{
397
+ type: Input
398
398
  }] } });
399
399
 
400
- class FsAclRolesComponent {
401
- constructor(_appAclService, _dialog) {
402
- this._appAclService = _appAclService;
403
- this._dialog = _dialog;
404
- this.aclLevels = [];
405
- this.list = new QueryList();
406
- this.indexedAclRoleLevels = {};
407
- this._destroy$ = new Subject();
408
- }
409
- ngOnInit() {
410
- new Observable(observer => {
411
- if (this.aclLevels.length) {
412
- observer.next(this.aclLevels);
413
- observer.complete();
414
- }
415
- else {
416
- this._appAclService.getLevels()
417
- .subscribe((aclLevels) => {
418
- observer.next(aclLevels);
419
- observer.complete();
420
- });
421
- }
422
- })
423
- .subscribe((aclLevels) => {
424
- this.aclLevels = aclLevels;
425
- this.indexedAclRoleLevels = list(this.aclLevels, 'name', 'value');
426
- this._loadListConfig();
427
- });
428
- }
429
- openDialog(aclRole = { id: null }) {
430
- this._dialog.open(FsAclRoleComponent, {
431
- width: '70%',
432
- data: {
433
- aclRole,
434
- aclLevels: this.aclLevels,
435
- loadAclRole: this.loadAclRole,
436
- saveAclRole: this.saveAclRole,
437
- loadRoleConfigs: this.loadRoleConfigs,
438
- disabled: this.disabledAclRole
439
- ? this.disabledAclRole(aclRole)
440
- : false,
441
- },
442
- })
443
- .afterClosed()
444
- .pipe(takeUntil(this._destroy$), filter((response) => !!response))
445
- .subscribe((response) => {
446
- this.list.forEach((list) => {
447
- list.reload();
448
- });
449
- });
450
- }
451
- ngOnDestroy() {
452
- this._destroy$.next();
453
- this._destroy$.complete();
454
- }
455
- _loadListConfig() {
456
- this.listConfig = {
457
- sort: { value: 'hierarchy' },
458
- filters: [
459
- {
460
- name: 'keyword',
461
- type: ItemType.Keyword,
462
- label: 'Search',
463
- },
464
- {
465
- name: 'level',
466
- label: 'Level',
467
- type: ItemType.Select,
468
- values: this.aclLevels,
469
- hide: this.aclLevels.length <= 1
470
- },
471
- {
472
- name: 'state',
473
- label: 'Show Deleted',
474
- type: ItemType.Checkbox,
475
- unchecked: 'active',
476
- checked: 'deleted',
477
- },
478
- ],
479
- actions: [
480
- {
481
- click: (event) => {
482
- this.openDialog();
483
- },
484
- label: 'Create',
485
- },
486
- ],
487
- rowActions: [
488
- {
489
- click: (data) => {
490
- return this.deleteAclRole(data);
491
- },
492
- remove: {
493
- title: 'Confirm',
494
- template: 'Are you sure you would like to delete this role?',
495
- },
496
- menu: true,
497
- label: 'Delete',
498
- show: (row) => {
499
- const hideDelete = !!this.disabledAclRole
500
- ? this.disabledAclRole(row)
501
- : false;
502
- return !!this.deleteAclRole
503
- && row.state !== 'deleted'
504
- && !hideDelete;
505
- },
506
- },
507
- {
508
- click: (data) => {
509
- return this.restoreAclRole(data)
510
- .pipe(tap(() => {
511
- this.list.forEach((l) => {
512
- l.reload();
513
- });
514
- }), takeUntil(this._destroy$))
515
- .subscribe();
516
- },
517
- label: 'Restore',
518
- show: (row) => !!this.restoreAclRole && row.state === 'deleted',
519
- },
520
- ],
521
- fetch: (query) => {
522
- query.permissions = true;
523
- return this.loadAclRoles(query)
524
- .pipe(map((data) => data));
525
- },
526
- };
527
- }
528
- }
529
- FsAclRolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAclRolesComponent, deps: [{ token: FsAppAclService }, { token: i2.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
530
- FsAclRolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsAclRolesComponent, selector: "fs-acl-roles", inputs: { deleteAclRole: "deleteAclRole", restoreAclRole: "restoreAclRole", saveAclRole: "saveAclRole", loadAclRoles: "loadAclRoles", loadAclRole: "loadAclRole", loadRoleConfigs: "loadRoleConfigs", aclLevels: "aclLevels", disabledAclRole: "disabledAclRole" }, viewQueries: [{ propertyName: "list", predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\" *ngIf=\"listConfig\">\n <fs-list-column title=\"Name\" name=\"name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.state !== 'deleted' else deletedRole\">\n <a (click)=\"openDialog(row)\">{{ row.name }}</a>\n </ng-container>\n <ng-template #deletedRole>\n {{ row.name }}\n </ng-template>\n <div class=\"small\">{{row.description}}</div>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"hierarchy\" title=\"Level\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{ indexedAclRoleLevels[row.level] }}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Permissions\">\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permissions\">\n <ng-container *ngFor=\"let permission of row.permissions\">\n <span *ngIf=\"permission.access\" class=\"permission\">\n <acl-permission-popover [permission]=\"permission\">{{permission.name}}</acl-permission-popover>\n </span>\n </ng-container>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [".permissions .permission+.permission:before{content:\", \"}\n"], components: [{ type: i12.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: FsAclPermissionPopoverComponent, selector: "acl-permission-popover", inputs: ["permission"] }], directives: [{ type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i12.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { type: i12.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
531
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAclRolesComponent, decorators: [{
532
- type: Component,
533
- args: [{ selector: 'fs-acl-roles', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-list [config]=\"listConfig\" *ngIf=\"listConfig\">\n <fs-list-column title=\"Name\" name=\"name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.state !== 'deleted' else deletedRole\">\n <a (click)=\"openDialog(row)\">{{ row.name }}</a>\n </ng-container>\n <ng-template #deletedRole>\n {{ row.name }}\n </ng-template>\n <div class=\"small\">{{row.description}}</div>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"hierarchy\" title=\"Level\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{ indexedAclRoleLevels[row.level] }}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Permissions\">\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permissions\">\n <ng-container *ngFor=\"let permission of row.permissions\">\n <span *ngIf=\"permission.access\" class=\"permission\">\n <acl-permission-popover [permission]=\"permission\">{{permission.name}}</acl-permission-popover>\n </span>\n </ng-container>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [".permissions .permission+.permission:before{content:\", \"}\n"] }]
534
- }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialog }]; }, propDecorators: { deleteAclRole: [{
535
- type: Input
536
- }], restoreAclRole: [{
537
- type: Input
538
- }], saveAclRole: [{
539
- type: Input
540
- }], loadAclRoles: [{
541
- type: Input
542
- }], loadAclRole: [{
543
- type: Input
544
- }], loadRoleConfigs: [{
545
- type: Input
546
- }], aclLevels: [{
547
- type: Input
548
- }], disabledAclRole: [{
549
- type: Input
550
- }], list: [{
551
- type: ViewChildren,
552
- args: [FsListComponent]
400
+ class FsAclRolesComponent {
401
+ constructor(_appAclService, _dialog) {
402
+ this._appAclService = _appAclService;
403
+ this._dialog = _dialog;
404
+ this.aclLevels = [];
405
+ this.list = new QueryList();
406
+ this.indexedAclRoleLevels = {};
407
+ this._destroy$ = new Subject();
408
+ }
409
+ ngOnInit() {
410
+ new Observable(observer => {
411
+ if (this.aclLevels.length) {
412
+ observer.next(this.aclLevels);
413
+ observer.complete();
414
+ }
415
+ else {
416
+ this._appAclService.getLevels()
417
+ .subscribe((aclLevels) => {
418
+ observer.next(aclLevels);
419
+ observer.complete();
420
+ });
421
+ }
422
+ })
423
+ .subscribe((aclLevels) => {
424
+ this.aclLevels = aclLevels;
425
+ this.indexedAclRoleLevels = list(this.aclLevels, 'name', 'value');
426
+ this._loadListConfig();
427
+ });
428
+ }
429
+ openDialog(aclRole = { id: null }) {
430
+ this._dialog.open(FsAclRoleComponent, {
431
+ width: '70%',
432
+ data: {
433
+ aclRole,
434
+ aclLevels: this.aclLevels,
435
+ loadAclRole: this.loadAclRole,
436
+ saveAclRole: this.saveAclRole,
437
+ loadRoleConfigs: this.loadRoleConfigs,
438
+ disabled: this.disabledAclRole
439
+ ? this.disabledAclRole(aclRole)
440
+ : false,
441
+ },
442
+ })
443
+ .afterClosed()
444
+ .pipe(takeUntil(this._destroy$), filter((response) => !!response))
445
+ .subscribe((response) => {
446
+ this.list.forEach((list) => {
447
+ list.reload();
448
+ });
449
+ });
450
+ }
451
+ ngOnDestroy() {
452
+ this._destroy$.next();
453
+ this._destroy$.complete();
454
+ }
455
+ _loadListConfig() {
456
+ this.listConfig = {
457
+ sort: { value: 'hierarchy' },
458
+ filters: [
459
+ {
460
+ name: 'keyword',
461
+ type: ItemType.Keyword,
462
+ label: 'Search',
463
+ },
464
+ {
465
+ name: 'level',
466
+ label: 'Level',
467
+ type: ItemType.Select,
468
+ values: this.aclLevels,
469
+ hide: this.aclLevels.length <= 1
470
+ },
471
+ {
472
+ name: 'state',
473
+ label: 'Show Deleted',
474
+ type: ItemType.Checkbox,
475
+ unchecked: 'active',
476
+ checked: 'deleted',
477
+ },
478
+ ],
479
+ actions: [
480
+ {
481
+ click: (event) => {
482
+ this.openDialog();
483
+ },
484
+ label: 'Create',
485
+ },
486
+ ],
487
+ rowActions: [
488
+ {
489
+ click: (data) => {
490
+ return this.deleteAclRole(data);
491
+ },
492
+ remove: {
493
+ title: 'Confirm',
494
+ template: 'Are you sure you would like to delete this role?',
495
+ },
496
+ menu: true,
497
+ label: 'Delete',
498
+ show: (row) => {
499
+ const hideDelete = !!this.disabledAclRole
500
+ ? this.disabledAclRole(row)
501
+ : false;
502
+ return !!this.deleteAclRole
503
+ && row.state !== 'deleted'
504
+ && !hideDelete;
505
+ },
506
+ },
507
+ {
508
+ click: (data) => {
509
+ return this.restoreAclRole(data)
510
+ .pipe(tap(() => {
511
+ this.list.forEach((l) => {
512
+ l.reload();
513
+ });
514
+ }), takeUntil(this._destroy$))
515
+ .subscribe();
516
+ },
517
+ label: 'Restore',
518
+ show: (row) => !!this.restoreAclRole && row.state === 'deleted',
519
+ },
520
+ ],
521
+ fetch: (query) => {
522
+ query.permissions = true;
523
+ return this.loadAclRoles(query)
524
+ .pipe(map((data) => data));
525
+ },
526
+ };
527
+ }
528
+ }
529
+ FsAclRolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAclRolesComponent, deps: [{ token: FsAppAclService }, { token: i2.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
530
+ FsAclRolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FsAclRolesComponent, selector: "fs-acl-roles", inputs: { deleteAclRole: "deleteAclRole", restoreAclRole: "restoreAclRole", saveAclRole: "saveAclRole", loadAclRoles: "loadAclRoles", loadAclRole: "loadAclRole", loadRoleConfigs: "loadRoleConfigs", aclLevels: "aclLevels", disabledAclRole: "disabledAclRole" }, viewQueries: [{ propertyName: "list", predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\" *ngIf=\"listConfig\">\n <fs-list-column title=\"Name\" name=\"name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.state !== 'deleted' else deletedRole\">\n <a (click)=\"openDialog(row)\">{{ row.name }}</a>\n </ng-container>\n <ng-template #deletedRole>\n {{ row.name }}\n </ng-template>\n <div class=\"small\">{{row.description}}</div>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"hierarchy\" title=\"Level\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{ indexedAclRoleLevels[row.level] }}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Permissions\">\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permissions\">\n <ng-container *ngFor=\"let permission of row.permissions\">\n <span *ngIf=\"permission.access\" class=\"permission\">\n <acl-permission-popover [permission]=\"permission\">{{permission.name}}</acl-permission-popover>\n </span>\n </ng-container>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [".permissions .permission+.permission:before{content:\", \"}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i13.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i13.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i13.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "component", type: FsAclPermissionPopoverComponent, selector: "acl-permission-popover", inputs: ["permission"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
531
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAclRolesComponent, decorators: [{
532
+ type: Component,
533
+ args: [{ selector: 'fs-acl-roles', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-list [config]=\"listConfig\" *ngIf=\"listConfig\">\n <fs-list-column title=\"Name\" name=\"name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.state !== 'deleted' else deletedRole\">\n <a (click)=\"openDialog(row)\">{{ row.name }}</a>\n </ng-container>\n <ng-template #deletedRole>\n {{ row.name }}\n </ng-template>\n <div class=\"small\">{{row.description}}</div>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"hierarchy\" title=\"Level\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{ indexedAclRoleLevels[row.level] }}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Permissions\">\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permissions\">\n <ng-container *ngFor=\"let permission of row.permissions\">\n <span *ngIf=\"permission.access\" class=\"permission\">\n <acl-permission-popover [permission]=\"permission\">{{permission.name}}</acl-permission-popover>\n </span>\n </ng-container>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [".permissions .permission+.permission:before{content:\", \"}\n"] }]
534
+ }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialog }]; }, propDecorators: { deleteAclRole: [{
535
+ type: Input
536
+ }], restoreAclRole: [{
537
+ type: Input
538
+ }], saveAclRole: [{
539
+ type: Input
540
+ }], loadAclRoles: [{
541
+ type: Input
542
+ }], loadAclRole: [{
543
+ type: Input
544
+ }], loadRoleConfigs: [{
545
+ type: Input
546
+ }], aclLevels: [{
547
+ type: Input
548
+ }], disabledAclRole: [{
549
+ type: Input
550
+ }], list: [{
551
+ type: ViewChildren,
552
+ args: [FsListComponent]
553
553
  }] } });
554
554
 
555
- class FsAclRolePopoverComponent {
556
- constructor(_appAclService) {
557
- this._appAclService = _appAclService;
558
- this.permissions = [];
559
- }
560
- ngOnInit() {
561
- const aclRolePermissions = this.aclRole.permissions || [];
562
- this._appAclService.getPermissions()
563
- .subscribe((response) => {
564
- this.permissions = response.filter(item => {
565
- return aclRolePermissions.some(permission => {
566
- return item.value === permission.value;
567
- });
568
- });
569
- });
570
- }
571
- }
572
- FsAclRolePopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAclRolePopoverComponent, deps: [{ token: FsAppAclService }], target: i0.ɵɵFactoryTarget.Component });
573
- FsAclRolePopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsAclRolePopoverComponent, selector: "fs-acl-role-popover", inputs: { aclRole: "aclRole", objectName: "objectName" }, ngImport: i0, template: "\n<fs-popover [template]=\"popover\" [maxWidth]=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n <div class=\"name small\">{{aclRole.name}}<span *ngIf=\"objectName\">: {{objectName}}</span></div>\n\n <ng-container *ngIf=\"permissions.length; else nonePermission\">\n <div *ngFor=\"let permission of permissions\" class=\"permission\">\n <div>{{permission.name}}</div>\n <div class=\"small\">{{permission.description}}</div>\n </div>\n </ng-container>\n\n <ng-template #nonePermission>\n None\n </ng-template>\n</ng-template>\n", styles: [".name{padding-bottom:10px}.permission+.permission{padding-top:5px}:host{cursor:pointer}\n"], components: [{ type: i2$1.FsPopoverComponent, selector: "fs-popover" }], directives: [{ type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
574
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAclRolePopoverComponent, decorators: [{
575
- type: Component,
576
- args: [{ selector: 'fs-acl-role-popover', template: "\n<fs-popover [template]=\"popover\" [maxWidth]=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n <div class=\"name small\">{{aclRole.name}}<span *ngIf=\"objectName\">: {{objectName}}</span></div>\n\n <ng-container *ngIf=\"permissions.length; else nonePermission\">\n <div *ngFor=\"let permission of permissions\" class=\"permission\">\n <div>{{permission.name}}</div>\n <div class=\"small\">{{permission.description}}</div>\n </div>\n </ng-container>\n\n <ng-template #nonePermission>\n None\n </ng-template>\n</ng-template>\n", styles: [".name{padding-bottom:10px}.permission+.permission{padding-top:5px}:host{cursor:pointer}\n"] }]
577
- }], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { aclRole: [{
578
- type: Input
579
- }], objectName: [{
580
- type: Input
555
+ class FsAclRolePopoverComponent {
556
+ constructor(_appAclService) {
557
+ this._appAclService = _appAclService;
558
+ this.permissions = [];
559
+ }
560
+ ngOnInit() {
561
+ const aclRolePermissions = this.aclRole.permissions || [];
562
+ this._appAclService.getPermissions()
563
+ .subscribe((response) => {
564
+ this.permissions = response.filter(item => {
565
+ return aclRolePermissions.some(permission => {
566
+ return item.value === permission.value;
567
+ });
568
+ });
569
+ });
570
+ }
571
+ }
572
+ FsAclRolePopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAclRolePopoverComponent, deps: [{ token: FsAppAclService }], target: i0.ɵɵFactoryTarget.Component });
573
+ FsAclRolePopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FsAclRolePopoverComponent, selector: "fs-acl-role-popover", inputs: { aclRole: "aclRole", objectName: "objectName" }, ngImport: i0, template: "\n<fs-popover [template]=\"popover\" [maxWidth]=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n <div class=\"name small\">{{aclRole.name}}<span *ngIf=\"objectName\">: {{objectName}}</span></div>\n\n <ng-container *ngIf=\"permissions.length; else nonePermission\">\n <div *ngFor=\"let permission of permissions\" class=\"permission\">\n <div>{{permission.name}}</div>\n <div class=\"small\">{{permission.description}}</div>\n </div>\n </ng-container>\n\n <ng-template #nonePermission>\n None\n </ng-template>\n</ng-template>\n", styles: [".name{padding-bottom:10px}.permission+.permission{padding-top:5px}:host{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.FsPopoverComponent, selector: "fs-popover" }] });
574
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAclRolePopoverComponent, decorators: [{
575
+ type: Component,
576
+ args: [{ selector: 'fs-acl-role-popover', template: "\n<fs-popover [template]=\"popover\" [maxWidth]=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n <div class=\"name small\">{{aclRole.name}}<span *ngIf=\"objectName\">: {{objectName}}</span></div>\n\n <ng-container *ngIf=\"permissions.length; else nonePermission\">\n <div *ngFor=\"let permission of permissions\" class=\"permission\">\n <div>{{permission.name}}</div>\n <div class=\"small\">{{permission.description}}</div>\n </div>\n </ng-container>\n\n <ng-template #nonePermission>\n None\n </ng-template>\n</ng-template>\n", styles: [".name{padding-bottom:10px}.permission+.permission{padding-top:5px}:host{cursor:pointer}\n"] }]
577
+ }], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { aclRole: [{
578
+ type: Input
579
+ }], objectName: [{
580
+ type: Input
581
581
  }] } });
582
582
 
583
- class FsAclObjectRolesComponent {
584
- constructor() {
585
- this.aclRoles = [];
586
- this.required = false;
587
- this.multiple = false;
588
- this.disabled = false;
589
- this.aclObjectRoles = [];
590
- this.rolesLabel = 'Roles';
591
- this.levelLabel = '';
592
- this.change = new EventEmitter();
593
- this.compareAclRole = (o1, o2) => {
594
- return o1 && o2 && o1.id === o2.id;
595
- };
596
- }
597
- changed() {
598
- this.change.emit(this.aclObjectRoles);
599
- }
600
- }
601
- FsAclObjectRolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAclObjectRolesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
602
- FsAclObjectRolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsAclObjectRolesComponent, selector: "fs-acl-object-roles", inputs: { aclRoles: "aclRoles", required: "required", multiple: "multiple", disabled: "disabled", aclObjectRoles: "aclObjectRoles", rolesLabel: "rolesLabel", levelLabel: "levelLabel" }, outputs: { change: "change" }, ngImport: i0, template: "<ng-container *ngIf=\"!multiple\">\n <ng-container *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <fs-checkbox-group\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n (ngModelChange)=\"changed()\"\n name=\"roles\"\n [compareWith]=\"compareAclRole\"\n [disabled]=\"disabled\"\n [label]=\"rolesLabel\"\n [fsFormRequired]=\"required\"\n orientation=\"vertical\">\n <mat-checkbox [disabled]=\"disabled\" *ngFor=\"let aclRole of aclRoles\" [value]=\"$any(aclRole)\">\n {{ aclRole.name }}\n </mat-checkbox>\n </fs-checkbox-group>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"multiple\">\n <table>\n <tr>\n <td>\n <small>{{levelLabel}}</small>\n </td>\n <td>\n <small>{{rolesLabel}}</small>\n </td>\n </tr>\n <tr *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <td>{{aclObjectRole.object.name}}</td>\n <td>\n <mat-form-field class=\"form-field-padless\">\n <mat-select\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n multiple=\"true\"\n [disabled]=\"disabled\"\n [compareWith]=\"compareAclRole\"\n (ngModelChange)=\"changed()\"\n name=\"aclRole_{{ aclObjectRole.object.id }}\">\n <mat-option *ngFor=\"let aclRole of aclRoles\" [value]=\"aclRole\">\n {{ aclRole.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </td>\n </tr>\n </table>\n</ng-container>\n", styles: ["table tr td:first-child{padding-right:15px}\n"], components: [{ type: i1.FsCheckboxGroupComponent, selector: "fs-checkbox-group", inputs: ["orientation", "position", "label", "disabled", "compareWith"], outputs: ["change"] }, { type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i10.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i11.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i15.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i15.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i16.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i16.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }] });
603
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAclObjectRolesComponent, decorators: [{
604
- type: Component,
605
- args: [{ selector: 'fs-acl-object-roles', viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], template: "<ng-container *ngIf=\"!multiple\">\n <ng-container *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <fs-checkbox-group\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n (ngModelChange)=\"changed()\"\n name=\"roles\"\n [compareWith]=\"compareAclRole\"\n [disabled]=\"disabled\"\n [label]=\"rolesLabel\"\n [fsFormRequired]=\"required\"\n orientation=\"vertical\">\n <mat-checkbox [disabled]=\"disabled\" *ngFor=\"let aclRole of aclRoles\" [value]=\"$any(aclRole)\">\n {{ aclRole.name }}\n </mat-checkbox>\n </fs-checkbox-group>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"multiple\">\n <table>\n <tr>\n <td>\n <small>{{levelLabel}}</small>\n </td>\n <td>\n <small>{{rolesLabel}}</small>\n </td>\n </tr>\n <tr *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <td>{{aclObjectRole.object.name}}</td>\n <td>\n <mat-form-field class=\"form-field-padless\">\n <mat-select\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n multiple=\"true\"\n [disabled]=\"disabled\"\n [compareWith]=\"compareAclRole\"\n (ngModelChange)=\"changed()\"\n name=\"aclRole_{{ aclObjectRole.object.id }}\">\n <mat-option *ngFor=\"let aclRole of aclRoles\" [value]=\"aclRole\">\n {{ aclRole.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </td>\n </tr>\n </table>\n</ng-container>\n", styles: ["table tr td:first-child{padding-right:15px}\n"] }]
606
- }], propDecorators: { aclRoles: [{
607
- type: Input
608
- }], required: [{
609
- type: Input
610
- }], multiple: [{
611
- type: Input
612
- }], disabled: [{
613
- type: Input
614
- }], aclObjectRoles: [{
615
- type: Input
616
- }], rolesLabel: [{
617
- type: Input
618
- }], levelLabel: [{
619
- type: Input
620
- }], change: [{
621
- type: Output
583
+ class FsAclObjectRolesComponent {
584
+ constructor() {
585
+ this.aclRoles = [];
586
+ this.required = false;
587
+ this.multiple = false;
588
+ this.disabled = false;
589
+ this.aclObjectRoles = [];
590
+ this.rolesLabel = 'Roles';
591
+ this.levelLabel = '';
592
+ this.change = new EventEmitter();
593
+ this.compareAclRole = (o1, o2) => {
594
+ return o1 && o2 && o1.id === o2.id;
595
+ };
596
+ }
597
+ changed() {
598
+ this.change.emit(this.aclObjectRoles);
599
+ }
600
+ }
601
+ FsAclObjectRolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAclObjectRolesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
602
+ FsAclObjectRolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FsAclObjectRolesComponent, selector: "fs-acl-object-roles", inputs: { aclRoles: "aclRoles", required: "required", multiple: "multiple", disabled: "disabled", aclObjectRoles: "aclObjectRoles", rolesLabel: "rolesLabel", levelLabel: "levelLabel" }, outputs: { change: "change" }, ngImport: i0, template: "<ng-container *ngIf=\"!multiple\">\n <ng-container *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <fs-checkbox-group\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n (ngModelChange)=\"changed()\"\n name=\"roles\"\n [compareWith]=\"compareAclRole\"\n [disabled]=\"disabled\"\n [label]=\"rolesLabel\"\n [fsFormRequired]=\"required\"\n orientation=\"vertical\">\n <mat-checkbox [disabled]=\"disabled\" *ngFor=\"let aclRole of aclRoles\" [value]=\"$any(aclRole)\">\n {{ aclRole.name }}\n </mat-checkbox>\n </fs-checkbox-group>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"multiple\">\n <table>\n <tr>\n <td>\n <small>{{levelLabel}}</small>\n </td>\n <td>\n <small>{{rolesLabel}}</small>\n </td>\n </tr>\n <tr *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <td>{{aclObjectRole.object.name}}</td>\n <td>\n <mat-form-field class=\"form-field-padless\">\n <mat-select\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n multiple=\"true\"\n [disabled]=\"disabled\"\n [compareWith]=\"compareAclRole\"\n (ngModelChange)=\"changed()\"\n name=\"aclRole_{{ aclObjectRole.object.id }}\">\n <mat-option *ngFor=\"let aclRole of aclRoles\" [value]=\"aclRole\">\n {{ aclRole.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </td>\n </tr>\n </table>\n</ng-container>\n", styles: ["table tr td:first-child{padding-right:15px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i7.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i8.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i9.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i15.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { kind: "directive", type: i15.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { kind: "component", type: i8$1.FsCheckboxGroupComponent, selector: "fs-checkbox-group", inputs: ["orientation", "position", "label", "disabled", "compareWith"], outputs: ["change"] }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }] });
603
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAclObjectRolesComponent, decorators: [{
604
+ type: Component,
605
+ args: [{ selector: 'fs-acl-object-roles', viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], template: "<ng-container *ngIf=\"!multiple\">\n <ng-container *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <fs-checkbox-group\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n (ngModelChange)=\"changed()\"\n name=\"roles\"\n [compareWith]=\"compareAclRole\"\n [disabled]=\"disabled\"\n [label]=\"rolesLabel\"\n [fsFormRequired]=\"required\"\n orientation=\"vertical\">\n <mat-checkbox [disabled]=\"disabled\" *ngFor=\"let aclRole of aclRoles\" [value]=\"$any(aclRole)\">\n {{ aclRole.name }}\n </mat-checkbox>\n </fs-checkbox-group>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"multiple\">\n <table>\n <tr>\n <td>\n <small>{{levelLabel}}</small>\n </td>\n <td>\n <small>{{rolesLabel}}</small>\n </td>\n </tr>\n <tr *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <td>{{aclObjectRole.object.name}}</td>\n <td>\n <mat-form-field class=\"form-field-padless\">\n <mat-select\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n multiple=\"true\"\n [disabled]=\"disabled\"\n [compareWith]=\"compareAclRole\"\n (ngModelChange)=\"changed()\"\n name=\"aclRole_{{ aclObjectRole.object.id }}\">\n <mat-option *ngFor=\"let aclRole of aclRoles\" [value]=\"aclRole\">\n {{ aclRole.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </td>\n </tr>\n </table>\n</ng-container>\n", styles: ["table tr td:first-child{padding-right:15px}\n"] }]
606
+ }], propDecorators: { aclRoles: [{
607
+ type: Input
608
+ }], required: [{
609
+ type: Input
610
+ }], multiple: [{
611
+ type: Input
612
+ }], disabled: [{
613
+ type: Input
614
+ }], aclObjectRoles: [{
615
+ type: Input
616
+ }], rolesLabel: [{
617
+ type: Input
618
+ }], levelLabel: [{
619
+ type: Input
620
+ }], change: [{
621
+ type: Output
622
622
  }] } });
623
623
 
624
- class FsAclEntryComponent {
625
- constructor(_appAclService, _dialogRef, _message, _data) {
626
- this._appAclService = _appAclService;
627
- this._dialogRef = _dialogRef;
628
- this._message = _message;
629
- this._data = _data;
630
- this.aclRoles = [];
631
- this.aclEntries = [];
632
- this.indexedAclRoleLevels = {};
633
- this.titleEdit = 'Edit Roles';
634
- this.titleAdd = 'Assign Roles';
635
- this.required = true;
636
- this.save = () => {
637
- const aclObjectEntry = {
638
- ...this.aclObjectEntry,
639
- aclEntries: this.aclEntries,
640
- };
641
- return this._data.saveAclObjectEntry(aclObjectEntry)
642
- .pipe(tap((data) => {
643
- this._message.success('Saved Changes');
644
- this.close(data);
645
- }));
646
- };
647
- this.aclObjectEntry = { ..._data.aclObjectEntry };
648
- this.required = _data.required ?? true;
649
- if (_data.titleEdit) {
650
- this.titleEdit = _data.titleEdit;
651
- }
652
- if (_data.titleAdd) {
653
- this.titleAdd = _data.titleAdd;
654
- }
655
- }
656
- ngOnInit() {
657
- forkJoin(this._data.loadAclRoles({
658
- level: this.aclObjectEntry.level,
659
- environmentId: this.aclObjectEntry.environmentId || null,
660
- }), this._appAclService.getIndexedLevels())
661
- .subscribe(([aclRoles, levels,]) => {
662
- this.aclRoles = aclRoles;
663
- this.indexedAclRoleLevels = levels;
664
- this.aclObjectRole = {
665
- object: this.aclObjectEntry.object,
666
- aclRoles: this.aclObjectEntry.aclEntries
667
- .map((aclEntry) => {
668
- return aclEntry.aclRole;
669
- }),
670
- };
671
- });
672
- }
673
- aclObjectRoleChange(aclObjectRoles) {
674
- this.aclEntries = aclObjectRoles.reduce((aclEntries, aclObjectRole) => {
675
- aclObjectRole.aclRoles.forEach(aclRole => {
676
- aclEntries.push({
677
- aclRoleId: aclRole.id,
678
- aclRole: aclRole,
679
- objectId: aclObjectRole.object ? aclObjectRole.object.id : null,
680
- object: aclObjectRole.object || null
681
- });
682
- });
683
- return aclEntries;
684
- }, []);
685
- }
686
- close(data = null) {
687
- this._dialogRef.close(data);
688
- }
689
- }
690
- FsAclEntryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAclEntryComponent, deps: [{ token: FsAppAclService }, { token: i2.MatDialogRef }, { token: i3.FsMessage }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
691
- FsAclEntryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsAclEntryComponent, selector: "ng-component", ngImport: i0, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <div mat-dialog-title>{{ titleEdit? titleEdit : titleAdd }}</div>\n <mat-dialog-content>\n <div *ngIf=\"aclObjectRole\">\n <fs-label-field *ngIf=\"aclObjectEntry.object\">\n <fs-label>{{indexedAclRoleLevels[aclObjectEntry.level]}}</fs-label>\n {{aclObjectEntry.object.name}}\n </fs-label-field>\n\n <fs-acl-object-roles\n [aclRoles]=\"aclRoles\"\n [aclObjectRoles]=\"[aclObjectRole]\"\n [required]=\"required\"\n (change)=\"aclObjectRoleChange($event)\">\n </fs-acl-object-roles>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\">Save</button>\n <button mat-button mat-dialog-close type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["::ng-deep .account-roles-autocomplete-panel .mat-option{line-height:normal}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text{display:flex;flex-direction:row;align-items:center}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text fs-badge{margin-right:5px}\n"], components: [{ type: i4.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i6.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i6.FsLabelComponent, selector: "fs-label" }, { type: FsAclObjectRolesComponent, selector: "fs-acl-object-roles", inputs: ["aclRoles", "required", "multiple", "disabled", "aclObjectRoles", "rolesLabel", "levelLabel"], outputs: ["change"] }, { type: i14.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i15.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i15.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i15.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i16.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i16.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] });
692
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAclEntryComponent, decorators: [{
693
- type: Component,
694
- args: [{ template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <div mat-dialog-title>{{ titleEdit? titleEdit : titleAdd }}</div>\n <mat-dialog-content>\n <div *ngIf=\"aclObjectRole\">\n <fs-label-field *ngIf=\"aclObjectEntry.object\">\n <fs-label>{{indexedAclRoleLevels[aclObjectEntry.level]}}</fs-label>\n {{aclObjectEntry.object.name}}\n </fs-label-field>\n\n <fs-acl-object-roles\n [aclRoles]=\"aclRoles\"\n [aclObjectRoles]=\"[aclObjectRole]\"\n [required]=\"required\"\n (change)=\"aclObjectRoleChange($event)\">\n </fs-acl-object-roles>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\">Save</button>\n <button mat-button mat-dialog-close type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["::ng-deep .account-roles-autocomplete-panel .mat-option{line-height:normal}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text{display:flex;flex-direction:row;align-items:center}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text fs-badge{margin-right:5px}\n"] }]
695
- }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialogRef }, { type: i3.FsMessage }, { type: undefined, decorators: [{
696
- type: Inject,
697
- args: [MAT_DIALOG_DATA]
624
+ class FsAclEntryComponent {
625
+ constructor(_appAclService, _dialogRef, _message, _data) {
626
+ this._appAclService = _appAclService;
627
+ this._dialogRef = _dialogRef;
628
+ this._message = _message;
629
+ this._data = _data;
630
+ this.aclRoles = [];
631
+ this.aclEntries = [];
632
+ this.indexedAclRoleLevels = {};
633
+ this.titleEdit = 'Edit Roles';
634
+ this.titleAdd = 'Assign Roles';
635
+ this.required = true;
636
+ this.save = () => {
637
+ const aclObjectEntry = {
638
+ ...this.aclObjectEntry,
639
+ aclEntries: this.aclEntries,
640
+ };
641
+ return this._data.saveAclObjectEntry(aclObjectEntry)
642
+ .pipe(tap((data) => {
643
+ this._message.success('Saved Changes');
644
+ this.close(data);
645
+ }));
646
+ };
647
+ this.aclObjectEntry = { ..._data.aclObjectEntry };
648
+ this.required = _data.required ?? true;
649
+ if (_data.titleEdit) {
650
+ this.titleEdit = _data.titleEdit;
651
+ }
652
+ if (_data.titleAdd) {
653
+ this.titleAdd = _data.titleAdd;
654
+ }
655
+ }
656
+ ngOnInit() {
657
+ forkJoin(this._data.loadAclRoles({
658
+ level: this.aclObjectEntry.level,
659
+ environmentId: this.aclObjectEntry.environmentId || null,
660
+ }), this._appAclService.getIndexedLevels())
661
+ .subscribe(([aclRoles, levels,]) => {
662
+ this.aclRoles = aclRoles;
663
+ this.indexedAclRoleLevels = levels;
664
+ this.aclObjectRole = {
665
+ object: this.aclObjectEntry.object,
666
+ aclRoles: this.aclObjectEntry.aclEntries
667
+ .map((aclEntry) => {
668
+ return aclEntry.aclRole;
669
+ }),
670
+ };
671
+ });
672
+ }
673
+ aclObjectRoleChange(aclObjectRoles) {
674
+ this.aclEntries = aclObjectRoles.reduce((aclEntries, aclObjectRole) => {
675
+ aclObjectRole.aclRoles.forEach(aclRole => {
676
+ aclEntries.push({
677
+ aclRoleId: aclRole.id,
678
+ aclRole: aclRole,
679
+ objectId: aclObjectRole.object ? aclObjectRole.object.id : null,
680
+ object: aclObjectRole.object || null
681
+ });
682
+ });
683
+ return aclEntries;
684
+ }, []);
685
+ }
686
+ close(data = null) {
687
+ this._dialogRef.close(data);
688
+ }
689
+ }
690
+ FsAclEntryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAclEntryComponent, deps: [{ token: FsAppAclService }, { token: i2.MatDialogRef }, { token: i3.FsMessage }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
691
+ FsAclEntryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FsAclEntryComponent, selector: "ng-component", ngImport: i0, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <div mat-dialog-title>{{ titleEdit? titleEdit : titleAdd }}</div>\n <mat-dialog-content>\n <div *ngIf=\"aclObjectRole\">\n <fs-label-field *ngIf=\"aclObjectEntry.object\">\n <fs-label>{{indexedAclRoleLevels[aclObjectEntry.level]}}</fs-label>\n {{aclObjectEntry.object.name}}\n </fs-label-field>\n\n <fs-acl-object-roles\n [aclRoles]=\"aclRoles\"\n [aclObjectRoles]=\"[aclObjectRole]\"\n [required]=\"required\"\n (change)=\"aclObjectRoleChange($event)\">\n </fs-acl-object-roles>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\">Save</button>\n <button mat-button mat-dialog-close type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["::ng-deep .account-roles-autocomplete-panel .mat-option{line-height:normal}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text{display:flex;flex-direction:row;align-items:center}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text fs-badge{margin-right:5px}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i10.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i14.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { kind: "directive", type: i15.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { kind: "directive", type: i15.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { kind: "component", type: i16.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i16.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "component", type: FsAclObjectRolesComponent, selector: "fs-acl-object-roles", inputs: ["aclRoles", "required", "multiple", "disabled", "aclObjectRoles", "rolesLabel", "levelLabel"], outputs: ["change"] }] });
692
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAclEntryComponent, decorators: [{
693
+ type: Component,
694
+ args: [{ template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <div mat-dialog-title>{{ titleEdit? titleEdit : titleAdd }}</div>\n <mat-dialog-content>\n <div *ngIf=\"aclObjectRole\">\n <fs-label-field *ngIf=\"aclObjectEntry.object\">\n <fs-label>{{indexedAclRoleLevels[aclObjectEntry.level]}}</fs-label>\n {{aclObjectEntry.object.name}}\n </fs-label-field>\n\n <fs-acl-object-roles\n [aclRoles]=\"aclRoles\"\n [aclObjectRoles]=\"[aclObjectRole]\"\n [required]=\"required\"\n (change)=\"aclObjectRoleChange($event)\">\n </fs-acl-object-roles>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\">Save</button>\n <button mat-button mat-dialog-close type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["::ng-deep .account-roles-autocomplete-panel .mat-option{line-height:normal}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text{display:flex;flex-direction:row;align-items:center}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text fs-badge{margin-right:5px}\n"] }]
695
+ }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialogRef }, { type: i3.FsMessage }, { type: undefined, decorators: [{
696
+ type: Inject,
697
+ args: [MAT_DIALOG_DATA]
698
698
  }] }]; } });
699
699
 
700
- class FsAclEntriesComponent {
701
- constructor(_appAclService, _dialog, _confirm) {
702
- this._appAclService = _appAclService;
703
- this._dialog = _dialog;
704
- this._confirm = _confirm;
705
- this.environmentShow = true;
706
- this.environmentLabel = 'Environment';
707
- this.environmentKey = 'environment';
708
- this.actions = [];
709
- this.aclEntriesList = null;
710
- this.aclEntriesConfig = null;
711
- this.permissions = [];
712
- this._destroy$ = new Subject();
713
- }
714
- ngOnInit() {
715
- this._appAclService.getPermissions()
716
- .subscribe(response => {
717
- this.permissions = response;
718
- });
719
- this.aclEntriesConfig = {
720
- status: false,
721
- paging: false,
722
- actions: this.actions,
723
- rowActions: [
724
- {
725
- label: 'Remove All Roles',
726
- click: (aclObjectEntry) => {
727
- this._confirm
728
- .confirm({
729
- title: 'Remove All Roles',
730
- commitLabel: 'Save',
700
+ class FsAclEntriesComponent {
701
+ constructor(_appAclService, _dialog, _confirm) {
702
+ this._appAclService = _appAclService;
703
+ this._dialog = _dialog;
704
+ this._confirm = _confirm;
705
+ this.environmentShow = true;
706
+ this.environmentLabel = 'Environment';
707
+ this.environmentKey = 'environment';
708
+ this.actions = [];
709
+ this.aclEntriesList = null;
710
+ this.aclEntriesConfig = null;
711
+ this.permissions = [];
712
+ this._destroy$ = new Subject();
713
+ }
714
+ ngOnInit() {
715
+ this._appAclService.getPermissions()
716
+ .subscribe(response => {
717
+ this.permissions = response;
718
+ });
719
+ this.aclEntriesConfig = {
720
+ status: false,
721
+ paging: false,
722
+ actions: this.actions,
723
+ rowActions: [
724
+ {
725
+ label: 'Remove All Roles',
726
+ click: (aclObjectEntry) => {
727
+ this._confirm
728
+ .confirm({
729
+ title: 'Remove All Roles',
730
+ commitLabel: 'Save',
731
731
  template: `Please note that removing roles may prevent users from being able to successfully login.<br>
732
732
  These changes are effective immediately.<br>
733
- Are you sure you would like to continue?`,
734
- }).subscribe(() => {
735
- const data = { ...aclObjectEntry, aclEntries: [] };
736
- this.saveAclObjectEntry(data)
737
- .subscribe(() => {
738
- this.aclEntriesList.reload();
739
- });
740
- });
741
- }
742
- }
743
- ],
744
- fetch: () => {
745
- return new Observable((observer) => {
746
- this.loadAclEntries({
747
- aclRoles: true,
748
- aclRolePermissions: true,
749
- objects: true,
750
- aclRoleState: 'active',
751
- })
752
- .subscribe((aclEntries) => {
753
- const objects = aclEntries
754
- .filter((aclEntry) => (!!aclEntry.object))
755
- .reduce((items, item) => {
756
- return {
757
- ...items,
758
- [item.object.id]: item.object,
759
- };
760
- }, {});
761
- const environments = aclEntries
762
- .filter((aclEntry) => (!!aclEntry[this.environmentKey]))
763
- .reduce((items, item) => {
764
- const environment = item[this.environmentKey];
765
- return {
766
- ...items,
767
- [environment.id]: environment,
768
- };
769
- }, {});
770
- const groupedAclEntries = groupBy(aclEntries, (item) => {
771
- const environmentId = (item[this.environmentKey])?.id;
772
- return [item.aclRole.level, environmentId, item.objectId];
773
- });
774
- let aclObjectEntries = Object.keys(groupedAclEntries)
775
- .reduce((accum, key) => {
776
- const parts = key.split(',');
777
- return [
778
- ...accum,
779
- {
780
- object: objects[parts[2]],
781
- level: parts[0],
782
- [`${this.environmentKey}Id`]: parts[1] ? parseInt(parts[1]) : null,
783
- [this.environmentKey]: environments[parts[1]],
784
- aclEntries: groupedAclEntries[key],
785
- }
786
- ];
787
- }, []);
788
- const hasApp = aclObjectEntries.some((item) => {
789
- return item.aclEntries.some((entry) => {
790
- return !entry.objectId;
791
- });
792
- });
793
- if (!hasApp) {
794
- aclObjectEntries.unshift({
795
- object: null,
796
- aclEntries: [],
797
- level: 'app',
798
- environmentId: null,
799
- });
800
- }
801
- aclObjectEntries = sortBy(aclObjectEntries, (item) => {
802
- return item.object ? item.level : '';
803
- });
804
- observer.next({ data: aclObjectEntries });
805
- observer.complete();
806
- });
807
- });
808
- },
809
- };
810
- }
811
- update(aclObjectEntry) {
812
- const data = {
813
- aclObjectEntry,
814
- required: false,
815
- loadAclRoles: this.loadAclRoles,
816
- saveAclObjectEntry: this.saveAclObjectEntry
817
- };
818
- this._dialog.open(FsAclEntryComponent, {
819
- data: data
820
- })
821
- .afterClosed()
822
- .pipe(takeUntil(this._destroy$))
823
- .subscribe(() => {
824
- this.aclEntriesList.reload();
825
- });
826
- }
827
- ngOnDestroy() {
828
- this._destroy$.next();
829
- this._destroy$.complete();
830
- }
831
- reload() {
832
- this.aclEntriesList.reload();
833
- }
834
- }
835
- FsAclEntriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAclEntriesComponent, deps: [{ token: FsAppAclService }, { token: i2.MatDialog }, { token: i3$1.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
836
- FsAclEntriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsAclEntriesComponent, selector: "fs-acl-entries", inputs: { loadAclEntries: "loadAclEntries", loadAclRoles: "loadAclRoles", saveAclObjectEntry: "saveAclObjectEntry", environmentShow: "environmentShow", environmentLabel: "environmentLabel", environmentKey: "environmentKey", actions: "actions" }, viewQueries: [{ propertyName: "aclEntriesList", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "\n<fs-list [config]=\"aclEntriesConfig\">\n <fs-list-column>\n <ng-template fs-list-header>Context</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div\n *ngIf=\"row.object; else elseObject\"\n class=\"fs-row.gap-small\">\n <fs-badge *ngIf=\"row.object.imageUrl\" shape=\"circle\" image=\"{{ row.object.imageUrl }}\"></fs-badge>\n <span>\n <div><small>{{ row.object.className }}</small></div>\n <a (click)=\"update(row)\">{{ row.object.name }}</a>\n </span>\n </div>\n\n <ng-template #elseObject>\n <a (click)=\"update(row)\">App</a>\n </ng-template>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column [show]=\"environmentShow\">\n <ng-template fs-list-header>{{environmentLabel}}</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.environment?.name}}\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Roles</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"fs-column\">\n <div div *ngFor=\"let aclEntry of row.aclEntries\">\n <ng-container [ngSwitch]=\"row.level\">\n <ng-container *ngSwitchCase=\"'app'\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\" objectName=\"App\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"row.object\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], components: [{ type: i12.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i5$1.FsBadgeComponent, selector: "fs-badge", inputs: ["color", "text", "tooltip", "size", "shape", "image", "icon", "iconSize", "iconColor", "backgroundSize"] }, { type: FsAclRolePopoverComponent, selector: "fs-acl-role-popover", inputs: ["aclRole", "objectName"] }], directives: [{ type: i12.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { type: i12.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i12.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i7$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
837
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAclEntriesComponent, decorators: [{
838
- type: Component,
839
- args: [{ selector: 'fs-acl-entries', template: "\n<fs-list [config]=\"aclEntriesConfig\">\n <fs-list-column>\n <ng-template fs-list-header>Context</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div\n *ngIf=\"row.object; else elseObject\"\n class=\"fs-row.gap-small\">\n <fs-badge *ngIf=\"row.object.imageUrl\" shape=\"circle\" image=\"{{ row.object.imageUrl }}\"></fs-badge>\n <span>\n <div><small>{{ row.object.className }}</small></div>\n <a (click)=\"update(row)\">{{ row.object.name }}</a>\n </span>\n </div>\n\n <ng-template #elseObject>\n <a (click)=\"update(row)\">App</a>\n </ng-template>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column [show]=\"environmentShow\">\n <ng-template fs-list-header>{{environmentLabel}}</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.environment?.name}}\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Roles</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"fs-column\">\n <div div *ngFor=\"let aclEntry of row.aclEntries\">\n <ng-container [ngSwitch]=\"row.level\">\n <ng-container *ngSwitchCase=\"'app'\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\" objectName=\"App\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"row.object\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""] }]
840
- }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialog }, { type: i3$1.FsPrompt }]; }, propDecorators: { loadAclEntries: [{
841
- type: Input
842
- }], loadAclRoles: [{
843
- type: Input
844
- }], saveAclObjectEntry: [{
845
- type: Input
846
- }], environmentShow: [{
847
- type: Input
848
- }], environmentLabel: [{
849
- type: Input
850
- }], environmentKey: [{
851
- type: Input
852
- }], actions: [{
853
- type: Input
854
- }], aclEntriesList: [{
855
- type: ViewChild,
856
- args: [FsListComponent]
733
+ Are you sure you would like to continue?`,
734
+ }).subscribe(() => {
735
+ const data = { ...aclObjectEntry, aclEntries: [] };
736
+ this.saveAclObjectEntry(data)
737
+ .subscribe(() => {
738
+ this.aclEntriesList.reload();
739
+ });
740
+ });
741
+ }
742
+ }
743
+ ],
744
+ fetch: () => {
745
+ return new Observable((observer) => {
746
+ this.loadAclEntries({
747
+ aclRoles: true,
748
+ aclRolePermissions: true,
749
+ objects: true,
750
+ aclRoleState: 'active',
751
+ })
752
+ .subscribe((aclEntries) => {
753
+ const objects = aclEntries
754
+ .filter((aclEntry) => (!!aclEntry.object))
755
+ .reduce((items, item) => {
756
+ return {
757
+ ...items,
758
+ [item.object.id]: item.object,
759
+ };
760
+ }, {});
761
+ const environments = aclEntries
762
+ .filter((aclEntry) => (!!aclEntry[this.environmentKey]))
763
+ .reduce((items, item) => {
764
+ const environment = item[this.environmentKey];
765
+ return {
766
+ ...items,
767
+ [environment.id]: environment,
768
+ };
769
+ }, {});
770
+ const groupedAclEntries = groupBy(aclEntries, (item) => {
771
+ const environmentId = (item[this.environmentKey])?.id;
772
+ return [item.aclRole.level, environmentId, item.objectId];
773
+ });
774
+ let aclObjectEntries = Object.keys(groupedAclEntries)
775
+ .reduce((accum, key) => {
776
+ const parts = key.split(',');
777
+ return [
778
+ ...accum,
779
+ {
780
+ object: objects[parts[2]],
781
+ level: parts[0],
782
+ [`${this.environmentKey}Id`]: parts[1] ? parseInt(parts[1]) : null,
783
+ [this.environmentKey]: environments[parts[1]],
784
+ aclEntries: groupedAclEntries[key],
785
+ }
786
+ ];
787
+ }, []);
788
+ const hasApp = aclObjectEntries.some((item) => {
789
+ return item.aclEntries.some((entry) => {
790
+ return !entry.objectId;
791
+ });
792
+ });
793
+ if (!hasApp) {
794
+ aclObjectEntries.unshift({
795
+ object: null,
796
+ aclEntries: [],
797
+ level: 'app',
798
+ environmentId: null,
799
+ });
800
+ }
801
+ aclObjectEntries = sortBy(aclObjectEntries, (item) => {
802
+ return item.object ? item.level : '';
803
+ });
804
+ observer.next({ data: aclObjectEntries });
805
+ observer.complete();
806
+ });
807
+ });
808
+ },
809
+ };
810
+ }
811
+ update(aclObjectEntry) {
812
+ const data = {
813
+ aclObjectEntry,
814
+ required: false,
815
+ loadAclRoles: this.loadAclRoles,
816
+ saveAclObjectEntry: this.saveAclObjectEntry
817
+ };
818
+ this._dialog.open(FsAclEntryComponent, {
819
+ data: data
820
+ })
821
+ .afterClosed()
822
+ .pipe(takeUntil(this._destroy$))
823
+ .subscribe(() => {
824
+ this.aclEntriesList.reload();
825
+ });
826
+ }
827
+ ngOnDestroy() {
828
+ this._destroy$.next();
829
+ this._destroy$.complete();
830
+ }
831
+ reload() {
832
+ this.aclEntriesList.reload();
833
+ }
834
+ }
835
+ FsAclEntriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAclEntriesComponent, deps: [{ token: FsAppAclService }, { token: i2.MatDialog }, { token: i3$1.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
836
+ FsAclEntriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FsAclEntriesComponent, selector: "fs-acl-entries", inputs: { loadAclEntries: "loadAclEntries", loadAclRoles: "loadAclRoles", saveAclObjectEntry: "saveAclObjectEntry", environmentShow: "environmentShow", environmentLabel: "environmentLabel", environmentKey: "environmentKey", actions: "actions" }, viewQueries: [{ propertyName: "aclEntriesList", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "\n<fs-list [config]=\"aclEntriesConfig\">\n <fs-list-column>\n <ng-template fs-list-header>Context</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div\n *ngIf=\"row.object; else elseObject\"\n class=\"fs-row.gap-small\">\n <fs-badge *ngIf=\"row.object.imageUrl\" shape=\"circle\" image=\"{{ row.object.imageUrl }}\"></fs-badge>\n <span>\n <div><small>{{ row.object.className }}</small></div>\n <a (click)=\"update(row)\">{{ row.object.name }}</a>\n </span>\n </div>\n\n <ng-template #elseObject>\n <a (click)=\"update(row)\">App</a>\n </ng-template>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column [show]=\"environmentShow\">\n <ng-template fs-list-header>{{environmentLabel}}</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.environment?.name}}\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Roles</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"fs-column\">\n <div div *ngFor=\"let aclEntry of row.aclEntries\">\n <ng-container [ngSwitch]=\"row.level\">\n <ng-container *ngSwitchCase=\"'app'\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\" objectName=\"App\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"row.object\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i13.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i13.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i13.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "directive", type: i13.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { kind: "component", type: i6$1.FsBadgeComponent, selector: "fs-badge", inputs: ["color", "text", "tooltip", "size", "shape", "image", "icon", "iconSize", "iconColor", "backgroundSize"] }, { kind: "component", type: FsAclRolePopoverComponent, selector: "fs-acl-role-popover", inputs: ["aclRole", "objectName"] }] });
837
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAclEntriesComponent, decorators: [{
838
+ type: Component,
839
+ args: [{ selector: 'fs-acl-entries', template: "\n<fs-list [config]=\"aclEntriesConfig\">\n <fs-list-column>\n <ng-template fs-list-header>Context</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div\n *ngIf=\"row.object; else elseObject\"\n class=\"fs-row.gap-small\">\n <fs-badge *ngIf=\"row.object.imageUrl\" shape=\"circle\" image=\"{{ row.object.imageUrl }}\"></fs-badge>\n <span>\n <div><small>{{ row.object.className }}</small></div>\n <a (click)=\"update(row)\">{{ row.object.name }}</a>\n </span>\n </div>\n\n <ng-template #elseObject>\n <a (click)=\"update(row)\">App</a>\n </ng-template>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column [show]=\"environmentShow\">\n <ng-template fs-list-header>{{environmentLabel}}</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.environment?.name}}\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Roles</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"fs-column\">\n <div div *ngFor=\"let aclEntry of row.aclEntries\">\n <ng-container [ngSwitch]=\"row.level\">\n <ng-container *ngSwitchCase=\"'app'\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\" objectName=\"App\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"row.object\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n" }]
840
+ }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialog }, { type: i3$1.FsPrompt }]; }, propDecorators: { loadAclEntries: [{
841
+ type: Input
842
+ }], loadAclRoles: [{
843
+ type: Input
844
+ }], saveAclObjectEntry: [{
845
+ type: Input
846
+ }], environmentShow: [{
847
+ type: Input
848
+ }], environmentLabel: [{
849
+ type: Input
850
+ }], environmentKey: [{
851
+ type: Input
852
+ }], actions: [{
853
+ type: Input
854
+ }], aclEntriesList: [{
855
+ type: ViewChild,
856
+ args: [FsListComponent]
857
857
  }] } });
858
858
 
859
- class FsAppAclModule {
860
- }
861
- FsAppAclModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppAclModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
862
- FsAppAclModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppAclModule, declarations: [FsAclRolesComponent,
863
- FsAclPermissionPopoverComponent,
864
- FsAclRoleComponent,
865
- FsAclEntriesComponent,
866
- FsAclRolePopoverComponent,
867
- FsAclObjectRolesComponent,
868
- FsAclEntryComponent,
869
- BulkOptionsFilterPipe,
870
- AclRolePermissionAvailablePipe], imports: [CommonModule,
871
- FormsModule,
872
- MatDialogModule,
873
- MatFormFieldModule,
874
- MatCheckboxModule,
875
- MatSelectModule,
876
- MatButtonModule,
877
- MatRadioModule,
878
- MatInputModule,
879
- FsListModule,
880
- FsPopoverModule,
881
- FsDialogModule,
882
- FsFormModule,
883
- FsLabelModule,
884
- FsRadioGroupModule,
885
- FsBadgeModule,
886
- FsCheckboxGroupModule,
887
- FsMenuModule], exports: [FsAclRolesComponent,
888
- FsAclPermissionPopoverComponent,
889
- FsAclRoleComponent,
890
- FsAclEntriesComponent,
891
- FsAclRolePopoverComponent,
892
- FsAclObjectRolesComponent,
893
- FsAclEntryComponent] });
894
- FsAppAclModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppAclModule, imports: [[
895
- CommonModule,
896
- FormsModule,
897
- MatDialogModule,
898
- MatFormFieldModule,
899
- MatCheckboxModule,
900
- MatSelectModule,
901
- MatButtonModule,
902
- MatRadioModule,
903
- MatInputModule,
904
- FsListModule,
905
- FsPopoverModule,
906
- FsDialogModule,
907
- FsFormModule,
908
- FsLabelModule,
909
- FsRadioGroupModule,
910
- FsBadgeModule,
911
- FsCheckboxGroupModule,
912
- FsMenuModule,
913
- ]] });
914
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppAclModule, decorators: [{
915
- type: NgModule,
916
- args: [{
917
- imports: [
918
- CommonModule,
919
- FormsModule,
920
- MatDialogModule,
921
- MatFormFieldModule,
922
- MatCheckboxModule,
923
- MatSelectModule,
924
- MatButtonModule,
925
- MatRadioModule,
926
- MatInputModule,
927
- FsListModule,
928
- FsPopoverModule,
929
- FsDialogModule,
930
- FsFormModule,
931
- FsLabelModule,
932
- FsRadioGroupModule,
933
- FsBadgeModule,
934
- FsCheckboxGroupModule,
935
- FsMenuModule,
936
- ],
937
- declarations: [
938
- FsAclRolesComponent,
939
- FsAclPermissionPopoverComponent,
940
- FsAclRoleComponent,
941
- FsAclEntriesComponent,
942
- FsAclRolePopoverComponent,
943
- FsAclObjectRolesComponent,
944
- FsAclEntryComponent,
945
- BulkOptionsFilterPipe,
946
- AclRolePermissionAvailablePipe,
947
- ],
948
- exports: [
949
- FsAclRolesComponent,
950
- FsAclPermissionPopoverComponent,
951
- FsAclRoleComponent,
952
- FsAclEntriesComponent,
953
- FsAclRolePopoverComponent,
954
- FsAclObjectRolesComponent,
955
- FsAclEntryComponent,
956
- ],
957
- }]
859
+ class FsAppAclModule {
860
+ }
861
+ FsAppAclModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppAclModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
862
+ FsAppAclModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: FsAppAclModule, declarations: [FsAclRolesComponent,
863
+ FsAclPermissionPopoverComponent,
864
+ FsAclRoleComponent,
865
+ FsAclEntriesComponent,
866
+ FsAclRolePopoverComponent,
867
+ FsAclObjectRolesComponent,
868
+ FsAclEntryComponent,
869
+ BulkOptionsFilterPipe,
870
+ AclRolePermissionAvailablePipe], imports: [CommonModule,
871
+ FormsModule,
872
+ MatDialogModule,
873
+ MatFormFieldModule,
874
+ MatCheckboxModule,
875
+ MatSelectModule,
876
+ MatButtonModule,
877
+ MatRadioModule,
878
+ MatInputModule,
879
+ FsListModule,
880
+ FsPopoverModule,
881
+ FsDialogModule,
882
+ FsFormModule,
883
+ FsLabelModule,
884
+ FsRadioGroupModule,
885
+ FsBadgeModule,
886
+ FsCheckboxGroupModule,
887
+ FsMenuModule], exports: [FsAclRolesComponent,
888
+ FsAclPermissionPopoverComponent,
889
+ FsAclRoleComponent,
890
+ FsAclEntriesComponent,
891
+ FsAclRolePopoverComponent,
892
+ FsAclObjectRolesComponent,
893
+ FsAclEntryComponent] });
894
+ FsAppAclModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppAclModule, imports: [CommonModule,
895
+ FormsModule,
896
+ MatDialogModule,
897
+ MatFormFieldModule,
898
+ MatCheckboxModule,
899
+ MatSelectModule,
900
+ MatButtonModule,
901
+ MatRadioModule,
902
+ MatInputModule,
903
+ FsListModule,
904
+ FsPopoverModule,
905
+ FsDialogModule,
906
+ FsFormModule,
907
+ FsLabelModule,
908
+ FsRadioGroupModule,
909
+ FsBadgeModule,
910
+ FsCheckboxGroupModule,
911
+ FsMenuModule] });
912
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppAclModule, decorators: [{
913
+ type: NgModule,
914
+ args: [{
915
+ imports: [
916
+ CommonModule,
917
+ FormsModule,
918
+ MatDialogModule,
919
+ MatFormFieldModule,
920
+ MatCheckboxModule,
921
+ MatSelectModule,
922
+ MatButtonModule,
923
+ MatRadioModule,
924
+ MatInputModule,
925
+ FsListModule,
926
+ FsPopoverModule,
927
+ FsDialogModule,
928
+ FsFormModule,
929
+ FsLabelModule,
930
+ FsRadioGroupModule,
931
+ FsBadgeModule,
932
+ FsCheckboxGroupModule,
933
+ FsMenuModule,
934
+ ],
935
+ declarations: [
936
+ FsAclRolesComponent,
937
+ FsAclPermissionPopoverComponent,
938
+ FsAclRoleComponent,
939
+ FsAclEntriesComponent,
940
+ FsAclRolePopoverComponent,
941
+ FsAclObjectRolesComponent,
942
+ FsAclEntryComponent,
943
+ BulkOptionsFilterPipe,
944
+ AclRolePermissionAvailablePipe,
945
+ ],
946
+ exports: [
947
+ FsAclRolesComponent,
948
+ FsAclPermissionPopoverComponent,
949
+ FsAclRoleComponent,
950
+ FsAclEntriesComponent,
951
+ FsAclRolePopoverComponent,
952
+ FsAclObjectRolesComponent,
953
+ FsAclEntryComponent,
954
+ ],
955
+ }]
958
956
  }] });
959
957
 
960
- /**
961
- * Generated bundle index. Do not edit.
958
+ /**
959
+ * Generated bundle index. Do not edit.
962
960
  */
963
961
 
964
962
  export { FS_APP_ACL_CONFIG, FsAclEntriesComponent, FsAclEntryComponent, FsAclObjectRolesComponent, FsAclPermissionPopoverComponent, FsAclRoleComponent, FsAclRolePopoverComponent, FsAclRolesComponent, FsAppAclModule, FsAppAclService };