mirror of
https://github.com/bitwarden/browser
synced 2026-02-02 09:43:29 +00:00
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.
This commit is contained in:
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user