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