@firestitch/app-acl 12.4.6 → 12.4.8

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 +50 -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 -31
  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 -0
  26. package/app/services/app-acl.service.d.ts +16 -16
  27. package/bundles/firestitch-app-acl.umd.js +1364 -1331
  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 +222 -221
  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 -124
  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 +27 -0
  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 +854 -823
  58. package/fesm2015/firestitch-app-acl.js.map +1 -1
  59. package/firestitch-app-acl.d.ts +5 -5
  60. package/package.json +1 -1
  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';
@@ -12,7 +12,7 @@ import { MatCheckboxModule } from '@angular/material/checkbox';
12
12
  import * as i2 from '@angular/material/dialog';
13
13
  import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
14
14
  import * as i0 from '@angular/core';
15
- import { InjectionToken, Injectable, Inject, Component, ChangeDetectionStrategy, ViewChild, Input, QueryList, ViewChildren, EventEmitter, Output, NgModule } from '@angular/core';
15
+ import { InjectionToken, Injectable, Inject, Pipe, Component, ChangeDetectionStrategy, ViewChild, Input, QueryList, ViewChildren, EventEmitter, Output, NgModule } from '@angular/core';
16
16
  import * as i7$1 from '@angular/common';
17
17
  import { CommonModule } from '@angular/common';
18
18
  import * as i12 from '@firestitch/list';
@@ -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,855 +41,884 @@ 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 FsAclRoleComponent {
111
- constructor(_data, _appAclService, _dialogRef, _message, _cdRef) {
112
- this._data = _data;
113
- this._appAclService = _appAclService;
114
- this._dialogRef = _dialogRef;
115
- this._message = _message;
116
- this._cdRef = _cdRef;
117
- this.aclRole = null;
118
- this.permissions = [];
119
- this.levelPermissions = [];
120
- this.AclRoleAccesses = AclRoleAccesses;
121
- this.indexedAccesses = {};
122
- this.aclLevels = [];
123
- this.indexedAclLevels = {};
124
- this.onlyFullAccess = false;
125
- this.AclLevels = {};
126
- this.roleConfigs = [];
127
- this.aclRoleConfigValues = {};
128
- this.aclRolePermissions = {};
129
- this._destroy$ = new Subject();
130
- this.save = () => {
131
- const aclRoleConfigs = this.roleConfigs
132
- .map((roleConfig) => {
133
- return {
134
- name: roleConfig.name,
135
- value: this.aclRoleConfigValues[roleConfig.name],
136
- };
137
- });
138
- const aclRole = Object.assign(Object.assign({}, this.aclRole), { permissions: this.levelPermissions.map((permission) => {
139
- return {
140
- value: permission.value,
141
- access: this.aclRolePermissions[permission.value] || 0,
142
- };
143
- }), aclRoleConfigs });
144
- return this._data.saveAclRole(aclRole)
145
- .pipe(tap((response) => {
146
- this._message.success('Saved Changes');
147
- this.close(response);
148
- }));
149
- };
150
- }
151
- ngOnInit() {
152
- forkJoin(this.getRole(), this._appAclService.getPermissions())
153
- .pipe(takeUntil(this._destroy$))
154
- .subscribe(([aclRole, aclPermissions,]) => {
155
- this.permissions = aclPermissions;
156
- this.aclLevels = this._data.aclLevels;
157
- this.indexedAclLevels = list(this.aclLevels, 'name', 'value');
158
- this.indexedAccesses = list(AclRoleAccesses, 'name', 'value');
159
- this.aclRole = Object.assign({
160
- aclPermissions: [],
161
- allPermissions: true,
162
- aclRoleConfigs: [],
163
- permissions: {},
164
- level: this.aclLevels[0].value,
165
- }, aclRole);
166
- this.aclRoleConfigValues = (aclRole.aclRoleConfigs || [])
167
- .reduce((accum, aclRoleConfig) => {
168
- return Object.assign(Object.assign({}, accum), { [aclRoleConfig.name]: aclRoleConfig.value });
169
- }, {});
170
- if (this.aclRole.id) {
171
- this.permissions.forEach((permission) => {
172
- let access = 0;
173
- const aclPermission = this.aclRole.aclPermissions.find((item) => {
174
- return item.permission === permission.value;
175
- });
176
- if (aclPermission) {
177
- access = aclPermission.access;
178
- }
179
- this.aclRolePermissions[permission.value] = access;
180
- });
181
- }
182
- if (this.aclRole.allPermissions) {
183
- this._applyMaxPermissionAccess();
184
- }
185
- this._updatePermissions();
186
- this._updateRoleConfigs();
187
- this._cdRef.markForCheck();
188
- });
189
- this.listConfig = {
190
- status: false,
191
- paging: false,
192
- noResults: {
193
- message: '',
194
- },
195
- group: {
196
- initialExpand: true,
197
- groupBy: (data) => {
198
- return data;
199
- },
200
- compareBy: (data) => {
201
- return data.category || 'General';
202
- },
203
- },
204
- fetch: () => {
205
- return of({
206
- data: this.levelPermissions.sort((a, b) => {
207
- a = a.name.toUpperCase();
208
- b = b.name.toUpperCase();
209
- if (a < b) {
210
- return -1;
211
- }
212
- else if (a > b) {
213
- return 1;
214
- }
215
- return 0;
216
- }),
217
- });
218
- },
219
- };
220
- }
221
- bulkChange(event, groupChildren, group) {
222
- groupChildren
223
- .forEach((permission) => {
224
- const access = permission.accesses
225
- .find((access) => event.value === access);
226
- if (access || !event.value) {
227
- this.aclRolePermissions[permission.value] = event.value;
228
- }
229
- });
230
- event.source.writeValue(null);
231
- }
232
- levelChange() {
233
- this._updatePermissions();
234
- this._updateRoleConfigs();
235
- this.list.reload();
236
- }
237
- getRole() {
238
- if (!this._data.aclRole.id) {
239
- return of(this._data.aclRole);
240
- }
241
- const query = {
242
- aclPermissions: true,
243
- aclRoleConfigs: true,
244
- };
245
- if (!this.environment) {
246
- query.environmentId = null;
247
- }
248
- return this._data.loadAclRole(this._data.aclRole, query);
249
- }
250
- close(data = null) {
251
- this._dialogRef.close(data);
252
- }
253
- allPermissionsChange(all) {
254
- this._updatePermissions();
255
- if (all) {
256
- this._applyMaxPermissionAccess();
257
- }
258
- }
259
- ngOnDestroy() {
260
- this._destroy$.next();
261
- this._destroy$.complete();
262
- }
263
- _updatePermissions() {
264
- this.levelPermissions = this.permissions.filter((permission) => {
265
- return permission.levels.some((item) => {
266
- return item === this.aclRole.level;
267
- });
268
- });
269
- }
270
- _updateRoleConfigs() {
271
- if (this._data.loadRoleConfigs) {
272
- this._data.loadRoleConfigs()
273
- .subscribe((roleConfigs) => {
274
- this.roleConfigs = roleConfigs
275
- .filter((roleConfig) => roleConfig.level === this.aclRole.level);
276
- this._cdRef.markForCheck();
277
- });
278
- }
279
- }
280
- _applyMaxPermissionAccess() {
281
- this.permissions.forEach((permission) => {
282
- this.aclRolePermissions[permission.value] = Math.max(...permission.accesses);
283
- });
284
- }
285
- }
286
- 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 });
287
- 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\">\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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
288
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclRoleComponent, decorators: [{
289
- type: Component,
290
- args: [{
291
- templateUrl: './acl-role.component.html',
292
- styleUrls: ['./acl-role.component.scss'],
293
- changeDetection: ChangeDetectionStrategy.OnPush,
294
- }]
295
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
296
- type: Inject,
297
- args: [MAT_DIALOG_DATA]
298
- }] }, { type: FsAppAclService }, { type: i2.MatDialogRef }, { type: i3.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { list: [{
299
- type: ViewChild,
300
- args: [FsListComponent]
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
+ }]
135
+ }] });
136
+
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
+ }
285
+ ngOnDestroy() {
286
+ this._destroy$.next();
287
+ this._destroy$.complete();
288
+ }
289
+ _updatePermissions() {
290
+ this.levelPermissions = this.permissions.filter((permission) => {
291
+ return permission.levels.some((item) => {
292
+ return item === this.aclRole.level;
293
+ });
294
+ });
295
+ }
296
+ _updateRoleConfigs() {
297
+ if (this._data.loadRoleConfigs) {
298
+ this._data.loadRoleConfigs()
299
+ .subscribe((roleConfigs) => {
300
+ this.roleConfigs = roleConfigs
301
+ .filter((roleConfig) => roleConfig.level === this.aclRole.level);
302
+ this._cdRef.markForCheck();
303
+ });
304
+ }
305
+ }
306
+ _applyMaxPermissionAccess() {
307
+ this.permissions.forEach((permission) => {
308
+ this.aclRolePermissions[permission.value] = Math.max(...permission.accesses);
309
+ });
310
+ }
311
+ }
312
+ 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 });
313
+ 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\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"] }, { 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 });
314
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclRoleComponent, decorators: [{
315
+ type: Component,
316
+ args: [{
317
+ templateUrl: './acl-role.component.html',
318
+ styleUrls: ['./acl-role.component.scss'],
319
+ changeDetection: ChangeDetectionStrategy.OnPush,
320
+ }]
321
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
322
+ type: Inject,
323
+ args: [MAT_DIALOG_DATA]
324
+ }] }, { type: FsAppAclService }, { type: i2.MatDialogRef }, { type: i3.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { list: [{
325
+ type: ViewChild,
326
+ args: [FsListComponent]
301
327
  }] } });
