@valtimo/access-control-management 11.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.
- package/README.md +33 -0
- package/esm2022/lib/access-control-management-routing.module.mjs +55 -0
- package/esm2022/lib/access-control-management.module.mjs +101 -0
- package/esm2022/lib/components/delete-role-modal/delete-role-modal.component.mjs +39 -0
- package/esm2022/lib/components/editor/access-control-editor.component.mjs +181 -0
- package/esm2022/lib/components/export-role-modal/export-role-modal.component.mjs +78 -0
- package/esm2022/lib/components/overview/access-control-overview.component.mjs +117 -0
- package/esm2022/lib/components/role-metadata-modal/role-metadata-modal.component.mjs +79 -0
- package/esm2022/lib/models/index.mjs +17 -0
- package/esm2022/lib/models/role.model.mjs +17 -0
- package/esm2022/lib/services/access-control-export.service.mjs +53 -0
- package/esm2022/lib/services/access-control.service.mjs +72 -0
- package/esm2022/lib/services/index.mjs +17 -0
- package/esm2022/public-api.mjs +22 -0
- package/esm2022/valtimo-access-control-management.mjs +5 -0
- package/fesm2022/valtimo-access-control-management.mjs +792 -0
- package/fesm2022/valtimo-access-control-management.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/access-control-management-routing.module.d.ts +8 -0
- package/lib/access-control-management.module.d.ts +17 -0
- package/lib/components/delete-role-modal/delete-role-modal.component.d.ts +11 -0
- package/lib/components/editor/access-control-editor.component.d.ts +52 -0
- package/lib/components/export-role-modal/export-role-modal.component.d.ts +23 -0
- package/lib/components/overview/access-control-overview.component.d.ts +39 -0
- package/lib/components/role-metadata-modal/role-metadata-modal.component.d.ts +24 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/models/role.model.d.ts +13 -0
- package/lib/services/access-control-export.service.d.ts +12 -0
- package/lib/services/access-control.service.d.ts +24 -0
- package/lib/services/index.d.ts +1 -0
- package/package.json +25 -0
- package/public-api.d.ts +3 -0
|
@@ -0,0 +1,792 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ViewChild, NgModule } from '@angular/core';
|
|
3
|
+
import { BehaviorSubject, tap, switchMap, take, catchError, of, combineLatest, map, Subject, finalize, delay, filter } from 'rxjs';
|
|
4
|
+
import * as i1 from '@valtimo/config';
|
|
5
|
+
import { ROLE_ADMIN } from '@valtimo/config';
|
|
6
|
+
import * as i2 from '@angular/common/http';
|
|
7
|
+
import * as i4 from '@angular/common';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
import * as i5 from '@ngx-translate/core';
|
|
10
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
11
|
+
import * as i3$1 from '@valtimo/components';
|
|
12
|
+
import { CARBON_CONSTANTS, ViewType, CarbonListComponent, ConfirmationModalModule, EditorModule, RenderInPageHeaderDirectiveModule, CarbonListModule } from '@valtimo/components';
|
|
13
|
+
import * as i2$1 from '@angular/router';
|
|
14
|
+
import { RouterModule } from '@angular/router';
|
|
15
|
+
import { AuthGuardService } from '@valtimo/security';
|
|
16
|
+
import * as i3 from 'carbon-components-angular';
|
|
17
|
+
import { NotificationService, ButtonModule, ModalModule, InputModule, IconModule, LoadingModule, DialogModule, NotificationModule } from 'carbon-components-angular';
|
|
18
|
+
import * as i1$1 from '@angular/forms';
|
|
19
|
+
import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
23
|
+
*
|
|
24
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
25
|
+
* you may not use this file except in compliance with the License.
|
|
26
|
+
* You may obtain a copy of the License at
|
|
27
|
+
*
|
|
28
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
29
|
+
*
|
|
30
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
31
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
32
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
33
|
+
* See the License for the specific language governing permissions and
|
|
34
|
+
* limitations under the License.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
39
|
+
*
|
|
40
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
41
|
+
* you may not use this file except in compliance with the License.
|
|
42
|
+
* You may obtain a copy of the License at
|
|
43
|
+
*
|
|
44
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
45
|
+
*
|
|
46
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
47
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
48
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
49
|
+
* See the License for the specific language governing permissions and
|
|
50
|
+
* limitations under the License.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
class AccessControlService {
|
|
54
|
+
get roleDtos$() {
|
|
55
|
+
return this.http.get(`${this.valtimoEndpointUri}v1/roles`);
|
|
56
|
+
}
|
|
57
|
+
constructor(configService, http) {
|
|
58
|
+
this.configService = configService;
|
|
59
|
+
this.http = http;
|
|
60
|
+
this.roles$ = new BehaviorSubject([]);
|
|
61
|
+
this.loading$ = new BehaviorSubject(false);
|
|
62
|
+
this.valtimoEndpointUri = `${this.configService.config.valtimoApi.endpointUri}management/`;
|
|
63
|
+
}
|
|
64
|
+
addRole(role) {
|
|
65
|
+
return this.http.post(`${this.valtimoEndpointUri}v1/roles`, role);
|
|
66
|
+
}
|
|
67
|
+
deleteRoles(request) {
|
|
68
|
+
return this.http.delete(`${this.valtimoEndpointUri}v1/roles`, { body: request });
|
|
69
|
+
}
|
|
70
|
+
dispatchAction(actionResult) {
|
|
71
|
+
actionResult
|
|
72
|
+
.pipe(tap(() => {
|
|
73
|
+
this.loading$.next(true);
|
|
74
|
+
}), switchMap(() => this.roleDtos$), take(1), catchError(error => of(error)))
|
|
75
|
+
.subscribe({
|
|
76
|
+
next: (roles) => {
|
|
77
|
+
this.roles$.next(roles);
|
|
78
|
+
this.loading$.next(false);
|
|
79
|
+
},
|
|
80
|
+
error: error => {
|
|
81
|
+
console.error(error);
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
loadRoles() {
|
|
86
|
+
this.roleDtos$
|
|
87
|
+
.pipe(tap(() => {
|
|
88
|
+
this.loading$.next(true);
|
|
89
|
+
}), take(1))
|
|
90
|
+
.subscribe({
|
|
91
|
+
next: (items) => {
|
|
92
|
+
this.roles$.next(items);
|
|
93
|
+
this.loading$.next(false);
|
|
94
|
+
},
|
|
95
|
+
error: error => {
|
|
96
|
+
console.error(error);
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
getRolePermissions(roleKey) {
|
|
101
|
+
return this.http.get(`${this.valtimoEndpointUri}v1/roles/${roleKey}/permissions`);
|
|
102
|
+
}
|
|
103
|
+
exportRolePermissions(roles) {
|
|
104
|
+
return this.http.post(`${this.valtimoEndpointUri}v1/permissions/search`, { roles });
|
|
105
|
+
}
|
|
106
|
+
updateRolePermissions(roleKey, updatedPermission) {
|
|
107
|
+
return this.http.put(`${this.valtimoEndpointUri}v1/roles/${roleKey}/permissions`, updatedPermission);
|
|
108
|
+
}
|
|
109
|
+
updateRole(roleKey, request) {
|
|
110
|
+
return this.http.put(`${this.valtimoEndpointUri}v1/roles/${roleKey}`, request);
|
|
111
|
+
}
|
|
112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlService, deps: [{ token: i1.ConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
113
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlService, providedIn: 'root' }); }
|
|
114
|
+
}
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlService, decorators: [{
|
|
116
|
+
type: Injectable,
|
|
117
|
+
args: [{ providedIn: 'root' }]
|
|
118
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i2.HttpClient }]; } });
|
|
119
|
+
|
|
120
|
+
/*
|
|
121
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
122
|
+
*
|
|
123
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
124
|
+
* you may not use this file except in compliance with the License.
|
|
125
|
+
* You may obtain a copy of the License at
|
|
126
|
+
*
|
|
127
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
128
|
+
*
|
|
129
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
130
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
131
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
132
|
+
* See the License for the specific language governing permissions and
|
|
133
|
+
* limitations under the License.
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
/*
|
|
137
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
138
|
+
*
|
|
139
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
140
|
+
* you may not use this file except in compliance with the License.
|
|
141
|
+
* You may obtain a copy of the License at
|
|
142
|
+
*
|
|
143
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
144
|
+
*
|
|
145
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
146
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
147
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
148
|
+
* See the License for the specific language governing permissions and
|
|
149
|
+
* limitations under the License.
|
|
150
|
+
*/
|
|
151
|
+
class AccessControlExportService {
|
|
152
|
+
constructor(accessControlService) {
|
|
153
|
+
this.accessControlService = accessControlService;
|
|
154
|
+
}
|
|
155
|
+
exportRoles(event) {
|
|
156
|
+
return (event.type === 'unified'
|
|
157
|
+
? this.accessControlService.exportRolePermissions(event.roleKeys).pipe(tap(res => {
|
|
158
|
+
this.downloadJson(res, event.type);
|
|
159
|
+
}))
|
|
160
|
+
: combineLatest(event.roleKeys.map((roleKey) => this.accessControlService.exportRolePermissions([roleKey]))).pipe(tap(res => {
|
|
161
|
+
res.forEach((permissions, index) => {
|
|
162
|
+
const roleKey = event.roleKeys[index];
|
|
163
|
+
this.downloadJson(permissions, event.type, roleKey);
|
|
164
|
+
});
|
|
165
|
+
}))).pipe(map(() => true), catchError(() => of(false)));
|
|
166
|
+
}
|
|
167
|
+
downloadJson(permissions, type, roleKey) {
|
|
168
|
+
const sJson = JSON.stringify({ permissions }, null, 2);
|
|
169
|
+
const element = document.createElement('a');
|
|
170
|
+
element.setAttribute('href', 'data:text/json;charset=UTF-8,' + encodeURIComponent(sJson));
|
|
171
|
+
element.setAttribute('download', `${type === 'separate' ? roleKey : 'combined'}.permissions.json`);
|
|
172
|
+
element.style.display = 'none';
|
|
173
|
+
document.body.appendChild(element);
|
|
174
|
+
element.click(); // simulate click
|
|
175
|
+
document.body.removeChild(element);
|
|
176
|
+
}
|
|
177
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlExportService, deps: [{ token: AccessControlService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
178
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlExportService, providedIn: 'root' }); }
|
|
179
|
+
}
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlExportService, decorators: [{
|
|
181
|
+
type: Injectable,
|
|
182
|
+
args: [{ providedIn: 'root' }]
|
|
183
|
+
}], ctorParameters: function () { return [{ type: AccessControlService }]; } });
|
|
184
|
+
|
|
185
|
+
/*
|
|
186
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
187
|
+
*
|
|
188
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
189
|
+
* you may not use this file except in compliance with the License.
|
|
190
|
+
* You may obtain a copy of the License at
|
|
191
|
+
*
|
|
192
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
193
|
+
*
|
|
194
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
195
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
196
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
197
|
+
* See the License for the specific language governing permissions and
|
|
198
|
+
* limitations under the License.
|
|
199
|
+
*/
|
|
200
|
+
class RoleMetadataModalComponent {
|
|
201
|
+
set defaultKeyValue(value) {
|
|
202
|
+
this._defaultKeyValue = value;
|
|
203
|
+
this.setDefaultKeyValue(value);
|
|
204
|
+
}
|
|
205
|
+
get key() {
|
|
206
|
+
return this.form?.get('key');
|
|
207
|
+
}
|
|
208
|
+
constructor(fb) {
|
|
209
|
+
this.fb = fb;
|
|
210
|
+
this.open = false;
|
|
211
|
+
this.type = 'add';
|
|
212
|
+
this.closeEvent = new EventEmitter();
|
|
213
|
+
this.form = this.fb.group({
|
|
214
|
+
key: this.fb.control('', Validators.required),
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
ngOnInit() { }
|
|
218
|
+
onCancel() {
|
|
219
|
+
this.closeEvent.emit(null);
|
|
220
|
+
this.resetForm();
|
|
221
|
+
}
|
|
222
|
+
onConfirm() {
|
|
223
|
+
if (!this.key) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
this.closeEvent.emit({ roleKey: this.key.value });
|
|
227
|
+
this.resetForm();
|
|
228
|
+
}
|
|
229
|
+
setDefaultKeyValue(value) {
|
|
230
|
+
this.key.setValue(value);
|
|
231
|
+
}
|
|
232
|
+
resetForm() {
|
|
233
|
+
setTimeout(() => {
|
|
234
|
+
this.form.reset();
|
|
235
|
+
if (this.type === 'edit') {
|
|
236
|
+
this.setDefaultKeyValue(this._defaultKeyValue);
|
|
237
|
+
}
|
|
238
|
+
}, CARBON_CONSTANTS.modalAnimationMs);
|
|
239
|
+
}
|
|
240
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RoleMetadataModalComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
241
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: RoleMetadataModalComponent, selector: "valtimo-role-metadata-modal", inputs: { open: "open", type: "type", defaultKeyValue: "defaultKeyValue" }, outputs: { closeEvent: "closeEvent" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{\n isAdd: type === 'add'\n } as vars\"\n [open]=\"open\"\n showFooter=\"true\"\n [title]=\"vars.title\"\n valtimoCdsModal\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCancel()\">\n <h3 cdsModalHeaderHeading>\n {{\n vars.isAdd\n ? ('accessControl.roles.add' | translate)\n : ('accessControl.roles.editRole' | translate)\n }}\n </h3>\n </cds-modal-header>\n\n <section cdsModalContent>\n <form [formGroup]=\"form\">\n <cds-label [invalid]=\"key.dirty && key.invalid\">\n {{ 'accessControl.roles.name' | translate }}\n\n <input\n formControlName=\"key\"\n cdsText\n placeholder=\"{{ 'accessControl.roles.name' | translate }}\"\n [attr.modal-primary-focus]=\"true\"\n [invalid]=\"key.dirty && key.invalid\"\n />\n </cds-label>\n </form>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"onCancel()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button [disabled]=\"this.form.invalid\" (click)=\"onConfirm()\" cdsButton=\"primary\">\n {{ vars.isAdd ? ('interface.create' | translate) : ('interface.save' | translate) }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i3.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i3.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i3.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i3.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
242
|
+
}
|
|
243
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RoleMetadataModalComponent, decorators: [{
|
|
244
|
+
type: Component,
|
|
245
|
+
args: [{ selector: 'valtimo-role-metadata-modal', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{\n isAdd: type === 'add'\n } as vars\"\n [open]=\"open\"\n showFooter=\"true\"\n [title]=\"vars.title\"\n valtimoCdsModal\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCancel()\">\n <h3 cdsModalHeaderHeading>\n {{\n vars.isAdd\n ? ('accessControl.roles.add' | translate)\n : ('accessControl.roles.editRole' | translate)\n }}\n </h3>\n </cds-modal-header>\n\n <section cdsModalContent>\n <form [formGroup]=\"form\">\n <cds-label [invalid]=\"key.dirty && key.invalid\">\n {{ 'accessControl.roles.name' | translate }}\n\n <input\n formControlName=\"key\"\n cdsText\n placeholder=\"{{ 'accessControl.roles.name' | translate }}\"\n [attr.modal-primary-focus]=\"true\"\n [invalid]=\"key.dirty && key.invalid\"\n />\n </cds-label>\n </form>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"onCancel()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button [disabled]=\"this.form.invalid\" (click)=\"onConfirm()\" cdsButton=\"primary\">\n {{ vars.isAdd ? ('interface.create' | translate) : ('interface.save' | translate) }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n" }]
|
|
246
|
+
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }]; }, propDecorators: { open: [{
|
|
247
|
+
type: Input
|
|
248
|
+
}], type: [{
|
|
249
|
+
type: Input
|
|
250
|
+
}], defaultKeyValue: [{
|
|
251
|
+
type: Input
|
|
252
|
+
}], closeEvent: [{
|
|
253
|
+
type: Output
|
|
254
|
+
}] } });
|
|
255
|
+
|
|
256
|
+
/*
|
|
257
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
258
|
+
*
|
|
259
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
260
|
+
* you may not use this file except in compliance with the License.
|
|
261
|
+
* You may obtain a copy of the License at
|
|
262
|
+
*
|
|
263
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
264
|
+
*
|
|
265
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
266
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
267
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
268
|
+
* See the License for the specific language governing permissions and
|
|
269
|
+
* limitations under the License.
|
|
270
|
+
*/
|
|
271
|
+
class DeleteRoleModalComponent {
|
|
272
|
+
constructor() {
|
|
273
|
+
this.deleteEvent = new EventEmitter();
|
|
274
|
+
}
|
|
275
|
+
onDelete(roles) {
|
|
276
|
+
this.deleteEvent.emit(roles);
|
|
277
|
+
}
|
|
278
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DeleteRoleModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
279
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DeleteRoleModalComponent, selector: "valtimo-delete-role-modal", inputs: { deleteRowKeys: "deleteRowKeys", showDeleteModal$: "showDeleteModal$" }, outputs: { deleteEvent: "deleteEvent" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"accessControl.roles.deleteModalContent\"\n [outputOnConfirm]=\"deleteRowKeys\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDelete($event)\"\n></valtimo-confirmation-modal>\n", dependencies: [{ kind: "component", type: i3$1.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm"], outputs: ["confirmEvent", "cancelEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
280
|
+
}
|
|
281
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DeleteRoleModalComponent, decorators: [{
|
|
282
|
+
type: Component,
|
|
283
|
+
args: [{ selector: 'valtimo-delete-role-modal', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"accessControl.roles.deleteModalContent\"\n [outputOnConfirm]=\"deleteRowKeys\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDelete($event)\"\n></valtimo-confirmation-modal>\n" }]
|
|
284
|
+
}], propDecorators: { deleteRowKeys: [{
|
|
285
|
+
type: Input
|
|
286
|
+
}], showDeleteModal$: [{
|
|
287
|
+
type: Input
|
|
288
|
+
}], deleteEvent: [{
|
|
289
|
+
type: Output
|
|
290
|
+
}] } });
|
|
291
|
+
|
|
292
|
+
/*
|
|
293
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
294
|
+
*
|
|
295
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
296
|
+
* you may not use this file except in compliance with the License.
|
|
297
|
+
* You may obtain a copy of the License at
|
|
298
|
+
*
|
|
299
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
300
|
+
*
|
|
301
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
302
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
303
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
304
|
+
* See the License for the specific language governing permissions and
|
|
305
|
+
* limitations under the License.
|
|
306
|
+
*/
|
|
307
|
+
class ExportRoleModalComponent {
|
|
308
|
+
constructor() {
|
|
309
|
+
this.open = false;
|
|
310
|
+
this.exportEvent = new EventEmitter();
|
|
311
|
+
this.closeEvent = new EventEmitter();
|
|
312
|
+
this.selectedType$ = new BehaviorSubject(null);
|
|
313
|
+
}
|
|
314
|
+
ngOnInit() {
|
|
315
|
+
this.openResetSubscription();
|
|
316
|
+
}
|
|
317
|
+
ngOnDestroy() {
|
|
318
|
+
this._resetSubscription?.unsubscribe();
|
|
319
|
+
}
|
|
320
|
+
onCancel() {
|
|
321
|
+
if (!this.disabled) {
|
|
322
|
+
this.resetType();
|
|
323
|
+
this.closeEvent.emit();
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
onConfirm(type) {
|
|
327
|
+
this.exportEvent.emit({ type, roleKeys: this.exportRowKeys });
|
|
328
|
+
}
|
|
329
|
+
selectType(type) {
|
|
330
|
+
this.selectedType$.next(type);
|
|
331
|
+
}
|
|
332
|
+
resetType() {
|
|
333
|
+
setTimeout(() => {
|
|
334
|
+
this.selectedType$.next(null);
|
|
335
|
+
}, CARBON_CONSTANTS.modalAnimationMs);
|
|
336
|
+
}
|
|
337
|
+
openResetSubscription() {
|
|
338
|
+
this._resetSubscription = this.reset$?.subscribe(() => {
|
|
339
|
+
this.closeEvent.emit();
|
|
340
|
+
this.resetType();
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ExportRoleModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
344
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ExportRoleModalComponent, selector: "valtimo-export-role-modal", inputs: { open: "open", exportRowKeys: "exportRowKeys", reset$: "reset$", disabled: "disabled" }, outputs: { exportEvent: "exportEvent", closeEvent: "closeEvent" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{title: ('interface.export' | translate), selectedType: selectedType$ | async} as vars\"\n valtimoCdsModal\n [open]=\"open\"\n size=\"sm\"\n showFooter=\"true\"\n [title]=\"vars.title\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCancel()\">\n <h3 cdsModalHeaderHeading>\n {{ vars.title }}\n </h3>\n </cds-modal-header>\n\n <section cdsModalContent>\n <div class=\"export-buttons\">\n <button [disabled]=\"disabled\" cdsButton=\"secondary\" (click)=\"selectType('unified')\">\n {{ 'accessControl.roles.singleExport' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"document\" size=\"16\"></svg>\n </button>\n\n <button [disabled]=\"disabled\" cdsButton=\"secondary\" (click)=\"selectType('separate')\">\n {{ 'accessControl.roles.multipleExport' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"copy--file\" size=\"16\"></svg>\n </button>\n </div>\n </section>\n\n <cds-modal-footer>\n <button [disabled]=\"disabled\" cdsButton=\"ghost\" (click)=\"onCancel()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n [disabled]=\"!vars.selectedType || disabled\"\n cdsButton=\"primary\"\n (click)=\"onConfirm(vars.selectedType)\"\n >\n {{ vars.title }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.export-buttons{display:grid;width:100%;grid-template-columns:1fr 1fr;column-gap:16px}.export-buttons button{width:100%}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: i3.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i3.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i3.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
345
|
+
}
|
|
346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ExportRoleModalComponent, decorators: [{
|
|
347
|
+
type: Component,
|
|
348
|
+
args: [{ selector: 'valtimo-export-role-modal', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{title: ('interface.export' | translate), selectedType: selectedType$ | async} as vars\"\n valtimoCdsModal\n [open]=\"open\"\n size=\"sm\"\n showFooter=\"true\"\n [title]=\"vars.title\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCancel()\">\n <h3 cdsModalHeaderHeading>\n {{ vars.title }}\n </h3>\n </cds-modal-header>\n\n <section cdsModalContent>\n <div class=\"export-buttons\">\n <button [disabled]=\"disabled\" cdsButton=\"secondary\" (click)=\"selectType('unified')\">\n {{ 'accessControl.roles.singleExport' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"document\" size=\"16\"></svg>\n </button>\n\n <button [disabled]=\"disabled\" cdsButton=\"secondary\" (click)=\"selectType('separate')\">\n {{ 'accessControl.roles.multipleExport' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"copy--file\" size=\"16\"></svg>\n </button>\n </div>\n </section>\n\n <cds-modal-footer>\n <button [disabled]=\"disabled\" cdsButton=\"ghost\" (click)=\"onCancel()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n [disabled]=\"!vars.selectedType || disabled\"\n cdsButton=\"primary\"\n (click)=\"onConfirm(vars.selectedType)\"\n >\n {{ vars.title }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.export-buttons{display:grid;width:100%;grid-template-columns:1fr 1fr;column-gap:16px}.export-buttons button{width:100%}\n"] }]
|
|
349
|
+
}], propDecorators: { open: [{
|
|
350
|
+
type: Input
|
|
351
|
+
}], exportRowKeys: [{
|
|
352
|
+
type: Input
|
|
353
|
+
}], reset$: [{
|
|
354
|
+
type: Input
|
|
355
|
+
}], disabled: [{
|
|
356
|
+
type: Input
|
|
357
|
+
}], exportEvent: [{
|
|
358
|
+
type: Output
|
|
359
|
+
}], closeEvent: [{
|
|
360
|
+
type: Output
|
|
361
|
+
}] } });
|
|
362
|
+
|
|
363
|
+
/*
|
|
364
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
365
|
+
*
|
|
366
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
367
|
+
* you may not use this file except in compliance with the License.
|
|
368
|
+
* You may obtain a copy of the License at
|
|
369
|
+
*
|
|
370
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
371
|
+
*
|
|
372
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
373
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
374
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
375
|
+
* See the License for the specific language governing permissions and
|
|
376
|
+
* limitations under the License.
|
|
377
|
+
*/
|
|
378
|
+
class AccessControlOverviewComponent {
|
|
379
|
+
constructor(accessControlService, accessControlExportService, router) {
|
|
380
|
+
this.accessControlService = accessControlService;
|
|
381
|
+
this.accessControlExportService = accessControlExportService;
|
|
382
|
+
this.router = router;
|
|
383
|
+
this.fields = [
|
|
384
|
+
{
|
|
385
|
+
viewType: ViewType.TEXT,
|
|
386
|
+
key: 'roleKey',
|
|
387
|
+
label: 'accessControl.roles.key',
|
|
388
|
+
},
|
|
389
|
+
];
|
|
390
|
+
this.roles$ = this.accessControlService.roles$;
|
|
391
|
+
this.loading$ = this.accessControlService.loading$;
|
|
392
|
+
this.skeleton$ = new BehaviorSubject(false);
|
|
393
|
+
this.showAddModal$ = new BehaviorSubject(false);
|
|
394
|
+
this.showDeleteModal$ = new BehaviorSubject(false);
|
|
395
|
+
this.showExportModal$ = new BehaviorSubject(false);
|
|
396
|
+
this.selectedRowKeys$ = new BehaviorSubject([]);
|
|
397
|
+
this.resetExportType$ = new Subject();
|
|
398
|
+
this.exportDisabled$ = new BehaviorSubject(false);
|
|
399
|
+
}
|
|
400
|
+
ngOnInit() {
|
|
401
|
+
this.accessControlService.loadRoles();
|
|
402
|
+
}
|
|
403
|
+
openAddModal() {
|
|
404
|
+
this.showAddModal$.next(true);
|
|
405
|
+
}
|
|
406
|
+
onAdd(data) {
|
|
407
|
+
this.showAddModal$.next(false);
|
|
408
|
+
if (!data) {
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
this.accessControlService.dispatchAction(this.accessControlService.addRole(data).pipe(finalize(() => {
|
|
412
|
+
this.showAddModal$.next(false);
|
|
413
|
+
})));
|
|
414
|
+
}
|
|
415
|
+
showDeleteModal() {
|
|
416
|
+
this.setSelectedRoleKeys();
|
|
417
|
+
this.showDeleteModal$.next(true);
|
|
418
|
+
}
|
|
419
|
+
showExportModal() {
|
|
420
|
+
this.setSelectedRoleKeys();
|
|
421
|
+
this.showExportModal$.next(true);
|
|
422
|
+
}
|
|
423
|
+
closeExportModal() {
|
|
424
|
+
this.showExportModal$.next(false);
|
|
425
|
+
}
|
|
426
|
+
onDelete(roles) {
|
|
427
|
+
this.enableSkeleton();
|
|
428
|
+
this.accessControlService.dispatchAction(this.accessControlService.deleteRoles({ roles }).pipe(finalize(() => {
|
|
429
|
+
this.disableSkeleton();
|
|
430
|
+
})));
|
|
431
|
+
}
|
|
432
|
+
onExport(event) {
|
|
433
|
+
this.exportDisabled$.next(true);
|
|
434
|
+
this.accessControlExportService
|
|
435
|
+
.exportRoles(event)
|
|
436
|
+
.pipe(tap(() => {
|
|
437
|
+
this.resetExportType$.next(null);
|
|
438
|
+
}), delay(CARBON_CONSTANTS.modalAnimationMs), tap(() => {
|
|
439
|
+
this.exportDisabled$.next(false);
|
|
440
|
+
}))
|
|
441
|
+
.subscribe();
|
|
442
|
+
}
|
|
443
|
+
onRowClick(role) {
|
|
444
|
+
this.router.navigate([`/access-control/${role.roleKey}`]);
|
|
445
|
+
}
|
|
446
|
+
enableSkeleton() {
|
|
447
|
+
this.skeleton$.next(true);
|
|
448
|
+
}
|
|
449
|
+
disableSkeleton() {
|
|
450
|
+
this.skeleton$.next(false);
|
|
451
|
+
}
|
|
452
|
+
setSelectedRoleKeys() {
|
|
453
|
+
this.selectedRowKeys$.next(this.carbonList.selectedItems.map((role) => role.roleKey));
|
|
454
|
+
}
|
|
455
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlOverviewComponent, deps: [{ token: AccessControlService }, { token: AccessControlExportService }, { token: i2$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
456
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AccessControlOverviewComponent, selector: "ng-component", viewQueries: [{ propertyName: "carbonList", first: true, predicate: CarbonListComponent, descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n [header]=\"true\"\n [items]=\"roles$ | async\"\n [fields]=\"fields\"\n [loading]=\"loading$ | async\"\n [showSelectionColumn]=\"true\"\n (rowClicked)=\"onRowClick($event)\"\n>\n <ng-container header> {{ 'accessControl.roles.title' | translate }} </ng-container>\n\n <div carbonToolbarContent>\n <ng-container [ngTemplateOutlet]=\"addRoleButton\"></ng-container>\n </div>\n\n <ng-container carbonToolbarActions>\n <button cdsButton=\"primary\" (click)=\"showDeleteModal()\">\n {{ 'interface.delete' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n\n <button cdsButton=\"primary\" (click)=\"showExportModal()\">\n {{ 'interface.export' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"download\" size=\"16\"></svg>\n </button>\n </ng-container>\n\n <valtimo-no-results\n [action]=\"addRoleButton\"\n description=\"{{ 'accessControl.roles.noResults.description' | translate }}\"\n title=\"{{ 'accessControl.roles.noResults.title' | translate }}\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n\n<valtimo-role-metadata-modal\n [open]=\"showAddModal$ | async\"\n (closeEvent)=\"onAdd($event)\"\n></valtimo-role-metadata-modal>\n\n<ng-container *ngIf=\"{selectedRowKeys: selectedRowKeys$ | async} as obs\">\n <valtimo-delete-role-modal\n [deleteRowKeys]=\"obs.selectedRowKeys\"\n [showDeleteModal$]=\"showDeleteModal$\"\n (deleteEvent)=\"onDelete($event)\"\n >\n </valtimo-delete-role-modal>\n\n <valtimo-export-role-modal\n [disabled]=\"exportDisabled$ | async\"\n [exportRowKeys]=\"obs.selectedRowKeys\"\n [open]=\"showExportModal$ | async\"\n [reset$]=\"resetExportType$\"\n (exportEvent)=\"onExport($event)\"\n (closeEvent)=\"closeExportModal()\"\n >\n </valtimo-export-role-modal>\n</ng-container>\n\n<ng-template #addRoleButton>\n <button cdsButton=\"primary\" (click)=\"openAddModal()\">\n {{ 'accessControl.roles.add' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: i3$1.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "header", "initialSortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "component", type: i3$1.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title"] }, { kind: "component", type: RoleMetadataModalComponent, selector: "valtimo-role-metadata-modal", inputs: ["open", "type", "defaultKeyValue"], outputs: ["closeEvent"] }, { kind: "component", type: DeleteRoleModalComponent, selector: "valtimo-delete-role-modal", inputs: ["deleteRowKeys", "showDeleteModal$"], outputs: ["deleteEvent"] }, { kind: "component", type: ExportRoleModalComponent, selector: "valtimo-export-role-modal", inputs: ["open", "exportRowKeys", "reset$", "disabled"], outputs: ["exportEvent", "closeEvent"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
457
|
+
}
|
|
458
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlOverviewComponent, decorators: [{
|
|
459
|
+
type: Component,
|
|
460
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n [header]=\"true\"\n [items]=\"roles$ | async\"\n [fields]=\"fields\"\n [loading]=\"loading$ | async\"\n [showSelectionColumn]=\"true\"\n (rowClicked)=\"onRowClick($event)\"\n>\n <ng-container header> {{ 'accessControl.roles.title' | translate }} </ng-container>\n\n <div carbonToolbarContent>\n <ng-container [ngTemplateOutlet]=\"addRoleButton\"></ng-container>\n </div>\n\n <ng-container carbonToolbarActions>\n <button cdsButton=\"primary\" (click)=\"showDeleteModal()\">\n {{ 'interface.delete' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n\n <button cdsButton=\"primary\" (click)=\"showExportModal()\">\n {{ 'interface.export' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"download\" size=\"16\"></svg>\n </button>\n </ng-container>\n\n <valtimo-no-results\n [action]=\"addRoleButton\"\n description=\"{{ 'accessControl.roles.noResults.description' | translate }}\"\n title=\"{{ 'accessControl.roles.noResults.title' | translate }}\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n\n<valtimo-role-metadata-modal\n [open]=\"showAddModal$ | async\"\n (closeEvent)=\"onAdd($event)\"\n></valtimo-role-metadata-modal>\n\n<ng-container *ngIf=\"{selectedRowKeys: selectedRowKeys$ | async} as obs\">\n <valtimo-delete-role-modal\n [deleteRowKeys]=\"obs.selectedRowKeys\"\n [showDeleteModal$]=\"showDeleteModal$\"\n (deleteEvent)=\"onDelete($event)\"\n >\n </valtimo-delete-role-modal>\n\n <valtimo-export-role-modal\n [disabled]=\"exportDisabled$ | async\"\n [exportRowKeys]=\"obs.selectedRowKeys\"\n [open]=\"showExportModal$ | async\"\n [reset$]=\"resetExportType$\"\n (exportEvent)=\"onExport($event)\"\n (closeEvent)=\"closeExportModal()\"\n >\n </valtimo-export-role-modal>\n</ng-container>\n\n<ng-template #addRoleButton>\n <button cdsButton=\"primary\" (click)=\"openAddModal()\">\n {{ 'accessControl.roles.add' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n" }]
|
|
461
|
+
}], ctorParameters: function () { return [{ type: AccessControlService }, { type: AccessControlExportService }, { type: i2$1.Router }]; }, propDecorators: { carbonList: [{
|
|
462
|
+
type: ViewChild,
|
|
463
|
+
args: [CarbonListComponent]
|
|
464
|
+
}] } });
|
|
465
|
+
|
|
466
|
+
/*
|
|
467
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
468
|
+
*
|
|
469
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
470
|
+
* you may not use this file except in compliance with the License.
|
|
471
|
+
* You may obtain a copy of the License at
|
|
472
|
+
*
|
|
473
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
474
|
+
*
|
|
475
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
476
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
477
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
478
|
+
* See the License for the specific language governing permissions and
|
|
479
|
+
* limitations under the License.
|
|
480
|
+
*/
|
|
481
|
+
class AccessControlEditorComponent {
|
|
482
|
+
constructor(accessControlService, route, pageTitleService, router, notificationService, translateService, accessControlExportService) {
|
|
483
|
+
this.accessControlService = accessControlService;
|
|
484
|
+
this.route = route;
|
|
485
|
+
this.pageTitleService = pageTitleService;
|
|
486
|
+
this.router = router;
|
|
487
|
+
this.notificationService = notificationService;
|
|
488
|
+
this.translateService = translateService;
|
|
489
|
+
this.accessControlExportService = accessControlExportService;
|
|
490
|
+
this.model$ = new BehaviorSubject(null);
|
|
491
|
+
this.saveDisabled$ = new BehaviorSubject(true);
|
|
492
|
+
this.editorDisabled$ = new BehaviorSubject(false);
|
|
493
|
+
this.moreDisabled$ = new BehaviorSubject(true);
|
|
494
|
+
this.showDeleteModal$ = new BehaviorSubject(false);
|
|
495
|
+
this.showEditModal$ = new BehaviorSubject(false);
|
|
496
|
+
this.selectedRowKeys$ = new BehaviorSubject(null);
|
|
497
|
+
this._updatedModelValue$ = new BehaviorSubject('');
|
|
498
|
+
}
|
|
499
|
+
ngOnInit() {
|
|
500
|
+
this.getPermissions();
|
|
501
|
+
this.openRoleKeySubscription();
|
|
502
|
+
}
|
|
503
|
+
ngOnDestroy() {
|
|
504
|
+
this.pageTitleService.enableReset();
|
|
505
|
+
this._roleKeySubscription?.unsubscribe();
|
|
506
|
+
}
|
|
507
|
+
onValid(valid) {
|
|
508
|
+
this.saveDisabled$.next(valid === false);
|
|
509
|
+
}
|
|
510
|
+
onValueChange(value) {
|
|
511
|
+
this._updatedModelValue$.next(value);
|
|
512
|
+
}
|
|
513
|
+
updatePermissions() {
|
|
514
|
+
this.disableEditor();
|
|
515
|
+
this.disableSave();
|
|
516
|
+
this.disableMore();
|
|
517
|
+
this._updatedModelValue$
|
|
518
|
+
.pipe(take(1), switchMap(updatedModelValue => this.accessControlService.updateRolePermissions(this._roleKey, JSON.parse(updatedModelValue))))
|
|
519
|
+
.subscribe({
|
|
520
|
+
next: result => {
|
|
521
|
+
this.enableMore();
|
|
522
|
+
this.enableSave();
|
|
523
|
+
this.enableEditor();
|
|
524
|
+
this.showSuccessMessage(this._roleKey);
|
|
525
|
+
this.setModel(result);
|
|
526
|
+
},
|
|
527
|
+
error: () => {
|
|
528
|
+
this.enableMore();
|
|
529
|
+
this.enableSave();
|
|
530
|
+
this.enableEditor();
|
|
531
|
+
},
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
onDelete(roles) {
|
|
535
|
+
this.disableEditor();
|
|
536
|
+
this.disableSave();
|
|
537
|
+
this.disableMore();
|
|
538
|
+
this.accessControlService.dispatchAction(this.accessControlService.deleteRoles({ roles }).pipe(finalize(() => {
|
|
539
|
+
this.router.navigate(['/access-control']);
|
|
540
|
+
})));
|
|
541
|
+
}
|
|
542
|
+
showDeleteModal() {
|
|
543
|
+
this.showDeleteModal$.next(true);
|
|
544
|
+
}
|
|
545
|
+
showEditModal() {
|
|
546
|
+
this.showEditModal$.next(true);
|
|
547
|
+
}
|
|
548
|
+
onEdit(currentRoleKey, data) {
|
|
549
|
+
this.showEditModal$.next(false);
|
|
550
|
+
if (!data) {
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
this.disableEditor();
|
|
554
|
+
this.disableSave();
|
|
555
|
+
this.disableMore();
|
|
556
|
+
this.accessControlService.updateRole(currentRoleKey, data).subscribe(() => {
|
|
557
|
+
this.router.navigate([`/access-control/${data.roleKey}`]);
|
|
558
|
+
this.showSuccessMessage(data.roleKey);
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
exportPermissions(model) {
|
|
562
|
+
this.accessControlExportService.downloadJson(JSON.parse(model.value), 'separate', this._roleKey);
|
|
563
|
+
}
|
|
564
|
+
openRoleKeySubscription() {
|
|
565
|
+
this._roleKeySubscription = this.route.params
|
|
566
|
+
.pipe(filter(params => params?.id), map(params => params.id), tap(roleKey => {
|
|
567
|
+
this._roleKey = roleKey;
|
|
568
|
+
this.pageTitleService.setCustomPageTitle(roleKey, true);
|
|
569
|
+
this.selectedRowKeys$.next([roleKey]);
|
|
570
|
+
}), switchMap(roleKey => this.accessControlService.getRolePermissions(roleKey)), tap(permissions => {
|
|
571
|
+
this.enableMore();
|
|
572
|
+
this.enableSave();
|
|
573
|
+
this.enableEditor();
|
|
574
|
+
this.setModel(permissions);
|
|
575
|
+
}))
|
|
576
|
+
.subscribe();
|
|
577
|
+
}
|
|
578
|
+
getPermissions() {
|
|
579
|
+
this.route.params
|
|
580
|
+
.pipe(tap(params => {
|
|
581
|
+
this.pageTitleService.setCustomPageTitle(params?.id);
|
|
582
|
+
this.selectedRowKeys$.next([params?.id]);
|
|
583
|
+
}), switchMap(params => this.accessControlService.getRolePermissions(params.id)))
|
|
584
|
+
.subscribe(permissions => {
|
|
585
|
+
this.enableMore();
|
|
586
|
+
this.enableSave();
|
|
587
|
+
this.enableEditor();
|
|
588
|
+
this.setModel(permissions);
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
setModel(permissions) {
|
|
592
|
+
this.model$.next({
|
|
593
|
+
value: JSON.stringify(permissions),
|
|
594
|
+
language: 'json',
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
disableMore() {
|
|
598
|
+
this.moreDisabled$.next(true);
|
|
599
|
+
}
|
|
600
|
+
enableMore() {
|
|
601
|
+
this.moreDisabled$.next(false);
|
|
602
|
+
}
|
|
603
|
+
disableSave() {
|
|
604
|
+
this.saveDisabled$.next(true);
|
|
605
|
+
}
|
|
606
|
+
enableSave() {
|
|
607
|
+
this.saveDisabled$.next(false);
|
|
608
|
+
}
|
|
609
|
+
disableEditor() {
|
|
610
|
+
this.editorDisabled$.next(true);
|
|
611
|
+
}
|
|
612
|
+
enableEditor() {
|
|
613
|
+
this.editorDisabled$.next(false);
|
|
614
|
+
}
|
|
615
|
+
showSuccessMessage(roleKey) {
|
|
616
|
+
this.notificationService.showToast({
|
|
617
|
+
caption: this.translateService.instant('accessControl.roles.savedSuccessTitleMessage', {
|
|
618
|
+
roleKey,
|
|
619
|
+
}),
|
|
620
|
+
type: 'success',
|
|
621
|
+
duration: 4000,
|
|
622
|
+
showClose: true,
|
|
623
|
+
title: this.translateService.instant('accessControl.roles.savedSuccessTitle'),
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlEditorComponent, deps: [{ token: AccessControlService }, { token: i2$1.ActivatedRoute }, { token: i3$1.PageTitleService }, { token: i2$1.Router }, { token: i3.NotificationService }, { token: i5.TranslateService }, { token: AccessControlExportService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
627
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AccessControlEditorComponent, selector: "ng-component", providers: [NotificationService], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container *ngIf=\"model$ | async as model; else loading\">\n <valtimo-editor\n [disabled]=\"editorDisabled$ | async\"\n [model]=\"model\"\n (validEvent)=\"onValid($event)\"\n (valueChangeEvent)=\"onValueChange($event)\"\n ></valtimo-editor>\n</ng-container>\n\n<ng-container renderInPageHeader>\n <ng-template>\n <div\n *ngIf=\"{model: model$ | async, moreDisabled: moreDisabled$ | async} as obs\"\n class=\"buttons-container\"\n >\n <cds-overflow-menu class=\"overflow-button\">\n <cds-overflow-menu-option [disabled]=\"obs.moreDisabled\" (selected)=\"showEditModal()\">{{\n 'accessControl.roles.editMetadata' | translate\n }}</cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n [disabled]=\"obs.moreDisabled\"\n (selected)=\"exportPermissions(obs.model)\"\n >{{ 'interface.export' | translate }}</cds-overflow-menu-option\n >\n\n <cds-overflow-menu-option\n [disabled]=\"obs.moreDisabled\"\n type=\"danger\"\n (selected)=\"showDeleteModal()\"\n >{{ 'interface.delete' | translate }}</cds-overflow-menu-option\n >\n </cds-overflow-menu>\n\n <button\n [disabled]=\"saveDisabled$ | async\"\n cdsButton=\"primary\"\n size=\"md\"\n (click)=\"updatePermissions()\"\n >\n {{ 'interface.save' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"save\" size=\"16\"></svg>\n </button>\n </div>\n </ng-template>\n</ng-container>\n\n<ng-container *ngIf=\"{selectedRowKeys: selectedRowKeys$ | async} as obs\">\n <valtimo-delete-role-modal\n [deleteRowKeys]=\"obs.selectedRowKeys\"\n [showDeleteModal$]=\"showDeleteModal$\"\n (deleteEvent)=\"onDelete($event)\"\n >\n </valtimo-delete-role-modal>\n\n <valtimo-role-metadata-modal\n [defaultKeyValue]=\"obs.selectedRowKeys[0]\"\n [open]=\"showEditModal$ | async\"\n type=\"edit\"\n (closeEvent)=\"onEdit(obs.selectedRowKeys[0], $event)\"\n ></valtimo-role-metadata-modal>\n</ng-container>\n\n<ng-template #loading>\n <div class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.loading-container{display:flex;width:100%;justify-content:center}.overflow-button{margin-right:16px}.buttons-container{display:flex;flex-direction:row}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: i3$1.EditorComponent, selector: "valtimo-editor", inputs: ["editorOptions", "model", "disabled", "formatOnLoad", "widthPx", "heightPx"], outputs: ["validEvent", "valueChangeEvent"] }, { kind: "directive", type: i3$1.RenderInPageHeaderDirective, selector: "[renderInPageHeader]" }, { kind: "component", type: i3.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "component", type: i3.OverflowMenu, selector: "cds-overflow-menu, ibm-overflow-menu", inputs: ["buttonLabel", "flip", "placement", "open", "customTrigger", "offset", "wrapperClass", "triggerClass"], outputs: ["openChange"] }, { kind: "component", type: i3.OverflowMenuOption, selector: "cds-overflow-menu-option, ibm-overflow-menu-option", inputs: ["divider", "type", "disabled", "href", "target", "innerClass"], outputs: ["selected"] }, { kind: "component", type: RoleMetadataModalComponent, selector: "valtimo-role-metadata-modal", inputs: ["open", "type", "defaultKeyValue"], outputs: ["closeEvent"] }, { kind: "component", type: DeleteRoleModalComponent, selector: "valtimo-delete-role-modal", inputs: ["deleteRowKeys", "showDeleteModal$"], outputs: ["deleteEvent"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
628
|
+
}
|
|
629
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlEditorComponent, decorators: [{
|
|
630
|
+
type: Component,
|
|
631
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, providers: [NotificationService], template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container *ngIf=\"model$ | async as model; else loading\">\n <valtimo-editor\n [disabled]=\"editorDisabled$ | async\"\n [model]=\"model\"\n (validEvent)=\"onValid($event)\"\n (valueChangeEvent)=\"onValueChange($event)\"\n ></valtimo-editor>\n</ng-container>\n\n<ng-container renderInPageHeader>\n <ng-template>\n <div\n *ngIf=\"{model: model$ | async, moreDisabled: moreDisabled$ | async} as obs\"\n class=\"buttons-container\"\n >\n <cds-overflow-menu class=\"overflow-button\">\n <cds-overflow-menu-option [disabled]=\"obs.moreDisabled\" (selected)=\"showEditModal()\">{{\n 'accessControl.roles.editMetadata' | translate\n }}</cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n [disabled]=\"obs.moreDisabled\"\n (selected)=\"exportPermissions(obs.model)\"\n >{{ 'interface.export' | translate }}</cds-overflow-menu-option\n >\n\n <cds-overflow-menu-option\n [disabled]=\"obs.moreDisabled\"\n type=\"danger\"\n (selected)=\"showDeleteModal()\"\n >{{ 'interface.delete' | translate }}</cds-overflow-menu-option\n >\n </cds-overflow-menu>\n\n <button\n [disabled]=\"saveDisabled$ | async\"\n cdsButton=\"primary\"\n size=\"md\"\n (click)=\"updatePermissions()\"\n >\n {{ 'interface.save' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"save\" size=\"16\"></svg>\n </button>\n </div>\n </ng-template>\n</ng-container>\n\n<ng-container *ngIf=\"{selectedRowKeys: selectedRowKeys$ | async} as obs\">\n <valtimo-delete-role-modal\n [deleteRowKeys]=\"obs.selectedRowKeys\"\n [showDeleteModal$]=\"showDeleteModal$\"\n (deleteEvent)=\"onDelete($event)\"\n >\n </valtimo-delete-role-modal>\n\n <valtimo-role-metadata-modal\n [defaultKeyValue]=\"obs.selectedRowKeys[0]\"\n [open]=\"showEditModal$ | async\"\n type=\"edit\"\n (closeEvent)=\"onEdit(obs.selectedRowKeys[0], $event)\"\n ></valtimo-role-metadata-modal>\n</ng-container>\n\n<ng-template #loading>\n <div class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.loading-container{display:flex;width:100%;justify-content:center}.overflow-button{margin-right:16px}.buttons-container{display:flex;flex-direction:row}\n"] }]
|
|
632
|
+
}], ctorParameters: function () { return [{ type: AccessControlService }, { type: i2$1.ActivatedRoute }, { type: i3$1.PageTitleService }, { type: i2$1.Router }, { type: i3.NotificationService }, { type: i5.TranslateService }, { type: AccessControlExportService }]; } });
|
|
633
|
+
|
|
634
|
+
/*
|
|
635
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
636
|
+
*
|
|
637
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
638
|
+
* you may not use this file except in compliance with the License.
|
|
639
|
+
* You may obtain a copy of the License at
|
|
640
|
+
*
|
|
641
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
642
|
+
*
|
|
643
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
644
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
645
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
646
|
+
* See the License for the specific language governing permissions and
|
|
647
|
+
* limitations under the License.
|
|
648
|
+
*/
|
|
649
|
+
const routes = [
|
|
650
|
+
{
|
|
651
|
+
path: 'access-control',
|
|
652
|
+
component: AccessControlOverviewComponent,
|
|
653
|
+
canActivate: [AuthGuardService],
|
|
654
|
+
data: { title: 'Access control', roles: [ROLE_ADMIN] },
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
path: 'access-control/:id',
|
|
658
|
+
component: AccessControlEditorComponent,
|
|
659
|
+
canActivate: [AuthGuardService],
|
|
660
|
+
data: {
|
|
661
|
+
title: 'Role details',
|
|
662
|
+
roles: [ROLE_ADMIN],
|
|
663
|
+
customPageTitle: true,
|
|
664
|
+
},
|
|
665
|
+
},
|
|
666
|
+
];
|
|
667
|
+
class AccessControlManagementRoutingModule {
|
|
668
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
669
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: AccessControlManagementRoutingModule, imports: [CommonModule, i2$1.RouterModule], exports: [RouterModule] }); }
|
|
670
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlManagementRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
|
|
671
|
+
}
|
|
672
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlManagementRoutingModule, decorators: [{
|
|
673
|
+
type: NgModule,
|
|
674
|
+
args: [{
|
|
675
|
+
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
676
|
+
exports: [RouterModule],
|
|
677
|
+
}]
|
|
678
|
+
}] });
|
|
679
|
+
|
|
680
|
+
/*
|
|
681
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
682
|
+
*
|
|
683
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
684
|
+
* you may not use this file except in compliance with the License.
|
|
685
|
+
* You may obtain a copy of the License at
|
|
686
|
+
*
|
|
687
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
688
|
+
*
|
|
689
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
690
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
691
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
692
|
+
* See the License for the specific language governing permissions and
|
|
693
|
+
* limitations under the License.
|
|
694
|
+
*/
|
|
695
|
+
class AccessControlManagementModule {
|
|
696
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
697
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: AccessControlManagementModule, declarations: [AccessControlOverviewComponent,
|
|
698
|
+
RoleMetadataModalComponent,
|
|
699
|
+
AccessControlEditorComponent,
|
|
700
|
+
DeleteRoleModalComponent,
|
|
701
|
+
ExportRoleModalComponent], imports: [CommonModule,
|
|
702
|
+
AccessControlManagementRoutingModule,
|
|
703
|
+
ButtonModule,
|
|
704
|
+
FormsModule,
|
|
705
|
+
ModalModule,
|
|
706
|
+
TranslateModule,
|
|
707
|
+
ReactiveFormsModule,
|
|
708
|
+
InputModule,
|
|
709
|
+
IconModule,
|
|
710
|
+
ConfirmationModalModule,
|
|
711
|
+
EditorModule,
|
|
712
|
+
RenderInPageHeaderDirectiveModule,
|
|
713
|
+
LoadingModule,
|
|
714
|
+
IconModule,
|
|
715
|
+
DialogModule,
|
|
716
|
+
NotificationModule,
|
|
717
|
+
CarbonListModule] }); }
|
|
718
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlManagementModule, imports: [CommonModule,
|
|
719
|
+
AccessControlManagementRoutingModule,
|
|
720
|
+
ButtonModule,
|
|
721
|
+
FormsModule,
|
|
722
|
+
ModalModule,
|
|
723
|
+
TranslateModule,
|
|
724
|
+
ReactiveFormsModule,
|
|
725
|
+
InputModule,
|
|
726
|
+
IconModule,
|
|
727
|
+
ConfirmationModalModule,
|
|
728
|
+
EditorModule,
|
|
729
|
+
RenderInPageHeaderDirectiveModule,
|
|
730
|
+
LoadingModule,
|
|
731
|
+
IconModule,
|
|
732
|
+
DialogModule,
|
|
733
|
+
NotificationModule,
|
|
734
|
+
CarbonListModule] }); }
|
|
735
|
+
}
|
|
736
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccessControlManagementModule, decorators: [{
|
|
737
|
+
type: NgModule,
|
|
738
|
+
args: [{
|
|
739
|
+
declarations: [
|
|
740
|
+
AccessControlOverviewComponent,
|
|
741
|
+
RoleMetadataModalComponent,
|
|
742
|
+
AccessControlEditorComponent,
|
|
743
|
+
DeleteRoleModalComponent,
|
|
744
|
+
ExportRoleModalComponent,
|
|
745
|
+
],
|
|
746
|
+
imports: [
|
|
747
|
+
CommonModule,
|
|
748
|
+
AccessControlManagementRoutingModule,
|
|
749
|
+
ButtonModule,
|
|
750
|
+
FormsModule,
|
|
751
|
+
ModalModule,
|
|
752
|
+
TranslateModule,
|
|
753
|
+
ReactiveFormsModule,
|
|
754
|
+
InputModule,
|
|
755
|
+
IconModule,
|
|
756
|
+
ConfirmationModalModule,
|
|
757
|
+
EditorModule,
|
|
758
|
+
RenderInPageHeaderDirectiveModule,
|
|
759
|
+
LoadingModule,
|
|
760
|
+
IconModule,
|
|
761
|
+
DialogModule,
|
|
762
|
+
NotificationModule,
|
|
763
|
+
CarbonListModule,
|
|
764
|
+
],
|
|
765
|
+
}]
|
|
766
|
+
}] });
|
|
767
|
+
|
|
768
|
+
/*
|
|
769
|
+
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
770
|
+
*
|
|
771
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
772
|
+
* you may not use this file except in compliance with the License.
|
|
773
|
+
* You may obtain a copy of the License at
|
|
774
|
+
*
|
|
775
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
776
|
+
*
|
|
777
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
778
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
779
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
780
|
+
* See the License for the specific language governing permissions and
|
|
781
|
+
* limitations under the License.
|
|
782
|
+
*/
|
|
783
|
+
/*
|
|
784
|
+
* Public API Surface of access-control
|
|
785
|
+
*/
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* Generated bundle index. Do not edit.
|
|
789
|
+
*/
|
|
790
|
+
|
|
791
|
+
export { AccessControlManagementModule, AccessControlService };
|
|
792
|
+
//# sourceMappingURL=valtimo-access-control-management.mjs.map
|