@firestitch/app-acl 12.4.7 → 12.4.9

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