302
328
 
303
- class FsAclPermissionPopoverComponent {
304
- constructor(_appAclService) {
305
- this._appAclService = _appAclService;
306
- }
307
- ngOnInit() {
308
- this._appAclService.getPermissions()
309
- .subscribe(permissions => {
310
- this.description = permissions.filter(item => {
311
- return item.value === this.permission.value;
312
- }).map(item => {
313
- return item.description;
314
- })[0];
315
- });
316
- }
317
- }
318
- FsAclPermissionPopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclPermissionPopoverComponent, deps: [{ token: FsAppAclService }], target: i0.ɵɵFactoryTarget.Component });
319
- 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"] }] });
320
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclPermissionPopoverComponent, decorators: [{
321
- type: Component,
322
- args: [{
323
- selector: 'acl-permission-popover',
324
- templateUrl: './acl-permission-popover.component.html',
325
- styleUrls: ['./acl-permission-popover.component.scss']
326
- }]
327
- }], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { permission: [{
328
- type: Input
329
+ class FsAclPermissionPopoverComponent {
330
+ constructor(_appAclService) {
331
+ this._appAclService = _appAclService;
332
+ }
333
+ ngOnInit() {
334
+ this._appAclService.getPermissions()
335
+ .subscribe(permissions => {
336
+ this.description = permissions.filter(item => {
337
+ return item.value === this.permission.value;
338
+ }).map(item => {
339
+ return item.description;
340
+ })[0];
341
+ });
342
+ }
343
+ }
344
+ FsAclPermissionPopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclPermissionPopoverComponent, deps: [{ token: FsAppAclService }], target: i0.ɵɵFactoryTarget.Component });
345
+ 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"] }] });
346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclPermissionPopoverComponent, decorators: [{
347
+ type: Component,
348
+ args: [{
349
+ selector: 'acl-permission-popover',
350
+ templateUrl: './acl-permission-popover.component.html',
351
+ styleUrls: ['./acl-permission-popover.component.scss']
352
+ }]
353
+ }], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { permission: [{
354
+ type: Input
329
355
  }] } });
330
356
 
