@firestitch/app-acl 18.0.4 → 18.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/components/acl-entries/acl-entries.component.d.ts +1 -5
- package/app/components/acl-entry/acl-entry.component.d.ts +9 -13
- package/app/components/acl-object-roles/acl-object-roles.component.d.ts +1 -1
- package/app/components/acl-permission-popover/acl-permission-popover.component.d.ts +1 -3
- package/app/components/acl-role/acl-role.component.d.ts +5 -9
- package/app/components/acl-role-popover/acl-role-popover.component.d.ts +1 -3
- package/app/components/acl-roles/acl-roles.component.d.ts +4 -7
- package/app/pipes/acl-role-permission-available.pipe.d.ts +1 -1
- package/app/pipes/bulk-options-filter.pipe.d.ts +1 -1
- package/app/services/app-acl.service.d.ts +5 -7
- package/esm2022/app/components/acl-entries/acl-entries.component.mjs +14 -22
- package/esm2022/app/components/acl-entry/acl-entry.component.mjs +39 -32
- package/esm2022/app/components/acl-object-roles/acl-object-roles.component.mjs +12 -11
- package/esm2022/app/components/acl-permission-popover/acl-permission-popover.component.mjs +9 -12
- package/esm2022/app/components/acl-role/acl-role.component.mjs +64 -48
- package/esm2022/app/components/acl-role-popover/acl-role-popover.component.mjs +9 -13
- package/esm2022/app/components/acl-roles/acl-roles.component.mjs +18 -25
- package/esm2022/app/interfaces/app-acl-config.mjs +1 -1
- package/esm2022/app/pipes/acl-role-permission-available.pipe.mjs +4 -3
- package/esm2022/app/pipes/bulk-options-filter.pipe.mjs +4 -3
- package/esm2022/app/services/app-acl.service.mjs +8 -25
- package/esm2022/public_api.mjs +1 -2
- package/fesm2022/firestitch-app-acl.mjs +166 -282
- package/fesm2022/firestitch-app-acl.mjs.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +0 -1
- package/app/fs-app-acl.module.d.ts +0 -33
- package/app/pipes/index.d.ts +0 -2
- package/esm2022/app/fs-app-acl.module.mjs +0 -127
- package/esm2022/app/pipes/index.mjs +0 -3
|
@@ -1,93 +1,57 @@
|
|
|
1
|
-
import * as i12 from '@angular/material/input';
|
|
2
|
-
import { MatInputModule } from '@angular/material/input';
|
|
3
|
-
import * as i11 from '@angular/material/radio';
|
|
4
|
-
import { MatRadioModule } from '@angular/material/radio';
|
|
5
|
-
import * as i10 from '@angular/material/button';
|
|
6
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
7
|
-
import * as i8 from '@angular/material/select';
|
|
8
|
-
import { MatSelectModule } from '@angular/material/select';
|
|
9
|
-
import * as i7 from '@angular/material/checkbox';
|
|
10
|
-
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
11
|
-
import * as i2 from '@angular/material/dialog';
|
|
12
|
-
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
13
1
|
import * as i0 from '@angular/core';
|
|
14
|
-
import { InjectionToken,
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
2
|
+
import { InjectionToken, inject, Injectable, Pipe, ChangeDetectorRef, Component, ChangeDetectionStrategy, ViewChild, Input, QueryList, ViewChildren, EventEmitter, Output } from '@angular/core';
|
|
3
|
+
import { MAT_DIALOG_DATA, MatDialogRef, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogClose, MatDialog } from '@angular/material/dialog';
|
|
4
|
+
import { list } from '@firestitch/common';
|
|
5
|
+
import { ItemType } from '@firestitch/filter';
|
|
6
|
+
import * as i1$1 from '@firestitch/list';
|
|
18
7
|
import { FsListComponent, FsListModule } from '@firestitch/list';
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
23
|
-
import * as
|
|
8
|
+
import { Subject, forkJoin, of, Observable } from 'rxjs';
|
|
9
|
+
import { shareReplay, map, takeUntil, tap, filter } from 'rxjs/operators';
|
|
10
|
+
import { MatButton } from '@angular/material/button';
|
|
11
|
+
import { FsMessage } from '@firestitch/message';
|
|
12
|
+
import * as i1 from '@angular/forms';
|
|
13
|
+
import { FormsModule, ControlContainer, NgForm } from '@angular/forms';
|
|
14
|
+
import * as i2 from '@firestitch/form';
|
|
24
15
|
import { FsFormModule } from '@firestitch/form';
|
|
25
|
-
import * as
|
|
16
|
+
import * as i3 from '@firestitch/dialog';
|
|
17
|
+
import { FsDialogModule } from '@firestitch/dialog';
|
|
18
|
+
import { CdkScrollable } from '@angular/cdk/scrolling';
|
|
19
|
+
import { MatFormField, MatLabel, MatHint } from '@angular/material/form-field';
|
|
20
|
+
import { MatInput } from '@angular/material/input';
|
|
21
|
+
import * as i4 from '@firestitch/label';
|
|
26
22
|
import { FsLabelModule } from '@firestitch/label';
|
|
27
|
-
import * as
|
|
23
|
+
import * as i5 from '@firestitch/radiogroup';
|
|
28
24
|
import { FsRadioGroupModule } from '@firestitch/radiogroup';
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
33
|
-
import * as
|
|
25
|
+
import { MatRadioButton } from '@angular/material/radio';
|
|
26
|
+
import { MatCheckbox } from '@angular/material/checkbox';
|
|
27
|
+
import { MatSelect } from '@angular/material/select';
|
|
28
|
+
import { MatOption } from '@angular/material/core';
|
|
29
|
+
import * as i7 from '@firestitch/menu';
|
|
34
30
|
import { FsMenuModule } from '@firestitch/menu';
|
|
35
|
-
import
|
|
36
|
-
import {
|
|
37
|
-
import { list } from '@firestitch/common';
|
|
38
|
-
import { ReplaySubject, Subject, forkJoin, of, Observable } from 'rxjs';
|
|
39
|
-
import * as i3 from '@firestitch/message';
|
|
40
|
-
import * as i5 from '@angular/forms';
|
|
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';
|
|
31
|
+
import * as i1$2 from '@firestitch/popover';
|
|
32
|
+
import { FsPopoverModule } from '@firestitch/popover';
|
|
45
33
|
import { groupBy, sortBy } from 'lodash-es';
|
|
46
|
-
import
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
AclRoleAccess[AclRoleAccess["Read"] = 5] = "Read";
|
|
52
|
-
AclRoleAccess[AclRoleAccess["Write"] = 10] = "Write";
|
|
53
|
-
AclRoleAccess[AclRoleAccess["Full"] = 15] = "Full";
|
|
54
|
-
})(AclRoleAccess || (AclRoleAccess = {}));
|
|
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 }
|
|
61
|
-
];
|
|
34
|
+
import { FsPrompt } from '@firestitch/prompt';
|
|
35
|
+
import * as i1$3 from '@firestitch/checkboxgroup';
|
|
36
|
+
import { FsCheckboxGroupModule } from '@firestitch/checkboxgroup';
|
|
37
|
+
import * as i2$1 from '@firestitch/badge';
|
|
38
|
+
import { FsBadgeModule } from '@firestitch/badge';
|
|
62
39
|
|
|
63
40
|
const FS_APP_ACL_CONFIG = new InjectionToken('fs-app-acl-config');
|
|
64
41
|
|
|
65
42
|
class FsAppAclService {
|
|
66
|
-
_appAclConfig;
|
|
43
|
+
_appAclConfig = inject(FS_APP_ACL_CONFIG);
|
|
67
44
|
_permissions$;
|
|
68
45
|
_levels$;
|
|
69
|
-
constructor(_appAclConfig) {
|
|
70
|
-
this._appAclConfig = _appAclConfig;
|
|
71
|
-
}
|
|
72
46
|
getPermissions() {
|
|
73
47
|
if (!this._permissions$) {
|
|
74
|
-
this._permissions$ =
|
|
75
|
-
this._appAclConfig.permissions
|
|
76
|
-
.subscribe((permissions) => {
|
|
77
|
-
this._permissions$.next(permissions);
|
|
78
|
-
this._permissions$.complete();
|
|
79
|
-
});
|
|
48
|
+
this._permissions$ = this._appAclConfig.permissions.pipe(shareReplay(1));
|
|
80
49
|
}
|
|
81
50
|
return this._permissions$;
|
|
82
51
|
}
|
|
83
52
|
getLevels() {
|
|
84
53
|
if (!this._levels$) {
|
|
85
|
-
this._levels$ =
|
|
86
|
-
this._appAclConfig.levels
|
|
87
|
-
.subscribe((levels) => {
|
|
88
|
-
this._levels$.next(levels);
|
|
89
|
-
this._levels$.complete();
|
|
90
|
-
});
|
|
54
|
+
this._levels$ = this._appAclConfig.levels.pipe(shareReplay(1));
|
|
91
55
|
}
|
|
92
56
|
return this._levels$;
|
|
93
57
|
}
|
|
@@ -97,7 +61,7 @@ class FsAppAclService {
|
|
|
97
61
|
return list(data, 'name', 'value');
|
|
98
62
|
}));
|
|
99
63
|
}
|
|
100
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAppAclService, deps: [
|
|
64
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAppAclService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
101
65
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAppAclService, providedIn: 'root' });
|
|
102
66
|
}
|
|
103
67
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAppAclService, decorators: [{
|
|
@@ -105,10 +69,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
105
69
|
args: [{
|
|
106
70
|
providedIn: 'root',
|
|
107
71
|
}]
|
|
108
|
-
}]
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
72
|
+
}] });
|
|
73
|
+
|
|
74
|
+
var AclRoleAccess;
|
|
75
|
+
(function (AclRoleAccess) {
|
|
76
|
+
AclRoleAccess[AclRoleAccess["None"] = 0] = "None";
|
|
77
|
+
AclRoleAccess[AclRoleAccess["Read"] = 5] = "Read";
|
|
78
|
+
AclRoleAccess[AclRoleAccess["Write"] = 10] = "Write";
|
|
79
|
+
AclRoleAccess[AclRoleAccess["Full"] = 15] = "Full";
|
|
80
|
+
})(AclRoleAccess || (AclRoleAccess = {}));
|
|
81
|
+
|
|
82
|
+
const AclRoleAccesses = [
|
|
83
|
+
{ name: 'None', value: AclRoleAccess.None },
|
|
84
|
+
{ name: 'Read', value: AclRoleAccess.Read },
|
|
85
|
+
{ name: 'Write', value: AclRoleAccess.Write },
|
|
86
|
+
{ name: 'Full', value: AclRoleAccess.Full }
|
|
87
|
+
];
|
|
112
88
|
|
|
113
89
|
class BulkOptionsFilterPipe {
|
|
114
90
|
transform(rolesList, children) {
|
|
@@ -126,12 +102,13 @@ class BulkOptionsFilterPipe {
|
|
|
126
102
|
}, (new Set));
|
|
127
103
|
}
|
|
128
104
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BulkOptionsFilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
129
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: BulkOptionsFilterPipe, name: "builkOptionsFilter" });
|
|
105
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: BulkOptionsFilterPipe, isStandalone: true, name: "builkOptionsFilter" });
|
|
130
106
|
}
|
|
131
107
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BulkOptionsFilterPipe, decorators: [{
|
|
132
108
|
type: Pipe,
|
|
133
109
|
args: [{
|
|
134
|
-
name: 'builkOptionsFilter'
|
|
110
|
+
name: 'builkOptionsFilter',
|
|
111
|
+
standalone: true
|
|
135
112
|
}]
|
|
136
113
|
}] });
|
|
137
114
|
|
|
@@ -145,21 +122,22 @@ class AclRolePermissionAvailablePipe {
|
|
|
145
122
|
return true;
|
|
146
123
|
}
|
|
147
124
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: AclRolePermissionAvailablePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
148
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: AclRolePermissionAvailablePipe, name: "aclRolePermissionAvailable" });
|
|
125
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: AclRolePermissionAvailablePipe, isStandalone: true, name: "aclRolePermissionAvailable" });
|
|
149
126
|
}
|
|
150
127
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: AclRolePermissionAvailablePipe, decorators: [{
|
|
151
128
|
type: Pipe,
|
|
152
129
|
args: [{
|
|
153
|
-
name: 'aclRolePermissionAvailable'
|
|
130
|
+
name: 'aclRolePermissionAvailable',
|
|
131
|
+
standalone: true
|
|
154
132
|
}]
|
|
155
133
|
}] });
|
|
156
134
|
|
|
157
135
|
class FsAclRoleComponent {
|
|
158
|
-
_data;
|
|
159
|
-
_appAclService;
|
|
160
|
-
_dialogRef;
|
|
161
|
-
_message;
|
|
162
|
-
_cdRef;
|
|
136
|
+
_data = inject(MAT_DIALOG_DATA);
|
|
137
|
+
_appAclService = inject(FsAppAclService);
|
|
138
|
+
_dialogRef = inject(MatDialogRef);
|
|
139
|
+
_message = inject(FsMessage);
|
|
140
|
+
_cdRef = inject(ChangeDetectorRef);
|
|
163
141
|
list;
|
|
164
142
|
submitButton;
|
|
165
143
|
aclRole = null;
|
|
@@ -179,13 +157,6 @@ class FsAclRoleComponent {
|
|
|
179
157
|
loadRoleConfigs;
|
|
180
158
|
disabled;
|
|
181
159
|
_destroy$ = new Subject();
|
|
182
|
-
constructor(_data, _appAclService, _dialogRef, _message, _cdRef) {
|
|
183
|
-
this._data = _data;
|
|
184
|
-
this._appAclService = _appAclService;
|
|
185
|
-
this._dialogRef = _dialogRef;
|
|
186
|
-
this._message = _message;
|
|
187
|
-
this._cdRef = _cdRef;
|
|
188
|
-
}
|
|
189
160
|
ngOnInit() {
|
|
190
161
|
forkJoin(this.getRole(), this._appAclService.getPermissions())
|
|
191
162
|
.pipe(takeUntil(this._destroy$))
|
|
@@ -370,16 +341,37 @@ class FsAclRoleComponent {
|
|
|
370
341
|
this.aclRolePermissions[permission.value] = AclRoleAccess.None;
|
|
371
342
|
});
|
|
372
343
|
}
|
|
373
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclRoleComponent, deps: [
|
|
374
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", 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\n fsForm\n [submit]=\"save\">\n <fs-dialog>\n <ng-container *ngIf=\"aclRole\">\n <div mat-dialog-title>\n <ng-container *ngIf=\"!disabled\">\n {{ aclRole.id ? 'Edit' : 'Create' }}\n </ng-container>\n <ng-container *ngIf=\"disabled\">\n View\n </ng-container>\n Role\n </div>\n <mat-dialog-content>\n <div class=\"fs-row.gap-lg.align-start\">\n <div class=\"fs-column left-column\">\n <mat-form-field>\n <mat-label>\n Name\n </mat-label>\n <input\n matInput\n [(ngModel)]=\"aclRole.name\"\n [disabled]=\"disabled\"\n name=\"name\"\n fsFormRequired>\n </mat-form-field>\n <mat-form-field>\n <mat-label>\n Description\n </mat-label>\n <input\n matInput\n [(ngModel)]=\"aclRole.description\"\n [disabled]=\"disabled\"\n name=\"description\">\n </mat-form-field>\n <fs-label-field *ngIf=\"aclRole.id || aclLevels.length === 1; else levels\">\n <fs-label>\n Level\n </fs-label>\n {{ indexedAclLevels[aclRole.level] }}\n </fs-label-field>\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 <fs-label-field *ngIf=\"levelPermissions.length\">\n <fs-label>\n All Permissions\n </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 <div\n class=\"fs-column\"\n *ngFor=\"let roleConfig of roleConfigs\">\n <fs-label-field *ngIf=\"roleConfig.type === 'checkbox'\">\n <fs-label>\n {{ roleConfig.label }}\n </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>\n {{ roleConfig.description }}\n </mat-hint>\n </fs-label-message>\n </fs-label-field>\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>\n {{ roleConfig.description }}\n </mat-hint>\n </mat-form-field>\n </div>\n </div>\n <div\n *ngIf=\"aclRole.level\"\n [hidden]=\"!levelPermissions.length\"\n class=\"permissions fs-column\">\n <fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Permissions\">\n <ng-template\n fs-list-group-cell\n let-row=\"row\"\n class=\"permission-group\">\n <div class=\"permission-group\">\n {{ row.category || 'General' }}\n </div>\n </ng-template>\n <ng-template\n fs-list-cell\n let-row=\"row\">\n <div class=\"permission\">\n {{ row.name }}\n </div>\n <div class=\"description small\">\n {{ row.description }}\n </div>\n </ng-template>\n </fs-list-column>\n <fs-list-column\n title=\"Access\"\n width=\"1%\"\n 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\n fs-list-cell\n let-row=\"permission\"\n 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 class=\"form-field-padless\">\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\n mat-button\n [mat-dialog-close]=\"null\"\n type=\"button\">\n {{ disabled ? 'Done' : 'Cancel' }}\n </button>\n </mat-dialog-actions>\n </ng-container>\n </fs-dialog>\n</form>", 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.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { 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: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i8.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i9.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i10.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i11.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], 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", "customizable", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i13.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "directive", type: i13.FsListGroupHeaderDirective, selector: "[fs-list-group-cell],[fs-list-group-header]" }, { kind: "component", type: i14.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { kind: "directive", type: i15.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { kind: "directive", type: i15.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { kind: "directive", type: i15.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([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: ["appearance", "showOutline", "disabled", "focused", "hoverable", "padless"] }, { 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 });
|
|
344
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclRoleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
345
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsAclRoleComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true }, { propertyName: "submitButton", first: true, predicate: ["submit"], descendants: true }], ngImport: i0, template: "<form\n fsForm\n [submit]=\"save\">\n <fs-dialog>\n @if (aclRole) {\n <div mat-dialog-title>\n @if (!disabled) {\n {{ aclRole.id ? 'Edit' : 'Create' }}\n }\n @if (disabled) {\n View\n }\n role\n </div>\n <mat-dialog-content>\n <div class=\"fs-row.gap-lg.align-start\">\n <div class=\"fs-column left-column\">\n <mat-form-field>\n <mat-label>\n Name\n </mat-label>\n <input\n matInput\n [(ngModel)]=\"aclRole.name\"\n [disabled]=\"disabled\"\n name=\"name\"\n fsFormRequired>\n </mat-form-field>\n <mat-form-field>\n <mat-label>\n Description\n </mat-label>\n <input\n matInput\n [(ngModel)]=\"aclRole.description\"\n [disabled]=\"disabled\"\n name=\"description\">\n </mat-form-field>\n @if (aclRole.id || aclLevels.length === 1) {\n <fs-label-field>\n <fs-label>\n Level\n </fs-label>\n {{ indexedAclLevels[aclRole.level] }}\n </fs-label-field>\n } @else {\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 @for (item of aclLevels; track item) {\n <mat-radio-button\n [value]=\"item.value\"\n [disabled]=\"!!aclRole.protected\">\n {{ item.name }}\n </mat-radio-button>\n }\n </fs-radio-group>\n </div>\n }\n @if (levelPermissions.length) {\n <fs-label-field>\n <fs-label>\n All permissions\n </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 @for (roleConfig of roleConfigs; track roleConfig) {\n <div\n class=\"fs-column\"\n >\n @if (roleConfig.type === 'checkbox') {\n <fs-label-field>\n <fs-label>\n {{ roleConfig.label }}\n </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>\n {{ roleConfig.description }}\n </mat-hint>\n </fs-label-message>\n </fs-label-field>\n }\n @if (roleConfig.type === 'select') {\n <mat-form-field>\n <mat-select\n [(ngModel)]=\"aclRoleConfigValues[roleConfig.name]\"\n [name]=\"roleConfig.name\"\n [required]=\"roleConfig.required\"\n [disabled]=\"disabled\"\n [placeholder]=\"roleConfig.label\">\n @for (item of roleConfig.values; track item) {\n <mat-option\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n }\n </mat-select>\n <mat-hint>\n {{ roleConfig.description }}\n </mat-hint>\n </mat-form-field>\n }\n </div>\n }\n </div>\n @if (aclRole.level) {\n <div\n [hidden]=\"!levelPermissions.length\"\n class=\"permissions fs-column\">\n <fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Permissions\">\n <ng-template\n fs-list-group-cell\n let-row=\"row\"\n class=\"permission-group\">\n <div class=\"permission-group\">\n {{ row.category || 'General' }}\n </div>\n </ng-template>\n <ng-template\n fs-list-cell\n let-row=\"row\">\n <div class=\"permission\">\n {{ row.name }}\n </div>\n <div class=\"description small\">\n {{ row.description }}\n </div>\n </ng-template>\n </fs-list-column>\n <fs-list-column\n title=\"Access\"\n width=\"1%\"\n 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 @if (!aclRole.allPermissions && !disabled) {\n <fs-menu>\n @for (access of AclRoleAccesses | builkOptionsFilter: groupChildren; track access) {\n <ng-template\n fs-menu-item\n (click)=\"bulkChange(access.value, groupChildren, group)\">\n {{ access.name }}\n </ng-template>\n }\n </fs-menu>\n }\n </ng-template>\n <ng-template\n fs-list-cell\n let-row=\"permission\"\n let-permission=\"row\">\n @if (aclRole.allPermissions || disabled) {\n <span>\n {{ indexedAccesses[aclRolePermissions[permission.value]] }}\n </span>\n } @else {\n @if (permission|aclRolePermissionAvailable:aclRolePermissions) {\n <mat-form-field class=\"form-field-padless\">\n <mat-select\n [(ngModel)]=\"aclRolePermissions[permission.value]\"\n [disabled]=\"!!aclRole.protected\"\n required\n [name]=\"'access-' + permission.value\"\n (ngModelChange)=\"permissionChange()\">\n @for (access of AclRoleAccesses; track access) {\n @if (access.value === 0 || permission.accesses.indexOf(access.value) !== -1) {\n <mat-option\n [value]=\"access.value\">\n {{ access.name }}\n </mat-option>\n }\n }\n </mat-select>\n </mat-form-field>\n } @else {\n Unavailable\n }\n }\n </ng-template>\n </fs-list-column>\n </fs-list>\n </div>\n }\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n @if (!disabled) {\n <button\n #submit\n mat-button\n type=\"submit\"\n color=\"primary\">\n {{ aclRole.id ? 'Save' : 'Create' }}\n </button>\n }\n <button\n mat-button\n [mat-dialog-close]=\"null\"\n type=\"button\">\n {{ disabled ? 'Done' : 'Cancel' }}\n </button>\n </mat-dialog-actions>\n }\n </fs-dialog>\n</form>", 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: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FsFormModule }, { kind: "directive", type: i2.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: i2.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { kind: "directive", type: i2.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: i2.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: "ngmodule", type: FsDialogModule }, { kind: "component", type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: 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: "ngmodule", type: FsLabelModule }, { kind: "component", type: i4.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i4.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["appearance", "showOutline", "disabled", "focused", "hoverable", "padless"] }, { kind: "component", type: i4.FsLabelMessageComponent, selector: "fs-label-message" }, { kind: "ngmodule", type: FsRadioGroupModule }, { kind: "component", type: i5.FsRadioGroupComponent, selector: "fs-radio-group", inputs: ["orientation", "label", "name", "disabled", "radioPosition", "compareWith", "required"] }, { kind: "component", type: MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FsListModule }, { kind: "component", type: i1$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i1$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customizable", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i1$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "directive", type: i1$1.FsListGroupHeaderDirective, selector: "[fs-list-group-cell],[fs-list-group-header]" }, { kind: "ngmodule", type: FsMenuModule }, { kind: "component", type: i7.FsMenuComponent, selector: "fs-menu", inputs: ["class", "buttonClass", "buttonType", "buttonColor"], outputs: ["opened", "closed"] }, { kind: "directive", type: i7.FsMenuItemDirective, selector: "fs-menu-group,[fs-menu-item]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "pipe", type: BulkOptionsFilterPipe, name: "builkOptionsFilter" }, { kind: "pipe", type: AclRolePermissionAvailablePipe, name: "aclRolePermissionAvailable" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
375
346
|
}
|
|
376
347
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclRoleComponent, decorators: [{
|
|
377
348
|
type: Component,
|
|
378
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush,
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
349
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
350
|
+
FormsModule,
|
|
351
|
+
FsFormModule,
|
|
352
|
+
FsDialogModule,
|
|
353
|
+
MatDialogTitle,
|
|
354
|
+
CdkScrollable,
|
|
355
|
+
MatDialogContent,
|
|
356
|
+
MatFormField,
|
|
357
|
+
MatLabel,
|
|
358
|
+
MatInput,
|
|
359
|
+
FsLabelModule,
|
|
360
|
+
FsRadioGroupModule,
|
|
361
|
+
MatRadioButton,
|
|
362
|
+
MatCheckbox,
|
|
363
|
+
MatHint,
|
|
364
|
+
MatSelect,
|
|
365
|
+
MatOption,
|
|
366
|
+
FsListModule,
|
|
367
|
+
FsMenuModule,
|
|
368
|
+
MatDialogActions,
|
|
369
|
+
MatButton,
|
|
370
|
+
MatDialogClose,
|
|
371
|
+
BulkOptionsFilterPipe,
|
|
372
|
+
AclRolePermissionAvailablePipe,
|
|
373
|
+
], template: "<form\n fsForm\n [submit]=\"save\">\n <fs-dialog>\n @if (aclRole) {\n <div mat-dialog-title>\n @if (!disabled) {\n {{ aclRole.id ? 'Edit' : 'Create' }}\n }\n @if (disabled) {\n View\n }\n role\n </div>\n <mat-dialog-content>\n <div class=\"fs-row.gap-lg.align-start\">\n <div class=\"fs-column left-column\">\n <mat-form-field>\n <mat-label>\n Name\n </mat-label>\n <input\n matInput\n [(ngModel)]=\"aclRole.name\"\n [disabled]=\"disabled\"\n name=\"name\"\n fsFormRequired>\n </mat-form-field>\n <mat-form-field>\n <mat-label>\n Description\n </mat-label>\n <input\n matInput\n [(ngModel)]=\"aclRole.description\"\n [disabled]=\"disabled\"\n name=\"description\">\n </mat-form-field>\n @if (aclRole.id || aclLevels.length === 1) {\n <fs-label-field>\n <fs-label>\n Level\n </fs-label>\n {{ indexedAclLevels[aclRole.level] }}\n </fs-label-field>\n } @else {\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 @for (item of aclLevels; track item) {\n <mat-radio-button\n [value]=\"item.value\"\n [disabled]=\"!!aclRole.protected\">\n {{ item.name }}\n </mat-radio-button>\n }\n </fs-radio-group>\n </div>\n }\n @if (levelPermissions.length) {\n <fs-label-field>\n <fs-label>\n All permissions\n </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 @for (roleConfig of roleConfigs; track roleConfig) {\n <div\n class=\"fs-column\"\n >\n @if (roleConfig.type === 'checkbox') {\n <fs-label-field>\n <fs-label>\n {{ roleConfig.label }}\n </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>\n {{ roleConfig.description }}\n </mat-hint>\n </fs-label-message>\n </fs-label-field>\n }\n @if (roleConfig.type === 'select') {\n <mat-form-field>\n <mat-select\n [(ngModel)]=\"aclRoleConfigValues[roleConfig.name]\"\n [name]=\"roleConfig.name\"\n [required]=\"roleConfig.required\"\n [disabled]=\"disabled\"\n [placeholder]=\"roleConfig.label\">\n @for (item of roleConfig.values; track item) {\n <mat-option\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n }\n </mat-select>\n <mat-hint>\n {{ roleConfig.description }}\n </mat-hint>\n </mat-form-field>\n }\n </div>\n }\n </div>\n @if (aclRole.level) {\n <div\n [hidden]=\"!levelPermissions.length\"\n class=\"permissions fs-column\">\n <fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Permissions\">\n <ng-template\n fs-list-group-cell\n let-row=\"row\"\n class=\"permission-group\">\n <div class=\"permission-group\">\n {{ row.category || 'General' }}\n </div>\n </ng-template>\n <ng-template\n fs-list-cell\n let-row=\"row\">\n <div class=\"permission\">\n {{ row.name }}\n </div>\n <div class=\"description small\">\n {{ row.description }}\n </div>\n </ng-template>\n </fs-list-column>\n <fs-list-column\n title=\"Access\"\n width=\"1%\"\n 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 @if (!aclRole.allPermissions && !disabled) {\n <fs-menu>\n @for (access of AclRoleAccesses | builkOptionsFilter: groupChildren; track access) {\n <ng-template\n fs-menu-item\n (click)=\"bulkChange(access.value, groupChildren, group)\">\n {{ access.name }}\n </ng-template>\n }\n </fs-menu>\n }\n </ng-template>\n <ng-template\n fs-list-cell\n let-row=\"permission\"\n let-permission=\"row\">\n @if (aclRole.allPermissions || disabled) {\n <span>\n {{ indexedAccesses[aclRolePermissions[permission.value]] }}\n </span>\n } @else {\n @if (permission|aclRolePermissionAvailable:aclRolePermissions) {\n <mat-form-field class=\"form-field-padless\">\n <mat-select\n [(ngModel)]=\"aclRolePermissions[permission.value]\"\n [disabled]=\"!!aclRole.protected\"\n required\n [name]=\"'access-' + permission.value\"\n (ngModelChange)=\"permissionChange()\">\n @for (access of AclRoleAccesses; track access) {\n @if (access.value === 0 || permission.accesses.indexOf(access.value) !== -1) {\n <mat-option\n [value]=\"access.value\">\n {{ access.name }}\n </mat-option>\n }\n }\n </mat-select>\n </mat-form-field>\n } @else {\n Unavailable\n }\n }\n </ng-template>\n </fs-list-column>\n </fs-list>\n </div>\n }\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n @if (!disabled) {\n <button\n #submit\n mat-button\n type=\"submit\"\n color=\"primary\">\n {{ aclRole.id ? 'Save' : 'Create' }}\n </button>\n }\n <button\n mat-button\n [mat-dialog-close]=\"null\"\n type=\"button\">\n {{ disabled ? 'Done' : 'Cancel' }}\n </button>\n </mat-dialog-actions>\n }\n </fs-dialog>\n</form>", 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"] }]
|
|
374
|
+
}], propDecorators: { list: [{
|
|
383
375
|
type: ViewChild,
|
|
384
376
|
args: [FsListComponent]
|
|
385
377
|
}], submitButton: [{
|
|
@@ -388,12 +380,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
388
380
|
}] } });
|
|
389
381
|
|
|
390
382
|
class FsAclPermissionPopoverComponent {
|
|
391
|
-
_appAclService;
|
|
383
|
+
_appAclService = inject(FsAppAclService);
|
|
392
384
|
permission;
|
|
393
385
|
description;
|
|
394
|
-
constructor(_appAclService) {
|
|
395
|
-
this._appAclService = _appAclService;
|
|
396
|
-
}
|
|
397
386
|
ngOnInit() {
|
|
398
387
|
this._appAclService.getPermissions()
|
|
399
388
|
.subscribe(permissions => {
|
|
@@ -404,19 +393,19 @@ class FsAclPermissionPopoverComponent {
|
|
|
404
393
|
})[0];
|
|
405
394
|
});
|
|
406
395
|
}
|
|
407
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclPermissionPopoverComponent, deps: [
|
|
408
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", 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:
|
|
396
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclPermissionPopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
397
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FsAclPermissionPopoverComponent, isStandalone: true, 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: "ngmodule", type: FsPopoverModule }, { kind: "component", type: i1$2.FsPopoverComponent, selector: "fs-popover" }] });
|
|
409
398
|
}
|
|
410
399
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclPermissionPopoverComponent, decorators: [{
|
|
411
400
|
type: Component,
|
|
412
|
-
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"] }]
|
|
413
|
-
}],
|
|
401
|
+
args: [{ selector: 'acl-permission-popover', standalone: true, imports: [FsPopoverModule], 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"] }]
|
|
402
|
+
}], propDecorators: { permission: [{
|
|
414
403
|
type: Input
|
|
415
404
|
}] } });
|
|
416
405
|
|
|
417
406
|
class FsAclRolesComponent {
|
|
418
|
-
_appAclService;
|
|
419
|
-
_dialog;
|
|
407
|
+
_appAclService = inject(FsAppAclService);
|
|
408
|
+
_dialog = inject(MatDialog);
|
|
420
409
|
deleteAclRole;
|
|
421
410
|
restoreAclRole;
|
|
422
411
|
saveAclRole;
|
|
@@ -430,12 +419,8 @@ class FsAclRolesComponent {
|
|
|
430
419
|
permissions;
|
|
431
420
|
indexedAclRoleLevels = {};
|
|
432
421
|
_destroy$ = new Subject();
|
|
433
|
-
constructor(_appAclService, _dialog) {
|
|
434
|
-
this._appAclService = _appAclService;
|
|
435
|
-
this._dialog = _dialog;
|
|
436
|
-
}
|
|
437
422
|
ngOnInit() {
|
|
438
|
-
new Observable(observer => {
|
|
423
|
+
new Observable((observer) => {
|
|
439
424
|
if (this.aclLevels.length) {
|
|
440
425
|
observer.next(this.aclLevels);
|
|
441
426
|
observer.complete();
|
|
@@ -494,7 +479,7 @@ class FsAclRolesComponent {
|
|
|
494
479
|
label: 'Level',
|
|
495
480
|
type: ItemType.Select,
|
|
496
481
|
values: this.aclLevels,
|
|
497
|
-
hide: this.aclLevels.length <= 1
|
|
482
|
+
hide: this.aclLevels.length <= 1,
|
|
498
483
|
},
|
|
499
484
|
{
|
|
500
485
|
name: 'state',
|
|
@@ -524,7 +509,7 @@ class FsAclRolesComponent {
|
|
|
524
509
|
menu: true,
|
|
525
510
|
label: 'Delete',
|
|
526
511
|
show: (row) => {
|
|
527
|
-
const hideDelete =
|
|
512
|
+
const hideDelete = this.disabledAclRole
|
|
528
513
|
? this.disabledAclRole(row)
|
|
529
514
|
: false;
|
|
530
515
|
return !!this.deleteAclRole
|
|
@@ -553,13 +538,13 @@ class FsAclRolesComponent {
|
|
|
553
538
|
},
|
|
554
539
|
};
|
|
555
540
|
}
|
|
556
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclRolesComponent, deps: [
|
|
557
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
541
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclRolesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
542
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsAclRolesComponent, isStandalone: true, 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: "@if (listConfig) {\n <fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Name\" name=\"name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n @if (row.state !== 'deleted') {\n <a (click)=\"openDialog(row)\">{{ row.name }}</a>\n } @else {\n {{ row.name }}\n }\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 @for (permission of row.permissions; track permission) {\n @if (permission.access) {\n <span class=\"permission\">\n <acl-permission-popover [permission]=\"permission\">{{permission.name}}</acl-permission-popover>\n </span>\n }\n }\n </div>\n </ng-template>\n </fs-list-column>\n </fs-list>\n}\n", styles: [".permissions .permission+.permission:before{content:\", \"}\n"], dependencies: [{ kind: "ngmodule", type: FsListModule }, { kind: "component", type: i1$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i1$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customizable", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i1$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "component", type: FsAclPermissionPopoverComponent, selector: "acl-permission-popover", inputs: ["permission"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
558
543
|
}
|
|
559
544
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclRolesComponent, decorators: [{
|
|
560
545
|
type: Component,
|
|
561
|
-
args: [{ selector: 'fs-acl-roles', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-list [config]=\"listConfig\"
|
|
562
|
-
}],
|
|
546
|
+
args: [{ selector: 'fs-acl-roles', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [FsListModule, FsAclPermissionPopoverComponent], template: "@if (listConfig) {\n <fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Name\" name=\"name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n @if (row.state !== 'deleted') {\n <a (click)=\"openDialog(row)\">{{ row.name }}</a>\n } @else {\n {{ row.name }}\n }\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 @for (permission of row.permissions; track permission) {\n @if (permission.access) {\n <span class=\"permission\">\n <acl-permission-popover [permission]=\"permission\">{{permission.name}}</acl-permission-popover>\n </span>\n }\n }\n </div>\n </ng-template>\n </fs-list-column>\n </fs-list>\n}\n", styles: [".permissions .permission+.permission:before{content:\", \"}\n"] }]
|
|
547
|
+
}], propDecorators: { deleteAclRole: [{
|
|
563
548
|
type: Input
|
|
564
549
|
}], restoreAclRole: [{
|
|
565
550
|
type: Input
|
|
@@ -580,37 +565,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
580
565
|
args: [FsListComponent]
|
|
581
566
|
}] } });
|
|
582
567
|
|
|
583
|
-
class FsAclRolePopoverComponent {
|
|
584
|
-
_appAclService;
|
|
585
|
-
aclRole;
|
|
586
|
-
objectName;
|
|
587
|
-
permissions = [];
|
|
588
|
-
constructor(_appAclService) {
|
|
589
|
-
this._appAclService = _appAclService;
|
|
590
|
-
}
|
|
591
|
-
ngOnInit() {
|
|
592
|
-
const aclRolePermissions = this.aclRole.permissions || [];
|
|
593
|
-
this._appAclService.getPermissions()
|
|
594
|
-
.subscribe((response) => {
|
|
595
|
-
this.permissions = response.filter(item => {
|
|
596
|
-
return aclRolePermissions.some(permission => {
|
|
597
|
-
return item.value === permission.value;
|
|
598
|
-
});
|
|
599
|
-
});
|
|
600
|
-
});
|
|
601
|
-
}
|
|
602
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclRolePopoverComponent, deps: [{ token: FsAppAclService }], target: i0.ɵɵFactoryTarget.Component });
|
|
603
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", 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" }] });
|
|
604
|
-
}
|
|
605
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclRolePopoverComponent, decorators: [{
|
|
606
|
-
type: Component,
|
|
607
|
-
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"] }]
|
|
608
|
-
}], ctorParameters: () => [{ type: FsAppAclService }], propDecorators: { aclRole: [{
|
|
609
|
-
type: Input
|
|
610
|
-
}], objectName: [{
|
|
611
|
-
type: Input
|
|
612
|
-
}] } });
|
|
613
|
-
|
|
614
568
|
class FsAclObjectRolesComponent {
|
|
615
569
|
aclRoles = [];
|
|
616
570
|
required = false;
|
|
@@ -627,11 +581,11 @@ class FsAclObjectRolesComponent {
|
|
|
627
581
|
this.change.emit(this.aclObjectRoles);
|
|
628
582
|
}
|
|
629
583
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclObjectRolesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
630
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
584
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsAclObjectRolesComponent, isStandalone: true, 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: "@if (!multiple) {\n @for (aclObjectRole of aclObjectRoles; track aclObjectRole) {\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 @for (aclRole of aclRoles; track aclRole) {\n <mat-checkbox [disabled]=\"disabled\" [value]=\"$any(aclRole)\">\n {{ aclRole.name }}\n </mat-checkbox>\n }\n </fs-checkbox-group>\n }\n}\n\n@if (multiple) {\n <table>\n <tr>\n <td>\n <small>{{levelLabel}}</small>\n </td>\n <td>\n <small>{{rolesLabel}}</small>\n </td>\n </tr>\n @for (aclObjectRole of aclObjectRoles; track aclObjectRole) {\n <tr>\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 @for (aclRole of aclRoles; track aclRole) {\n <mat-option [value]=\"aclRole\">\n {{ aclRole.name }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </td>\n </tr>\n }\n </table>\n}\n", styles: ["table tr td:first-child{padding-right:15px}\n"], dependencies: [{ kind: "ngmodule", type: FsCheckboxGroupModule }, { kind: "component", type: i1$3.FsCheckboxGroupComponent, selector: "fs-checkbox-group", inputs: ["orientation", "position", "label", "disabled", "compareWith"], outputs: ["change"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: FsFormModule }, { kind: "directive", type: i2.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { kind: "directive", type: i2.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: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }] });
|
|
631
585
|
}
|
|
632
586
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclObjectRolesComponent, decorators: [{
|
|
633
587
|
type: Component,
|
|
634
|
-
args: [{ selector: 'fs-acl-object-roles', viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], template: "
|
|
588
|
+
args: [{ selector: 'fs-acl-object-roles', viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], standalone: true, imports: [FsCheckboxGroupModule, FormsModule, FsFormModule, MatCheckbox, MatFormField, MatSelect, MatOption], template: "@if (!multiple) {\n @for (aclObjectRole of aclObjectRoles; track aclObjectRole) {\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 @for (aclRole of aclRoles; track aclRole) {\n <mat-checkbox [disabled]=\"disabled\" [value]=\"$any(aclRole)\">\n {{ aclRole.name }}\n </mat-checkbox>\n }\n </fs-checkbox-group>\n }\n}\n\n@if (multiple) {\n <table>\n <tr>\n <td>\n <small>{{levelLabel}}</small>\n </td>\n <td>\n <small>{{rolesLabel}}</small>\n </td>\n </tr>\n @for (aclObjectRole of aclObjectRoles; track aclObjectRole) {\n <tr>\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 @for (aclRole of aclRoles; track aclRole) {\n <mat-option [value]=\"aclRole\">\n {{ aclRole.name }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </td>\n </tr>\n }\n </table>\n}\n", styles: ["table tr td:first-child{padding-right:15px}\n"] }]
|
|
635
589
|
}], propDecorators: { aclRoles: [{
|
|
636
590
|
type: Input
|
|
637
591
|
}], required: [{
|
|
@@ -651,10 +605,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
651
605
|
}] } });
|
|
652
606
|
|
|
653
607
|
class FsAclEntryComponent {
|
|
654
|
-
_appAclService;
|
|
655
|
-
_dialogRef;
|
|
656
|
-
_message;
|
|
657
|
-
_data;
|
|
658
608
|
aclRoles = [];
|
|
659
609
|
aclObjectEntry;
|
|
660
610
|
aclObjectRole;
|
|
@@ -663,11 +613,12 @@ class FsAclEntryComponent {
|
|
|
663
613
|
titleEdit = 'Edit Roles';
|
|
664
614
|
titleAdd = 'Assign Roles';
|
|
665
615
|
required = true;
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
616
|
+
_appAclService = inject(FsAppAclService);
|
|
617
|
+
_dialogRef = inject(MatDialogRef);
|
|
618
|
+
_message = inject(FsMessage);
|
|
619
|
+
_data = inject(MAT_DIALOG_DATA);
|
|
620
|
+
constructor() {
|
|
621
|
+
const _data = this._data;
|
|
671
622
|
this.aclObjectEntry = { ..._data.aclObjectEntry };
|
|
672
623
|
this.required = _data.required ?? true;
|
|
673
624
|
if (_data.titleEdit) {
|
|
@@ -696,12 +647,12 @@ class FsAclEntryComponent {
|
|
|
696
647
|
}
|
|
697
648
|
aclObjectRoleChange(aclObjectRoles) {
|
|
698
649
|
this.aclEntries = aclObjectRoles.reduce((aclEntries, aclObjectRole) => {
|
|
699
|
-
aclObjectRole.aclRoles.forEach(aclRole => {
|
|
650
|
+
aclObjectRole.aclRoles.forEach((aclRole) => {
|
|
700
651
|
aclEntries.push({
|
|
701
652
|
aclRoleId: aclRole.id,
|
|
702
653
|
aclRole: aclRole,
|
|
703
654
|
objectId: aclObjectRole.object ? aclObjectRole.object.id : null,
|
|
704
|
-
object: aclObjectRole.object || null
|
|
655
|
+
object: aclObjectRole.object || null,
|
|
705
656
|
});
|
|
706
657
|
});
|
|
707
658
|
return aclEntries;
|
|
@@ -721,21 +672,58 @@ class FsAclEntryComponent {
|
|
|
721
672
|
close(data = null) {
|
|
722
673
|
this._dialogRef.close(data);
|
|
723
674
|
}
|
|
724
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclEntryComponent, deps: [
|
|
725
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
675
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclEntryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
676
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsAclEntryComponent, isStandalone: true, 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 @if (aclObjectRole) {\n <div>\n @if (aclObjectEntry.object) {\n <fs-label-field>\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 }\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: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FsFormModule }, { kind: "directive", type: i2.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: i2.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: "ngmodule", type: FsDialogModule }, { kind: "component", type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: FsLabelModule }, { kind: "component", type: i4.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i4.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["appearance", "showOutline", "disabled", "focused", "hoverable", "padless"] }, { kind: "component", type: FsAclObjectRolesComponent, selector: "fs-acl-object-roles", inputs: ["aclRoles", "required", "multiple", "disabled", "aclObjectRoles", "rolesLabel", "levelLabel"], outputs: ["change"] }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] });
|
|
726
677
|
}
|
|
727
678
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclEntryComponent, decorators: [{
|
|
728
679
|
type: Component,
|
|
729
|
-
args: [{
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
680
|
+
args: [{ standalone: true, imports: [
|
|
681
|
+
FormsModule,
|
|
682
|
+
FsFormModule,
|
|
683
|
+
FsDialogModule,
|
|
684
|
+
MatDialogTitle,
|
|
685
|
+
CdkScrollable,
|
|
686
|
+
MatDialogContent,
|
|
687
|
+
FsLabelModule,
|
|
688
|
+
FsAclObjectRolesComponent,
|
|
689
|
+
MatDialogActions,
|
|
690
|
+
MatButton,
|
|
691
|
+
MatDialogClose,
|
|
692
|
+
], template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <div mat-dialog-title>{{ titleEdit? titleEdit : titleAdd }}</div>\n <mat-dialog-content>\n @if (aclObjectRole) {\n <div>\n @if (aclObjectEntry.object) {\n <fs-label-field>\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 }\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"] }]
|
|
693
|
+
}], ctorParameters: () => [] });
|
|
694
|
+
|
|
695
|
+
class FsAclRolePopoverComponent {
|
|
696
|
+
_appAclService = inject(FsAppAclService);
|
|
697
|
+
aclRole;
|
|
698
|
+
objectName;
|
|
699
|
+
permissions = [];
|
|
700
|
+
ngOnInit() {
|
|
701
|
+
const aclRolePermissions = this.aclRole.permissions || [];
|
|
702
|
+
this._appAclService.getPermissions()
|
|
703
|
+
.subscribe((response) => {
|
|
704
|
+
this.permissions = response.filter(item => {
|
|
705
|
+
return aclRolePermissions.some(permission => {
|
|
706
|
+
return item.value === permission.value;
|
|
707
|
+
});
|
|
708
|
+
});
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclRolePopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
712
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsAclRolePopoverComponent, isStandalone: true, 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}}@if (objectName) {\n <span>: {{objectName}}</span>\n }</div>\n\n @if (permissions.length) {\n @for (permission of permissions; track permission) {\n <div class=\"permission\">\n <div>{{permission.name}}</div>\n <div class=\"small\">{{permission.description}}</div>\n </div>\n }\n } @else {\n None\n }\n\n</ng-template>\n", styles: [".name{padding-bottom:10px}.permission+.permission{padding-top:5px}:host{cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: FsPopoverModule }, { kind: "component", type: i1$2.FsPopoverComponent, selector: "fs-popover" }] });
|
|
713
|
+
}
|
|
714
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclRolePopoverComponent, decorators: [{
|
|
715
|
+
type: Component,
|
|
716
|
+
args: [{ selector: 'fs-acl-role-popover', standalone: true, imports: [FsPopoverModule], 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}}@if (objectName) {\n <span>: {{objectName}}</span>\n }</div>\n\n @if (permissions.length) {\n @for (permission of permissions; track permission) {\n <div class=\"permission\">\n <div>{{permission.name}}</div>\n <div class=\"small\">{{permission.description}}</div>\n </div>\n }\n } @else {\n None\n }\n\n</ng-template>\n", styles: [".name{padding-bottom:10px}.permission+.permission{padding-top:5px}:host{cursor:pointer}\n"] }]
|
|
717
|
+
}], propDecorators: { aclRole: [{
|
|
718
|
+
type: Input
|
|
719
|
+
}], objectName: [{
|
|
720
|
+
type: Input
|
|
721
|
+
}] } });
|
|
734
722
|
|
|
735
723
|
class FsAclEntriesComponent {
|
|
736
|
-
_appAclService;
|
|
737
|
-
_dialog;
|
|
738
|
-
_confirm;
|
|
724
|
+
_appAclService = inject(FsAppAclService);
|
|
725
|
+
_dialog = inject(MatDialog);
|
|
726
|
+
_confirm = inject(FsPrompt);
|
|
739
727
|
loadAclEntries;
|
|
740
728
|
loadAclRoles;
|
|
741
729
|
saveAclObjectEntry;
|
|
@@ -747,11 +735,6 @@ class FsAclEntriesComponent {
|
|
|
747
735
|
aclEntriesConfig = null;
|
|
748
736
|
permissions = [];
|
|
749
737
|
_destroy$ = new Subject();
|
|
750
|
-
constructor(_appAclService, _dialog, _confirm) {
|
|
751
|
-
this._appAclService = _appAclService;
|
|
752
|
-
this._dialog = _dialog;
|
|
753
|
-
this._confirm = _confirm;
|
|
754
|
-
}
|
|
755
738
|
ngOnInit() {
|
|
756
739
|
this._appAclService.getPermissions()
|
|
757
740
|
.subscribe(response => {
|
|
@@ -872,13 +855,13 @@ class FsAclEntriesComponent {
|
|
|
872
855
|
reload() {
|
|
873
856
|
this.aclEntriesList.reload();
|
|
874
857
|
}
|
|
875
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclEntriesComponent, deps: [
|
|
876
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
858
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclEntriesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
859
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsAclEntriesComponent, isStandalone: true, 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: "<fs-list [config]=\"aclEntriesConfig\">\n <fs-list-column>\n <ng-template fs-list-header>\n Context\n </ng-template>\n <ng-template\n fs-list-cell\n let-row=\"row\">\n @if (row.object) {\n <div\n class=\"fs-row.gap-sm\">\n @if (row.object.imageUrl) {\n <fs-badge\n shape=\"circle\"\n image=\"{{ row.object.imageUrl }}\">\n </fs-badge>\n }\n <span>\n <div>\n <small>\n {{ row.object.className }}\n </small>\n </div>\n <a (click)=\"update(row)\">\n {{ row.object.name }}\n </a>\n </span>\n </div>\n } @else {\n <a (click)=\"update(row)\">\n App\n </a>\n }\n </ng-template>\n </fs-list-column>\n <fs-list-column [show]=\"environmentShow\">\n <ng-template fs-list-header>\n {{ environmentLabel }}\n </ng-template>\n <ng-template\n fs-list-cell\n let-row=\"row\">\n {{ row.environment?.name }}\n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>\n Roles\n </ng-template>\n <ng-template\n fs-list-cell\n let-row=\"row\">\n <div class=\"fs-column\">\n @for (aclEntry of row.aclEntries; track aclEntry) {\n <div\n div\n >\n @switch (row.level) {\n @case ('app') {\n <fs-acl-role-popover\n [aclRole]=\"aclEntry.aclRole\"\n objectName=\"App\">\n {{ aclEntry.aclRole.name }}\n </fs-acl-role-popover>\n }\n @default {\n @if (row.object) {\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\">\n {{ aclEntry.aclRole.name }}\n </fs-acl-role-popover>\n }\n }\n }\n </div>\n }\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>", styles: [""], dependencies: [{ kind: "ngmodule", type: FsListModule }, { kind: "component", type: i1$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i1$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customizable", "sortable", "sortableDefault", "sortableDirection", "direction", "align", "width", "class"] }, { kind: "directive", type: i1$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "directive", type: i1$1.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { kind: "ngmodule", type: FsBadgeModule }, { kind: "component", type: i2$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"] }] });
|
|
877
860
|
}
|
|
878
861
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAclEntriesComponent, decorators: [{
|
|
879
862
|
type: Component,
|
|
880
|
-
args: [{ selector: 'fs-acl-entries', template: "<fs-list [config]=\"aclEntriesConfig\">\n <fs-list-column>\n <ng-template fs-list-header>\n Context\n </ng-template>\n <ng-template\n
|
|
881
|
-
}],
|
|
863
|
+
args: [{ selector: 'fs-acl-entries', standalone: true, imports: [FsListModule, FsBadgeModule, FsAclRolePopoverComponent], template: "<fs-list [config]=\"aclEntriesConfig\">\n <fs-list-column>\n <ng-template fs-list-header>\n Context\n </ng-template>\n <ng-template\n fs-list-cell\n let-row=\"row\">\n @if (row.object) {\n <div\n class=\"fs-row.gap-sm\">\n @if (row.object.imageUrl) {\n <fs-badge\n shape=\"circle\"\n image=\"{{ row.object.imageUrl }}\">\n </fs-badge>\n }\n <span>\n <div>\n <small>\n {{ row.object.className }}\n </small>\n </div>\n <a (click)=\"update(row)\">\n {{ row.object.name }}\n </a>\n </span>\n </div>\n } @else {\n <a (click)=\"update(row)\">\n App\n </a>\n }\n </ng-template>\n </fs-list-column>\n <fs-list-column [show]=\"environmentShow\">\n <ng-template fs-list-header>\n {{ environmentLabel }}\n </ng-template>\n <ng-template\n fs-list-cell\n let-row=\"row\">\n {{ row.environment?.name }}\n </ng-template>\n </fs-list-column>\n <fs-list-column>\n <ng-template fs-list-header>\n Roles\n </ng-template>\n <ng-template\n fs-list-cell\n let-row=\"row\">\n <div class=\"fs-column\">\n @for (aclEntry of row.aclEntries; track aclEntry) {\n <div\n div\n >\n @switch (row.level) {\n @case ('app') {\n <fs-acl-role-popover\n [aclRole]=\"aclEntry.aclRole\"\n objectName=\"App\">\n {{ aclEntry.aclRole.name }}\n </fs-acl-role-popover>\n }\n @default {\n @if (row.object) {\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\">\n {{ aclEntry.aclRole.name }}\n </fs-acl-role-popover>\n }\n }\n }\n </div>\n }\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>" }]
|
|
864
|
+
}], propDecorators: { loadAclEntries: [{
|
|
882
865
|
type: Input
|
|
883
866
|
}], loadAclRoles: [{
|
|
884
867
|
type: Input
|
|
@@ -897,108 +880,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
897
880
|
args: [FsListComponent]
|
|
898
881
|
}] } });
|
|
899
882
|
|
|
900
|
-
class FsAppAclModule {
|
|
901
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAppAclModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
902
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: FsAppAclModule, declarations: [FsAclRolesComponent,
|
|
903
|
-
FsAclPermissionPopoverComponent,
|
|
904
|
-
FsAclRoleComponent,
|
|
905
|
-
FsAclEntriesComponent,
|
|
906
|
-
FsAclRolePopoverComponent,
|
|
907
|
-
FsAclObjectRolesComponent,
|
|
908
|
-
FsAclEntryComponent,
|
|
909
|
-
BulkOptionsFilterPipe,
|
|
910
|
-
AclRolePermissionAvailablePipe], imports: [CommonModule,
|
|
911
|
-
FormsModule,
|
|
912
|
-
MatDialogModule,
|
|
913
|
-
MatFormFieldModule,
|
|
914
|
-
MatCheckboxModule,
|
|
915
|
-
MatSelectModule,
|
|
916
|
-
MatButtonModule,
|
|
917
|
-
MatRadioModule,
|
|
918
|
-
MatInputModule,
|
|
919
|
-
FsListModule,
|
|
920
|
-
FsPopoverModule,
|
|
921
|
-
FsDialogModule,
|
|
922
|
-
FsFormModule,
|
|
923
|
-
FsLabelModule,
|
|
924
|
-
FsRadioGroupModule,
|
|
925
|
-
FsBadgeModule,
|
|
926
|
-
FsCheckboxGroupModule,
|
|
927
|
-
FsMenuModule], exports: [FsAclRolesComponent,
|
|
928
|
-
FsAclPermissionPopoverComponent,
|
|
929
|
-
FsAclRoleComponent,
|
|
930
|
-
FsAclEntriesComponent,
|
|
931
|
-
FsAclRolePopoverComponent,
|
|
932
|
-
FsAclObjectRolesComponent,
|
|
933
|
-
FsAclEntryComponent] });
|
|
934
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAppAclModule, imports: [CommonModule,
|
|
935
|
-
FormsModule,
|
|
936
|
-
MatDialogModule,
|
|
937
|
-
MatFormFieldModule,
|
|
938
|
-
MatCheckboxModule,
|
|
939
|
-
MatSelectModule,
|
|
940
|
-
MatButtonModule,
|
|
941
|
-
MatRadioModule,
|
|
942
|
-
MatInputModule,
|
|
943
|
-
FsListModule,
|
|
944
|
-
FsPopoverModule,
|
|
945
|
-
FsDialogModule,
|
|
946
|
-
FsFormModule,
|
|
947
|
-
FsLabelModule,
|
|
948
|
-
FsRadioGroupModule,
|
|
949
|
-
FsBadgeModule,
|
|
950
|
-
FsCheckboxGroupModule,
|
|
951
|
-
FsMenuModule] });
|
|
952
|
-
}
|
|
953
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsAppAclModule, decorators: [{
|
|
954
|
-
type: NgModule,
|
|
955
|
-
args: [{
|
|
956
|
-
imports: [
|
|
957
|
-
CommonModule,
|
|
958
|
-
FormsModule,
|
|
959
|
-
MatDialogModule,
|
|
960
|
-
MatFormFieldModule,
|
|
961
|
-
MatCheckboxModule,
|
|
962
|
-
MatSelectModule,
|
|
963
|
-
MatButtonModule,
|
|
964
|
-
MatRadioModule,
|
|
965
|
-
MatInputModule,
|
|
966
|
-
FsListModule,
|
|
967
|
-
FsPopoverModule,
|
|
968
|
-
FsDialogModule,
|
|
969
|
-
FsFormModule,
|
|
970
|
-
FsLabelModule,
|
|
971
|
-
FsRadioGroupModule,
|
|
972
|
-
FsBadgeModule,
|
|
973
|
-
FsCheckboxGroupModule,
|
|
974
|
-
FsMenuModule,
|
|
975
|
-
],
|
|
976
|
-
declarations: [
|
|
977
|
-
FsAclRolesComponent,
|
|
978
|
-
FsAclPermissionPopoverComponent,
|
|
979
|
-
FsAclRoleComponent,
|
|
980
|
-
FsAclEntriesComponent,
|
|
981
|
-
FsAclRolePopoverComponent,
|
|
982
|
-
FsAclObjectRolesComponent,
|
|
983
|
-
FsAclEntryComponent,
|
|
984
|
-
BulkOptionsFilterPipe,
|
|
985
|
-
AclRolePermissionAvailablePipe,
|
|
986
|
-
],
|
|
987
|
-
exports: [
|
|
988
|
-
FsAclRolesComponent,
|
|
989
|
-
FsAclPermissionPopoverComponent,
|
|
990
|
-
FsAclRoleComponent,
|
|
991
|
-
FsAclEntriesComponent,
|
|
992
|
-
FsAclRolePopoverComponent,
|
|
993
|
-
FsAclObjectRolesComponent,
|
|
994
|
-
FsAclEntryComponent,
|
|
995
|
-
],
|
|
996
|
-
}]
|
|
997
|
-
}] });
|
|
998
|
-
|
|
999
883
|
/**
|
|
1000
884
|
* Generated bundle index. Do not edit.
|
|
1001
885
|
*/
|
|
1002
886
|
|
|
1003
|
-
export { FS_APP_ACL_CONFIG, FsAclEntriesComponent, FsAclEntryComponent, FsAclObjectRolesComponent, FsAclPermissionPopoverComponent, FsAclRoleComponent, FsAclRolePopoverComponent, FsAclRolesComponent,
|
|
887
|
+
export { FS_APP_ACL_CONFIG, FsAclEntriesComponent, FsAclEntryComponent, FsAclObjectRolesComponent, FsAclPermissionPopoverComponent, FsAclRoleComponent, FsAclRolePopoverComponent, FsAclRolesComponent, FsAppAclService };
|
|
1004
888
|
//# sourceMappingURL=firestitch-app-acl.mjs.map
|