mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
[PM-25878] Activity Tab - Critical App Count (#16474)
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
}
|
||||
|
||||
@if (!(isLoading$ | async) && (noData$ | async)) {
|
||||
<div class="tw-mt-4" *ngIf="">
|
||||
<div class="tw-mt-4">
|
||||
<bit-no-items class="tw-text-main">
|
||||
<ng-container slot="title">
|
||||
<h2 class="tw-font-semibold tw-mt-4">
|
||||
{{ organization?.name }}
|
||||
{{ "noAppsInOrgTitle" | i18n: organization?.name }}
|
||||
</h2>
|
||||
</ng-container>
|
||||
<ng-container slot="description">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Component, DestroyRef, inject, OnInit } from "@angular/core";
|
||||
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { BehaviorSubject, firstValueFrom, of, switchMap } from "rxjs";
|
||||
import { BehaviorSubject, combineLatest, firstValueFrom, of, switchMap } from "rxjs";
|
||||
|
||||
import {
|
||||
CriticalAppsService,
|
||||
@@ -13,6 +13,7 @@ import { Organization } from "@bitwarden/common/admin-console/models/domain/orga
|
||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { getUserId } from "@bitwarden/common/auth/services/account.service";
|
||||
import { getById } from "@bitwarden/common/platform/misc";
|
||||
import { OrganizationId } from "@bitwarden/common/types/guid";
|
||||
import { SharedModule } from "@bitwarden/web-vault/app/shared";
|
||||
|
||||
import { ActivityCardComponent } from "./activity-card.component";
|
||||
@@ -41,20 +42,24 @@ export class AllActivityComponent implements OnInit {
|
||||
(await firstValueFrom(
|
||||
this.organizationService.organizations$(userId).pipe(getById(organizationId)),
|
||||
)) ?? null;
|
||||
}
|
||||
|
||||
this.dataService.applications$
|
||||
.pipe(
|
||||
takeUntilDestroyed(this.destroyRef),
|
||||
switchMap((apps) => {
|
||||
const atRiskMembers = this.reportService.generateAtRiskMemberList(apps ?? []);
|
||||
return of({ apps, atRiskMembers });
|
||||
}),
|
||||
)
|
||||
.subscribe(({ apps, atRiskMembers }) => {
|
||||
this.noData$.next((apps?.length ?? 0) === 0);
|
||||
this.atRiskMemberCount = atRiskMembers?.length;
|
||||
});
|
||||
combineLatest([
|
||||
this.dataService.applications$,
|
||||
this.criticalAppsService.getAppsListForOrg(organizationId as OrganizationId),
|
||||
])
|
||||
.pipe(
|
||||
takeUntilDestroyed(this.destroyRef),
|
||||
switchMap(([apps, criticalApps]) => {
|
||||
const atRiskMembers = this.reportService.generateAtRiskMemberList(apps ?? []);
|
||||
return of({ apps, atRiskMembers, criticalApps });
|
||||
}),
|
||||
)
|
||||
.subscribe(({ apps, atRiskMembers, criticalApps }) => {
|
||||
this.noData$.next((apps?.length ?? 0) === 0);
|
||||
this.atRiskMemberCount = atRiskMembers?.length ?? 0;
|
||||
this.criticalApplicationsCount = criticalApps?.length ?? 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
constructor(
|
||||
|
||||
Reference in New Issue
Block a user