331
- class FsAclRolesComponent {
332
- constructor(_appAclService, _dialog) {
333
- this._appAclService = _appAclService;
334
- this._dialog = _dialog;
335
- this.aclLevels = [];
336
- this.list = new QueryList();
337
- this.indexedAclRoleLevels = {};
338
- this._destroy$ = new Subject();
339
- }
340
- ngOnInit() {
341
- new Observable(observer => {
342
- if (this.aclLevels.length) {
343
- observer.next(this.aclLevels);
344
- observer.complete();
345
- }
346
- else {
347
- this._appAclService.getLevels()
348
- .subscribe((aclLevels) => {
349
- observer.next(aclLevels);
350
- observer.complete();
351
- });
352
- }
353
- })
354
- .subscribe((aclLevels) => {
355
- this.aclLevels = aclLevels;
356
- this.indexedAclRoleLevels = list(this.aclLevels, 'name', 'value');
357
- this._loadListConfig();
358
- });
359
- }
360
- openDialog(aclRole = { id: null }) {
361
- this._dialog.open(FsAclRoleComponent, {
362
- width: '70%',
363
- data: {
364
- aclRole,
365
- aclLevels: this.aclLevels,
366
- loadAclRole: this.loadAclRole,
367
- saveAclRole: this.saveAclRole,
368
- loadRoleConfigs: this.loadRoleConfigs,
369
- },
370
- })
371
- .afterClosed()
372
- .pipe(takeUntil(this._destroy$), filter((response) => !!response))
373
- .subscribe((response) => {
374
- this.list.forEach((list) => {
375
- list.reload();
376
- });
377
- });
378
- }
379
- ngOnDestroy() {
380
- this._destroy$.next();
381
- this._destroy$.complete();
382
- }
383
- _loadListConfig() {
384
- this.listConfig = {
385
- sort: { value: 'hierarchy' },
386
- filters: [
387
- {
388
- name: 'keyword',
389
- type: ItemType.Keyword,
390
- label: 'Search',
391
- },
392
- {
393
- name: 'level',
394
- label: 'Level',
395
- type: ItemType.Select,
396
- values: this.aclLevels,
397
- hide: this.aclLevels.length <= 1
398
- },
399
- {
400
- name: 'state',
401
- label: 'Show Deleted',
402
- type: ItemType.Checkbox,
403
- unchecked: 'active',
404
- checked: 'deleted',
405
- },
406
- ],
407
- actions: [
408
- {
409
- click: (event) => {
410
- this.openDialog();
411
- },
412
- label: 'Create',
413
- },
414
- ],
415
- rowActions: [
416
- {
417
- click: (data) => {
418
- return this.deleteAclRole(data);
419
- },
420
- remove: {
421
- title: 'Confirm',
422
- template: 'Are you sure you would like to delete this role?',
423
- },
424
- menu: true,
425
- label: 'Delete',
426
- show: (row) => !!this.deleteAclRole && row.state !== 'deleted',
427
- },
428
- {
429
- click: (data) => {
430
- return this.restoreAclRole(data)
431
- .pipe(tap(() => {
432
- this.list.forEach((l) => {
433
- l.reload();
434
- });
435
- }), takeUntil(this._destroy$))
436
- .subscribe();
437
- },
438
- label: 'Restore',
439
- show: (row) => !!this.restoreAclRole && row.state === 'deleted',
440
- },
441
- ],
442
- fetch: (query) => {
443
- query.permissions = true;
444
- return this.loadAclRoles(query)
445
- .pipe(map((data) => data));
446
- },
447
- };
448
- }
449
- }
450
- 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 });
451
- 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 });
452
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclRolesComponent, decorators: [{
453
- type: Component,
454
- args: [{
455
- selector: 'fs-acl-roles',
456
- templateUrl: 'acl-roles.component.html',
457
- styleUrls: ['acl-roles.component.scss'],
458
- changeDetection: ChangeDetectionStrategy.OnPush,
459
- }]
460
- }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialog }]; }, propDecorators: { deleteAclRole: [{
461
- type: Input
462
- }], restoreAclRole: [{
463
- type: Input
464
- }], saveAclRole: [{
465
- type: Input
466
- }], loadAclRoles: [{
467
- type: Input
468
- }], loadAclRole: [{
469
- type: Input
470
- }], loadRoleConfigs: [{
471
- type: Input
472
- }], aclLevels: [{
473
- type: Input
474
- }], list: [{
475
- type: ViewChildren,
476
- args: [FsListComponent]
357
+ class FsAclRolesComponent {
358
+ constructor(_appAclService, _dialog) {
359
+ this._appAclService = _appAclService;
360
+ this._dialog = _dialog;
361
+ this.aclLevels = [];
362
+ this.list = new QueryList();
363
+ this.indexedAclRoleLevels = {};
364
+ this._destroy$ = new Subject();
365
+ }
366
+ ngOnInit() {
367
+ new Observable(observer => {
368
+ if (this.aclLevels.length) {
369
+ observer.next(this.aclLevels);
370
+ observer.complete();
371
+ }
372
+ else {
373
+ this._appAclService.getLevels()
374
+ .subscribe((aclLevels) => {
375
+ observer.next(aclLevels);
376
+ observer.complete();
377
+ });
378
+ }
379
+ })
380
+ .subscribe((aclLevels) => {
381
+ this.aclLevels = aclLevels;
382
+ this.indexedAclRoleLevels = list(this.aclLevels, 'name', 'value');
383
+ this._loadListConfig();
384
+ });
385
+ }
386
+ openDialog(aclRole = { id: null }) {
387
+ this._dialog.open(FsAclRoleComponent, {
388
+ width: '70%',
389
+ data: {
390
+ aclRole,
391
+ aclLevels: this.aclLevels,
392
+ loadAclRole: this.loadAclRole,
393
+ saveAclRole: this.saveAclRole,
394
+ loadRoleConfigs: this.loadRoleConfigs,
395
+ },
396
+ })
397
+ .afterClosed()
398
+ .pipe(takeUntil(this._destroy$), filter((response) => !!response))
399
+ .subscribe((response) => {
400
+ this.list.forEach((list) => {
401
+ list.reload();
402
+ });
403
+ });
404
+ }
405
+ ngOnDestroy() {
406
+ this._destroy$.next();
407
+ this._destroy$.complete();
408
+ }
409
+ _loadListConfig() {
410
+ this.listConfig = {
411
+ sort: { value: 'hierarchy' },
412
+ filters: [
413
+ {
414
+ name: 'keyword',
415
+ type: ItemType.Keyword,
416
+ label: 'Search',
417
+ },
418
+ {
419
+ name: 'level',
420
+ label: 'Level',
421
+ type: ItemType.Select,
422
+ values: this.aclLevels,
423
+ hide: this.aclLevels.length <= 1
424
+ },
425
+ {
426
+ name: 'state',
427
+ label: 'Show Deleted',
428
+ type: ItemType.Checkbox,
429
+ unchecked: 'active',
430
+ checked: 'deleted',
431
+ },
432
+ ],
433
+ actions: [
434
+ {
435
+ click: (event) => {
436
+ this.openDialog();
437
+ },
438
+ label: 'Create',
439
+ },
440
+ ],
441
+ rowActions: [
442
+ {
443
+ click: (data) => {
444
+ return this.deleteAclRole(data);
445
+ },
446
+ remove: {
447
+ title: 'Confirm',
448
+ template: 'Are you sure you would like to delete this role?',
449
+ },
450
+ menu: true,
451
+ label: 'Delete',
452
+ show: (row) => !!this.deleteAclRole && row.state !== 'deleted',
453
+ },
454
+ {
455
+ click: (data) => {
456
+ return this.restoreAclRole(data)
457
+ .pipe(tap(() => {
458
+ this.list.forEach((l) => {
459
+ l.reload();
460
+ });
461
+ }), takeUntil(this._destroy$))
462
+ .subscribe();
463
+ },
464
+ label: 'Restore',
465
+ show: (row) => !!this.restoreAclRole && row.state === 'deleted',
466
+ },
467
+ ],
468
+ fetch: (query) => {
469
+ query.permissions = true;
470
+ return this.loadAclRoles(query)
471
+ .pipe(map((data) => data));
472
+ },
473
+ };
474
+ }
475
+ }
476
+ 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 });
477
+ 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 });
478
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclRolesComponent, decorators: [{
479
+ type: Component,
480
+ args: [{
481
+ selector: 'fs-acl-roles',
482
+ templateUrl: 'acl-roles.component.html',
483
+ styleUrls: ['acl-roles.component.scss'],
484
+ changeDetection: ChangeDetectionStrategy.OnPush,
485
+ }]
486
+ }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialog }]; }, propDecorators: { deleteAclRole: [{
487
+ type: Input
488
+ }], restoreAclRole: [{
489
+ type: Input
490
+ }], saveAclRole: [{
491
+ type: Input
492
+ }], loadAclRoles: [{
493
+ type: Input
494
+ }], loadAclRole: [{
495
+ type: Input
496
+ }], loadRoleConfigs: [{
497
+ type: Input
498
+ }], aclLevels: [{
499
+ type: Input
500
+ }], list: [{
501
+ type: ViewChildren,
502
+ args: [FsListComponent]
477
503
  }] } });
