mirror of
https://github.com/bitwarden/browser
synced 2026-02-02 17:53:41 +00:00
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
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user