mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 07:13:32 +00:00
[PM-2594] Replacing hardcoded cloud vault urls based on region obtained from ConfigService (#5629)
* [PM-2594] Added property "CloudVault" to EnvironmentServerConfigData and EnvironmentServerConfigResponse * [PM-2594] Replaced hardcoded vault urls with value obtained from ConfigService * [PM-2594] Renamed EnvironmentServerConfigResponse.cloudVault to cloudWebVault * [PM-2594] Updated unit test with new property "cloudWebVault" * [PM-2594] Added methods to get and set CloudWebVaultUrl on EnvironmentService. Configured ConfigurationService to set value based on cloudVaultRegion * [PM-2594] Added JSDOC comments to methods getCloudWebVaultUrl and setCloudWebVaultUrl * [PM-2594] Renamed EnvironmentServerConfigData.cloudVaultRegion to cloudRegion * [PM-2594] Fixed unit test
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
<a
|
||||
bitButton
|
||||
buttonType="secondary"
|
||||
href="https://vault.bitwarden.com"
|
||||
href="{{ this.cloudWebVaultUrl }}"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>
|
||||
|
||||
@@ -12,6 +12,7 @@ import { Organization } from "@bitwarden/common/admin-console/models/domain/orga
|
||||
import { OrganizationConnectionResponse } from "@bitwarden/common/admin-console/models/response/organization-connection.response";
|
||||
import { BillingSyncConfigApi } from "@bitwarden/common/billing/models/api/billing-sync-config.api";
|
||||
import { SelfHostedOrganizationSubscriptionView } from "@bitwarden/common/billing/models/view/self-hosted-organization-subscription.view";
|
||||
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
@@ -34,6 +35,7 @@ export class OrganizationSubscriptionSelfhostComponent implements OnInit, OnDest
|
||||
subscription: SelfHostedOrganizationSubscriptionView;
|
||||
organizationId: string;
|
||||
userOrg: Organization;
|
||||
cloudWebVaultUrl: string;
|
||||
|
||||
licenseOptions = LicenseOptions;
|
||||
form = new FormGroup({
|
||||
@@ -82,8 +84,11 @@ export class OrganizationSubscriptionSelfhostComponent implements OnInit, OnDest
|
||||
private route: ActivatedRoute,
|
||||
private organizationApiService: OrganizationApiServiceAbstraction,
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private i18nService: I18nService
|
||||
) {}
|
||||
private i18nService: I18nService,
|
||||
private environmentService: EnvironmentService
|
||||
) {
|
||||
this.cloudWebVaultUrl = this.environmentService.getCloudWebVaultUrl();
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.route.params
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
<a
|
||||
bitButton
|
||||
buttonType="secondary"
|
||||
href="https://vault.bitwarden.com/#/settings/subscription"
|
||||
href="{{ this.cloudWebVaultUrl }}/#/settings/subscription"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Router } from "@angular/router";
|
||||
import { DialogServiceAbstraction, SimpleDialogType } from "@bitwarden/angular/services/dialog";
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { SubscriptionResponse } from "@bitwarden/common/billing/models/response/subscription.response";
|
||||
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.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";
|
||||
@@ -22,6 +23,7 @@ export class UserSubscriptionComponent implements OnInit {
|
||||
showUpdateLicense = false;
|
||||
sub: SubscriptionResponse;
|
||||
selfHosted = false;
|
||||
cloudWebVaultUrl: string;
|
||||
|
||||
cancelPromise: Promise<any>;
|
||||
reinstatePromise: Promise<any>;
|
||||
@@ -34,9 +36,11 @@ export class UserSubscriptionComponent implements OnInit {
|
||||
private router: Router,
|
||||
private logService: LogService,
|
||||
private fileDownloadService: FileDownloadService,
|
||||
private dialogService: DialogServiceAbstraction
|
||||
private dialogService: DialogServiceAbstraction,
|
||||
private environmentService: EnvironmentService
|
||||
) {
|
||||
this.selfHosted = platformUtilsService.isSelfHost();
|
||||
this.cloudWebVaultUrl = this.environmentService.getCloudWebVaultUrl();
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
|
||||
Reference in New Issue
Block a user