478
504
 
479
- class FsAclRolePopoverComponent {
480
- constructor(_appAclService) {
481
- this._appAclService = _appAclService;
482
- this.permissions = [];
483
- }
484
- ngOnInit() {
485
- const aclRolePermissions = this.aclRole.permissions || [];
486
- this._appAclService.getPermissions()
487
- .subscribe((response) => {
488
- this.permissions = response.filter(item => {
489
- return aclRolePermissions.some(permission => {
490
- return item.value === permission.value;
491
- });
492
- });
493
- });
494
- }
495
- }
496
- FsAclRolePopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclRolePopoverComponent, deps: [{ token: FsAppAclService }], target: i0.ɵɵFactoryTarget.Component });
497
- 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"] }] });
498
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclRolePopoverComponent, decorators: [{
499
- type: Component,
500
- args: [{
501
- selector: 'fs-acl-role-popover',
502
- templateUrl: './acl-role-popover.component.html',
503
- styleUrls: ['./acl-role-popover.component.scss']
504
- }]
505
- }], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { aclRole: [{
506
- type: Input
507
- }], objectName: [{
508
- type: Input
505
+ class FsAclRolePopoverComponent {
506
+ constructor(_appAclService) {
507
+ this._appAclService = _appAclService;
508
+ this.permissions = [];
509
+ }
510
+ ngOnInit() {
511
+ const aclRolePermissions = this.aclRole.permissions || [];
512
+ this._appAclService.getPermissions()
513
+ .subscribe((response) => {
514
+ this.permissions = response.filter(item => {
515
+ return aclRolePermissions.some(permission => {
516
+ return item.value === permission.value;
517
+ });
518
+ });
519
+ });
520
+ }
521
+ }
522
+ FsAclRolePopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclRolePopoverComponent, deps: [{ token: FsAppAclService }], target: i0.ɵɵFactoryTarget.Component });
523
+ 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"] }] });
524
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclRolePopoverComponent, decorators: [{
525
+ type: Component,
526
+ args: [{
527
+ selector: 'fs-acl-role-popover',
528
+ templateUrl: './acl-role-popover.component.html',
529
+ styleUrls: ['./acl-role-popover.component.scss']
530
+ }]
531
+ }], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { aclRole: [{
532
+ type: Input
533
+ }], objectName: [{
534
+ type: Input
509
535
  }] } });
510
536
 
511
- class FsAclObjectRolesComponent {
512
- constructor() {
513
- this.aclRoles = [];
514
- this.required = false;
515
- this.multiple = false;
516
- this.disabled = false;
517
- this.aclObjectRoles = [];
518
- this.rolesLabel = 'Roles';
519
- this.levelLabel = '';
520
- this.change = new EventEmitter();
521
- this.compareAclRole = (o1, o2) => {
522
- return o1 && o2 && o1.id === o2.id;
523
- };
524
- }
525
- changed() {
526
- this.change.emit(this.aclObjectRoles);
527
- }
528
- }
529
- FsAclObjectRolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclObjectRolesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
530
- 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 }] });
531
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclObjectRolesComponent, decorators: [{
532
- type: Component,
533
- args: [{
534
- selector: 'fs-acl-object-roles',
535
- templateUrl: './acl-object-roles.component.html',
536
- styleUrls: ['./acl-object-roles.component.scss'],
537
- viewProviders: [{ provide: ControlContainer, useExisting: NgForm }]
538
- }]
539
- }], propDecorators: { aclRoles: [{
540
- type: Input
541
- }], required: [{
542
- type: Input
543
- }], multiple: [{
544
- type: Input
545
- }], disabled: [{
546
- type: Input
547
- }], aclObjectRoles: [{
548
- type: Input
549
- }], rolesLabel: [{
550
- type: Input
551
- }], levelLabel: [{
552
- type: Input
553
- }], change: [{
554
- type: Output
537
+ class FsAclObjectRolesComponent {
538
+ constructor() {
539
+ this.aclRoles = [];
540
+ this.required = false;
541
+ this.multiple = false;
542
+ this.disabled = false;
543
+ this.aclObjectRoles = [];
544
+ this.rolesLabel = 'Roles';
545
+ this.levelLabel = '';
546
+ this.change = new EventEmitter();
547
+ this.compareAclRole = (o1, o2) => {
548
+ return o1 && o2 && o1.id === o2.id;
549
+ };
550
+ }
551
+ changed() {
552
+ this.change.emit(this.aclObjectRoles);
553
+ }
554
+ }
555
+ FsAclObjectRolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclObjectRolesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
556
+ 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 }] });
557
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclObjectRolesComponent, decorators: [{
558
+ type: Component,
559
+ args: [{
560
+ selector: 'fs-acl-object-roles',
561
+ templateUrl: './acl-object-roles.component.html',
562
+ styleUrls: ['./acl-object-roles.component.scss'],
563
+ viewProviders: [{ provide: ControlContainer, useExisting: NgForm }]
564
+ }]
565
+ }], propDecorators: { aclRoles: [{
566
+ type: Input
567
+ }], required: [{
568
+ type: Input
569
+ }], multiple: [{
570
+ type: Input
571
+ }], disabled: [{
572
+ type: Input
573
+ }], aclObjectRoles: [{
574
+ type: Input
575
+ }], rolesLabel: [{
576
+ type: Input
577
+ }], levelLabel: [{
578
+ type: Input
579
+ }], change: [{
580
+ type: Output
555
581
  }] } });
