1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-02 17:53:41 +00:00

refactor(dirt): use reactive newApplications$ in AllActivitiesService

Replace manual newApplications population with subscription to
orchestrator's reactive observable. Ensures automatic updates
when applicationData changes.

- Subscribe to dataService.newApplications$
- Add setNewApplications() helper method
- Remove newApplications update from setAllAppsReportSummary()
- Data now flows through dedicated observable pipeline

Related to PM-27284
This commit is contained in:
Claude
2025-10-28 21:19:27 +00:00
parent 7194a24361
commit 0ab40debb3

View File

@@ -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,
});
}
}