@abp/ng.permission-management 10.5.0 → 10.6.0-rc.2
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/fesm2022/abp-ng.permission-management-proxy.mjs +3 -3
- package/fesm2022/abp-ng.permission-management-proxy.mjs.map +1 -1
- package/fesm2022/abp-ng.permission-management.mjs +335 -277
- package/fesm2022/abp-ng.permission-management.mjs.map +1 -1
- package/package.json +2 -2
- package/types/abp-ng.permission-management.d.ts +41 -29
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { NgStyle } from '@angular/common';
|
|
2
|
-
import { ConfigStateService, LocalizationPipe, ListService } from '@abp/ng.core';
|
|
3
|
-
import { ToasterService, ModalComponent, ButtonComponent, ModalCloseDirective, ConfirmationService, Confirmation } from '@abp/ng.theme.shared';
|
|
4
|
-
import { PermissionsService } from '@abp/ng.permission-management/proxy';
|
|
5
1
|
import * as i0 from '@angular/core';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { switchMap, finalize, tap } from 'rxjs/operators';
|
|
2
|
+
import { inject, DOCUMENT, input, output, signal, computed, effect, untracked, ChangeDetectionStrategy, Component, Injectable, InjectionToken, DestroyRef, model, NgModule } from '@angular/core';
|
|
3
|
+
import { NgStyle } from '@angular/common';
|
|
9
4
|
import * as i1 from '@angular/forms';
|
|
10
5
|
import { FormsModule } from '@angular/forms';
|
|
11
6
|
import { Tabs, TabList, Tab, TabPanel, TabContent } from '@angular/aria/tabs';
|
|
7
|
+
import { of, Observable, map, switchMap as switchMap$1, finalize as finalize$1 } from 'rxjs';
|
|
8
|
+
import { finalize, tap, switchMap } from 'rxjs/operators';
|
|
9
|
+
import { ConfigStateService, LocalizationPipe, ListService } from '@abp/ng.core';
|
|
10
|
+
import { ToasterService, ModalComponent, ButtonComponent, ModalCloseDirective, ConfirmationService, Confirmation } from '@abp/ng.theme.shared';
|
|
11
|
+
import { PermissionsService } from '@abp/ng.permission-management/proxy';
|
|
12
|
+
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
12
13
|
import { EntityProp, ExtensionsService, mergeWithDefaultProps, ExtensibleTableComponent, EXTENSIONS_IDENTIFIER } from '@abp/ng.components/extensible';
|
|
13
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
14
14
|
import { LookupSearchComponent } from '@abp/ng.components/lookup';
|
|
15
15
|
|
|
16
16
|
class PermissionManagementComponent {
|
|
@@ -32,125 +32,161 @@ class PermissionManagementComponent {
|
|
|
32
32
|
set hideBadges(value) {
|
|
33
33
|
this._hideBadgesOverride = value;
|
|
34
34
|
}
|
|
35
|
-
//
|
|
35
|
+
// Backward-compatible getters/setters for ReplaceableTemplateDirective.
|
|
36
36
|
get visible() {
|
|
37
|
-
return this.
|
|
37
|
+
return this.modalVisible();
|
|
38
38
|
}
|
|
39
39
|
set visible(value) {
|
|
40
|
-
|
|
40
|
+
this.setVisible(value);
|
|
41
|
+
}
|
|
42
|
+
setVisible(value) {
|
|
43
|
+
if (value && this.isClosingModal) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (value === this.modalVisible()) {
|
|
41
47
|
return;
|
|
42
48
|
}
|
|
43
49
|
if (value) {
|
|
44
|
-
this.
|
|
45
|
-
this._visible.set(true);
|
|
46
|
-
this.visibleChange.emit(true);
|
|
47
|
-
afterNextRender(() => {
|
|
48
|
-
this.initModal();
|
|
49
|
-
}, { injector: this.injector });
|
|
50
|
-
});
|
|
50
|
+
this.showModal();
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
53
|
-
this.
|
|
54
|
-
this._visible.set(false);
|
|
55
|
-
this.visibleChange.emit(false);
|
|
56
|
-
this.filter.set('');
|
|
53
|
+
this.hideModal();
|
|
57
54
|
}
|
|
58
55
|
}
|
|
56
|
+
get permissions() {
|
|
57
|
+
return this.permissionsState();
|
|
58
|
+
}
|
|
59
|
+
set permissions(value) {
|
|
60
|
+
this.permissionsState.set(value);
|
|
61
|
+
}
|
|
62
|
+
get selectedGroup() {
|
|
63
|
+
return this.selectedGroupState();
|
|
64
|
+
}
|
|
65
|
+
get selectThisTab() {
|
|
66
|
+
return this.selectThisTabState().checked;
|
|
67
|
+
}
|
|
68
|
+
get selectAllTab() {
|
|
69
|
+
return this.selectAllTabState().checked;
|
|
70
|
+
}
|
|
71
|
+
onModalVisibleChange(value) {
|
|
72
|
+
this.visibleChange.emit(value);
|
|
73
|
+
}
|
|
74
|
+
onModalDisappear() {
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
if (!this.modalVisible()) {
|
|
77
|
+
this.resetModalState();
|
|
78
|
+
}
|
|
79
|
+
this.isClosingModal = false;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
showModal() {
|
|
83
|
+
if (this.isOpening || this.modalVisible()) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
this.isClosingModal = false;
|
|
87
|
+
this.isOpening = true;
|
|
88
|
+
this.openModal()
|
|
89
|
+
.pipe(finalize(() => (this.isOpening = false)))
|
|
90
|
+
.subscribe(() => {
|
|
91
|
+
this.modalVisible.set(true);
|
|
92
|
+
this.visibleChange.emit(true);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
hideModal() {
|
|
96
|
+
if (!this.modalVisible()) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this.isClosingModal = true;
|
|
100
|
+
this.visibleChange.emit(false);
|
|
101
|
+
this.modalVisible.set(false);
|
|
102
|
+
}
|
|
103
|
+
resetModalState() {
|
|
104
|
+
this.setSelectedGroup(null);
|
|
105
|
+
this.filter.set('');
|
|
106
|
+
this.disabledSelectAllInAllTabsState.set(false);
|
|
107
|
+
}
|
|
108
|
+
// constructor() {
|
|
109
|
+
// effect(() => {
|
|
110
|
+
// this.setVisible(this.visibleInput());
|
|
111
|
+
// });
|
|
112
|
+
// }
|
|
59
113
|
constructor() {
|
|
60
114
|
this.service = inject(PermissionsService);
|
|
61
115
|
this.configState = inject(ConfigStateService);
|
|
62
116
|
this.toasterService = inject(ToasterService);
|
|
63
|
-
this.injector = inject(Injector);
|
|
64
117
|
this.document = inject(DOCUMENT);
|
|
65
118
|
this.providerNameInput = input('', { ...(ngDevMode ? { debugName: "providerNameInput" } : /* istanbul ignore next */ {}), alias: 'providerName' });
|
|
66
119
|
this.providerKeyInput = input('', { ...(ngDevMode ? { debugName: "providerKeyInput" } : /* istanbul ignore next */ {}), alias: 'providerKey' });
|
|
67
120
|
this.hideBadgesInput = input(false, { ...(ngDevMode ? { debugName: "hideBadgesInput" } : /* istanbul ignore next */ {}), alias: 'hideBadges' });
|
|
68
|
-
this.entityDisplayName = input(undefined,
|
|
121
|
+
this.entityDisplayName = input(undefined, /* @ts-ignore */
|
|
122
|
+
...(ngDevMode ? [{ debugName: "entityDisplayName" }] : /* istanbul ignore next */ []));
|
|
69
123
|
this.visibleInput = input(false, { ...(ngDevMode ? { debugName: "visibleInput" } : /* istanbul ignore next */ {}), alias: 'visible' });
|
|
70
|
-
// Output signals
|
|
71
124
|
this.visibleChange = output();
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
this.
|
|
75
|
-
|
|
125
|
+
this.modalVisible = signal(false, /* @ts-ignore */
|
|
126
|
+
...(ngDevMode ? [{ debugName: "modalVisible" }] : /* istanbul ignore next */ []));
|
|
127
|
+
this.modalBusy = signal(false, /* @ts-ignore */
|
|
128
|
+
...(ngDevMode ? [{ debugName: "modalBusy" }] : /* istanbul ignore next */ []));
|
|
129
|
+
this.filter = signal('', /* @ts-ignore */
|
|
130
|
+
...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
|
|
131
|
+
this.isOpening = false;
|
|
132
|
+
this.isClosingModal = false;
|
|
76
133
|
this.data = { groups: [], entityDisplayName: '' };
|
|
77
|
-
this.
|
|
78
|
-
|
|
79
|
-
this.
|
|
80
|
-
|
|
81
|
-
this.
|
|
82
|
-
|
|
83
|
-
this.
|
|
84
|
-
|
|
85
|
-
|
|
134
|
+
this.permissionsState = signal([], /* @ts-ignore */
|
|
135
|
+
...(ngDevMode ? [{ debugName: "permissionsState" }] : /* istanbul ignore next */ []));
|
|
136
|
+
this.selectedGroupState = signal(null, /* @ts-ignore */
|
|
137
|
+
...(ngDevMode ? [{ debugName: "selectedGroupState" }] : /* istanbul ignore next */ []));
|
|
138
|
+
this.permissionGroupSignal = signal([], /* @ts-ignore */
|
|
139
|
+
...(ngDevMode ? [{ debugName: "permissionGroupSignal" }] : /* istanbul ignore next */ []));
|
|
140
|
+
this.selectedGroupPermissions = computed(() => {
|
|
141
|
+
const group = this.selectedGroupState();
|
|
142
|
+
if (!group) {
|
|
143
|
+
return [];
|
|
144
|
+
}
|
|
145
|
+
const margin = `margin-${this.document.body?.dir === 'rtl' ? 'right' : 'left'}.px`;
|
|
146
|
+
const groupPermissions = this.permissionGroupSignal().find(item => item.name === group.name)?.permissions || [];
|
|
147
|
+
const permissions = this.permissionsState();
|
|
148
|
+
return groupPermissions.map(permission => ({
|
|
149
|
+
...permission,
|
|
150
|
+
style: { [margin]: findMargin(groupPermissions, permission) },
|
|
151
|
+
isGranted: (permissions.find(per => per.name === permission.name) || {}).isGranted,
|
|
152
|
+
}));
|
|
153
|
+
}, /* @ts-ignore */
|
|
154
|
+
...(ngDevMode ? [{ debugName: "selectedGroupPermissions" }] : /* istanbul ignore next */ []));
|
|
155
|
+
this.selectThisTabState = computed(() => getSelectAllCheckboxState(this.selectedGroupPermissions(), this.providerName), /* @ts-ignore */
|
|
156
|
+
...(ngDevMode ? [{ debugName: "selectThisTabState" }] : /* istanbul ignore next */ []));
|
|
157
|
+
this.selectAllTabState = computed(() => getSelectAllCheckboxState(this.permissionsState(), this.providerName), /* @ts-ignore */
|
|
158
|
+
...(ngDevMode ? [{ debugName: "selectAllTabState" }] : /* istanbul ignore next */ []));
|
|
159
|
+
// Disabled state is based on the API snapshot (not live edits) so select-all stays toggleable.
|
|
160
|
+
this.disableSelectAllTab = computed(() => isSelectAllDisabled(this.selectedGroupState()?.permissions, this.providerName), /* @ts-ignore */
|
|
161
|
+
...(ngDevMode ? [{ debugName: "disableSelectAllTab" }] : /* istanbul ignore next */ []));
|
|
162
|
+
this.disabledSelectAllInAllTabsState = signal(false, /* @ts-ignore */
|
|
163
|
+
...(ngDevMode ? [{ debugName: "disabledSelectAllInAllTabsState" }] : /* istanbul ignore next */ []));
|
|
164
|
+
this.disabledSelectAllInAllTabs = this.disabledSelectAllInAllTabsState.asReadonly();
|
|
86
165
|
this.permissionGroups = computed(() => {
|
|
87
166
|
const search = this.filter().toLowerCase().trim();
|
|
88
|
-
|
|
167
|
+
const groups = this.permissionGroupSignal();
|
|
89
168
|
if (!search) {
|
|
90
|
-
this.setSelectedGroup(groups[0]);
|
|
91
169
|
return groups;
|
|
92
170
|
}
|
|
93
|
-
const includesSearch = text => text.toLowerCase().includes(search);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
this.selectedGroupPermissions = [];
|
|
100
|
-
}
|
|
101
|
-
return groups;
|
|
102
|
-
}, ...(ngDevMode ? [{ debugName: "permissionGroups" }] : /* istanbul ignore next */ []));
|
|
171
|
+
const includesSearch = (text) => text.toLowerCase().includes(search);
|
|
172
|
+
return groups.filter(group => group.permissions.some(permission => includesSearch(permission.displayName) || includesSearch(group.displayName)));
|
|
173
|
+
}, /* @ts-ignore */
|
|
174
|
+
...(ngDevMode ? [{ debugName: "permissionGroups" }] : /* istanbul ignore next */ []));
|
|
103
175
|
this.trackByFn = (_, item) => item.name;
|
|
104
176
|
effect(() => {
|
|
105
|
-
const
|
|
106
|
-
untracked(() =>
|
|
107
|
-
if (this._visible() !== inputValue) {
|
|
108
|
-
if (inputValue) {
|
|
109
|
-
this.openModal().subscribe(() => {
|
|
110
|
-
this._visible.set(true);
|
|
111
|
-
afterNextRender(() => {
|
|
112
|
-
this.initModal();
|
|
113
|
-
}, { injector: this.injector });
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
this.setSelectedGroup(null);
|
|
118
|
-
this._visible.set(false);
|
|
119
|
-
this.filter.set('');
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
});
|
|
177
|
+
const visible = this.visibleInput();
|
|
178
|
+
untracked(() => this.setVisible(visible));
|
|
123
179
|
});
|
|
124
180
|
}
|
|
125
181
|
getChecked(name) {
|
|
126
|
-
return (this.
|
|
182
|
+
return (this.permissionsState().find(per => per.name === name) || { isGranted: false })
|
|
183
|
+
.isGranted;
|
|
127
184
|
}
|
|
128
185
|
setSelectedGroup(group) {
|
|
129
|
-
this.
|
|
130
|
-
if (!this.selectedGroup) {
|
|
131
|
-
this.selectedGroupPermissions = [];
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const margin = `margin-${this.document.body?.dir === 'rtl' ? 'right' : 'left'}.px`;
|
|
135
|
-
const permissions = (this.data.groups.find(group => group.name === this.selectedGroup?.name) || {}).permissions ||
|
|
136
|
-
[];
|
|
137
|
-
this.selectedGroupPermissions = permissions.map(permission => ({
|
|
138
|
-
...permission,
|
|
139
|
-
style: { [margin]: findMargin(permissions, permission) },
|
|
140
|
-
isGranted: (this.permissions.find(per => per.name === permission.name) || {}).isGranted,
|
|
141
|
-
}));
|
|
142
|
-
}
|
|
143
|
-
setDisabled(permissions) {
|
|
144
|
-
if (permissions.length) {
|
|
145
|
-
this.disableSelectAllTab = permissions.every(permission => permission.isGranted &&
|
|
146
|
-
permission.grantedProviders?.every(p => p.providerName !== this.providerName));
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
this.disableSelectAllTab = false;
|
|
150
|
-
}
|
|
186
|
+
this.selectedGroupState.set(group);
|
|
151
187
|
}
|
|
152
188
|
isGrantedByOtherProviderName(grantedProviders) {
|
|
153
|
-
if (grantedProviders
|
|
189
|
+
if (grantedProviders?.length) {
|
|
154
190
|
return grantedProviders.findIndex(p => p.providerName !== this.providerName) > -1;
|
|
155
191
|
}
|
|
156
192
|
return false;
|
|
@@ -160,17 +196,13 @@ class PermissionManagementComponent {
|
|
|
160
196
|
if (isGranted && this.isGrantedByOtherProviderName(grantedProviders)) {
|
|
161
197
|
return;
|
|
162
198
|
}
|
|
163
|
-
this.setSelectedGroup(this.selectedGroup);
|
|
164
199
|
setTimeout(() => {
|
|
165
200
|
this.updatePermissionStatus(clickedPermission);
|
|
166
|
-
this.updateSelectedGroupPermissions(clickedPermission);
|
|
167
201
|
this.setParentClicked(clickedPermission);
|
|
168
|
-
this.setTabCheckboxState();
|
|
169
|
-
this.setGrantCheckboxState();
|
|
170
202
|
}, 0);
|
|
171
203
|
}
|
|
172
204
|
updatePermissionStatus(clickedPermission) {
|
|
173
|
-
this.permissions
|
|
205
|
+
this.permissionsState.update(permissions => permissions.map(permission => {
|
|
174
206
|
const isExactMatch = clickedPermission.name == permission.name;
|
|
175
207
|
const isParentOfPermission = clickedPermission.parentName === permission.name;
|
|
176
208
|
const isChildOfPermission = clickedPermission.name === permission.parentName;
|
|
@@ -184,14 +216,14 @@ class PermissionManagementComponent {
|
|
|
184
216
|
return { ...permission, isGranted: true };
|
|
185
217
|
}
|
|
186
218
|
return permission;
|
|
187
|
-
});
|
|
219
|
+
}));
|
|
188
220
|
}
|
|
189
221
|
setParentClicked(clickedPermission) {
|
|
190
222
|
if (clickedPermission.parentName) {
|
|
191
|
-
const parentPermissions = findParentPermissions(this.
|
|
223
|
+
const parentPermissions = findParentPermissions(this.permissionsState(), clickedPermission);
|
|
192
224
|
if (parentPermissions.length > 0) {
|
|
193
225
|
const parentNames = new Set(parentPermissions.map(parent => parent.name));
|
|
194
|
-
this.permissions
|
|
226
|
+
this.permissionsState.update(permissions => permissions.map(per => {
|
|
195
227
|
let updatedIsGranted = per.isGranted;
|
|
196
228
|
if (per.parentName === clickedPermission.name && !clickedPermission.isGranted) {
|
|
197
229
|
updatedIsGranted = false;
|
|
@@ -200,12 +232,12 @@ class PermissionManagementComponent {
|
|
|
200
232
|
updatedIsGranted = true;
|
|
201
233
|
}
|
|
202
234
|
return { ...per, isGranted: updatedIsGranted };
|
|
203
|
-
});
|
|
235
|
+
}));
|
|
204
236
|
}
|
|
205
237
|
return;
|
|
206
238
|
}
|
|
207
|
-
this.permissions
|
|
208
|
-
const parents = findParentPermissions(
|
|
239
|
+
this.permissionsState.update(permissions => permissions.map(per => {
|
|
240
|
+
const parents = findParentPermissions(permissions, per);
|
|
209
241
|
if (parents.length > 0) {
|
|
210
242
|
const rootParent = parents[parents.length - 1];
|
|
211
243
|
if (rootParent.name === clickedPermission.name && !rootParent.isGranted) {
|
|
@@ -213,82 +245,60 @@ class PermissionManagementComponent {
|
|
|
213
245
|
}
|
|
214
246
|
}
|
|
215
247
|
return per;
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
updateSelectedGroupPermissions(clickedPermissions) {
|
|
219
|
-
this.selectedGroupPermissions = this.selectedGroupPermissions.map(per => {
|
|
220
|
-
if (per.name === clickedPermissions.name) {
|
|
221
|
-
per.isGranted = !per.isGranted;
|
|
222
|
-
}
|
|
223
|
-
return per;
|
|
224
|
-
});
|
|
248
|
+
}));
|
|
225
249
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
const selectablePermissions = this.selectedGroupPermissions.filter(per => per.grantedProviders.every(p => p.providerName === providerName));
|
|
229
|
-
const selectedPermissions = selectablePermissions.filter(per => per.isGranted);
|
|
230
|
-
const element = this.document.querySelector('#select-all-in-this-tabs');
|
|
231
|
-
if (!element) {
|
|
250
|
+
onSelectThisTabChange(event) {
|
|
251
|
+
if (this.disableSelectAllTab()) {
|
|
232
252
|
return;
|
|
233
253
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
254
|
+
const state = this.selectThisTabState();
|
|
255
|
+
const checked = !state.checked || state.indeterminate;
|
|
256
|
+
this.permissionsState.update(permissions => {
|
|
257
|
+
let updatedPermissions = [...permissions];
|
|
258
|
+
this.selectedGroupPermissions().forEach(permission => {
|
|
259
|
+
if (this.isGrantedByOtherProviderName(permission.grantedProviders)) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const index = updatedPermissions.findIndex(per => per.name === permission.name);
|
|
263
|
+
if (index < 0) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
updatedPermissions = [
|
|
267
|
+
...updatedPermissions.slice(0, index),
|
|
268
|
+
{ ...updatedPermissions[index], isGranted: checked },
|
|
269
|
+
...updatedPermissions.slice(index + 1),
|
|
270
|
+
];
|
|
271
|
+
});
|
|
272
|
+
return updatedPermissions;
|
|
273
|
+
});
|
|
245
274
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
const selectedAllPermissions = selectablePermissions.filter(per => per.isGranted);
|
|
250
|
-
const checkboxElement = this.document.querySelector('#select-all-in-all-tabs');
|
|
251
|
-
if (selectedAllPermissions.length === selectablePermissions.length) {
|
|
252
|
-
checkboxElement.indeterminate = false;
|
|
253
|
-
this.selectAllTab = true;
|
|
254
|
-
}
|
|
255
|
-
else if (selectedAllPermissions.length === 0) {
|
|
256
|
-
checkboxElement.indeterminate = false;
|
|
257
|
-
this.selectAllTab = false;
|
|
275
|
+
onSelectAllChange(event) {
|
|
276
|
+
if (this.disabledSelectAllInAllTabs()) {
|
|
277
|
+
return;
|
|
258
278
|
}
|
|
259
|
-
|
|
260
|
-
|
|
279
|
+
const state = this.selectAllTabState();
|
|
280
|
+
const checked = !state.checked || state.indeterminate;
|
|
281
|
+
if (this.filter()) {
|
|
282
|
+
this.onFilterChange('');
|
|
261
283
|
}
|
|
284
|
+
this.permissionsState.update(permissions => permissions.map(permission => ({
|
|
285
|
+
...permission,
|
|
286
|
+
isGranted: this.isGrantedByOtherProviderName(permission.grantedProviders) || checked,
|
|
287
|
+
})));
|
|
262
288
|
}
|
|
263
|
-
|
|
264
|
-
this.
|
|
265
|
-
|
|
266
|
-
return;
|
|
267
|
-
const index = this.permissions.findIndex(per => per.name === permission.name);
|
|
268
|
-
this.permissions = [
|
|
269
|
-
...this.permissions.slice(0, index),
|
|
270
|
-
{ ...this.permissions[index], isGranted: !this.selectThisTab },
|
|
271
|
-
...this.permissions.slice(index + 1),
|
|
272
|
-
];
|
|
273
|
-
});
|
|
274
|
-
this.setGrantCheckboxState();
|
|
289
|
+
onFilterChange(value) {
|
|
290
|
+
this.filter.set(value);
|
|
291
|
+
this.syncSelectedGroupWithFilter();
|
|
275
292
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
293
|
+
syncSelectedGroupWithFilter() {
|
|
294
|
+
const groups = this.permissionGroups();
|
|
295
|
+
if (!groups.length) {
|
|
296
|
+
this.setSelectedGroup(null);
|
|
297
|
+
return;
|
|
279
298
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
isGranted: this.isGrantedByOtherProviderName(permission.grantedProviders) || !this.selectAllTab,
|
|
283
|
-
}));
|
|
284
|
-
if (!this.disableSelectAllTab) {
|
|
285
|
-
this.selectThisTab = !this.selectAllTab;
|
|
286
|
-
this.setTabCheckboxState();
|
|
287
|
-
if (this.filter()) {
|
|
288
|
-
this.setGrantCheckboxState();
|
|
289
|
-
}
|
|
299
|
+
if (!groups.some(group => group.name === this.selectedGroupState()?.name)) {
|
|
300
|
+
this.onChangeGroup(groups[0]);
|
|
290
301
|
}
|
|
291
|
-
this.onChangeGroup(this.selectedGroup);
|
|
292
302
|
}
|
|
293
303
|
onTabChange(groupName) {
|
|
294
304
|
const group = this.permissionGroups().find(g => g.name === groupName);
|
|
@@ -297,28 +307,28 @@ class PermissionManagementComponent {
|
|
|
297
307
|
}
|
|
298
308
|
}
|
|
299
309
|
onChangeGroup(group) {
|
|
300
|
-
this.setDisabled(group.permissions);
|
|
301
310
|
this.setSelectedGroup(group);
|
|
302
|
-
this.setTabCheckboxState();
|
|
303
311
|
}
|
|
304
312
|
submit() {
|
|
313
|
+
if (this.modalBusy()) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
305
316
|
const unchangedPermissions = getPermissions(this.data.groups);
|
|
306
|
-
const changedPermissions = this.
|
|
317
|
+
const changedPermissions = this.permissionsState()
|
|
307
318
|
.filter(per => (unchangedPermissions.find(unchanged => unchanged.name === per.name) || {}).isGranted ===
|
|
308
319
|
per.isGranted
|
|
309
320
|
? false
|
|
310
321
|
: true)
|
|
311
322
|
.map(({ name, isGranted }) => ({ name, isGranted }));
|
|
312
323
|
if (!changedPermissions.length) {
|
|
313
|
-
this.
|
|
324
|
+
this.hideModal();
|
|
314
325
|
return;
|
|
315
326
|
}
|
|
316
|
-
this.modalBusy
|
|
327
|
+
this.modalBusy.set(true);
|
|
317
328
|
this.service
|
|
318
329
|
.update(this.providerName, this.providerKey, { permissions: changedPermissions })
|
|
319
|
-
.pipe(switchMap(() => this.shouldFetchAppConfig() ? this.configState.refreshAppState() : of(null)), finalize(() =>
|
|
330
|
+
.pipe(tap(() => this.hideModal()), switchMap(() => this.shouldFetchAppConfig() ? this.configState.refreshAppState() : of(null)), finalize(() => this.modalBusy.set(false)))
|
|
320
331
|
.subscribe(() => {
|
|
321
|
-
this.visible = false;
|
|
322
332
|
this.toasterService.success('AbpUi::SavedSuccessfully');
|
|
323
333
|
});
|
|
324
334
|
}
|
|
@@ -332,22 +342,14 @@ class PermissionManagementComponent {
|
|
|
332
342
|
const { groups } = permissionRes || {};
|
|
333
343
|
this.data = permissionRes;
|
|
334
344
|
this.permissionGroupSignal.set(groups);
|
|
335
|
-
|
|
336
|
-
this.
|
|
337
|
-
this.
|
|
338
|
-
|
|
345
|
+
const permissions = getPermissions(groups);
|
|
346
|
+
this.permissionsState.set(permissions);
|
|
347
|
+
this.disabledSelectAllInAllTabsState.set(isSelectAllDisabled(permissions, providerName));
|
|
348
|
+
this.setSelectedGroup(groups[0] ?? null);
|
|
339
349
|
}));
|
|
340
350
|
}
|
|
341
|
-
initModal() {
|
|
342
|
-
// TODO: Refactor
|
|
343
|
-
setTimeout(() => {
|
|
344
|
-
this.setDisabled(this.selectedGroup?.permissions || []);
|
|
345
|
-
this.setTabCheckboxState();
|
|
346
|
-
this.setGrantCheckboxState();
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
351
|
getAssignedCount(groupName) {
|
|
350
|
-
return this.
|
|
352
|
+
return this.permissionsState().reduce((acc, val) => (val.groupName === groupName && val.isGranted ? acc + 1 : acc), 0);
|
|
351
353
|
}
|
|
352
354
|
shouldFetchAppConfig() {
|
|
353
355
|
const currentUser = this.configState.getOne('currentUser');
|
|
@@ -359,12 +361,12 @@ class PermissionManagementComponent {
|
|
|
359
361
|
return currentUser.id === providerKey;
|
|
360
362
|
return false;
|
|
361
363
|
}
|
|
362
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
363
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: PermissionManagementComponent, isStandalone: true, selector: "abp-permission-management", inputs: { providerNameInput: { classPropertyName: "providerNameInput", publicName: "providerName", isSignal: true, isRequired: false, transformFunction: null }, providerKeyInput: { classPropertyName: "providerKeyInput", publicName: "providerKey", isSignal: true, isRequired: false, transformFunction: null }, hideBadgesInput: { classPropertyName: "hideBadgesInput", publicName: "hideBadges", isSignal: true, isRequired: false, transformFunction: null }, entityDisplayName: { classPropertyName: "entityDisplayName", publicName: "entityDisplayName", isSignal: true, isRequired: false, transformFunction: null }, visibleInput: { classPropertyName: "visibleInput", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, viewQueries: [{ propertyName: "selectAllInThisTabsRef", predicate: ["selectAllInThisTabsRef"], descendants: true, isSignal: true }, { propertyName: "selectAllInAllTabsRef", predicate: ["selectAllInAllTabsRef"], descendants: true, isSignal: true }], exportAs: ["abpPermissionManagement"], ngImport: i0, template: "<abp-modal [(visible)]=\"visible\" [busy]=\"modalBusy\" [options]=\"{ size: 'lg', scrollable: false }\">\r\n @if (data.entityDisplayName || entityDisplayName()) {\r\n <ng-template #abpHeader>\r\n <h4>\r\n {{ 'AbpPermissionManagement::Permissions' | abpLocalization }} -\r\n {{ entityDisplayName() || data.entityDisplayName }}\r\n </h4>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <div class=\"row d-flex align-items-center mb-2\">\r\n <div class=\"col\">\r\n <div class=\"input-group mb-2\">\r\n <span class=\"input-group-text\" id=\"basic-addon1\"><i class=\"bi bi-search\"></i></span>\r\n <input\r\n type=\"text\"\r\n class=\"form-control\"\r\n id=\"permission-search\"\r\n placeholder=\"Filter\"\r\n [ngModel]=\"filter()\"\r\n (ngModelChange)=\"filter.set($event)\"\r\n />\r\n </div>\r\n </div>\r\n <div class=\"col-auto\">\r\n <div class=\"form-check mb-2\">\r\n <input\r\n #selectAllInAllTabsRef\r\n type=\"checkbox\"\r\n id=\"select-all-in-all-tabs\"\r\n name=\"select-all-in-all-tabs\"\r\n class=\"form-check-input\"\r\n [(ngModel)]=\"selectAllTab\"\r\n (click)=\"onClickSelectAll()\"\r\n [disabled]=\"disabledSelectAllInAllTabs\"\r\n />\r\n <label class=\"form-check-label\" for=\"select-all-in-all-tabs\">{{\r\n 'AbpPermissionManagement::SelectAllInAllTabs' | abpLocalization\r\n }}</label>\r\n </div>\r\n </div>\r\n </div>\r\n <fieldset class=\"border rounded-4 p-3\">\r\n <legend class=\"px-1 h5 mb-0\">\r\n {{ 'AbpPermissionManagement::PermissionGroup' | abpLocalization }}\r\n </legend>\r\n <div class=\"row\" ngTabs orientation=\"vertical\">\r\n <div class=\"col-md-4\">\r\n <div\r\n class=\"overflow-auto lpx-scroll-pills-container scroll-in-modal\"\r\n ngTabList\r\n orientation=\"vertical\"\r\n selectionMode=\"follow\"\r\n [selectedTab]=\"selectedGroup?.name\"\r\n (selectedTabChange)=\"onTabChange($event)\"\r\n >\r\n <div class=\"nav nav-pills flex-column\">\r\n @for (group of permissionGroups(); track $index) {\r\n <div class=\"border nav-item\">\r\n @if ({ assignedCount: getAssignedCount(group.name) }; as count) {\r\n <button\r\n ngTab\r\n [value]=\"group.name\"\r\n class=\"nav-link pointer text-start w-100\"\r\n #tab=\"ngTab\"\r\n [class.active]=\"tab.selected()\"\r\n type=\"button\"\r\n >\r\n <div [class.font-weight-bold]=\"count.assignedCount\">\r\n {{ group?.displayName }}\r\n @if (count.assignedCount > 0) {\r\n <span>({{ count.assignedCount }})</span>\r\n }\r\n </div>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-md-8 scroll-in-modal\">\r\n @for (group of permissionGroups(); track $index) {\r\n <div ngTabPanel [value]=\"group.name\">\r\n <ng-template ngTabContent>\r\n <div class=\"ps-1\">\r\n @if (selectedGroupPermissions.length) {\r\n <div class=\"form-check mb-2\">\r\n <input\r\n #selectAllInThisTabsRef\r\n type=\"checkbox\"\r\n id=\"select-all-in-this-tabs\"\r\n name=\"select-all-in-this-tabs\"\r\n class=\"form-check-input\"\r\n [(ngModel)]=\"selectThisTab\"\r\n [disabled]=\"disableSelectAllTab\"\r\n (click)=\"onClickSelectThisTab()\"\r\n />\r\n <label class=\"form-check-label\" for=\"select-all-in-this-tabs\">{{\r\n 'AbpPermissionManagement::SelectAllInThisTab' | abpLocalization\r\n }}</label>\r\n </div>\r\n <hr class=\"my-2\" />\r\n @for (permission of selectedGroupPermissions; track $index; let i = $index) {\r\n <div [ngStyle]=\"permission.style\" class=\"form-check mb-2\">\r\n <input\r\n #permissionCheckbox\r\n type=\"checkbox\"\r\n [checked]=\"getChecked(permission.name)\"\r\n [value]=\"getChecked(permission.name)\"\r\n [attr.id]=\"permission.name\"\r\n class=\"form-check-input\"\r\n [disabled]=\"isGrantedByOtherProviderName(permission.grantedProviders)\"\r\n (click)=\"onClickCheckbox(permission, permissionCheckbox.value)\"\r\n />\r\n <label class=\"form-check-label\" [attr.for]=\"permission.name\"\r\n >{{ permission.displayName }}\r\n @if (!hideBadges) {\r\n @for (provider of permission.grantedProviders; track $index) {\r\n <span class=\"badge bg-primary text-dark\"\r\n >{{ provider.providerName }}: {{ provider.providerKey }}</span\r\n >\r\n }\r\n }\r\n </label>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </ng-template>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </fieldset>\r\n </ng-template>\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-outline-primary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" (click)=\"submit()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n }\r\n</abp-modal>\r\n", styles: [".scroll-in-modal{overflow:auto;max-height:calc(100vh - 23.1rem)}.lpx-scroll-pills-container .nav-pills{display:block;overflow-y:auto}@media(max-width:768px){.scroll-in-modal{max-height:calc(100vh - 15rem)}.lpx-scroll-pills-container .nav-pills{max-height:500px}}fieldset legend{float:none;width:auto}.lpx-scroll-pills-container .tab-content{padding-top:0!important;padding-bottom:0!important}.lpx-scroll-pills-container .nav-item{margin-bottom:10px;border-radius:10px}.lpx-scroll-pills-container .nav-item .nav-link.active{color:#fff!important;border-color:#6c5dd3!important;background-color:#6c5dd3!important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { 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.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { 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: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "component", type: ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "directive", type: ModalCloseDirective, selector: "[abpClose]" }, { kind: "directive", type: Tabs, selector: "[ngTabs]", exportAs: ["ngTabs"] }, { kind: "directive", type: TabList, selector: "[ngTabList]", inputs: ["orientation", "wrap", "softDisabled", "focusMode", "selectionMode", "selectedTab", "disabled"], outputs: ["selectedTabChange"], exportAs: ["ngTabList"] }, { kind: "directive", type: Tab, selector: "[ngTab]", inputs: ["id", "disabled", "value"], exportAs: ["ngTab"] }, { kind: "directive", type: TabPanel, selector: "[ngTabPanel]", inputs: ["id", "value"], exportAs: ["ngTabPanel"] }, { kind: "directive", type: TabContent, selector: "ng-template[ngTabContent]", exportAs: ["ngTabContent"] }, { kind: "pipe", type: LocalizationPipe, name: "abpLocalization" }] }); }
|
|
364
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PermissionManagementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
365
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: PermissionManagementComponent, isStandalone: true, selector: "abp-permission-management", inputs: { providerNameInput: { classPropertyName: "providerNameInput", publicName: "providerName", isSignal: true, isRequired: false, transformFunction: null }, providerKeyInput: { classPropertyName: "providerKeyInput", publicName: "providerKey", isSignal: true, isRequired: false, transformFunction: null }, hideBadgesInput: { classPropertyName: "hideBadgesInput", publicName: "hideBadges", isSignal: true, isRequired: false, transformFunction: null }, entityDisplayName: { classPropertyName: "entityDisplayName", publicName: "entityDisplayName", isSignal: true, isRequired: false, transformFunction: null }, visibleInput: { classPropertyName: "visibleInput", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, exportAs: ["abpPermissionManagement"], ngImport: i0, template: "<abp-modal\r\n [(visible)]=\"modalVisible\"\r\n (visibleChange)=\"onModalVisibleChange($event)\"\r\n (disappear)=\"onModalDisappear()\"\r\n [busy]=\"modalBusy()\"\r\n [suppressUnsavedChangesWarning]=\"true\"\r\n [options]=\"{ size: 'lg', scrollable: false }\"\r\n>\r\n @if (data.entityDisplayName || entityDisplayName()) {\r\n <ng-template #abpHeader>\r\n <h4>\r\n {{ 'AbpPermissionManagement::Permissions' | abpLocalization }} -\r\n {{ entityDisplayName() || data.entityDisplayName }}\r\n </h4>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <div class=\"row d-flex align-items-center mb-2\">\r\n <div class=\"col\">\r\n <div class=\"input-group mb-2\">\r\n <span class=\"input-group-text\" id=\"basic-addon1\"><i class=\"bi bi-search\"></i></span>\r\n <input\r\n type=\"text\"\r\n class=\"form-control\"\r\n id=\"permission-search\"\r\n placeholder=\"Filter\"\r\n [ngModel]=\"filter()\"\r\n (ngModelChange)=\"onFilterChange($event)\"\r\n />\r\n </div>\r\n </div>\r\n <div class=\"col-auto\">\r\n <div class=\"form-check mb-2\">\r\n <input\r\n #selectAllInAllTabsRef\r\n type=\"checkbox\"\r\n id=\"select-all-in-all-tabs\"\r\n name=\"select-all-in-all-tabs\"\r\n class=\"form-check-input\"\r\n [checked]=\"selectAllTabState().checked\"\r\n [indeterminate]=\"selectAllTabState().indeterminate\"\r\n (change)=\"onSelectAllChange($event)\"\r\n [disabled]=\"disabledSelectAllInAllTabs()\"\r\n />\r\n <label class=\"form-check-label\" for=\"select-all-in-all-tabs\">{{\r\n 'AbpPermissionManagement::SelectAllInAllTabs' | abpLocalization\r\n }}</label>\r\n </div>\r\n </div>\r\n </div>\r\n <fieldset class=\"border rounded-4 p-3\">\r\n <legend class=\"px-1 h5 mb-0\">\r\n {{ 'AbpPermissionManagement::PermissionGroup' | abpLocalization }}\r\n </legend>\r\n <div class=\"row\" ngTabs orientation=\"vertical\">\r\n <div class=\"col-md-4\">\r\n <div\r\n class=\"overflow-auto lpx-scroll-pills-container scroll-in-modal\"\r\n ngTabList\r\n orientation=\"vertical\"\r\n selectionMode=\"follow\"\r\n [selectedTab]=\"selectedGroup?.name\"\r\n (selectedTabChange)=\"onTabChange($event)\"\r\n >\r\n <div class=\"nav nav-pills flex-column\">\r\n @for (group of permissionGroups(); track $index) {\r\n <div class=\"border nav-item\">\r\n @if ({ assignedCount: getAssignedCount(group.name) }; as count) {\r\n <button\r\n ngTab\r\n [value]=\"group.name\"\r\n class=\"nav-link pointer text-start w-100\"\r\n #tab=\"ngTab\"\r\n [class.active]=\"tab.selected()\"\r\n type=\"button\"\r\n >\r\n <div [class.font-weight-bold]=\"count.assignedCount\">\r\n {{ group?.displayName }}\r\n @if (count.assignedCount > 0) {\r\n <span>({{ count.assignedCount }})</span>\r\n }\r\n </div>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-md-8 scroll-in-modal\">\r\n @for (group of permissionGroups(); track $index) {\r\n <div ngTabPanel [value]=\"group.name\">\r\n <ng-template ngTabContent>\r\n <div class=\"ps-1\">\r\n @if (selectedGroup?.name === group.name && selectedGroupPermissions().length) {\r\n <div class=\"form-check mb-2\">\r\n <input\r\n #selectAllInThisTabsRef\r\n type=\"checkbox\"\r\n id=\"select-all-in-this-tabs\"\r\n name=\"select-all-in-this-tabs\"\r\n class=\"form-check-input\"\r\n [checked]=\"selectThisTabState().checked\"\r\n [indeterminate]=\"selectThisTabState().indeterminate\"\r\n [disabled]=\"disableSelectAllTab()\"\r\n (change)=\"onSelectThisTabChange($event)\"\r\n />\r\n <label class=\"form-check-label\" for=\"select-all-in-this-tabs\">{{\r\n 'AbpPermissionManagement::SelectAllInThisTab' | abpLocalization\r\n }}</label>\r\n </div>\r\n <hr class=\"my-2\" />\r\n @for (permission of selectedGroupPermissions(); track $index; let i = $index) {\r\n <div [ngStyle]=\"permission.style\" class=\"form-check mb-2\">\r\n <input\r\n #permissionCheckbox\r\n type=\"checkbox\"\r\n [checked]=\"getChecked(permission.name)\"\r\n [value]=\"getChecked(permission.name)\"\r\n [attr.id]=\"permission.name\"\r\n class=\"form-check-input\"\r\n [disabled]=\"isGrantedByOtherProviderName(permission.grantedProviders)\"\r\n (click)=\"onClickCheckbox(permission)\"\r\n />\r\n <label class=\"form-check-label\" [attr.for]=\"permission.name\"\r\n >{{ permission.displayName }}\r\n @if (!hideBadges) {\r\n @for (provider of permission.grantedProviders; track $index) {\r\n <span class=\"badge bg-primary text-dark\"\r\n >{{ provider.providerName }}: {{ provider.providerKey }}</span\r\n >\r\n }\r\n }\r\n </label>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </ng-template>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </fieldset>\r\n </ng-template>\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-outline-primary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" buttonType=\"button\" (click)=\"submit()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n }\r\n</abp-modal>\r\n", styles: [".scroll-in-modal{overflow:auto;max-height:calc(100vh - 23.1rem)}.lpx-scroll-pills-container .nav-pills{display:block;overflow-y:auto}@media(max-width:768px){.scroll-in-modal{max-height:calc(100vh - 15rem)}.lpx-scroll-pills-container .nav-pills{max-height:500px}}fieldset legend{float:none;width:auto}.lpx-scroll-pills-container .tab-content{padding-top:0!important;padding-bottom:0!important}.lpx-scroll-pills-container .nav-item{margin-bottom:10px;border-radius:10px}.lpx-scroll-pills-container .nav-item .nav-link.active{color:#fff!important;border-color:#6c5dd3!important;background-color:#6c5dd3!important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { 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: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "component", type: ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "directive", type: ModalCloseDirective, selector: "[abpClose]" }, { kind: "directive", type: Tabs, selector: "[ngTabs]", exportAs: ["ngTabs"] }, { kind: "directive", type: TabList, selector: "[ngTabList]", inputs: ["orientation", "wrap", "softDisabled", "focusMode", "selectionMode", "selectedTab", "disabled"], outputs: ["selectedTabChange"], exportAs: ["ngTabList"] }, { kind: "directive", type: Tab, selector: "[ngTab]", inputs: ["id", "disabled", "value"], exportAs: ["ngTab"] }, { kind: "directive", type: TabPanel, selector: "[ngTabPanel]", inputs: ["id", "value"], exportAs: ["ngTabPanel"] }, { kind: "directive", type: TabContent, selector: "ng-template[ngTabContent]", exportAs: ["ngTabContent"] }, { kind: "pipe", type: LocalizationPipe, name: "abpLocalization" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
364
366
|
}
|
|
365
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PermissionManagementComponent, decorators: [{
|
|
366
368
|
type: Component,
|
|
367
|
-
args: [{ selector: 'abp-permission-management', exportAs: 'abpPermissionManagement', imports: [
|
|
369
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'abp-permission-management', exportAs: 'abpPermissionManagement', imports: [
|
|
368
370
|
FormsModule,
|
|
369
371
|
NgStyle,
|
|
370
372
|
ModalComponent,
|
|
@@ -376,8 +378,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
376
378
|
Tab,
|
|
377
379
|
TabPanel,
|
|
378
380
|
TabContent,
|
|
379
|
-
], template: "<abp-modal
|
|
380
|
-
}], ctorParameters: () => [], propDecorators: { providerNameInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "providerName", required: false }] }], providerKeyInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "providerKey", required: false }] }], hideBadgesInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideBadges", required: false }] }], entityDisplayName: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityDisplayName", required: false }] }], visibleInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }]
|
|
381
|
+
], template: "<abp-modal\r\n [(visible)]=\"modalVisible\"\r\n (visibleChange)=\"onModalVisibleChange($event)\"\r\n (disappear)=\"onModalDisappear()\"\r\n [busy]=\"modalBusy()\"\r\n [suppressUnsavedChangesWarning]=\"true\"\r\n [options]=\"{ size: 'lg', scrollable: false }\"\r\n>\r\n @if (data.entityDisplayName || entityDisplayName()) {\r\n <ng-template #abpHeader>\r\n <h4>\r\n {{ 'AbpPermissionManagement::Permissions' | abpLocalization }} -\r\n {{ entityDisplayName() || data.entityDisplayName }}\r\n </h4>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <div class=\"row d-flex align-items-center mb-2\">\r\n <div class=\"col\">\r\n <div class=\"input-group mb-2\">\r\n <span class=\"input-group-text\" id=\"basic-addon1\"><i class=\"bi bi-search\"></i></span>\r\n <input\r\n type=\"text\"\r\n class=\"form-control\"\r\n id=\"permission-search\"\r\n placeholder=\"Filter\"\r\n [ngModel]=\"filter()\"\r\n (ngModelChange)=\"onFilterChange($event)\"\r\n />\r\n </div>\r\n </div>\r\n <div class=\"col-auto\">\r\n <div class=\"form-check mb-2\">\r\n <input\r\n #selectAllInAllTabsRef\r\n type=\"checkbox\"\r\n id=\"select-all-in-all-tabs\"\r\n name=\"select-all-in-all-tabs\"\r\n class=\"form-check-input\"\r\n [checked]=\"selectAllTabState().checked\"\r\n [indeterminate]=\"selectAllTabState().indeterminate\"\r\n (change)=\"onSelectAllChange($event)\"\r\n [disabled]=\"disabledSelectAllInAllTabs()\"\r\n />\r\n <label class=\"form-check-label\" for=\"select-all-in-all-tabs\">{{\r\n 'AbpPermissionManagement::SelectAllInAllTabs' | abpLocalization\r\n }}</label>\r\n </div>\r\n </div>\r\n </div>\r\n <fieldset class=\"border rounded-4 p-3\">\r\n <legend class=\"px-1 h5 mb-0\">\r\n {{ 'AbpPermissionManagement::PermissionGroup' | abpLocalization }}\r\n </legend>\r\n <div class=\"row\" ngTabs orientation=\"vertical\">\r\n <div class=\"col-md-4\">\r\n <div\r\n class=\"overflow-auto lpx-scroll-pills-container scroll-in-modal\"\r\n ngTabList\r\n orientation=\"vertical\"\r\n selectionMode=\"follow\"\r\n [selectedTab]=\"selectedGroup?.name\"\r\n (selectedTabChange)=\"onTabChange($event)\"\r\n >\r\n <div class=\"nav nav-pills flex-column\">\r\n @for (group of permissionGroups(); track $index) {\r\n <div class=\"border nav-item\">\r\n @if ({ assignedCount: getAssignedCount(group.name) }; as count) {\r\n <button\r\n ngTab\r\n [value]=\"group.name\"\r\n class=\"nav-link pointer text-start w-100\"\r\n #tab=\"ngTab\"\r\n [class.active]=\"tab.selected()\"\r\n type=\"button\"\r\n >\r\n <div [class.font-weight-bold]=\"count.assignedCount\">\r\n {{ group?.displayName }}\r\n @if (count.assignedCount > 0) {\r\n <span>({{ count.assignedCount }})</span>\r\n }\r\n </div>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-md-8 scroll-in-modal\">\r\n @for (group of permissionGroups(); track $index) {\r\n <div ngTabPanel [value]=\"group.name\">\r\n <ng-template ngTabContent>\r\n <div class=\"ps-1\">\r\n @if (selectedGroup?.name === group.name && selectedGroupPermissions().length) {\r\n <div class=\"form-check mb-2\">\r\n <input\r\n #selectAllInThisTabsRef\r\n type=\"checkbox\"\r\n id=\"select-all-in-this-tabs\"\r\n name=\"select-all-in-this-tabs\"\r\n class=\"form-check-input\"\r\n [checked]=\"selectThisTabState().checked\"\r\n [indeterminate]=\"selectThisTabState().indeterminate\"\r\n [disabled]=\"disableSelectAllTab()\"\r\n (change)=\"onSelectThisTabChange($event)\"\r\n />\r\n <label class=\"form-check-label\" for=\"select-all-in-this-tabs\">{{\r\n 'AbpPermissionManagement::SelectAllInThisTab' | abpLocalization\r\n }}</label>\r\n </div>\r\n <hr class=\"my-2\" />\r\n @for (permission of selectedGroupPermissions(); track $index; let i = $index) {\r\n <div [ngStyle]=\"permission.style\" class=\"form-check mb-2\">\r\n <input\r\n #permissionCheckbox\r\n type=\"checkbox\"\r\n [checked]=\"getChecked(permission.name)\"\r\n [value]=\"getChecked(permission.name)\"\r\n [attr.id]=\"permission.name\"\r\n class=\"form-check-input\"\r\n [disabled]=\"isGrantedByOtherProviderName(permission.grantedProviders)\"\r\n (click)=\"onClickCheckbox(permission)\"\r\n />\r\n <label class=\"form-check-label\" [attr.for]=\"permission.name\"\r\n >{{ permission.displayName }}\r\n @if (!hideBadges) {\r\n @for (provider of permission.grantedProviders; track $index) {\r\n <span class=\"badge bg-primary text-dark\"\r\n >{{ provider.providerName }}: {{ provider.providerKey }}</span\r\n >\r\n }\r\n }\r\n </label>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </ng-template>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </fieldset>\r\n </ng-template>\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-outline-primary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" buttonType=\"button\" (click)=\"submit()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n }\r\n</abp-modal>\r\n", styles: [".scroll-in-modal{overflow:auto;max-height:calc(100vh - 23.1rem)}.lpx-scroll-pills-container .nav-pills{display:block;overflow-y:auto}@media(max-width:768px){.scroll-in-modal{max-height:calc(100vh - 15rem)}.lpx-scroll-pills-container .nav-pills{max-height:500px}}fieldset legend{float:none;width:auto}.lpx-scroll-pills-container .tab-content{padding-top:0!important;padding-bottom:0!important}.lpx-scroll-pills-container .nav-item{margin-bottom:10px;border-radius:10px}.lpx-scroll-pills-container .nav-item .nav-link.active{color:#fff!important;border-color:#6c5dd3!important;background-color:#6c5dd3!important}\n"] }]
|
|
382
|
+
}], ctorParameters: () => [], propDecorators: { providerNameInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "providerName", required: false }] }], providerKeyInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "providerKey", required: false }] }], hideBadgesInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideBadges", required: false }] }], entityDisplayName: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityDisplayName", required: false }] }], visibleInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }] } });
|
|
383
|
+
function isSelectAllDisabled(permissions, providerName) {
|
|
384
|
+
if (!permissions?.length) {
|
|
385
|
+
return false;
|
|
386
|
+
}
|
|
387
|
+
return permissions.every(permission => permission.isGranted &&
|
|
388
|
+
permission.grantedProviders?.every(p => p.providerName !== providerName));
|
|
389
|
+
}
|
|
390
|
+
function getSelectAllCheckboxState(permissions, providerName) {
|
|
391
|
+
const selectablePermissions = permissions.filter(permission => (permission.grantedProviders ?? []).every(p => p.providerName === providerName));
|
|
392
|
+
const selectedPermissions = selectablePermissions.filter(permission => permission.isGranted);
|
|
393
|
+
if (!selectablePermissions.length || selectedPermissions.length === 0) {
|
|
394
|
+
return { checked: false, indeterminate: false };
|
|
395
|
+
}
|
|
396
|
+
if (selectedPermissions.length === selectablePermissions.length) {
|
|
397
|
+
return { checked: true, indeterminate: false };
|
|
398
|
+
}
|
|
399
|
+
return { checked: false, indeterminate: true };
|
|
400
|
+
}
|
|
381
401
|
function findParentPermissions(permissions, permission) {
|
|
382
402
|
const permissionMap = new Map(permissions.map(p => [p.name, p]));
|
|
383
403
|
let currentPermission = permissionMap.get(permission.name) ?? null;
|
|
@@ -417,48 +437,75 @@ var eResourcePermissionViewModes;
|
|
|
417
437
|
class ResourcePermissionStateService {
|
|
418
438
|
constructor() {
|
|
419
439
|
// View state
|
|
420
|
-
this.viewMode = signal(eResourcePermissionViewModes.List,
|
|
421
|
-
|
|
422
|
-
this.
|
|
423
|
-
|
|
440
|
+
this.viewMode = signal(eResourcePermissionViewModes.List, /* @ts-ignore */
|
|
441
|
+
...(ngDevMode ? [{ debugName: "viewMode" }] : /* istanbul ignore next */ []));
|
|
442
|
+
this.modalBusy = signal(false, /* @ts-ignore */
|
|
443
|
+
...(ngDevMode ? [{ debugName: "modalBusy" }] : /* istanbul ignore next */ []));
|
|
444
|
+
this.hasResourcePermission = signal(false, /* @ts-ignore */
|
|
445
|
+
...(ngDevMode ? [{ debugName: "hasResourcePermission" }] : /* istanbul ignore next */ []));
|
|
446
|
+
this.hasProviderKeyLookupService = signal(false, /* @ts-ignore */
|
|
447
|
+
...(ngDevMode ? [{ debugName: "hasProviderKeyLookupService" }] : /* istanbul ignore next */ []));
|
|
424
448
|
// Resource data
|
|
425
|
-
this.resourceName = signal('',
|
|
426
|
-
|
|
427
|
-
this.
|
|
449
|
+
this.resourceName = signal('', /* @ts-ignore */
|
|
450
|
+
...(ngDevMode ? [{ debugName: "resourceName" }] : /* istanbul ignore next */ []));
|
|
451
|
+
this.resourceKey = signal('', /* @ts-ignore */
|
|
452
|
+
...(ngDevMode ? [{ debugName: "resourceKey" }] : /* istanbul ignore next */ []));
|
|
453
|
+
this.resourceDisplayName = signal(undefined, /* @ts-ignore */
|
|
454
|
+
...(ngDevMode ? [{ debugName: "resourceDisplayName" }] : /* istanbul ignore next */ []));
|
|
428
455
|
// Permissions data
|
|
429
|
-
this.allResourcePermissions = signal([],
|
|
430
|
-
|
|
431
|
-
this.
|
|
432
|
-
|
|
433
|
-
this.
|
|
434
|
-
|
|
456
|
+
this.allResourcePermissions = signal([], /* @ts-ignore */
|
|
457
|
+
...(ngDevMode ? [{ debugName: "allResourcePermissions" }] : /* istanbul ignore next */ []));
|
|
458
|
+
this.resourcePermissions = signal([], /* @ts-ignore */
|
|
459
|
+
...(ngDevMode ? [{ debugName: "resourcePermissions" }] : /* istanbul ignore next */ []));
|
|
460
|
+
this.totalCount = signal(0, /* @ts-ignore */
|
|
461
|
+
...(ngDevMode ? [{ debugName: "totalCount" }] : /* istanbul ignore next */ []));
|
|
462
|
+
this.permissionDefinitions = signal([], /* @ts-ignore */
|
|
463
|
+
...(ngDevMode ? [{ debugName: "permissionDefinitions" }] : /* istanbul ignore next */ []));
|
|
464
|
+
this.permissionsWithProvider = signal([], /* @ts-ignore */
|
|
465
|
+
...(ngDevMode ? [{ debugName: "permissionsWithProvider" }] : /* istanbul ignore next */ []));
|
|
466
|
+
this.selectedPermissions = signal([], /* @ts-ignore */
|
|
467
|
+
...(ngDevMode ? [{ debugName: "selectedPermissions" }] : /* istanbul ignore next */ []));
|
|
435
468
|
// Provider data
|
|
436
|
-
this.providers = signal([],
|
|
437
|
-
|
|
438
|
-
this.
|
|
469
|
+
this.providers = signal([], /* @ts-ignore */
|
|
470
|
+
...(ngDevMode ? [{ debugName: "providers" }] : /* istanbul ignore next */ []));
|
|
471
|
+
this.selectedProviderName = signal('', /* @ts-ignore */
|
|
472
|
+
...(ngDevMode ? [{ debugName: "selectedProviderName" }] : /* istanbul ignore next */ []));
|
|
473
|
+
this.selectedProviderKey = signal('', /* @ts-ignore */
|
|
474
|
+
...(ngDevMode ? [{ debugName: "selectedProviderKey" }] : /* istanbul ignore next */ []));
|
|
439
475
|
// Edit mode specific
|
|
440
|
-
this.editProviderName = signal('',
|
|
441
|
-
|
|
476
|
+
this.editProviderName = signal('', /* @ts-ignore */
|
|
477
|
+
...(ngDevMode ? [{ debugName: "editProviderName" }] : /* istanbul ignore next */ []));
|
|
478
|
+
this.editProviderKey = signal('', /* @ts-ignore */
|
|
479
|
+
...(ngDevMode ? [{ debugName: "editProviderKey" }] : /* istanbul ignore next */ []));
|
|
442
480
|
// Search state
|
|
443
|
-
this.searchFilter = signal('',
|
|
444
|
-
|
|
445
|
-
this.
|
|
481
|
+
this.searchFilter = signal('', /* @ts-ignore */
|
|
482
|
+
...(ngDevMode ? [{ debugName: "searchFilter" }] : /* istanbul ignore next */ []));
|
|
483
|
+
this.searchResults = signal([], /* @ts-ignore */
|
|
484
|
+
...(ngDevMode ? [{ debugName: "searchResults" }] : /* istanbul ignore next */ []));
|
|
485
|
+
this.showDropdown = signal(false, /* @ts-ignore */
|
|
486
|
+
...(ngDevMode ? [{ debugName: "showDropdown" }] : /* istanbul ignore next */ []));
|
|
446
487
|
// Computed properties
|
|
447
|
-
this.isAddMode = computed(() => this.viewMode() === eResourcePermissionViewModes.Add,
|
|
448
|
-
|
|
449
|
-
this.
|
|
450
|
-
|
|
488
|
+
this.isAddMode = computed(() => this.viewMode() === eResourcePermissionViewModes.Add, /* @ts-ignore */
|
|
489
|
+
...(ngDevMode ? [{ debugName: "isAddMode" }] : /* istanbul ignore next */ []));
|
|
490
|
+
this.isEditMode = computed(() => this.viewMode() === eResourcePermissionViewModes.Edit, /* @ts-ignore */
|
|
491
|
+
...(ngDevMode ? [{ debugName: "isEditMode" }] : /* istanbul ignore next */ []));
|
|
492
|
+
this.isListMode = computed(() => this.viewMode() === eResourcePermissionViewModes.List, /* @ts-ignore */
|
|
493
|
+
...(ngDevMode ? [{ debugName: "isListMode" }] : /* istanbul ignore next */ []));
|
|
494
|
+
this.currentPermissionsList = computed(() => this.isAddMode() ? this.permissionDefinitions() : this.permissionsWithProvider(), /* @ts-ignore */
|
|
495
|
+
...(ngDevMode ? [{ debugName: "currentPermissionsList" }] : /* istanbul ignore next */ []));
|
|
451
496
|
this.allPermissionsSelected = computed(() => {
|
|
452
497
|
const definitions = this.currentPermissionsList();
|
|
453
498
|
return definitions.length > 0 &&
|
|
454
499
|
definitions.every(p => this.selectedPermissions().includes(p.name || ''));
|
|
455
|
-
},
|
|
500
|
+
}, /* @ts-ignore */
|
|
501
|
+
...(ngDevMode ? [{ debugName: "allPermissionsSelected" }] : /* istanbul ignore next */ []));
|
|
456
502
|
this.canSave = computed(() => {
|
|
457
503
|
if (this.isAddMode()) {
|
|
458
504
|
return !!this.selectedProviderKey() && this.selectedPermissions().length > 0;
|
|
459
505
|
}
|
|
460
506
|
return this.selectedPermissions().length >= 0;
|
|
461
|
-
},
|
|
507
|
+
}, /* @ts-ignore */
|
|
508
|
+
...(ngDevMode ? [{ debugName: "canSave" }] : /* istanbul ignore next */ []));
|
|
462
509
|
}
|
|
463
510
|
// State transition methods
|
|
464
511
|
goToListMode() {
|
|
@@ -541,10 +588,10 @@ class ResourcePermissionStateService {
|
|
|
541
588
|
this.permissionDefinitions.set(permissions);
|
|
542
589
|
this.hasResourcePermission.set(permissions.length > 0);
|
|
543
590
|
}
|
|
544
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
545
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
591
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ResourcePermissionStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
592
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ResourcePermissionStateService }); }
|
|
546
593
|
}
|
|
547
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
594
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ResourcePermissionStateService, decorators: [{
|
|
548
595
|
type: Injectable
|
|
549
596
|
}] });
|
|
550
597
|
|
|
@@ -598,8 +645,8 @@ class ResourcePermissionListComponent {
|
|
|
598
645
|
this.deleteClicked = output();
|
|
599
646
|
configureResourcePermissionExtensions();
|
|
600
647
|
}
|
|
601
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
602
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
648
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ResourcePermissionListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
649
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: ResourcePermissionListComponent, isStandalone: true, selector: "abp-resource-permission-list", outputs: { addClicked: "addClicked", editClicked: "editClicked", deleteClicked: "deleteClicked" }, providers: [
|
|
603
650
|
ListService,
|
|
604
651
|
{
|
|
605
652
|
provide: EXTENSIONS_IDENTIFIER,
|
|
@@ -607,7 +654,7 @@ class ResourcePermissionListComponent {
|
|
|
607
654
|
},
|
|
608
655
|
], ngImport: i0, template: "<div class=\"d-grid gap-2 mb-3 d-md-flex justify-content-md-end\">\r\n <button class=\"btn btn-sm btn-primary\" type=\"button\" (click)=\"addClicked.emit()\">\r\n <i class=\"fa fa-plus me-1\"></i>\r\n {{ 'AbpPermissionManagement::AddResourcePermission' | abpLocalization }}\r\n </button>\r\n</div>\r\n\r\n<ng-template #actionsTemplate let-row>\r\n <div class=\"btn-group btn-group-sm\" role=\"group\">\r\n <button\r\n class=\"btn btn-outline-primary\"\r\n type=\"button\"\r\n (click)=\"editClicked.emit(row)\"\r\n [title]=\"'AbpUi::Edit' | abpLocalization\"\r\n >\r\n <i class=\"fa fa-edit\"></i>\r\n </button>\r\n <button\r\n class=\"btn btn-outline-danger\"\r\n type=\"button\"\r\n (click)=\"deleteClicked.emit(row)\"\r\n [title]=\"'AbpUi::Delete' | abpLocalization\"\r\n >\r\n <i class=\"fa fa-trash\"></i>\r\n </button>\r\n </div>\r\n</ng-template>\r\n\r\n@if (state.resourcePermissions().length > 0) {\r\n <abp-extensible-table\r\n [data]=\"state.resourcePermissions()\"\r\n [recordsTotal]=\"state.totalCount()\"\r\n [list]=\"list\"\r\n [actionsTemplate]=\"actionsTemplate\"\r\n actionsText=\"AbpUi::Actions\"\r\n />\r\n} @else {\r\n <div class=\"alert alert-info\">\r\n {{ 'AbpPermissionManagement::NoPermissionsAssigned' | abpLocalization }}\r\n </div>\r\n}\r\n", dependencies: [{ kind: "component", type: ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate", "selectable", "selectionType", "selected", "infiniteScroll", "isLoading", "scrollThreshold", "tableHeight", "rowDetailTemplate", "rowDetailHeight"], outputs: ["tableActivate", "selectionChange", "loadMore", "rowDetailToggle"], exportAs: ["abpExtensibleTable"] }, { kind: "pipe", type: LocalizationPipe, name: "abpLocalization" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
609
656
|
}
|
|
610
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
657
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ResourcePermissionListComponent, decorators: [{
|
|
611
658
|
type: Component,
|
|
612
659
|
args: [{ selector: 'abp-resource-permission-list', providers: [
|
|
613
660
|
ListService,
|
|
@@ -623,7 +670,8 @@ class ProviderKeySearchComponent {
|
|
|
623
670
|
this.state = inject(ResourcePermissionStateService);
|
|
624
671
|
this.service = inject(PermissionsService);
|
|
625
672
|
this.destroyRef = inject(DestroyRef);
|
|
626
|
-
this.resourceName = input.required(
|
|
673
|
+
this.resourceName = input.required(/* @ts-ignore */
|
|
674
|
+
...(ngDevMode ? [{ debugName: "resourceName" }] : /* istanbul ignore next */ []));
|
|
627
675
|
this.searchFn = () => new Observable();
|
|
628
676
|
}
|
|
629
677
|
ngOnInit() {
|
|
@@ -650,10 +698,10 @@ class ProviderKeySearchComponent {
|
|
|
650
698
|
providerDisplayName: k.providerDisplayName || undefined,
|
|
651
699
|
}))), takeUntilDestroyed(this.destroyRef));
|
|
652
700
|
}
|
|
653
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
654
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
701
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ProviderKeySearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
702
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.7", type: ProviderKeySearchComponent, isStandalone: true, selector: "abp-provider-key-search", inputs: { resourceName: { classPropertyName: "resourceName", publicName: "resourceName", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<abp-lookup-search\r\n label=\"AbpPermissionManagement::SearchProviderKey\"\r\n placeholder=\"AbpPermissionManagement::SearchProviderKey\"\r\n [searchFn]=\"searchFn\"\r\n [displayValue]=\"state.searchFilter()\"\r\n (displayValueChange)=\"state.searchFilter.set($event)\"\r\n [selectedValue]=\"state.selectedProviderKey()\"\r\n (selectedValueChange)=\"state.selectedProviderKey.set($event)\"\r\n (itemSelected)=\"onItemSelected($event)\"\r\n/>\r\n", dependencies: [{ kind: "component", type: LookupSearchComponent, selector: "abp-lookup-search", inputs: ["label", "placeholder", "debounceTime", "minSearchLength", "displayKey", "valueKey", "disabled", "searchFn", "selectedValue", "displayValue"], outputs: ["selectedValueChange", "displayValueChange", "itemSelected", "searchChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
655
703
|
}
|
|
656
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
704
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ProviderKeySearchComponent, decorators: [{
|
|
657
705
|
type: Component,
|
|
658
706
|
args: [{ selector: 'abp-provider-key-search', imports: [LookupSearchComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<abp-lookup-search\r\n label=\"AbpPermissionManagement::SearchProviderKey\"\r\n placeholder=\"AbpPermissionManagement::SearchProviderKey\"\r\n [searchFn]=\"searchFn\"\r\n [displayValue]=\"state.searchFilter()\"\r\n (displayValueChange)=\"state.searchFilter.set($event)\"\r\n [selectedValue]=\"state.selectedProviderKey()\"\r\n (selectedValueChange)=\"state.selectedProviderKey.set($event)\"\r\n (itemSelected)=\"onItemSelected($event)\"\r\n/>\r\n" }]
|
|
659
707
|
}], propDecorators: { resourceName: [{ type: i0.Input, args: [{ isSignal: true, alias: "resourceName", required: true }] }] } });
|
|
@@ -661,15 +709,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
661
709
|
class PermissionCheckboxListComponent {
|
|
662
710
|
constructor() {
|
|
663
711
|
this.state = inject(ResourcePermissionStateService);
|
|
664
|
-
this.permissions = input.required(
|
|
665
|
-
|
|
666
|
-
this.
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
712
|
+
this.permissions = input.required(/* @ts-ignore */
|
|
713
|
+
...(ngDevMode ? [{ debugName: "permissions" }] : /* istanbul ignore next */ []));
|
|
714
|
+
this.idPrefix = input('default', /* @ts-ignore */
|
|
715
|
+
...(ngDevMode ? [{ debugName: "idPrefix" }] : /* istanbul ignore next */ []));
|
|
716
|
+
this.title = input('AbpPermissionManagement::ResourcePermissionPermissions', /* @ts-ignore */
|
|
717
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
718
|
+
this.showTitle = input(true, /* @ts-ignore */
|
|
719
|
+
...(ngDevMode ? [{ debugName: "showTitle" }] : /* istanbul ignore next */ []));
|
|
720
|
+
}
|
|
721
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PermissionCheckboxListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
722
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: PermissionCheckboxListComponent, isStandalone: true, selector: "abp-permission-checkbox-list", inputs: { permissions: { classPropertyName: "permissions", publicName: "permissions", isSignal: true, isRequired: true, transformFunction: null }, idPrefix: { classPropertyName: "idPrefix", publicName: "idPrefix", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, showTitle: { classPropertyName: "showTitle", publicName: "showTitle", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"mb-3\">\r\n @if (showTitle()) {\r\n <h5>{{ title() | abpLocalization }}</h5>\r\n }\r\n <div class=\"form-check form-switch mb-2\">\r\n <input\r\n class=\"form-check-input\"\r\n type=\"checkbox\"\r\n id=\"grantAll-{{ idPrefix() }}\"\r\n [checked]=\"state.allPermissionsSelected()\"\r\n (change)=\"state.toggleAllPermissions(!state.allPermissionsSelected())\"\r\n />\r\n <label class=\"form-check-label\" for=\"grantAll-{{ idPrefix() }}\">\r\n {{ 'AbpPermissionManagement::GrantAllResourcePermissions' | abpLocalization }}\r\n </label>\r\n </div>\r\n <div class=\"abp-permission-list-container border rounded p-3\">\r\n @for (perm of permissions(); track perm.name) {\r\n <div class=\"form-check\">\r\n <input\r\n class=\"form-check-input\"\r\n type=\"checkbox\"\r\n id=\"perm-{{ idPrefix() }}-{{ perm.name }}\"\r\n [checked]=\"state.isPermissionSelected(perm.name || '')\"\r\n (change)=\"state.togglePermission(perm.name || '')\"\r\n />\r\n <label class=\"form-check-label\" for=\"perm-{{ idPrefix() }}-{{ perm.name }}\">\r\n {{ perm.displayName }}\r\n </label>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".abp-permission-list-container{max-height:300px;overflow-y:auto}\n"], dependencies: [{ kind: "pipe", type: LocalizationPipe, name: "abpLocalization" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
671
723
|
}
|
|
672
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
724
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PermissionCheckboxListComponent, decorators: [{
|
|
673
725
|
type: Component,
|
|
674
726
|
args: [{ selector: 'abp-permission-checkbox-list', imports: [LocalizationPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mb-3\">\r\n @if (showTitle()) {\r\n <h5>{{ title() | abpLocalization }}</h5>\r\n }\r\n <div class=\"form-check form-switch mb-2\">\r\n <input\r\n class=\"form-check-input\"\r\n type=\"checkbox\"\r\n id=\"grantAll-{{ idPrefix() }}\"\r\n [checked]=\"state.allPermissionsSelected()\"\r\n (change)=\"state.toggleAllPermissions(!state.allPermissionsSelected())\"\r\n />\r\n <label class=\"form-check-label\" for=\"grantAll-{{ idPrefix() }}\">\r\n {{ 'AbpPermissionManagement::GrantAllResourcePermissions' | abpLocalization }}\r\n </label>\r\n </div>\r\n <div class=\"abp-permission-list-container border rounded p-3\">\r\n @for (perm of permissions(); track perm.name) {\r\n <div class=\"form-check\">\r\n <input\r\n class=\"form-check-input\"\r\n type=\"checkbox\"\r\n id=\"perm-{{ idPrefix() }}-{{ perm.name }}\"\r\n [checked]=\"state.isPermissionSelected(perm.name || '')\"\r\n (change)=\"state.togglePermission(perm.name || '')\"\r\n />\r\n <label class=\"form-check-label\" for=\"perm-{{ idPrefix() }}-{{ perm.name }}\">\r\n {{ perm.displayName }}\r\n </label>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".abp-permission-list-container{max-height:300px;overflow-y:auto}\n"] }]
|
|
675
727
|
}], propDecorators: { permissions: [{ type: i0.Input, args: [{ isSignal: true, alias: "permissions", required: true }] }], idPrefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "idPrefix", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], showTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTitle", required: false }] }] } });
|
|
@@ -678,15 +730,17 @@ class ResourcePermissionFormComponent {
|
|
|
678
730
|
constructor() {
|
|
679
731
|
this.state = inject(ResourcePermissionStateService);
|
|
680
732
|
this.eResourcePermissionViewModes = eResourcePermissionViewModes;
|
|
681
|
-
this.mode = input.required(
|
|
682
|
-
|
|
733
|
+
this.mode = input.required(/* @ts-ignore */
|
|
734
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
735
|
+
this.resourceName = input.required(/* @ts-ignore */
|
|
736
|
+
...(ngDevMode ? [{ debugName: "resourceName" }] : /* istanbul ignore next */ []));
|
|
683
737
|
this.save = output();
|
|
684
738
|
this.cancel = output();
|
|
685
739
|
}
|
|
686
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
687
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
740
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ResourcePermissionFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
741
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: ResourcePermissionFormComponent, isStandalone: true, selector: "abp-resource-permission-form", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: true, transformFunction: null }, resourceName: { classPropertyName: "resourceName", publicName: "resourceName", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { save: "save", cancel: "cancel" }, ngImport: i0, template: "@if (mode() === eResourcePermissionViewModes.Add) {\r\n <div class=\"mb-3\">\r\n <label class=\"form-label fw-bold\">\r\n {{ 'AbpPermissionManagement::SelectProvider' | abpLocalization }}\r\n </label>\r\n <div class=\"mb-2\">\r\n @for (provider of state.providers(); track provider.name; let i = $index) {\r\n <div class=\"form-check form-check-inline\">\r\n <input\r\n class=\"form-check-input\"\r\n type=\"radio\"\r\n [id]=\"'provider-' + i\"\r\n [value]=\"provider.name\"\r\n [checked]=\"state.selectedProviderName() === provider.name\"\r\n (change)=\"state.onProviderChange(provider.name || '')\"\r\n />\r\n <label class=\"form-check-label\" [for]=\"'provider-' + i\">\r\n {{ provider.displayName }}\r\n </label>\r\n </div>\r\n }\r\n </div>\r\n\r\n <abp-provider-key-search [resourceName]=\"resourceName()\" />\r\n </div>\r\n\r\n <abp-permission-checkbox-list [permissions]=\"state.permissionDefinitions()\" idPrefix=\"add\" />\r\n} @else {\r\n <div class=\"mb-3\" id=\"permissionList\">\r\n <abp-permission-checkbox-list\r\n [permissions]=\"state.permissionsWithProvider()\"\r\n idPrefix=\"edit\"\r\n [showTitle]=\"false\"\r\n />\r\n </div>\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: ProviderKeySearchComponent, selector: "abp-provider-key-search", inputs: ["resourceName"] }, { kind: "component", type: PermissionCheckboxListComponent, selector: "abp-permission-checkbox-list", inputs: ["permissions", "idPrefix", "title", "showTitle"] }, { kind: "pipe", type: LocalizationPipe, name: "abpLocalization" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
688
742
|
}
|
|
689
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
743
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ResourcePermissionFormComponent, decorators: [{
|
|
690
744
|
type: Component,
|
|
691
745
|
args: [{ selector: 'abp-resource-permission-form', imports: [
|
|
692
746
|
FormsModule,
|
|
@@ -705,11 +759,33 @@ class ResourcePermissionManagementComponent {
|
|
|
705
759
|
this.confirmationService = inject(ConfirmationService);
|
|
706
760
|
this.state = inject(ResourcePermissionStateService);
|
|
707
761
|
this.list = inject(ListService);
|
|
708
|
-
this.resourceName = input.required(
|
|
709
|
-
|
|
710
|
-
this.
|
|
711
|
-
|
|
712
|
-
this.
|
|
762
|
+
this.resourceName = input.required(/* @ts-ignore */
|
|
763
|
+
...(ngDevMode ? [{ debugName: "resourceName" }] : /* istanbul ignore next */ []));
|
|
764
|
+
this.resourceKey = input.required(/* @ts-ignore */
|
|
765
|
+
...(ngDevMode ? [{ debugName: "resourceKey" }] : /* istanbul ignore next */ []));
|
|
766
|
+
this.resourceDisplayName = input(/* @ts-ignore */
|
|
767
|
+
...(ngDevMode ? [undefined, { debugName: "resourceDisplayName" }] : /* istanbul ignore next */ []));
|
|
768
|
+
this.visible = model(false, /* @ts-ignore */
|
|
769
|
+
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
770
|
+
this.previousVisible = signal(false, /* @ts-ignore */
|
|
771
|
+
...(ngDevMode ? [{ debugName: "previousVisible" }] : /* istanbul ignore next */ []));
|
|
772
|
+
this.listData = toSignal(this.list.hookToQuery(query => {
|
|
773
|
+
const allData = this.state.allResourcePermissions();
|
|
774
|
+
const skipCount = query.skipCount || 0;
|
|
775
|
+
const maxResultCount = query.maxResultCount || DEFAULT_MAX_RESULT_COUNT;
|
|
776
|
+
const paginatedData = allData.slice(skipCount, skipCount + maxResultCount);
|
|
777
|
+
return of({
|
|
778
|
+
items: paginatedData,
|
|
779
|
+
totalCount: allData.length,
|
|
780
|
+
});
|
|
781
|
+
}), { initialValue: { items: [], totalCount: 0 } });
|
|
782
|
+
effect(() => {
|
|
783
|
+
const result = this.listData();
|
|
784
|
+
untracked(() => {
|
|
785
|
+
this.state.resourcePermissions.set(result.items);
|
|
786
|
+
this.state.totalCount.set(result.totalCount);
|
|
787
|
+
});
|
|
788
|
+
});
|
|
713
789
|
effect(() => {
|
|
714
790
|
const resourceName = this.resourceName();
|
|
715
791
|
const resourceKey = this.resourceKey();
|
|
@@ -732,24 +808,6 @@ class ResourcePermissionManagementComponent {
|
|
|
732
808
|
untracked(() => this.previousVisible.set(isVisible));
|
|
733
809
|
});
|
|
734
810
|
}
|
|
735
|
-
ngOnInit() {
|
|
736
|
-
this.list.maxResultCount = DEFAULT_MAX_RESULT_COUNT;
|
|
737
|
-
this.list
|
|
738
|
-
.hookToQuery(query => {
|
|
739
|
-
const allData = this.state.allResourcePermissions();
|
|
740
|
-
const skipCount = query.skipCount || 0;
|
|
741
|
-
const maxResultCount = query.maxResultCount || DEFAULT_MAX_RESULT_COUNT;
|
|
742
|
-
const paginatedData = allData.slice(skipCount, skipCount + maxResultCount);
|
|
743
|
-
return of({
|
|
744
|
-
items: paginatedData,
|
|
745
|
-
totalCount: allData.length,
|
|
746
|
-
});
|
|
747
|
-
})
|
|
748
|
-
.subscribe(result => {
|
|
749
|
-
this.state.resourcePermissions.set(result.items);
|
|
750
|
-
this.state.totalCount.set(result.totalCount);
|
|
751
|
-
});
|
|
752
|
-
}
|
|
753
811
|
openModal() {
|
|
754
812
|
this.state.modalBusy.set(true);
|
|
755
813
|
this.service
|
|
@@ -832,27 +890,27 @@ class ResourcePermissionManagementComponent {
|
|
|
832
890
|
},
|
|
833
891
|
});
|
|
834
892
|
}
|
|
835
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
836
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
893
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ResourcePermissionManagementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
894
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: ResourcePermissionManagementComponent, isStandalone: true, selector: "abp-resource-permission-management", inputs: { resourceName: { classPropertyName: "resourceName", publicName: "resourceName", isSignal: true, isRequired: true, transformFunction: null }, resourceKey: { classPropertyName: "resourceKey", publicName: "resourceKey", isSignal: true, isRequired: true, transformFunction: null }, resourceDisplayName: { classPropertyName: "resourceDisplayName", publicName: "resourceDisplayName", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange" }, providers: [ResourcePermissionStateService, ListService], exportAs: ["abpResourcePermissionManagement"], ngImport: i0, template: "<abp-modal\r\n [(visible)]=\"visible\"\r\n [busy]=\"state.modalBusy()\"\r\n [options]=\"{ size: 'xl', scrollable: false }\"\r\n>\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">\r\n @switch (state.viewMode()) {\r\n @case (eResourcePermissionViewModes.Edit) {\r\n {{ 'AbpPermissionManagement::UpdatePermission' | abpLocalization }}\r\n }\r\n @case (eResourcePermissionViewModes.Add) {\r\n {{ 'AbpPermissionManagement::AddResourcePermission' | abpLocalization }}\r\n }\r\n @default {\r\n {{ 'AbpPermissionManagement::ResourcePermissions' | abpLocalization }}\r\n @if (resourceDisplayName()) {\r\n - {{ resourceDisplayName() }}\r\n }\r\n }\r\n }\r\n </h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n @if (!state.hasResourcePermission() || !state.hasProviderKeyLookupService()) {\r\n <div class=\"alert alert-warning\" role=\"alert\">\r\n @if (!state.hasResourcePermission()) {\r\n {{ 'AbpPermissionManagement::NoResourcePermissionFound' | abpLocalization }}\r\n } @else {\r\n {{ 'AbpPermissionManagement::NoResourceProviderKeyLookupServiceFound' | abpLocalization }}\r\n }\r\n </div>\r\n } @else {\r\n @switch (state.viewMode()) {\r\n @case (eResourcePermissionViewModes.List) {\r\n <abp-resource-permission-list\r\n (addClicked)=\"onAddClicked()\"\r\n (editClicked)=\"onEditClicked($event)\"\r\n (deleteClicked)=\"onDeleteClicked($event)\"\r\n />\r\n }\r\n @case (eResourcePermissionViewModes.Add) {\r\n <abp-resource-permission-form [mode]=\"eResourcePermissionViewModes.Add\" [resourceName]=\"resourceName()\" />\r\n }\r\n @case (eResourcePermissionViewModes.Edit) {\r\n <abp-resource-permission-form [mode]=\"eResourcePermissionViewModes.Edit\" [resourceName]=\"resourceName()\" />\r\n }\r\n }\r\n }\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n @if (state.isListMode()) {\r\n <button type=\"button\" class=\"btn btn-outline-primary\" abpClose>\r\n {{ 'AbpUi::Close' | abpLocalization }}\r\n </button>\r\n } @else {\r\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"state.goToListMode()\">\r\n {{ 'AbpUi::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" (click)=\"savePermission()\">\r\n {{ 'AbpUi::Save' | abpLocalization }}\r\n </abp-button>\r\n }\r\n </ng-template>\r\n</abp-modal>\r\n", dependencies: [{ kind: "component", type: ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "component", type: ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "directive", type: ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: ResourcePermissionListComponent, selector: "abp-resource-permission-list", outputs: ["addClicked", "editClicked", "deleteClicked"] }, { kind: "component", type: ResourcePermissionFormComponent, selector: "abp-resource-permission-form", inputs: ["mode", "resourceName"], outputs: ["save", "cancel"] }, { kind: "pipe", type: LocalizationPipe, name: "abpLocalization" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
837
895
|
}
|
|
838
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
896
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ResourcePermissionManagementComponent, decorators: [{
|
|
839
897
|
type: Component,
|
|
840
|
-
args: [{ selector: 'abp-resource-permission-management', exportAs: 'abpResourcePermissionManagement', providers: [ResourcePermissionStateService, ListService], imports: [
|
|
898
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'abp-resource-permission-management', exportAs: 'abpResourcePermissionManagement', providers: [ResourcePermissionStateService, ListService], imports: [
|
|
841
899
|
ModalComponent,
|
|
842
900
|
LocalizationPipe,
|
|
843
901
|
ButtonComponent,
|
|
844
902
|
ModalCloseDirective,
|
|
845
903
|
ResourcePermissionListComponent,
|
|
846
904
|
ResourcePermissionFormComponent,
|
|
847
|
-
], template: "<abp-modal\r\n [(visible)]=\"visible\"\r\n [busy]=\"state.modalBusy()\"\r\n [options]=\"{ size: 'xl', scrollable: false }\"\r\n>\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">\r\n @switch (state.viewMode()) {\r\n @case (eResourcePermissionViewModes.Edit) {\r\n {{ 'AbpPermissionManagement::UpdatePermission' | abpLocalization }}\r\n }\r\n @case (eResourcePermissionViewModes.Add) {\r\n {{ 'AbpPermissionManagement::AddResourcePermission' | abpLocalization }}\r\n }\r\n @default {\r\n {{ 'AbpPermissionManagement::ResourcePermissions' | abpLocalization }}\r\n @if (resourceDisplayName()) {\r\n - {{ resourceDisplayName() }}\r\n }\r\n }\r\n }\r\n </h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n @if (!state.hasResourcePermission() || !state.hasProviderKeyLookupService()) {\r\n <div class=\"alert alert-warning\" role=\"alert\">\r\n @if (!state.hasResourcePermission()) {\r\n {{ 'AbpPermissionManagement::NoResourcePermissionFound' | abpLocalization }}\r\n } @else {\r\n {{ 'AbpPermissionManagement::NoResourceProviderKeyLookupServiceFound' | abpLocalization }}\r\n }\r\n </div>\r\n } @else {\r\n @switch (state.viewMode()) {\r\n @case (eResourcePermissionViewModes.List) {\r\n <abp-resource-permission-list\r\n (addClicked)=\"onAddClicked()\"\r\n (editClicked)=\"onEditClicked($event)\"\r\n (deleteClicked)=\"onDeleteClicked($event)\"\r\n />\r\n }\r\n @case (eResourcePermissionViewModes.Add) {\r\n <abp-resource-permission-form mode=\"
|
|
905
|
+
], template: "<abp-modal\r\n [(visible)]=\"visible\"\r\n [busy]=\"state.modalBusy()\"\r\n [options]=\"{ size: 'xl', scrollable: false }\"\r\n>\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">\r\n @switch (state.viewMode()) {\r\n @case (eResourcePermissionViewModes.Edit) {\r\n {{ 'AbpPermissionManagement::UpdatePermission' | abpLocalization }}\r\n }\r\n @case (eResourcePermissionViewModes.Add) {\r\n {{ 'AbpPermissionManagement::AddResourcePermission' | abpLocalization }}\r\n }\r\n @default {\r\n {{ 'AbpPermissionManagement::ResourcePermissions' | abpLocalization }}\r\n @if (resourceDisplayName()) {\r\n - {{ resourceDisplayName() }}\r\n }\r\n }\r\n }\r\n </h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n @if (!state.hasResourcePermission() || !state.hasProviderKeyLookupService()) {\r\n <div class=\"alert alert-warning\" role=\"alert\">\r\n @if (!state.hasResourcePermission()) {\r\n {{ 'AbpPermissionManagement::NoResourcePermissionFound' | abpLocalization }}\r\n } @else {\r\n {{ 'AbpPermissionManagement::NoResourceProviderKeyLookupServiceFound' | abpLocalization }}\r\n }\r\n </div>\r\n } @else {\r\n @switch (state.viewMode()) {\r\n @case (eResourcePermissionViewModes.List) {\r\n <abp-resource-permission-list\r\n (addClicked)=\"onAddClicked()\"\r\n (editClicked)=\"onEditClicked($event)\"\r\n (deleteClicked)=\"onDeleteClicked($event)\"\r\n />\r\n }\r\n @case (eResourcePermissionViewModes.Add) {\r\n <abp-resource-permission-form [mode]=\"eResourcePermissionViewModes.Add\" [resourceName]=\"resourceName()\" />\r\n }\r\n @case (eResourcePermissionViewModes.Edit) {\r\n <abp-resource-permission-form [mode]=\"eResourcePermissionViewModes.Edit\" [resourceName]=\"resourceName()\" />\r\n }\r\n }\r\n }\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n @if (state.isListMode()) {\r\n <button type=\"button\" class=\"btn btn-outline-primary\" abpClose>\r\n {{ 'AbpUi::Close' | abpLocalization }}\r\n </button>\r\n } @else {\r\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"state.goToListMode()\">\r\n {{ 'AbpUi::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" (click)=\"savePermission()\">\r\n {{ 'AbpUi::Save' | abpLocalization }}\r\n </abp-button>\r\n }\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
848
906
|
}], ctorParameters: () => [], propDecorators: { resourceName: [{ type: i0.Input, args: [{ isSignal: true, alias: "resourceName", required: true }] }], resourceKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "resourceKey", required: true }] }], resourceDisplayName: [{ type: i0.Input, args: [{ isSignal: true, alias: "resourceDisplayName", required: false }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }] } });
|
|
849
907
|
|
|
850
908
|
class PermissionManagementModule {
|
|
851
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
852
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
853
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
909
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PermissionManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
910
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.7", ngImport: i0, type: PermissionManagementModule, imports: [PermissionManagementComponent], exports: [PermissionManagementComponent] }); }
|
|
911
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PermissionManagementModule, imports: [PermissionManagementComponent] }); }
|
|
854
912
|
}
|
|
855
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
913
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: PermissionManagementModule, decorators: [{
|
|
856
914
|
type: NgModule,
|
|
857
915
|
args: [{
|
|
858
916
|
declarations: [],
|