556
582
 
557
- class FsAclEntryComponent {
558
- constructor(_appAclService, _dialogRef, _message, _data) {
559
- var _a;
560
- this._appAclService = _appAclService;
561
- this._dialogRef = _dialogRef;
562
- this._message = _message;
563
- this._data = _data;
564
- this.aclRoles = [];
565
- this.aclEntries = [];
566
- this.indexedAclRoleLevels = {};
567
- this.titleEdit = 'Edit Roles';
568
- this.titleAdd = 'Assign Roles';
569
- this.required = true;
570
- this.save = () => {
571
- const aclObjectEntry = Object.assign(Object.assign({}, this.aclObjectEntry), { aclEntries: this.aclEntries });
572
- return this._data.saveAclObjectEntry(aclObjectEntry)
573
- .pipe(tap((data) => {
574
- this._message.success('Saved Changes');
575
- this.close(data);
576
- }));
577
- };
578
- this.aclObjectEntry = Object.assign({}, _data.aclObjectEntry);
579
- this.required = (_a = _data.required) !== null && _a !== void 0 ? _a : true;
580
- if (_data.titleEdit) {
581
- this.titleEdit = _data.titleEdit;
582
- }
583
- if (_data.titleAdd) {
584
- this.titleAdd = _data.titleAdd;
585
- }
586
- }
587
- ngOnInit() {
588
- forkJoin(this._data.loadAclRoles({
589
- level: this.aclObjectEntry.level,
590
- environmentId: this.aclObjectEntry.environmentId || null,
591
- }), this._appAclService.getIndexedLevels())
592
- .subscribe(([aclRoles, levels,]) => {
593
- this.aclRoles = aclRoles;
594
- this.indexedAclRoleLevels = levels;
595
- this.aclObjectRole = {
596
- object: this.aclObjectEntry.object,
597
- aclRoles: this.aclObjectEntry.aclEntries
598
- .map((aclEntry) => {
599
- return aclEntry.aclRole;
600
- }),
601
- };
602
- });
603
- }
604
- aclObjectRoleChange(aclObjectRoles) {
605
- this.aclEntries = aclObjectRoles.reduce((aclEntries, aclObjectRole) => {
606
- aclObjectRole.aclRoles.forEach(aclRole => {
607
- aclEntries.push({
608
- aclRoleId: aclRole.id,
609
- aclRole: aclRole,
610
- objectId: aclObjectRole.object ? aclObjectRole.object.id : null,
611
- object: aclObjectRole.object || null
612
- });
613
- });
614
- return aclEntries;
615
- }, []);
616
- }
617
- close(data = null) {
618
- this._dialogRef.close(data);
619
- }
620
- }
621
- 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 });
622
- 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"] }] });
623
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclEntryComponent, decorators: [{
624
- type: Component,
625
- args: [{
626
- templateUrl: './acl-entry.component.html',
627
- styleUrls: ['./acl-entry.component.scss'],
628
- }]
629
- }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialogRef }, { type: i3.FsMessage }, { type: undefined, decorators: [{
630
- type: Inject,
631
- args: [MAT_DIALOG_DATA]
583
+ class FsAclEntryComponent {
584
+ constructor(_appAclService, _dialogRef, _message, _data) {
585
+ var _a;
586
+ this._appAclService = _appAclService;
587
+ this._dialogRef = _dialogRef;
588
+ this._message = _message;
589
+ this._data = _data;
590
+ this.aclRoles = [];
591
+ this.aclEntries = [];
592
+ this.indexedAclRoleLevels = {};
593
+ this.titleEdit = 'Edit Roles';
594
+ this.titleAdd = 'Assign Roles';
595
+ this.required = true;
596
+ this.save = () => {
597
+ const aclObjectEntry = Object.assign(Object.assign({}, this.aclObjectEntry), { aclEntries: this.aclEntries });
598
+ return this._data.saveAclObjectEntry(aclObjectEntry)
599
+ .pipe(tap((data) => {
600
+ this._message.success('Saved Changes');
601
+ this.close(data);
602
+ }));
603
+ };
604
+ this.aclObjectEntry = Object.assign({}, _data.aclObjectEntry);
605
+ this.required = (_a = _data.required) !== null && _a !== void 0 ? _a : true;
606
+ if (_data.titleEdit) {
607
+ this.titleEdit = _data.titleEdit;
608
+ }
609
+ if (_data.titleAdd) {
610
+ this.titleAdd = _data.titleAdd;
611
+ }
612
+ }
613
+ ngOnInit() {
614
+ forkJoin(this._data.loadAclRoles({
615
+ level: this.aclObjectEntry.level,
616
+ environmentId: this.aclObjectEntry.environmentId || null,
617
+ }), this._appAclService.getIndexedLevels())
618
+ .subscribe(([aclRoles, levels,]) => {
619
+ this.aclRoles = aclRoles;
620
+ this.indexedAclRoleLevels = levels;
621
+ this.aclObjectRole = {
622
+ object: this.aclObjectEntry.object,
623
+ aclRoles: this.aclObjectEntry.aclEntries
624
+ .map((aclEntry) => {
625
+ return aclEntry.aclRole;
626
+ }),
627
+ };
628
+ });
629
+ }
630
+ aclObjectRoleChange(aclObjectRoles) {
631
+ this.aclEntries = aclObjectRoles.reduce((aclEntries, aclObjectRole) => {
632
+ aclObjectRole.aclRoles.forEach(aclRole => {
633
+ aclEntries.push({
634
+ aclRoleId: aclRole.id,
635
+ aclRole: aclRole,
636
+ objectId: aclObjectRole.object ? aclObjectRole.object.id : null,
637
+ object: aclObjectRole.object || null
638
+ });
639
+ });
640
+ return aclEntries;
641
+ }, []);
642
+ }
643
+ close(data = null) {
644
+ this._dialogRef.close(data);
645
+ }
646
+ }
647
+ 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 });
648
+ 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"] }, { type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }] });
649
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclEntryComponent, decorators: [{
650
+ type: Component,
651
+ args: [{
652
+ templateUrl: './acl-entry.component.html',
653
+ styleUrls: ['./acl-entry.component.scss'],
654
+ }]
655
+ }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialogRef }, { type: i3.FsMessage }, { type: undefined, decorators: [{
656
+ type: Inject,
657
+ args: [MAT_DIALOG_DATA]
632
658
  }] }]; } });
