|
@ -1,29 +1,83 @@ |
|
|
import { FormPropData,EXTENSIONS_IDENTIFIER ,generateFormFromProps, ExtensibleModule} from '@abp/ng.components/extensible'; |
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
FormPropData, |
|
|
|
|
|
EXTENSIONS_IDENTIFIER, |
|
|
|
|
|
generateFormFromProps, |
|
|
|
|
|
ExtensibleModule, |
|
|
|
|
|
} from '@abp/ng.components/extensible'; |
|
|
import { PageModule } from '@abp/ng.components/page'; |
|
|
import { PageModule } from '@abp/ng.components/page'; |
|
|
import { CoreModule, ListResultDto, ListService, LocalizationModule, PagedResultDto } from '@abp/ng.core'; |
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
CoreModule, |
|
|
|
|
|
ListResultDto, |
|
|
|
|
|
ListService, |
|
|
|
|
|
LocalizationModule, |
|
|
|
|
|
PagedResultDto, |
|
|
|
|
|
} from '@abp/ng.core'; |
|
|
import { eIdentityComponents } from '@abp/ng.identity'; |
|
|
import { eIdentityComponents } from '@abp/ng.identity'; |
|
|
import { GetIdentityUsersInput, IdentityRoleDto, IdentityUserDto, IdentityUserService } from '@abp/ng.identity/proxy'; |
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
GetIdentityUsersInput, |
|
|
|
|
|
IdentityRoleDto, |
|
|
|
|
|
IdentityUserDto, |
|
|
|
|
|
IdentityUserService, |
|
|
|
|
|
IdentityUserUpdateDto, |
|
|
|
|
|
} from '@abp/ng.identity/proxy'; |
|
|
import { CommonModule } from '@angular/common'; |
|
|
import { CommonModule } from '@angular/common'; |
|
|
import { Component, inject, Injector, OnInit, TemplateRef, TrackByFunction, ViewChild } from '@angular/core'; |
|
|
|
|
|
import { AbstractControl, FormsModule, UntypedFormArray, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; |
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
Component, |
|
|
|
|
|
ElementRef, |
|
|
|
|
|
HostListener, |
|
|
|
|
|
inject, |
|
|
|
|
|
Injector, |
|
|
|
|
|
OnInit, |
|
|
|
|
|
TemplateRef, |
|
|
|
|
|
TrackByFunction, |
|
|
|
|
|
ViewChild, |
|
|
|
|
|
} from '@angular/core'; |
|
|
|
|
|
import { |
|
|
|
|
|
AbstractControl, |
|
|
|
|
|
FormsModule, |
|
|
|
|
|
NgForm, |
|
|
|
|
|
UntypedFormArray, |
|
|
|
|
|
UntypedFormBuilder, |
|
|
|
|
|
UntypedFormGroup, |
|
|
|
|
|
} from '@angular/forms'; |
|
|
import { ButtonModule } from 'primeng/button'; |
|
|
import { ButtonModule } from 'primeng/button'; |
|
|
import { TableModule } from 'primeng/table'; |
|
|
import { TableModule } from 'primeng/table'; |
|
|
import { Confirmation, eFormComponets, ThemeSharedModule,ToasterService ,ConfirmationService} from '@abp/ng.theme.shared'; |
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
Confirmation, |
|
|
|
|
|
eFormComponets, |
|
|
|
|
|
ThemeSharedModule, |
|
|
|
|
|
ToasterService, |
|
|
|
|
|
ConfirmationService, |
|
|
|
|
|
} from '@abp/ng.theme.shared'; |
|
|
import { finalize, switchMap, tap } from 'rxjs'; |
|
|
import { finalize, switchMap, tap } from 'rxjs'; |
|
|
import { ePermissionManagementComponents, PermissionManagementModule } from '@abp/ng.permission-management'; |
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
ePermissionManagementComponents, |
|
|
|
|
|
PermissionManagementModule, |
|
|
|
|
|
} from '@abp/ng.permission-management'; |
|
|
import { NgxDatatableModule } from '@swimlane/ngx-datatable'; |
|
|
import { NgxDatatableModule } from '@swimlane/ngx-datatable'; |
|
|
import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; |
|
|
|
|
|
|
|
|
import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; |
|
|
import { PaginatorModule } from 'primeng/paginator'; |
|
|
import { PaginatorModule } from 'primeng/paginator'; |
|
|
import { TagModule } from 'primeng/tag'; // For active/inactive status
|
|
|
import { TagModule } from 'primeng/tag'; // For active/inactive status
|
|
|
|
|
|
import { SplitButtonModule } from 'primeng/splitbutton'; |
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
selector: 'app-custom-users', |
|
|
selector: 'app-custom-users', |
|
|
standalone: true, |
|
|
standalone: true, |
|
|
imports: [CommonModule,FormsModule,TableModule,ButtonModule,PageModule,LocalizationModule,ThemeSharedModule,NgxDatatableModule,ExtensibleModule, |
|
|
|
|
|
PermissionManagementModule, |
|
|
|
|
|
CoreModule, |
|
|
|
|
|
NgbNavModule, |
|
|
|
|
|
PaginatorModule,TagModule |
|
|
|
|
|
|
|
|
imports: [ |
|
|
|
|
|
CommonModule, |
|
|
|
|
|
FormsModule, |
|
|
|
|
|
TableModule, |
|
|
|
|
|
ButtonModule, |
|
|
|
|
|
PageModule, |
|
|
|
|
|
LocalizationModule, |
|
|
|
|
|
ThemeSharedModule, |
|
|
|
|
|
NgxDatatableModule, |
|
|
|
|
|
ExtensibleModule, |
|
|
|
|
|
PermissionManagementModule, |
|
|
|
|
|
CoreModule, |
|
|
|
|
|
NgbNavModule, |
|
|
|
|
|
PaginatorModule, |
|
|
|
|
|
TagModule,SplitButtonModule |
|
|
], |
|
|
], |
|
|
templateUrl: './custom-users.component.html', |
|
|
templateUrl: './custom-users.component.html', |
|
|
providers: [ |
|
|
providers: [ |
|
@ -33,15 +87,16 @@ import { TagModule } from 'primeng/tag'; // For active/inactive status |
|
|
useValue: eIdentityComponents.Users, |
|
|
useValue: eIdentityComponents.Users, |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
styleUrl: './custom-users.component.scss' |
|
|
|
|
|
|
|
|
styleUrl: './custom-users.component.scss', |
|
|
}) |
|
|
}) |
|
|
export class CustomUsersComponent implements OnInit{ |
|
|
|
|
|
|
|
|
export class CustomUsersComponent implements OnInit { |
|
|
protected readonly list = inject(ListService<GetIdentityUsersInput>); |
|
|
protected readonly list = inject(ListService<GetIdentityUsersInput>); |
|
|
protected readonly confirmationService = inject(ConfirmationService); |
|
|
protected readonly confirmationService = inject(ConfirmationService); |
|
|
protected readonly service = inject(IdentityUserService); |
|
|
protected readonly service = inject(IdentityUserService); |
|
|
protected readonly toasterService = inject(ToasterService); |
|
|
protected readonly toasterService = inject(ToasterService); |
|
|
private readonly fb = inject(UntypedFormBuilder); |
|
|
private readonly fb = inject(UntypedFormBuilder); |
|
|
private readonly injector = inject(Injector); |
|
|
private readonly injector = inject(Injector); |
|
|
|
|
|
@ViewChild('firstDropdownItem') firstDropdownItem: ElementRef; |
|
|
|
|
|
|
|
|
data: PagedResultDto<IdentityUserDto> = { items: [], totalCount: 0 }; |
|
|
data: PagedResultDto<IdentityUserDto> = { items: [], totalCount: 0 }; |
|
|
|
|
|
|
|
@ -49,12 +104,13 @@ export class CustomUsersComponent implements OnInit{ |
|
|
modalContent!: TemplateRef<any>; |
|
|
modalContent!: TemplateRef<any>; |
|
|
|
|
|
|
|
|
form!: UntypedFormGroup; |
|
|
form!: UntypedFormGroup; |
|
|
|
|
|
|
|
|
|
|
|
password:string; |
|
|
selected?: IdentityUserDto; |
|
|
selected?: IdentityUserDto; |
|
|
|
|
|
|
|
|
selectedUserRoles?: IdentityRoleDto[]; |
|
|
selectedUserRoles?: IdentityRoleDto[]; |
|
|
|
|
|
|
|
|
roles?: IdentityRoleDto[]; |
|
|
|
|
|
|
|
|
// roles?: IdentityRoleDto[];
|
|
|
|
|
|
roles: (IdentityRoleDto & { selected: boolean })[] = []; // Use intersection type to add 'selected'
|
|
|
|
|
|
|
|
|
visiblePermissions = false; |
|
|
visiblePermissions = false; |
|
|
|
|
|
|
|
@ -71,8 +127,32 @@ export class CustomUsersComponent implements OnInit{ |
|
|
inputKey = eFormComponets.FormCheckboxComponent; |
|
|
inputKey = eFormComponets.FormCheckboxComponent; |
|
|
|
|
|
|
|
|
trackByFn: TrackByFunction<AbstractControl> = (index, item) => Object.keys(item)[0] || index; |
|
|
trackByFn: TrackByFunction<AbstractControl> = (index, item) => Object.keys(item)[0] || index; |
|
|
|
|
|
isDropdownOpen = false; |
|
|
|
|
|
|
|
|
|
|
|
toggleDropdown() { |
|
|
|
|
|
this.isDropdownOpen = !this.isDropdownOpen; |
|
|
|
|
|
|
|
|
|
|
|
// After the dropdown is shown, focus the first item in the dropdown
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
if (this.firstDropdownItem) { |
|
|
|
|
|
this.firstDropdownItem.nativeElement.focus(); |
|
|
|
|
|
} |
|
|
|
|
|
}, 100); // Delay to ensure dropdown is rendered
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
closeDropdown() { |
|
|
|
|
|
this.isDropdownOpen = false; |
|
|
|
|
|
} |
|
|
|
|
|
actionItems = [ |
|
|
|
|
|
{ label: 'Edit', icon: 'pi pi-pencil', command: () => this.edit("") }, |
|
|
|
|
|
{ label: 'Delete', icon: 'pi pi-trash', command: () => this.delete("","") }, |
|
|
|
|
|
// { label: 'Permissions', icon: 'pi pi-shield', command: () => this.openPermissionsModal("") },
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onVisiblePermissionChange = (event: boolean) => { |
|
|
onVisiblePermissionChange = (event: boolean) => { |
|
|
|
|
|
debugger |
|
|
this.visiblePermissions = event; |
|
|
this.visiblePermissions = event; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -83,87 +163,189 @@ export class CustomUsersComponent implements OnInit{ |
|
|
ngOnInit() { |
|
|
ngOnInit() { |
|
|
this.hookToQuery(); |
|
|
this.hookToQuery(); |
|
|
} |
|
|
} |
|
|
|
|
|
formValid() { |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
// buildForm() {
|
|
|
|
|
|
// debugger
|
|
|
|
|
|
// const data = new FormPropData(this.injector, this.selected);
|
|
|
|
|
|
// this.form = generateFormFromProps(data);
|
|
|
|
|
|
|
|
|
|
|
|
// this.service.getAssignableRoles().subscribe(({ items }) => {
|
|
|
|
|
|
// this.roles = items;
|
|
|
|
|
|
// if (this.roles) {
|
|
|
|
|
|
// this.form.addControl(
|
|
|
|
|
|
// 'roleNames',
|
|
|
|
|
|
// this.fb.array(
|
|
|
|
|
|
// this.roles.map(role =>
|
|
|
|
|
|
// this.fb.group({
|
|
|
|
|
|
// [role.name as string]: [
|
|
|
|
|
|
// this.selected?.id
|
|
|
|
|
|
// ? !!this.selectedUserRoles?.find(userRole => userRole.id === role.id)
|
|
|
|
|
|
// : role.isDefault,
|
|
|
|
|
|
// ],
|
|
|
|
|
|
// }),
|
|
|
|
|
|
// ),
|
|
|
|
|
|
// ),
|
|
|
|
|
|
// );
|
|
|
|
|
|
// }
|
|
|
|
|
|
// });
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
buildForm() { |
|
|
|
|
|
debugger |
|
|
|
|
|
const data = new FormPropData(this.injector, this.selected); |
|
|
|
|
|
this.form = generateFormFromProps(data); |
|
|
|
|
|
|
|
|
// openModal() {
|
|
|
|
|
|
// this.buildForm();
|
|
|
|
|
|
// this.isModalVisible = true;
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// add() {
|
|
|
|
|
|
// debugger
|
|
|
|
|
|
// this.selected = {} as IdentityUserDto;
|
|
|
|
|
|
// this.selectedUserRoles = [] as IdentityRoleDto[];
|
|
|
|
|
|
// this.openModal();
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// edit(id: string) {
|
|
|
|
|
|
// debugger
|
|
|
|
|
|
// this.service
|
|
|
|
|
|
// .get(id)
|
|
|
|
|
|
// .pipe(
|
|
|
|
|
|
// tap(user => (this.selected = user)),
|
|
|
|
|
|
// switchMap(() => this.service.getRoles(id)),
|
|
|
|
|
|
// )
|
|
|
|
|
|
// .subscribe(userRole => {
|
|
|
|
|
|
// debugger
|
|
|
|
|
|
|
|
|
|
|
|
// this.selectedUserRoles = userRole.items || [];
|
|
|
|
|
|
// this.openModal();
|
|
|
|
|
|
// });
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// save() {
|
|
|
|
|
|
// if (!this.form.valid || this.modalBusy) return;
|
|
|
|
|
|
// this.modalBusy = true;
|
|
|
|
|
|
|
|
|
|
|
|
// const { roleNames = [] } = this.form.value;
|
|
|
|
|
|
// const mappedRoleNames =
|
|
|
|
|
|
// roleNames
|
|
|
|
|
|
// .filter((role: { [key: string]: any }) => !!role[Object.keys(role)[0]])
|
|
|
|
|
|
// .map((role: { [key: string]: any }) => Object.keys(role)[0]) || [];
|
|
|
|
|
|
|
|
|
|
|
|
// const { id } = this.selected || {};
|
|
|
|
|
|
|
|
|
|
|
|
// (id
|
|
|
|
|
|
// ? this.service.update(id, {
|
|
|
|
|
|
// ...this.selected,
|
|
|
|
|
|
// ...this.form.value,
|
|
|
|
|
|
// roleNames: mappedRoleNames,
|
|
|
|
|
|
// })
|
|
|
|
|
|
// : this.service.create({ ...this.form.value, roleNames: mappedRoleNames })
|
|
|
|
|
|
// )
|
|
|
|
|
|
// .pipe(finalize(() => (this.modalBusy = false)))
|
|
|
|
|
|
// .subscribe(() => {
|
|
|
|
|
|
// this.isModalVisible = false;
|
|
|
|
|
|
// this.toasterService.success('AbpUi::SavedSuccessfully');
|
|
|
|
|
|
// this.list.get();
|
|
|
|
|
|
// });
|
|
|
|
|
|
// }
|
|
|
|
|
|
buildForm() { |
|
|
this.service.getAssignableRoles().subscribe(({ items }) => { |
|
|
this.service.getAssignableRoles().subscribe(({ items }) => { |
|
|
this.roles = items; |
|
|
|
|
|
if (this.roles) { |
|
|
|
|
|
this.form.addControl( |
|
|
|
|
|
'roleNames', |
|
|
|
|
|
this.fb.array( |
|
|
|
|
|
this.roles.map(role => |
|
|
|
|
|
this.fb.group({ |
|
|
|
|
|
[role.name as string]: [ |
|
|
|
|
|
this.selected?.id |
|
|
|
|
|
? !!this.selectedUserRoles?.find(userRole => userRole.id === role.id) |
|
|
|
|
|
: role.isDefault, |
|
|
|
|
|
], |
|
|
|
|
|
}), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
this.roles = items.map(role => ({ |
|
|
|
|
|
...role, |
|
|
|
|
|
selected: this.selectedUserRoles.some(userRole => userRole.id === role.id), |
|
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
// Initialize the selected roles based on existing data for selected user
|
|
|
|
|
|
if (this.selected?.id) { |
|
|
|
|
|
this.roles.forEach(role => { |
|
|
|
|
|
role.selected = this.selectedUserRoles.some(userRole => userRole.id === role.id); |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
// Default values when creating a new user
|
|
|
|
|
|
this.roles.forEach(role => { |
|
|
|
|
|
role.selected = role.isDefault; |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
openModal() { |
|
|
openModal() { |
|
|
this.buildForm(); |
|
|
|
|
|
|
|
|
this.loadRoles(); // Load roles when modal opens
|
|
|
this.isModalVisible = true; |
|
|
this.isModalVisible = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
loadRoles() { |
|
|
|
|
|
this.service.getAssignableRoles().subscribe(({ items }) => { |
|
|
|
|
|
this.roles = items.map(role => ({ |
|
|
|
|
|
...role, // spread IdentityRoleDto properties
|
|
|
|
|
|
selected: false, // Initially no role is selected
|
|
|
|
|
|
})); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
add() { |
|
|
add() { |
|
|
debugger |
|
|
|
|
|
this.selected = {} as IdentityUserDto; |
|
|
this.selected = {} as IdentityUserDto; |
|
|
this.selectedUserRoles = [] as IdentityRoleDto[]; |
|
|
this.selectedUserRoles = [] as IdentityRoleDto[]; |
|
|
|
|
|
this.password = ''; // Store password separately
|
|
|
|
|
|
|
|
|
this.openModal(); |
|
|
this.openModal(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
edit(id: string) { |
|
|
edit(id: string) { |
|
|
debugger |
|
|
|
|
|
this.service |
|
|
this.service |
|
|
.get(id) |
|
|
.get(id) |
|
|
.pipe( |
|
|
|
|
|
tap(user => (this.selected = user)), |
|
|
|
|
|
switchMap(() => this.service.getRoles(id)), |
|
|
|
|
|
) |
|
|
|
|
|
.subscribe(userRole => { |
|
|
|
|
|
debugger |
|
|
|
|
|
|
|
|
|
|
|
this.selectedUserRoles = userRole.items || []; |
|
|
|
|
|
this.openModal(); |
|
|
|
|
|
|
|
|
.pipe(finalize(() => this.buildForm())) |
|
|
|
|
|
.subscribe(user => { |
|
|
|
|
|
this.selected = user; |
|
|
|
|
|
this.service.getRoles(id).subscribe(userRoles => { |
|
|
|
|
|
this.selectedUserRoles = userRoles.items || []; |
|
|
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
this.openModal(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
save() { |
|
|
|
|
|
if (!this.form.valid || this.modalBusy) return; |
|
|
|
|
|
|
|
|
// Save user data (either create or update)
|
|
|
|
|
|
save(form: NgForm) { |
|
|
|
|
|
debugger; |
|
|
|
|
|
if (this.modalBusy || form.invalid) return; |
|
|
|
|
|
|
|
|
this.modalBusy = true; |
|
|
this.modalBusy = true; |
|
|
|
|
|
|
|
|
const { roleNames = [] } = this.form.value; |
|
|
|
|
|
const mappedRoleNames = |
|
|
|
|
|
roleNames |
|
|
|
|
|
.filter((role: { [key: string]: any }) => !!role[Object.keys(role)[0]]) |
|
|
|
|
|
.map((role: { [key: string]: any }) => Object.keys(role)[0]) || []; |
|
|
|
|
|
|
|
|
|
|
|
const { id } = this.selected || {}; |
|
|
|
|
|
|
|
|
|
|
|
(id |
|
|
|
|
|
? this.service.update(id, { |
|
|
|
|
|
...this.selected, |
|
|
|
|
|
...this.form.value, |
|
|
|
|
|
roleNames: mappedRoleNames, |
|
|
|
|
|
}) |
|
|
|
|
|
: this.service.create({ ...this.form.value, roleNames: mappedRoleNames }) |
|
|
|
|
|
) |
|
|
|
|
|
.pipe(finalize(() => (this.modalBusy = false))) |
|
|
|
|
|
.subscribe(() => { |
|
|
|
|
|
this.isModalVisible = false; |
|
|
|
|
|
this.toasterService.success('AbpUi::SavedSuccessfully'); |
|
|
|
|
|
this.list.get(); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
// Prepare roleNames array
|
|
|
|
|
|
// Prepare roleNames array
|
|
|
|
|
|
const selectedRoleNames = this.roles |
|
|
|
|
|
.filter(role => role.selected) // Only include selected roles
|
|
|
|
|
|
.map(role => role.name); // Extract role names
|
|
|
|
|
|
|
|
|
|
|
|
// Create user payload
|
|
|
|
|
|
|
|
|
|
|
|
const userPayload: any = { |
|
|
|
|
|
userName: this.selected.userName, |
|
|
|
|
|
name: this.selected.name, |
|
|
|
|
|
surname: this.selected.surname, |
|
|
|
|
|
email: this.selected.email, |
|
|
|
|
|
phoneNumber: this.selected.phoneNumber, |
|
|
|
|
|
isActive: this.selected.isActive, |
|
|
|
|
|
lockoutEnabled: this.selected.lockoutEnabled, |
|
|
|
|
|
roleNames: selectedRoleNames, // Include selected roles
|
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Only include password if creating a new user
|
|
|
|
|
|
if (!this.selected.id && this.password) { |
|
|
|
|
|
userPayload.password = this.password; |
|
|
|
|
|
} |
|
|
|
|
|
// Handle create or update
|
|
|
|
|
|
const saveObservable = this.selected.id |
|
|
|
|
|
? this.service.update(this.selected.id, userPayload) // Update if id exists
|
|
|
|
|
|
: this.service.create(userPayload); // Create if no id
|
|
|
|
|
|
|
|
|
|
|
|
saveObservable.pipe(finalize(() => (this.modalBusy = false))).subscribe(() => { |
|
|
|
|
|
this.isModalVisible = false; |
|
|
|
|
|
this.toasterService.success('AbpUi::SavedSuccessfully'); |
|
|
|
|
|
this.list.get(); // Reload the list if needed
|
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private getRoleNames() { |
|
|
|
|
|
return this.roles.filter(role => role.selected).map(role => role.name); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
delete(id: string, userName: string) { |
|
|
delete(id: string, userName: string) { |
|
@ -191,17 +373,19 @@ export class CustomUsersComponent implements OnInit{ |
|
|
// this.list.hookToQuery(query => this.service.getList(query)).subscribe(res => (this.data = res));
|
|
|
// this.list.hookToQuery(query => this.service.getList(query)).subscribe(res => (this.data = res));
|
|
|
// }
|
|
|
// }
|
|
|
private hookToQuery() { |
|
|
private hookToQuery() { |
|
|
this.list.hookToQuery(query => { |
|
|
|
|
|
console.log('Query:', query); // Log the query
|
|
|
|
|
|
return this.service.getList(query); |
|
|
|
|
|
}).subscribe(res => { |
|
|
|
|
|
debugger |
|
|
|
|
|
this.data = res; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
this.list |
|
|
|
|
|
.hookToQuery(query => { |
|
|
|
|
|
console.log('Query:', query); // Log the query
|
|
|
|
|
|
return this.service.getList(query); |
|
|
|
|
|
}) |
|
|
|
|
|
.subscribe(res => { |
|
|
|
|
|
debugger; |
|
|
|
|
|
this.data = res; |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
openPermissionsModal(providerKey: string, entityDisplayName?: string) { |
|
|
openPermissionsModal(providerKey: string, entityDisplayName?: string) { |
|
|
debugger |
|
|
|
|
|
|
|
|
debugger; |
|
|
this.providerKey = providerKey; |
|
|
this.providerKey = providerKey; |
|
|
this.entityDisplayName = entityDisplayName; |
|
|
this.entityDisplayName = entityDisplayName; |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|