From 1b2e3b8abd3fdb41e0dfddb27aef7dee09eb2f81 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Thu, 25 Jul 2024 02:03:38 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20UserService=20zur=20Filterung=20von=20i?= =?UTF-8?q?mportierten=20Benuzer=20in=20DirUserTableComponent=20hinzugef?= =?UTF-8?q?=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dir-group-table/dir-group-table.component.ts | 2 +- .../dir-user-table/dir-user-table.component.ts | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/tables/dir-group-table/dir-group-table.component.ts b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/tables/dir-group-table/dir-group-table.component.ts index 8acbf5d..f284156 100644 --- a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/tables/dir-group-table/dir-group-table.component.ts +++ b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/tables/dir-group-table/dir-group-table.component.ts @@ -26,7 +26,7 @@ export class DirGroupTableComponent extends BaseTableComponent { 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; }, error: (error) => { } diff --git a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/tables/dir-user-table/dir-user-table.component.ts b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/tables/dir-user-table/dir-user-table.component.ts index 60bcb23..f155788 100644 --- a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/tables/dir-user-table/dir-user-table.component.ts +++ b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/tables/dir-user-table/dir-user-table.component.ts @@ -7,6 +7,8 @@ import { ColorModeService } from '../../../services/color-mode.service'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { env } from '../../../../environments/environment'; +import { UserService } from '../../../services/user.service'; +import { firstValueFrom } from 'rxjs/internal/firstValueFrom'; @Component({ standalone: true, @@ -16,14 +18,18 @@ import { env } from '../../../../environments/environment'; styleUrl: './dir-user-table.component.css' }) export class DirUserTableComponent extends BaseTableComponent { - constructor(service: DirUserService, cModeService: ColorModeService) { + constructor(service: DirUserService, cModeService: ColorModeService, private uService: UserService) { super(service, env.columnNames.dirUser, cModeService) } fetchDataByGroupName(groupName: string): void { this.service.getAll(groupName).subscribe({ - next: (response: any) => { - this.source = response; + next: async (response: DirUser[]) => { + + 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; }, error: (error: any) => { }