mirror of
https://github.com/bitwarden/browser
synced 2026-01-21 20:03:43 +00:00
[PM-26146] Remove risk insights activity tab feature flag (#18218)
This commit is contained in:
@@ -140,7 +140,10 @@ export class RiskInsightsOrchestratorService {
|
||||
reportProgress$ = this._reportProgressSubject.asObservable();
|
||||
|
||||
// --------------------------- Critical Application data ---------------------
|
||||
criticalReportResults$: Observable<RiskInsightsEnrichedData | null> = of(null);
|
||||
private _criticalReportResultsSubject = new BehaviorSubject<RiskInsightsEnrichedData | null>(
|
||||
null,
|
||||
);
|
||||
criticalReportResults$ = this._criticalReportResultsSubject.asObservable();
|
||||
|
||||
// --------------------------- Trigger subjects ---------------------
|
||||
private _initializeOrganizationTriggerSubject = new Subject<OrganizationId>();
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
<dirt-report-loading [progressStep]="step"></dirt-report-loading>
|
||||
} @else {
|
||||
<!-- Check final states after initial calls have been completed -->
|
||||
@if (isRiskInsightsActivityTabFeatureEnabled && !(dataService.hasReportData$ | async)) {
|
||||
<!-- Show empty state only when feature flag is enabled and there's no report data -->
|
||||
@if (!(dataService.hasReportData$ | async)) {
|
||||
<!-- Show empty state only when there's no report data -->
|
||||
<div @fadeIn class="tw-flex tw-justify-center tw-items-center tw-min-h-[70vh] tw-w-full">
|
||||
@if (!hasCiphers) {
|
||||
<!-- Show Empty state when there are no applications (no ciphers to make reports on) -->
|
||||
@@ -85,11 +85,9 @@
|
||||
|
||||
<div class="tw-flex-1 tw-flex tw-flex-col">
|
||||
<bit-tab-group [(selectedIndex)]="tabIndex" (selectedIndexChange)="onTabChange($event)">
|
||||
@if (isRiskInsightsActivityTabFeatureEnabled) {
|
||||
<bit-tab label="{{ 'activity' | i18n }}">
|
||||
<dirt-all-activity [organizationId]="this.organizationId"></dirt-all-activity>
|
||||
</bit-tab>
|
||||
}
|
||||
<bit-tab label="{{ 'activity' | i18n }}">
|
||||
<dirt-all-activity [organizationId]="this.organizationId"></dirt-all-activity>
|
||||
</bit-tab>
|
||||
<bit-tab label="{{ 'allApplicationsWithCount' | i18n: appsCount }}">
|
||||
<dirt-all-applications></dirt-all-applications>
|
||||
</bit-tab>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user