From 650139de89e04c2b008d1319ef8b240e3bb0df15 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 7 Nov 2025 12:24:54 -0500 Subject: [PATCH] use RiskInsightsTabType enum for tab navigation Replace hardcoded tab index logic with RiskInsightsTabType.AllApps enum value when activity tab is enabled. This improves code maintainability and makes the tab index source explicit. --- .../critical-applications.component.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/critical-applications/critical-applications.component.ts b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/critical-applications/critical-applications.component.ts index 4ccf920f0d3..e033f9265c4 100644 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/critical-applications/critical-applications.component.ts +++ b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/critical-applications/critical-applications.component.ts @@ -26,6 +26,7 @@ import { SharedModule } from "@bitwarden/web-vault/app/shared"; import { PipesModule } from "@bitwarden/web-vault/app/vault/individual-vault/pipes/pipes.module"; import { DefaultAdminTaskService } from "../../../vault/services/default-admin-task.service"; +import { RiskInsightsTabType } from "../models/risk-insights.models"; import { AppTableRowScrollableComponent } from "../shared/app-table-row-scrollable.component"; import { AccessIntelligenceSecurityTasksService } from "../shared/security-tasks.service"; @@ -111,8 +112,11 @@ export class CriticalApplicationsComponent implements OnInit { } goToAllAppsTab = async () => { - // If activity tab is enabled, All Apps is tab 1, otherwise it's tab 0 - const allAppsTabIndex = this.isRiskInsightsActivityTabFeatureEnabled ? 1 : 0; //TODO: change this logic when feature flag is implemented? + // Use RiskInsightsTabType enum to get the correct tab index + // When activity tab is enabled: AllApps = 1, otherwise it becomes 0 (first tab) + const allAppsTabIndex = this.isRiskInsightsActivityTabFeatureEnabled + ? RiskInsightsTabType.AllApps + : 0; await this.router.navigate([], { relativeTo: this.activatedRoute.parent, queryParams: { tabIndex: allAppsTabIndex },