From 3fc89280821f6ebd7f4b468751ec58380bcb0908 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 28 Oct 2025 17:46:53 -0400 Subject: [PATCH] feat(dirt): make AllActivitiesService reactive to new applications Update AllActivitiesService to subscribe to orchestrator's newApplications$ observable instead of receiving data through summary updates. - Subscribe to dataService.newApplications$ in constructor - Add setNewApplications() helper method - Remove newApplications update from setAllAppsReportSummary() - New applications now update reactively when review status changes Related to PM-27284 --- .../services/view/all-activities.service.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/view/all-activities.service.ts b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/view/all-activities.service.ts index c275ad8c355..7de8ab223de 100644 --- a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/view/all-activities.service.ts +++ b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/view/all-activities.service.ts @@ -46,12 +46,18 @@ export class AllActivitiesService { this.setAllAppsReportDetails(report.reportData); } }); + // Critical application summary changes this.dataService.criticalReportResults$.subscribe((report) => { if (report) { this.setCriticalAppsReportSummary(report.summaryData); } }); + + // New applications changes (from orchestrator's reactive pipeline) + this.dataService.newApplications$.subscribe((newApps) => { + this.setNewApplications(newApps); + }); } setCriticalAppsReportSummary(summary: OrganizationReportSummary) { @@ -71,7 +77,7 @@ export class AllActivitiesService { totalAtRiskMemberCount: summary.totalAtRiskMemberCount, totalApplicationCount: summary.totalApplicationCount, totalAtRiskApplicationCount: summary.totalAtRiskApplicationCount, - newApplications: summary.newApplications, + // Note: newApplications now set separately via newApplications$ subscription }); } @@ -91,4 +97,15 @@ export class AllActivitiesService { setTaskCreatedCount(count: number) { this.taskCreatedCountSubject$.next(count); } + + /** + * Updates the newApplications list in the report summary. + * Called when the orchestrator's newApplications$ observable emits. + */ + private setNewApplications(newApps: string[]) { + this.reportSummarySubject$.next({ + ...this.reportSummarySubject$.getValue(), + newApplications: newApps, + }); + } }