feat: UserService zur Filterung von importierten Benuzer in DirUserTableComponent hinzugefügt
This commit is contained in:
parent
5a7eb504a9
commit
1b2e3b8abd
@ -26,7 +26,7 @@ export class DirGroupTableComponent extends BaseTableComponent<DirGroup, DirGrou
|
|||||||
this.service.getAll().subscribe({
|
this.service.getAll().subscribe({
|
||||||
next: async (response) => {
|
next: async (response) => {
|
||||||
const group_names = (await firstValueFrom(this.gService.getAll())).map(g => g.name);
|
const group_names = (await firstValueFrom(this.gService.getAll())).map(g => g.name);
|
||||||
this.source = response.filter(dGroup => dGroup.samaccountname.length && group_names.includes(dGroup.samaccountname[0]));
|
this.source = response.filter(dGroup => dGroup.samaccountname?.length && !group_names.includes(dGroup.samaccountname[0]));
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
error: (error) => { }
|
error: (error) => { }
|
||||||
|
|||||||
@ -7,6 +7,8 @@ import { ColorModeService } from '../../../services/color-mode.service';
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { env } from '../../../../environments/environment';
|
import { env } from '../../../../environments/environment';
|
||||||
|
import { UserService } from '../../../services/user.service';
|
||||||
|
import { firstValueFrom } from 'rxjs/internal/firstValueFrom';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone: true,
|
standalone: true,
|
||||||
@ -16,14 +18,18 @@ import { env } from '../../../../environments/environment';
|
|||||||
styleUrl: './dir-user-table.component.css'
|
styleUrl: './dir-user-table.component.css'
|
||||||
})
|
})
|
||||||
export class DirUserTableComponent extends BaseTableComponent<DirUser, DirUserService> {
|
export class DirUserTableComponent extends BaseTableComponent<DirUser, DirUserService> {
|
||||||
constructor(service: DirUserService, cModeService: ColorModeService) {
|
constructor(service: DirUserService, cModeService: ColorModeService, private uService: UserService) {
|
||||||
super(service, env.columnNames.dirUser, cModeService)
|
super(service, env.columnNames.dirUser, cModeService)
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchDataByGroupName(groupName: string): void {
|
fetchDataByGroupName(groupName: string): void {
|
||||||
this.service.getAll(groupName).subscribe({
|
this.service.getAll(groupName).subscribe({
|
||||||
next: (response: any) => {
|
next: async (response: DirUser[]) => {
|
||||||
this.source = response;
|
|
||||||
|
const usernames = (await firstValueFrom(this.uService.getAll())).map(u => u.username)
|
||||||
|
console.log(usernames)
|
||||||
|
console.log(response)
|
||||||
|
this.source = response.filter(user => user.samaccountname?.length && !usernames.includes(user.samaccountname[0]));
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
error: (error: any) => { }
|
error: (error: any) => { }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user