|
|
@ -1,5 +1,6 @@ |
|
|
import { ABP } from '@abp/ng.core'; |
|
|
import { ListService } from '@abp/ng.core'; |
|
|
import { ConfirmationService, Confirmation } from '@abp/ng.theme.shared'; |
|
|
import { ePermissionManagementComponents } from '@abp/ng.permission-management'; |
|
|
|
|
|
import { Confirmation, ConfirmationService } from '@abp/ng.theme.shared'; |
|
|
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; |
|
|
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; |
|
|
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; |
|
|
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; |
|
|
import { Select, Store } from '@ngxs/store'; |
|
|
import { Select, Store } from '@ngxs/store'; |
|
|
@ -14,11 +15,11 @@ import { |
|
|
} from '../../actions/identity.actions'; |
|
|
} from '../../actions/identity.actions'; |
|
|
import { Identity } from '../../models/identity'; |
|
|
import { Identity } from '../../models/identity'; |
|
|
import { IdentityState } from '../../states/identity.state'; |
|
|
import { IdentityState } from '../../states/identity.state'; |
|
|
import { ePermissionManagementComponents } from '@abp/ng.permission-management'; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
selector: 'abp-roles', |
|
|
selector: 'abp-roles', |
|
|
templateUrl: './roles.component.html', |
|
|
templateUrl: './roles.component.html', |
|
|
|
|
|
providers: [ListService], |
|
|
}) |
|
|
}) |
|
|
export class RolesComponent implements OnInit { |
|
|
export class RolesComponent implements OnInit { |
|
|
@Select(IdentityState.getRoles) |
|
|
@Select(IdentityState.getRoles) |
|
|
@ -37,16 +38,10 @@ export class RolesComponent implements OnInit { |
|
|
|
|
|
|
|
|
providerKey: string; |
|
|
providerKey: string; |
|
|
|
|
|
|
|
|
pageQuery: ABP.PageQueryParams = { maxResultCount: 10 }; |
|
|
|
|
|
|
|
|
|
|
|
loading = false; |
|
|
loading = false; |
|
|
|
|
|
|
|
|
modalBusy = false; |
|
|
modalBusy = false; |
|
|
|
|
|
|
|
|
sortOrder = ''; |
|
|
|
|
|
|
|
|
|
|
|
sortKey = ''; |
|
|
|
|
|
|
|
|
|
|
|
permissionManagementKey = ePermissionManagementComponents.PermissionManagement; |
|
|
permissionManagementKey = ePermissionManagementComponents.PermissionManagement; |
|
|
|
|
|
|
|
|
@ViewChild('formRef', { static: false, read: ElementRef }) |
|
|
@ViewChild('formRef', { static: false, read: ElementRef }) |
|
|
@ -57,6 +52,7 @@ export class RolesComponent implements OnInit { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
constructor( |
|
|
constructor( |
|
|
|
|
|
public readonly list: ListService, |
|
|
private confirmationService: ConfirmationService, |
|
|
private confirmationService: ConfirmationService, |
|
|
private fb: FormBuilder, |
|
|
private fb: FormBuilder, |
|
|
private store: Store, |
|
|
private store: Store, |
|
|
@ -126,18 +122,8 @@ export class RolesComponent implements OnInit { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
onPageChange(page: number) { |
|
|
|
|
|
this.pageQuery.skipCount = (page - 1) * this.pageQuery.maxResultCount; |
|
|
|
|
|
|
|
|
|
|
|
this.get(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
get() { |
|
|
get() { |
|
|
this.loading = true; |
|
|
this.list.hookToQuery(query => this.store.dispatch(new GetRoles(query))).subscribe(); |
|
|
this.store |
|
|
|
|
|
.dispatch(new GetRoles(this.pageQuery)) |
|
|
|
|
|
.pipe(finalize(() => (this.loading = false))) |
|
|
|
|
|
.subscribe(); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
onClickSaveButton() { |
|
|
onClickSaveButton() { |
|
|
@ -152,4 +138,10 @@ export class RolesComponent implements OnInit { |
|
|
this.visiblePermissions = true; |
|
|
this.visiblePermissions = true; |
|
|
}, 0); |
|
|
}, 0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onSort(event) { |
|
|
|
|
|
const { prop, dir } = event.sorts[0]; |
|
|
|
|
|
this.list.sortKey = prop; |
|
|
|
|
|
this.list.sortOrder = dir; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|