|
|
|
|
@ -1,4 +1,5 @@
@@ -1,4 +1,5 @@
|
|
|
|
|
import { Component, Input, OnInit } from "@angular/core"; |
|
|
|
|
import { Router } from "@angular/router"; |
|
|
|
|
|
|
|
|
|
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; |
|
|
|
|
import { ConfigServiceAbstraction } from "@bitwarden/common/platform/abstractions/config/config.service.abstraction"; |
|
|
|
|
@ -13,14 +14,17 @@ import { Utils } from "@bitwarden/common/platform/misc/utils";
@@ -13,14 +14,17 @@ import { Utils } from "@bitwarden/common/platform/misc/utils";
|
|
|
|
|
export class EnvironmentSelectorComponent implements OnInit { |
|
|
|
|
constructor( |
|
|
|
|
private configService: ConfigServiceAbstraction, |
|
|
|
|
private platformUtilsService: PlatformUtilsService |
|
|
|
|
private platformUtilsService: PlatformUtilsService, |
|
|
|
|
private router: Router |
|
|
|
|
) {} |
|
|
|
|
|
|
|
|
|
@Input() hasFlags: boolean; |
|
|
|
|
isEuServer: boolean; |
|
|
|
|
isUsServer: boolean; |
|
|
|
|
showRegionSelector = false; |
|
|
|
|
euServerFlagEnabled: boolean; |
|
|
|
|
selectedRegionImageName: string; |
|
|
|
|
routeAndParams: string; |
|
|
|
|
|
|
|
|
|
async ngOnInit() { |
|
|
|
|
this.euServerFlagEnabled = await this.configService.getFeatureFlagBool( |
|
|
|
|
@ -31,6 +35,7 @@ export class EnvironmentSelectorComponent implements OnInit {
@@ -31,6 +35,7 @@ export class EnvironmentSelectorComponent implements OnInit {
|
|
|
|
|
this.isUsServer = domain.includes(RegionDomain.US) || domain.includes(RegionDomain.USQA); |
|
|
|
|
this.selectedRegionImageName = this.getRegionImage(); |
|
|
|
|
this.showRegionSelector = !this.platformUtilsService.isSelfHost(); |
|
|
|
|
this.routeAndParams = `/#${this.router.url}`; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getRegionImage(): string { |
|
|
|
|
|