633
659
 
634
- class FsAclEntriesComponent {
635
- constructor(_appAclService, _dialog, _confirm) {
636
- this._appAclService = _appAclService;
637
- this._dialog = _dialog;
638
- this._confirm = _confirm;
639
- this.environmentShow = true;
640
- this.environmentLabel = 'Environment';
641
- this.environmentKey = 'environment';
642
- this.actions = [];
643
- this.aclEntriesList = null;
644
- this.aclEntriesConfig = null;
645
- this.permissions = [];
646
- this._destroy$ = new Subject();
647
- }
648
- ngOnInit() {
649
- this._appAclService.getPermissions()
650
- .subscribe(response => {
651
- this.permissions = response;
652
- });
653
- this.aclEntriesConfig = {
654
- status: false,
655
- paging: false,
656
- actions: this.actions,
657
- rowActions: [
658
- {
659
- label: 'Remove All Roles',
660
- click: (aclObjectEntry) => {
661
- this._confirm
662
- .confirm({
663
- title: 'Remove All Roles',
664
- commitLabel: 'Save',
660
+ class FsAclEntriesComponent {
661
+ constructor(_appAclService, _dialog, _confirm) {
662
+ this._appAclService = _appAclService;
663
+ this._dialog = _dialog;
664
+ this._confirm = _confirm;
665
+ this.environmentShow = true;
666
+ this.environmentLabel = 'Environment';
667
+ this.environmentKey = 'environment';
668
+ this.actions = [];
669
+ this.aclEntriesList = null;
670
+ this.aclEntriesConfig = null;
671
+ this.permissions = [];
672
+ this._destroy$ = new Subject();
673
+ }
674
+ ngOnInit() {
675
+ this._appAclService.getPermissions()
676
+ .subscribe(response => {
677
+ this.permissions = response;
678
+ });
679
+ this.aclEntriesConfig = {
680
+ status: false,
681
+ paging: false,
682
+ actions: this.actions,
683
+ rowActions: [
684
+ {
685
+ label: 'Remove All Roles',
686
+ click: (aclObjectEntry) => {
687
+ this._confirm
688
+ .confirm({
689
+ title: 'Remove All Roles',
690
+ commitLabel: 'Save',
665
691
  template: `Please note that removing roles may prevent users from being able to successfully login.<br>
666
692
  These changes are effective immediately.<br>
667
- Are you sure you would like to continue?`,
668
- }).subscribe(() => {
669
- const data = Object.assign(Object.assign({}, aclObjectEntry), { aclEntries: [] });
670
- this.saveAclObjectEntry(data)
671
- .subscribe(() => {
672
- this.aclEntriesList.reload();
673
- });
674
- });
675
- }
676
- }
677
- ],
678
- fetch: () => {
679
- return new Observable((observer) => {
680
- this.loadAclEntries({
681
- aclRoles: true,
682
- aclRolePermissions: true,
683
- objects: true,
684
- aclRoleState: 'active',
685
- })
686
- .subscribe((aclEntries) => {
687
- const objects = aclEntries
688
- .filter((aclEntry) => (!!aclEntry.object))
689
- .reduce((items, item) => {
690
- return Object.assign(Object.assign({}, items), { [item.object.id]: item.object });
691
- }, {});
692
- const environments = aclEntries
693
- .filter((aclEntry) => (!!aclEntry[this.environmentKey]))
694
- .reduce((items, item) => {
695
- const environment = item[this.environmentKey];
696
- return Object.assign(Object.assign({}, items), { [environment.id]: environment });
697
- }, {});
698
- const groupedAclEntries = groupBy(aclEntries, (item) => {
699
- var _a;
700
- const environmentId = (_a = (item[this.environmentKey])) === null || _a === void 0 ? void 0 : _a.id;
701
- return [item.aclRole.level, environmentId, item.objectId];
702
- });
703
- let aclObjectEntries = Object.keys(groupedAclEntries)
704
- .reduce((accum, key) => {
705
- const parts = key.split(',');
706
- return [
707
- ...accum,
708
- {
709
- object: objects[parts[2]],
710
- level: parts[0],
711
- [`${this.environmentKey}Id`]: parts[1] ? parseInt(parts[1]) : null,
712
- [this.environmentKey]: environments[parts[1]],
713
- aclEntries: groupedAclEntries[key],
714
- }
715
- ];
716
- }, []);
717
- const hasApp = aclObjectEntries.some((item) => {
718
- return item.aclEntries.some((entry) => {
719
- return !entry.objectId;
720
- });
721
- });
722
- if (!hasApp) {
723
- aclObjectEntries.unshift({
724
- object: null,
725
- aclEntries: [],
726
- level: 'app',
727
- environmentId: null,
728
- });
729
- }
730
- aclObjectEntries = sortBy(aclObjectEntries, (item) => {
731
- return item.object ? item.level : '';
732
- });
733
- observer.next({ data: aclObjectEntries });
734
- observer.complete();
735
- });
736
- });
737
- },
738
- };
739
- }
740
- update(aclObjectEntry) {
741
- const data = {
742
- aclObjectEntry,
743
- required: false,
744
- loadAclRoles: this.loadAclRoles,
745
- saveAclObjectEntry: this.saveAclObjectEntry
746
- };
747
- this._dialog.open(FsAclEntryComponent, {
748
- data: data
749
- })
750
- .afterClosed()
751
- .pipe(takeUntil(this._destroy$))
752
- .subscribe(() => {
753
- this.aclEntriesList.reload();
754
- });
755
- }
756
- ngOnDestroy() {
757
- this._destroy$.next();
758
- this._destroy$.complete();
759
- }
760
- reload() {
761
- this.aclEntriesList.reload();
762
- }
763
- }
764
- 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 });
765
- 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]" }] });
766
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclEntriesComponent, decorators: [{
767
- type: Component,
768
- args: [{
769
- selector: 'fs-acl-entries',
770
- templateUrl: './acl-entries.component.html',
771
- styleUrls: ['./acl-entries.component.scss']
772
- }]
773
- }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialog }, { type: i3$1.FsPrompt }]; }, propDecorators: { loadAclEntries: [{
774
- type: Input
775
- }], loadAclRoles: [{
776
- type: Input
777
- }], saveAclObjectEntry: [{
778
- type: Input
779
- }], environmentShow: [{
780
- type: Input
781
- }], environmentLabel: [{
782
- type: Input
783
- }], environmentKey: [{
784
- type: Input
785
- }], actions: [{
786
- type: Input
787
- }], aclEntriesList: [{
788
- type: ViewChild,
789
- args: [FsListComponent]
693
+ Are you sure you would like to continue?`,
694
+ }).subscribe(() => {
695
+ const data = Object.assign(Object.assign({}, aclObjectEntry), { aclEntries: [] });
696
+ this.saveAclObjectEntry(data)
697
+ .subscribe(() => {
698
+ this.aclEntriesList.reload();
699
+ });
700
+ });
701
+ }
702
+ }
703
+ ],
704
+ fetch: () => {
705
+ return new Observable((observer) => {
706
+ this.loadAclEntries({
707
+ aclRoles: true,
708
+ aclRolePermissions: true,
709
+ objects: true,
710
+ aclRoleState: 'active',
711
+ })
712
+ .subscribe((aclEntries) => {
713
+ const objects = aclEntries
714
+ .filter((aclEntry) => (!!aclEntry.object))
715
+ .reduce((items, item) => {
716
+ return Object.assign(Object.assign({}, items), { [item.object.id]: item.object });
717
+ }, {});
718
+ const environments = aclEntries
719
+ .filter((aclEntry) => (!!aclEntry[this.environmentKey]))
720
+ .reduce((items, item) => {
721
+ const environment = item[this.environmentKey];
722
+ return Object.assign(Object.assign({}, items), { [environment.id]: environment });
723
+ }, {});
724
+ const groupedAclEntries = groupBy(aclEntries, (item) => {
725
+ var _a;
726
+ const environmentId = (_a = (item[this.environmentKey])) === null || _a === void 0 ? void 0 : _a.id;
727
+ return [item.aclRole.level, environmentId, item.objectId];
728
+ });
729
+ let aclObjectEntries = Object.keys(groupedAclEntries)
730
+ .reduce((accum, key) => {
731
+ const parts = key.split(',');
732
+ return [
733
+ ...accum,
734
+ {
735
+ object: objects[parts[2]],
736
+ level: parts[0],
737
+ [`${this.environmentKey}Id`]: parts[1] ? parseInt(parts[1]) : null,
738
+ [this.environmentKey]: environments[parts[1]],
739
+ aclEntries: groupedAclEntries[key],
740
+ }
741
+ ];
742
+ }, []);
743
+ const hasApp = aclObjectEntries.some((item) => {
744
+ return item.aclEntries.some((entry) => {
745
+ return !entry.objectId;
746
+ });
747
+ });
748
+ if (!hasApp) {
749
+ aclObjectEntries.unshift({
750
+ object: null,
751
+ aclEntries: [],
752
+ level: 'app',
753
+ environmentId: null,
754
+ });
755
+ }
756
+ aclObjectEntries = sortBy(aclObjectEntries, (item) => {
757
+ return item.object ? item.level : '';
758
+ });
759
+ observer.next({ data: aclObjectEntries });
760
+ observer.complete();
761
+ });
762
+ });
763
+ },
764
+ };
765
+ }
766
+ update(aclObjectEntry) {
767
+ const data = {
768
+ aclObjectEntry,
769
+ required: false,
770
+ loadAclRoles: this.loadAclRoles,
771
+ saveAclObjectEntry: this.saveAclObjectEntry
772
+ };
773
+ this._dialog.open(FsAclEntryComponent, {
774
+ data: data
775
+ })
776
+ .afterClosed()
777
+ .pipe(takeUntil(this._destroy$))
778
+ .subscribe(() => {
779
+ this.aclEntriesList.reload();
780
+ });
781
+ }
782
+ ngOnDestroy() {
783
+ this._destroy$.next();
784
+ this._destroy$.complete();
785
+ }
786
+ reload() {
787
+ this.aclEntriesList.reload();
788
+ }
789
+ }
790
+ 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 });
791
+ 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]" }] });
792
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAclEntriesComponent, decorators: [{
793
+ type: Component,
794
+ args: [{
795
+ selector: 'fs-acl-entries',
796
+ templateUrl: './acl-entries.component.html',
797
+ styleUrls: ['./acl-entries.component.scss']
798
+ }]
799
+ }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialog }, { type: i3$1.FsPrompt }]; }, propDecorators: { loadAclEntries: [{
800
+ type: Input
801
+ }], loadAclRoles: [{
802
+ type: Input
803
+ }], saveAclObjectEntry: [{
804
+ type: Input
805
+ }], environmentShow: [{
806
+ type: Input
807
+ }], environmentLabel: [{
808
+ type: Input
809
+ }], environmentKey: [{
810
+ type: Input
811
+ }], actions: [{
812
+ type: Input
813
+ }], aclEntriesList: [{
814
+ type: ViewChild,
815
+ args: [FsListComponent]
790
816
  }] } });
791
817
 
792
- class FsAppAclModule {
793
- }
794
- FsAppAclModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAppAclModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
795
- FsAppAclModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAppAclModule, declarations: [FsAclRolesComponent,
796
- FsAclPermissionPopoverComponent,
797
- FsAclRoleComponent,
798
- FsAclEntriesComponent,
799
- FsAclRolePopoverComponent,
800
- FsAclObjectRolesComponent,
801
- FsAclEntryComponent], imports: [CommonModule,
802
- FormsModule,
803
- MatDialogModule,
804
- MatFormFieldModule,
805
- MatCheckboxModule,
806
- MatSelectModule,
807
- MatButtonModule,
808
- MatRadioModule,
809
- MatInputModule,
810
- FlexLayoutModule,
811
- FsListModule,
812
- FsPopoverModule,
813
- FsDialogModule,
814
- FsFormModule,
815
- FsLabelModule,
816
- FsRadioGroupModule,
817
- FsBadgeModule,
818
- FsCheckboxGroupModule], exports: [FsAclRolesComponent,
819
- FsAclPermissionPopoverComponent,
820
- FsAclRoleComponent,
821
- FsAclEntriesComponent,
822
- FsAclRolePopoverComponent,
823
- FsAclObjectRolesComponent,
824
- FsAclEntryComponent] });
825
- FsAppAclModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAppAclModule, imports: [[
826
- CommonModule,
827
- FormsModule,
828
- MatDialogModule,
829
- MatFormFieldModule,
830
- MatCheckboxModule,
831
- MatSelectModule,
832
- MatButtonModule,
833
- MatRadioModule,
834
- MatInputModule,
835
- FlexLayoutModule,
836
- FsListModule,
837
- FsPopoverModule,
838
- FsDialogModule,
839
- FsFormModule,
840
- FsLabelModule,
841
- FsRadioGroupModule,
842
- FsBadgeModule,
843
- FsCheckboxGroupModule,
844
- ]] });
845
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAppAclModule, decorators: [{
846
- type: NgModule,
847
- args: [{
848
- imports: [
849
- CommonModule,
850
- FormsModule,
851
- MatDialogModule,
852
- MatFormFieldModule,
853
- MatCheckboxModule,
854
- MatSelectModule,
855
- MatButtonModule,
856
- MatRadioModule,
857
- MatInputModule,
858
- FlexLayoutModule,
859
- FsListModule,
860
- FsPopoverModule,
861
- FsDialogModule,
862
- FsFormModule,
863
- FsLabelModule,
864
- FsRadioGroupModule,
865
- FsBadgeModule,
866
- FsCheckboxGroupModule,
867
- ],
868
- declarations: [
869
- FsAclRolesComponent,
870
- FsAclPermissionPopoverComponent,
871
- FsAclRoleComponent,
872
- FsAclEntriesComponent,
873
- FsAclRolePopoverComponent,
874
- FsAclObjectRolesComponent,
875
- FsAclEntryComponent,
876
- ],
877
- exports: [
878
- FsAclRolesComponent,
879
- FsAclPermissionPopoverComponent,
880
- FsAclRoleComponent,
881
- FsAclEntriesComponent,
882
- FsAclRolePopoverComponent,
883
- FsAclObjectRolesComponent,
884
- FsAclEntryComponent,
885
- ],
886
- }]
818
+ class FsAppAclModule {
819
+ }
820
+ FsAppAclModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAppAclModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
821
+ FsAppAclModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAppAclModule, declarations: [FsAclRolesComponent,
822
+ FsAclPermissionPopoverComponent,
823
+ FsAclRoleComponent,
824
+ FsAclEntriesComponent,
825
+ FsAclRolePopoverComponent,
826
+ FsAclObjectRolesComponent,
827
+ FsAclEntryComponent,
828
+ BulkOptionsFilterPipe], imports: [CommonModule,
829
+ FormsModule,
830
+ MatDialogModule,
831
+ MatFormFieldModule,
832
+ MatCheckboxModule,
833
+ MatSelectModule,
834
+ MatButtonModule,
835
+ MatRadioModule,
836
+ MatInputModule,
837
+ FlexLayoutModule,
838
+ FsListModule,
839
+ FsPopoverModule,
840
+ FsDialogModule,
841
+ FsFormModule,
842
+ FsLabelModule,
843
+ FsRadioGroupModule,
844
+ FsBadgeModule,
845
+ FsCheckboxGroupModule,
846
+ FsMenuModule], exports: [FsAclRolesComponent,
847
+ FsAclPermissionPopoverComponent,
848
+ FsAclRoleComponent,
849
+ FsAclEntriesComponent,
850
+ FsAclRolePopoverComponent,
851
+ FsAclObjectRolesComponent,
852
+ FsAclEntryComponent] });
853
+ FsAppAclModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAppAclModule, imports: [[
854
+ CommonModule,
855
+ FormsModule,
856
+ MatDialogModule,
857
+ MatFormFieldModule,
858
+ MatCheckboxModule,
859
+ MatSelectModule,
860
+ MatButtonModule,
861
+ MatRadioModule,
862
+ MatInputModule,
863
+ FlexLayoutModule,
864
+ FsListModule,
865
+ FsPopoverModule,
866
+ FsDialogModule,
867
+ FsFormModule,
868
+ FsLabelModule,
869
+ FsRadioGroupModule,
870
+ FsBadgeModule,
871
+ FsCheckboxGroupModule,
872
+ FsMenuModule,
873
+ ]] });
874
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FsAppAclModule, decorators: [{
875
+ type: NgModule,
876
+ args: [{
877
+ imports: [
878
+ CommonModule,
879
+ FormsModule,
880
+ MatDialogModule,
881
+ MatFormFieldModule,
882
+ MatCheckboxModule,
883
+ MatSelectModule,
884
+ MatButtonModule,
885
+ MatRadioModule,
886
+ MatInputModule,
887
+ FlexLayoutModule,
888
+ FsListModule,
889
+ FsPopoverModule,
890
+ FsDialogModule,
891
+ FsFormModule,
892
+ FsLabelModule,
893
+ FsRadioGroupModule,
894
+ FsBadgeModule,
895
+ FsCheckboxGroupModule,
896
+ FsMenuModule,
897
+ ],
898
+ declarations: [
899
+ FsAclRolesComponent,
900
+ FsAclPermissionPopoverComponent,
901
+ FsAclRoleComponent,
902
+ FsAclEntriesComponent,
903
+ FsAclRolePopoverComponent,
904
+ FsAclObjectRolesComponent,
905
+ FsAclEntryComponent,
906
+ BulkOptionsFilterPipe,
907
+ ],
908
+ exports: [
909
+ FsAclRolesComponent,
910
+ FsAclPermissionPopoverComponent,
911
+ FsAclRoleComponent,
912
+ FsAclEntriesComponent,
913
+ FsAclRolePopoverComponent,
914
+ FsAclObjectRolesComponent,
915
+ FsAclEntryComponent,
916
+ ],
917
+ }]
887
918
  }] });
888
919
 
889
- /**
890
- * Generated bundle index. Do not edit.
920
+ /**
921
+ * Generated bundle index. Do not edit.
891
922
  */
892
923
 
893
924
  export { FS_APP_ACL_CONFIG, FsAclEntriesComponent, FsAclEntryComponent, FsAclObjectRolesComponent, FsAclPermissionPopoverComponent, FsAclRoleComponent, FsAclRolePopoverComponent, FsAclRolesComponent, FsAppAclModule, FsAppAclService };