@abp/ng.identity 7.0.1 → 7.0.3
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/esm2020/lib/components/roles/roles.component.mjs +6 -5
- package/esm2020/lib/components/users/users.component.mjs +25 -21
- package/esm2020/lib/defaults/default-roles-entity-actions.mjs +5 -5
- package/esm2020/lib/defaults/default-roles-form-props.mjs +3 -3
- package/esm2020/lib/defaults/default-users-entity-actions.mjs +10 -9
- package/esm2020/lib/defaults/default-users-form-props.mjs +2 -2
- package/esm2020/lib/identity.module.mjs +7 -3
- package/fesm2015/abp-ng.identity.mjs +44 -35
- package/fesm2015/abp-ng.identity.mjs.map +1 -1
- package/fesm2020/abp-ng.identity.mjs +41 -32
- package/fesm2020/abp-ng.identity.mjs.map +1 -1
- package/lib/components/roles/roles.component.d.ts +3 -3
- package/lib/components/users/users.component.d.ts +13 -13
- package/lib/defaults/default-roles-form-props.d.ts +1 -1
- package/lib/identity.module.d.ts +2 -1
- package/package.json +5 -4
|
@@ -14,6 +14,8 @@ import * as i7 from '@ngx-validate/core';
|
|
|
14
14
|
import { NgxValidateCoreModule } from '@ngx-validate/core';
|
|
15
15
|
import * as i7$1 from '@abp/ng.permission-management';
|
|
16
16
|
import { PermissionManagementModule } from '@abp/ng.permission-management';
|
|
17
|
+
import * as i8 from '@abp/ng.components/page';
|
|
18
|
+
import { PageModule } from '@abp/ng.components/page';
|
|
17
19
|
import * as i5 from '@angular/common';
|
|
18
20
|
import * as i6$1 from '@ng-bootstrap/ng-bootstrap';
|
|
19
21
|
import { NgbNavModule, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
|
@@ -32,7 +34,7 @@ class RolesComponent {
|
|
|
32
34
|
this.visiblePermissions = false;
|
|
33
35
|
this.modalBusy = false;
|
|
34
36
|
this.permissionManagementKey = "PermissionManagement.PermissionManagementComponent" /* ePermissionManagementComponents.PermissionManagement */;
|
|
35
|
-
this.onVisiblePermissionChange = event => {
|
|
37
|
+
this.onVisiblePermissionChange = (event) => {
|
|
36
38
|
this.visiblePermissions = event;
|
|
37
39
|
};
|
|
38
40
|
}
|
|
@@ -61,7 +63,7 @@ class RolesComponent {
|
|
|
61
63
|
if (!this.form.valid)
|
|
62
64
|
return;
|
|
63
65
|
this.modalBusy = true;
|
|
64
|
-
const { id } = this.selected;
|
|
66
|
+
const { id } = this.selected || {};
|
|
65
67
|
(id
|
|
66
68
|
? this.service.update(id, { ...this.selected, ...this.form.value })
|
|
67
69
|
: this.service.create(this.form.value))
|
|
@@ -105,7 +107,7 @@ RolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version
|
|
|
105
107
|
provide: EXTENSIONS_IDENTIFIER,
|
|
106
108
|
useValue: "Identity.RolesComponent" /* eIdentityComponents.Roles */,
|
|
107
109
|
},
|
|
108
|
-
], ngImport: i0, template: "<
|
|
110
|
+
], ngImport: i0, template: "<abp-page [title]=\"'AbpIdentity::Roles' | abpLocalization\" [toolbar]=\"data.items\">\r\n <div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-body\">\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n\r\n <abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewRole') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n </abp-modal>\r\n\r\n <abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'R' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true },\r\n hideBadges: { value: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n >\r\n </abp-permission-management>\r\n</abp-page>\r\n", dependencies: [{ kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i1.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }, { kind: "directive", type: i7.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: i6.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { kind: "component", type: i6.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], outputs: ["tableActivate"], exportAs: ["abpExtensibleTable"] }, { kind: "component", type: i7$1.PermissionManagementComponent, selector: "abp-permission-management", inputs: ["providerName", "providerKey", "hideBadges", "entityDisplayName", "visible"], outputs: ["visibleChange"], exportAs: ["abpPermissionManagement"] }, { kind: "component", type: i8.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
109
111
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: RolesComponent, decorators: [{
|
|
110
112
|
type: Component,
|
|
111
113
|
args: [{ selector: 'abp-roles', providers: [
|
|
@@ -114,7 +116,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
114
116
|
provide: EXTENSIONS_IDENTIFIER,
|
|
115
117
|
useValue: "Identity.RolesComponent" /* eIdentityComponents.Roles */,
|
|
116
118
|
},
|
|
117
|
-
], template: "<
|
|
119
|
+
], template: "<abp-page [title]=\"'AbpIdentity::Roles' | abpLocalization\" [toolbar]=\"data.items\">\r\n <div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-body\">\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n\r\n <abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewRole') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n </abp-modal>\r\n\r\n <abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'R' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true },\r\n hideBadges: { value: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n >\r\n </abp-permission-management>\r\n</abp-page>\r\n" }]
|
|
118
120
|
}], ctorParameters: function () { return [{ type: i1.ListService }, { type: i2.ConfirmationService }, { type: i2.ToasterService }, { type: i0.Injector }, { type: i3.IdentityRoleService }]; } });
|
|
119
121
|
|
|
120
122
|
class UsersComponent {
|
|
@@ -130,7 +132,7 @@ class UsersComponent {
|
|
|
130
132
|
this.modalBusy = false;
|
|
131
133
|
this.permissionManagementKey = "PermissionManagement.PermissionManagementComponent" /* ePermissionManagementComponents.PermissionManagement */;
|
|
132
134
|
this.trackByFn = (index, item) => Object.keys(item)[0] || index;
|
|
133
|
-
this.onVisiblePermissionChange = event => {
|
|
135
|
+
this.onVisiblePermissionChange = (event) => {
|
|
134
136
|
this.visiblePermissions = event;
|
|
135
137
|
};
|
|
136
138
|
}
|
|
@@ -145,13 +147,15 @@ class UsersComponent {
|
|
|
145
147
|
this.form = generateFormFromProps(data);
|
|
146
148
|
this.service.getAssignableRoles().subscribe(({ items }) => {
|
|
147
149
|
this.roles = items;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
if (this.roles) {
|
|
151
|
+
this.form.addControl('roleNames', this.fb.array(this.roles.map(role => this.fb.group({
|
|
152
|
+
[role.name]: [
|
|
153
|
+
this.selected?.id
|
|
154
|
+
? !!this.selectedUserRoles?.find(userRole => userRole.id === role.id)
|
|
155
|
+
: role.isDefault,
|
|
156
|
+
],
|
|
157
|
+
}))));
|
|
158
|
+
}
|
|
155
159
|
});
|
|
156
160
|
}
|
|
157
161
|
openModal() {
|
|
@@ -177,9 +181,10 @@ class UsersComponent {
|
|
|
177
181
|
return;
|
|
178
182
|
this.modalBusy = true;
|
|
179
183
|
const { roleNames = [] } = this.form.value;
|
|
180
|
-
const mappedRoleNames = roleNames
|
|
181
|
-
[]
|
|
182
|
-
|
|
184
|
+
const mappedRoleNames = roleNames
|
|
185
|
+
.filter((role) => !!role[Object.keys(role)[0]])
|
|
186
|
+
.map((role) => Object.keys(role)[0]) || [];
|
|
187
|
+
const { id } = this.selected || {};
|
|
183
188
|
(id
|
|
184
189
|
? this.service.update(id, {
|
|
185
190
|
...this.selected,
|
|
@@ -230,7 +235,7 @@ UsersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version
|
|
|
230
235
|
provide: EXTENSIONS_IDENTIFIER,
|
|
231
236
|
useValue: "Identity.UsersComponent" /* eIdentityComponents.Users */,
|
|
232
237
|
},
|
|
233
|
-
], viewQueries: [{ propertyName: "modalContent", first: true, predicate: ["modalContent"], descendants: true }], ngImport: i0, template: "<
|
|
238
|
+
], viewQueries: [{ propertyName: "modalContent", first: true, predicate: ["modalContent"], descendants: true }], ngImport: i0, template: "<abp-page [title]=\"'AbpIdentity::Users' | abpLocalization\" [toolbar]=\"data.items\">\r\n\r\n <div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-body\">\r\n <div id=\"data-tables-table-filter\" class=\"data-tables-filter mb-3\">\r\n <div class=\"input-group\">\r\n <input\r\n type=\"search\"\r\n class=\"form-control\"\r\n [placeholder]=\"'AbpUi::PagerSearch' | abpLocalization\"\r\n [(ngModel)]=\"list.filter\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n\r\n <abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewUser') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <ng-template #loaderRef\r\n >\r\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\"></i></div\r\n >\r\n </ng-template>\r\n\r\n <form *ngIf=\"form; else loaderRef\" [formGroup]=\"form\" (ngSubmit)=\"save()\">\r\n <ul ngbNav #nav=\"ngbNav\" class=\"nav-tabs\">\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::UserInformations' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </ng-template>\r\n </li>\r\n\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::Roles' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <div\r\n *ngFor=\"let roleGroup of roleGroups; let i = index; trackBy: trackByFn\"\r\n class=\"form-check mb-2\"\r\n >\r\n <input\r\n type=\"checkbox\"\r\n class=\"form-check-input\"\r\n [attr.id]=\"'roles-' + i\"\r\n [formControl]=\"roleGroup.controls[roles[i].name]\"\r\n />\r\n <label class=\"form-check-label\" [attr.for]=\"'roles-' + i\">{{ roles[i].name }}</label>\r\n </div>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n\r\n <div class=\"mt-2 fade-in-top\" [ngbNavOutlet]=\"nav\"></div>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n </abp-modal>\r\n\r\n <abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'U' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n [entityDisplayName]=\"entityDisplayName\"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n >\r\n </abp-permission-management>\r\n</abp-page>\r\n", dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.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: i4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i1.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }, { kind: "directive", type: i6$1.NgbNavContent, selector: "ng-template[ngbNavContent]" }, { kind: "directive", type: i6$1.NgbNav, selector: "[ngbNav]", inputs: ["activeId", "animation", "destroyOnHide", "orientation", "roles", "keyboard"], outputs: ["activeIdChange", "shown", "hidden", "navChange"], exportAs: ["ngbNav"] }, { kind: "directive", type: i6$1.NgbNavItem, selector: "[ngbNavItem]", inputs: ["destroyOnHide", "disabled", "domId", "ngbNavItem"], outputs: ["shown", "hidden"], exportAs: ["ngbNavItem"] }, { kind: "directive", type: i6$1.NgbNavLink, selector: "a[ngbNavLink]" }, { kind: "component", type: i6$1.NgbNavOutlet, selector: "[ngbNavOutlet]", inputs: ["paneRole", "ngbNavOutlet"] }, { kind: "directive", type: i7.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i7.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: i6.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { kind: "component", type: i6.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], outputs: ["tableActivate"], exportAs: ["abpExtensibleTable"] }, { kind: "component", type: i7$1.PermissionManagementComponent, selector: "abp-permission-management", inputs: ["providerName", "providerKey", "hideBadges", "entityDisplayName", "visible"], outputs: ["visibleChange"], exportAs: ["abpPermissionManagement"] }, { kind: "component", type: i8.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
234
239
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UsersComponent, decorators: [{
|
|
235
240
|
type: Component,
|
|
236
241
|
args: [{ selector: 'abp-users', providers: [
|
|
@@ -239,7 +244,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
239
244
|
provide: EXTENSIONS_IDENTIFIER,
|
|
240
245
|
useValue: "Identity.UsersComponent" /* eIdentityComponents.Users */,
|
|
241
246
|
},
|
|
242
|
-
], template: "<
|
|
247
|
+
], template: "<abp-page [title]=\"'AbpIdentity::Users' | abpLocalization\" [toolbar]=\"data.items\">\r\n\r\n <div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-body\">\r\n <div id=\"data-tables-table-filter\" class=\"data-tables-filter mb-3\">\r\n <div class=\"input-group\">\r\n <input\r\n type=\"search\"\r\n class=\"form-control\"\r\n [placeholder]=\"'AbpUi::PagerSearch' | abpLocalization\"\r\n [(ngModel)]=\"list.filter\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n\r\n <abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewUser') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <ng-template #loaderRef\r\n >\r\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\"></i></div\r\n >\r\n </ng-template>\r\n\r\n <form *ngIf=\"form; else loaderRef\" [formGroup]=\"form\" (ngSubmit)=\"save()\">\r\n <ul ngbNav #nav=\"ngbNav\" class=\"nav-tabs\">\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::UserInformations' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </ng-template>\r\n </li>\r\n\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::Roles' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <div\r\n *ngFor=\"let roleGroup of roleGroups; let i = index; trackBy: trackByFn\"\r\n class=\"form-check mb-2\"\r\n >\r\n <input\r\n type=\"checkbox\"\r\n class=\"form-check-input\"\r\n [attr.id]=\"'roles-' + i\"\r\n [formControl]=\"roleGroup.controls[roles[i].name]\"\r\n />\r\n <label class=\"form-check-label\" [attr.for]=\"'roles-' + i\">{{ roles[i].name }}</label>\r\n </div>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n\r\n <div class=\"mt-2 fade-in-top\" [ngbNavOutlet]=\"nav\"></div>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n </abp-modal>\r\n\r\n <abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'U' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n [entityDisplayName]=\"entityDisplayName\"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n >\r\n </abp-permission-management>\r\n</abp-page>\r\n" }]
|
|
243
248
|
}], ctorParameters: function () { return [{ type: i1.ListService }, { type: i2.ConfirmationService }, { type: i3.IdentityUserService }, { type: i2.ToasterService }, { type: i4.UntypedFormBuilder }, { type: i0.Injector }]; }, propDecorators: { modalContent: [{
|
|
244
249
|
type: ViewChild,
|
|
245
250
|
args: ['modalContent', { static: false }]
|
|
@@ -250,7 +255,7 @@ const DEFAULT_ROLES_ENTITY_ACTIONS = EntityAction.createMany([
|
|
|
250
255
|
text: 'AbpIdentity::Edit',
|
|
251
256
|
action: data => {
|
|
252
257
|
const component = data.getInjected(RolesComponent);
|
|
253
|
-
component.edit(data.record.id);
|
|
258
|
+
component.edit(data.record.id || '');
|
|
254
259
|
},
|
|
255
260
|
permission: 'AbpIdentity.Roles.Update',
|
|
256
261
|
},
|
|
@@ -258,7 +263,7 @@ const DEFAULT_ROLES_ENTITY_ACTIONS = EntityAction.createMany([
|
|
|
258
263
|
text: 'AbpIdentity::Permissions',
|
|
259
264
|
action: data => {
|
|
260
265
|
const component = data.getInjected(RolesComponent);
|
|
261
|
-
component.openPermissionsModal(data.record.name);
|
|
266
|
+
component.openPermissionsModal(data.record.name || '');
|
|
262
267
|
},
|
|
263
268
|
permission: 'AbpIdentity.Roles.ManagePermissions',
|
|
264
269
|
},
|
|
@@ -266,10 +271,10 @@ const DEFAULT_ROLES_ENTITY_ACTIONS = EntityAction.createMany([
|
|
|
266
271
|
text: 'AbpIdentity::Delete',
|
|
267
272
|
action: data => {
|
|
268
273
|
const component = data.getInjected(RolesComponent);
|
|
269
|
-
component.delete(data.record.id, data.record.name);
|
|
274
|
+
component.delete(data.record.id || '', data.record.name || '');
|
|
270
275
|
},
|
|
271
276
|
permission: 'AbpIdentity.Roles.Delete',
|
|
272
|
-
visible: data => !data
|
|
277
|
+
visible: data => !data?.record.isStatic,
|
|
273
278
|
},
|
|
274
279
|
]);
|
|
275
280
|
|
|
@@ -300,7 +305,7 @@ const DEFAULT_ROLES_CREATE_FORM_PROPS = FormProp.createMany([
|
|
|
300
305
|
name: 'name',
|
|
301
306
|
displayName: 'AbpIdentity::RoleName',
|
|
302
307
|
id: 'role-name',
|
|
303
|
-
disabled: (data) => data.record && data.record.isStatic,
|
|
308
|
+
disabled: ((data) => data.record && data.record.isStatic),
|
|
304
309
|
validators: () => [Validators.required],
|
|
305
310
|
},
|
|
306
311
|
{
|
|
@@ -337,7 +342,7 @@ const DEFAULT_USERS_ENTITY_ACTIONS = EntityAction.createMany([
|
|
|
337
342
|
text: 'AbpIdentity::Edit',
|
|
338
343
|
action: data => {
|
|
339
344
|
const component = data.getInjected(UsersComponent);
|
|
340
|
-
component.edit(data.record.id);
|
|
345
|
+
component.edit(data.record.id || '');
|
|
341
346
|
},
|
|
342
347
|
permission: 'AbpIdentity.Users.Update',
|
|
343
348
|
},
|
|
@@ -345,19 +350,20 @@ const DEFAULT_USERS_ENTITY_ACTIONS = EntityAction.createMany([
|
|
|
345
350
|
text: 'AbpIdentity::Permissions',
|
|
346
351
|
action: data => {
|
|
347
352
|
const component = data.getInjected(UsersComponent);
|
|
348
|
-
component.openPermissionsModal(data.record.id, data.record.userName);
|
|
353
|
+
component.openPermissionsModal(data.record.id || '', data.record.userName);
|
|
349
354
|
},
|
|
350
355
|
permission: 'AbpIdentity.Users.ManagePermissions',
|
|
351
|
-
},
|
|
356
|
+
},
|
|
357
|
+
{
|
|
352
358
|
text: 'AbpIdentity::Delete',
|
|
353
359
|
action: data => {
|
|
354
360
|
const component = data.getInjected(UsersComponent);
|
|
355
|
-
component.delete(data.record.id, data.record.name || data.record.userName);
|
|
361
|
+
component.delete(data.record.id || '', data.record.name || data.record.userName || '');
|
|
356
362
|
},
|
|
357
363
|
visible: data => {
|
|
358
|
-
const userName = data
|
|
359
|
-
const configStateService = data
|
|
360
|
-
const currentUser = configStateService
|
|
364
|
+
const userName = data?.record.userName;
|
|
365
|
+
const configStateService = data?.getInjected(ConfigStateService);
|
|
366
|
+
const currentUser = configStateService?.getOne('currentUser');
|
|
361
367
|
return userName !== currentUser.userName;
|
|
362
368
|
},
|
|
363
369
|
permission: 'AbpIdentity.Users.Delete',
|
|
@@ -459,7 +465,7 @@ const DEFAULT_USERS_EDIT_FORM_PROPS = DEFAULT_USERS_CREATE_FORM_PROPS.map(prop =
|
|
|
459
465
|
if (prop.name === 'password') {
|
|
460
466
|
return {
|
|
461
467
|
...prop,
|
|
462
|
-
validators: data => [...getPasswordValidators({ get: data.getInjected })],
|
|
468
|
+
validators: (data) => [...getPasswordValidators({ get: data.getInjected })],
|
|
463
469
|
};
|
|
464
470
|
}
|
|
465
471
|
return prop;
|
|
@@ -619,7 +625,8 @@ IdentityModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
619
625
|
UiExtensionsModule,
|
|
620
626
|
NgbDropdownModule,
|
|
621
627
|
PermissionManagementModule,
|
|
622
|
-
NgxValidateCoreModule
|
|
628
|
+
NgxValidateCoreModule,
|
|
629
|
+
PageModule], exports: [RolesComponent, UsersComponent] });
|
|
623
630
|
IdentityModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityModule, imports: [CoreModule,
|
|
624
631
|
IdentityRoutingModule,
|
|
625
632
|
NgbNavModule,
|
|
@@ -627,7 +634,8 @@ IdentityModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
|
|
|
627
634
|
UiExtensionsModule,
|
|
628
635
|
NgbDropdownModule,
|
|
629
636
|
PermissionManagementModule,
|
|
630
|
-
NgxValidateCoreModule
|
|
637
|
+
NgxValidateCoreModule,
|
|
638
|
+
PageModule] });
|
|
631
639
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityModule, decorators: [{
|
|
632
640
|
type: NgModule,
|
|
633
641
|
args: [{
|
|
@@ -642,6 +650,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
642
650
|
NgbDropdownModule,
|
|
643
651
|
PermissionManagementModule,
|
|
644
652
|
NgxValidateCoreModule,
|
|
653
|
+
PageModule,
|
|
645
654
|
],
|
|
646
655
|
}]
|
|
647
656
|
}] });
|