@firestitch/app-acl 13.0.0 → 15.0.0

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