From f2b383a38fad8c5db2705fd3609febc3825dfb87 Mon Sep 17 00:00:00 2001 From: voommen-livefront Date: Wed, 5 Nov 2025 15:21:32 -0600 Subject: [PATCH] update PR comments from claude --- .../all-applications/all-applications.component.ts | 8 ++++---- .../critical-applications.component.ts | 9 +++++++-- .../shared/app-table-row-scrollable.component.html | 2 ++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications/all-applications.component.ts b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications/all-applications.component.ts index 0e4a97e3617..6ad1d2eba92 100644 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications/all-applications.component.ts +++ b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications/all-applications.component.ts @@ -2,7 +2,7 @@ import { Component, DestroyRef, inject, OnInit, ChangeDetectionStrategy } from " import { takeUntilDestroyed } from "@angular/core/rxjs-interop"; import { FormControl } from "@angular/forms"; import { ActivatedRoute, Router } from "@angular/router"; -import { combineLatest, debounceTime, of, switchMap } from "rxjs"; +import { combineLatest, debounceTime, map } from "rxjs"; import { Security } from "@bitwarden/assets/svg"; import { @@ -78,9 +78,9 @@ export class AllApplicationsComponent implements OnInit { async ngOnInit() { combineLatest([this.dataService.enrichedReportData$, this.dataService.ciphers$]) .pipe( - switchMap(([report, ciphers]) => { + map(([report, ciphers]) => { if (!report) { - return of(null); + return null; } // Map ciphers to each application @@ -92,7 +92,7 @@ export class AllApplicationsComponent implements OnInit { .filter((c): c is CipherView => c !== undefined), })); - return of({ ...report, reportData: reportWithCiphers }); + return { ...report, reportData: reportWithCiphers }; }), takeUntilDestroyed(this.destroyRef), ) diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/critical-applications/critical-applications.component.ts b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/critical-applications/critical-applications.component.ts index d84346be0b3..d3abd92a978 100644 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/critical-applications/critical-applications.component.ts +++ b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/critical-applications/critical-applications.component.ts @@ -78,10 +78,15 @@ export class CriticalApplicationsComponent implements OnInit { if (!report) { return null; } - const reportWithCiphers = (report?.reportData ?? []).map((app) => ({ + + const cipherMap = new Map(ciphers?.map((c) => [c.id, c])); + const reportWithCiphers = report.reportData.map((app) => ({ ...app, - ciphers: ciphers?.filter((cipher) => app.cipherIds.includes(cipher.id)) ?? [], + ciphers: app.cipherIds + .map((id) => cipherMap?.get(id)) + .filter((c): c is CipherView => c !== undefined), })); + return { ...report, reportData: reportWithCiphers }; }), takeUntilDestroyed(this.destroyRef), diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/shared/app-table-row-scrollable.component.html b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/shared/app-table-row-scrollable.component.html index 9d9198536fb..a3815c8d5df 100644 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/shared/app-table-row-scrollable.component.html +++ b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/shared/app-table-row-scrollable.component.html @@ -47,6 +47,8 @@ > @if (row.ciphers?.[0]) { + } @else { + }