diff --git a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-orchestrator.service.ts b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-orchestrator.service.ts index 050ec8df944..88af8081a8b 100644 --- a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-orchestrator.service.ts +++ b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-orchestrator.service.ts @@ -140,7 +140,10 @@ export class RiskInsightsOrchestratorService { reportProgress$ = this._reportProgressSubject.asObservable(); // --------------------------- Critical Application data --------------------- - criticalReportResults$: Observable = of(null); + private _criticalReportResultsSubject = new BehaviorSubject( + null, + ); + criticalReportResults$ = this._criticalReportResultsSubject.asObservable(); // --------------------------- Trigger subjects --------------------- private _initializeOrganizationTriggerSubject = new Subject(); @@ -989,7 +992,7 @@ export class RiskInsightsOrchestratorService { // Setup the pipeline to create a report view filtered to only critical applications private _setupCriticalApplicationReport() { const criticalReportResultsPipeline$ = this.enrichedReportData$.pipe( - filter((state) => !!state), + filter((state) => !!state && !!state.summaryData), map((enrichedReports) => { const criticalApplications = enrichedReports!.reportData.filter( (app) => app.isMarkedAsCritical, @@ -997,11 +1000,11 @@ export class RiskInsightsOrchestratorService { // Generate a new summary based on just the critical applications const summary = this.reportService.getApplicationsSummary( criticalApplications, - enrichedReports.applicationData, - enrichedReports.summaryData.totalMemberCount, + enrichedReports!.applicationData, + enrichedReports!.summaryData.totalMemberCount, ); return { - ...enrichedReports, + ...enrichedReports!, summaryData: summary, reportData: criticalApplications, }; @@ -1009,7 +1012,9 @@ export class RiskInsightsOrchestratorService { shareReplay({ bufferSize: 1, refCount: true }), ); - this.criticalReportResults$ = criticalReportResultsPipeline$; + criticalReportResultsPipeline$.pipe(takeUntil(this._destroy$)).subscribe((data) => { + this._criticalReportResultsSubject.next(data); + }); } /** diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.html b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.html index d4342d24cd5..dfbd49d95f7 100644 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.html +++ b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.html @@ -13,8 +13,8 @@ } @else { - @if (isRiskInsightsActivityTabFeatureEnabled && !(dataService.hasReportData$ | async)) { - + @if (!(dataService.hasReportData$ | async)) { +
@if (!hasCiphers) { @@ -85,11 +85,9 @@
- @if (isRiskInsightsActivityTabFeatureEnabled) { - - - - } + + + diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.ts b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.ts index 18afdf8c8ab..b307c91d29f 100644 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.ts +++ b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.ts @@ -21,8 +21,6 @@ import { ReportStatus, RiskInsightsDataService, } from "@bitwarden/bit-common/dirt/reports/risk-insights"; -import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; -import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { FileDownloadService } from "@bitwarden/common/platform/abstractions/file-download/file-download.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; @@ -80,8 +78,7 @@ export class RiskInsightsComponent implements OnInit, OnDestroy { private destroyRef = inject(DestroyRef); protected ReportStatusEnum = ReportStatus; - tabIndex: RiskInsightsTabType = RiskInsightsTabType.AllApps; - isRiskInsightsActivityTabFeatureEnabled: boolean = false; + tabIndex: RiskInsightsTabType = RiskInsightsTabType.AllActivity; appsCount: number = 0; @@ -112,7 +109,6 @@ export class RiskInsightsComponent implements OnInit, OnDestroy { constructor( private route: ActivatedRoute, private router: Router, - private configService: ConfigService, protected dataService: RiskInsightsDataService, protected i18nService: I18nService, protected dialogService: DialogService, @@ -120,16 +116,8 @@ export class RiskInsightsComponent implements OnInit, OnDestroy { private logService: LogService, ) { this.route.queryParams.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(({ tabIndex }) => { - this.tabIndex = !isNaN(Number(tabIndex)) ? Number(tabIndex) : RiskInsightsTabType.AllApps; + this.tabIndex = !isNaN(Number(tabIndex)) ? Number(tabIndex) : RiskInsightsTabType.AllActivity; }); - - this.configService - .getFeatureFlag$(FeatureFlag.PM22887_RiskInsightsActivityTab) - .pipe(takeUntilDestroyed(this.destroyRef)) - .subscribe((isEnabled) => { - this.isRiskInsightsActivityTabFeatureEnabled = isEnabled; - this.tabIndex = 0; // default to first tab - }); } async ngOnInit() { diff --git a/libs/common/src/enums/feature-flag.enum.ts b/libs/common/src/enums/feature-flag.enum.ts index 20da219e8d7..048b0147a6f 100644 --- a/libs/common/src/enums/feature-flag.enum.ts +++ b/libs/common/src/enums/feature-flag.enum.ts @@ -54,7 +54,6 @@ export enum FeatureFlag { /* DIRT */ EventManagementForDataDogAndCrowdStrike = "event-management-for-datadog-and-crowdstrike", PhishingDetection = "phishing-detection", - PM22887_RiskInsightsActivityTab = "pm-22887-risk-insights-activity-tab", /* Vault */ PM19941MigrateCipherDomainToSdk = "pm-19941-migrate-cipher-domain-to-sdk", @@ -116,7 +115,6 @@ export const DefaultFeatureFlagValue = { /* DIRT */ [FeatureFlag.EventManagementForDataDogAndCrowdStrike]: FALSE, [FeatureFlag.PhishingDetection]: FALSE, - [FeatureFlag.PM22887_RiskInsightsActivityTab]: FALSE, /* Vault */ [FeatureFlag.CipherKeyEncryption]: FALSE,