diff --git a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html index 1a49d9cbd6..fd8925df56 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html +++ b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html @@ -5,77 +5,17 @@
{{ 'AbpIdentity::Roles' | abpLocalization }}
- +
- - - -
- -
- - - - - -
-
-
-
- - - {{ row.name }} - {{ - 'AbpIdentity::DisplayName:IsDefault' | abpLocalization - }} - {{ - 'AbpIdentity::DisplayName:IsPublic' | abpLocalization - }} - - -
+
@@ -85,36 +25,8 @@ -
-
- * - -
- -
- - -
- -
- - -
+ +
@@ -122,7 +34,7 @@ - {{ + {{ 'AbpIdentity::Save' | abpLocalization }} diff --git a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts index 8df9762b97..c1410ff148 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts +++ b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts @@ -1,8 +1,13 @@ import { ListService, PagedAndSortedResultRequestDto } from '@abp/ng.core'; import { ePermissionManagementComponents } from '@abp/ng.permission-management'; import { Confirmation, ConfirmationService } from '@abp/ng.theme.shared'; -import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { + EXTENSIONS_IDENTIFIER, + FormPropData, + generateFormFromProps, +} from '@abp/ng.theme.shared/extensions'; +import { Component, ElementRef, Injector, OnInit, ViewChild } from '@angular/core'; +import { FormGroup } from '@angular/forms'; import { Select, Store } from '@ngxs/store'; import { Observable } from 'rxjs'; import { finalize, pluck } from 'rxjs/operators'; @@ -13,13 +18,20 @@ import { GetRoles, UpdateRole, } from '../../actions/identity.actions'; +import { eIdentityComponents } from '../../enums/components'; import { IdentityRoleDto } from '../../proxy/identity/models'; import { IdentityState } from '../../states/identity.state'; @Component({ selector: 'abp-roles', templateUrl: './roles.component.html', - providers: [ListService], + providers: [ + ListService, + { + provide: EXTENSIONS_IDENTIFIER, + useValue: eIdentityComponents.Roles, + }, + ], }) export class RolesComponent implements OnInit { @Select(IdentityState.getRoles) @@ -51,9 +63,9 @@ export class RolesComponent implements OnInit { constructor( public readonly list: ListService, - private confirmationService: ConfirmationService, - private fb: FormBuilder, - private store: Store, + protected confirmationService: ConfirmationService, + protected store: Store, + protected injector: Injector, ) {} ngOnInit() { @@ -61,14 +73,8 @@ export class RolesComponent implements OnInit { } buildForm() { - this.form = this.fb.group({ - name: new FormControl({ value: this.selected.name || '', disabled: this.selected.isStatic }, [ - Validators.required, - Validators.maxLength(256), - ]), - isDefault: [this.selected.isDefault || false], - isPublic: [this.selected.isPublic || false], - }); + const data = new FormPropData(this.injector, this.selected); + this.form = generateFormFromProps(data); } openModal() {