PM-2593 Update Premium Urls to target cloudWebVaultUrl (#5861)
* updated urls in premium web component and premium libs to use the cloudwebvaulturl * moved premium.component in web from base settings to a new settings folder inside vault
This commit is contained in:
parent
a7cce1a3ad
commit
96c6b870cb
|
@ -4,6 +4,7 @@ import { Component } from "@angular/core";
|
|||
import { DialogServiceAbstraction } from "@bitwarden/angular/services/dialog";
|
||||
import { PremiumComponent as BasePremiumComponent } from "@bitwarden/angular/vault/components/premium.component";
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
|
@ -24,9 +25,18 @@ export class PremiumComponent extends BasePremiumComponent {
|
|||
logService: LogService,
|
||||
private location: Location,
|
||||
private currencyPipe: CurrencyPipe,
|
||||
dialogService: DialogServiceAbstraction
|
||||
dialogService: DialogServiceAbstraction,
|
||||
environmentService: EnvironmentService
|
||||
) {
|
||||
super(i18nService, platformUtilsService, apiService, logService, stateService, dialogService);
|
||||
super(
|
||||
i18nService,
|
||||
platformUtilsService,
|
||||
apiService,
|
||||
logService,
|
||||
stateService,
|
||||
dialogService,
|
||||
environmentService
|
||||
);
|
||||
|
||||
// Support old price string. Can be removed in future once all translations are properly updated.
|
||||
const thePrice = this.currencyPipe.transform(this.price, "$");
|
||||
|
|
|
@ -3,6 +3,7 @@ import { Component } from "@angular/core";
|
|||
import { DialogServiceAbstraction } from "@bitwarden/angular/services/dialog";
|
||||
import { PremiumComponent as BasePremiumComponent } from "@bitwarden/angular/vault/components/premium.component";
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
|
@ -19,8 +20,17 @@ export class PremiumComponent extends BasePremiumComponent {
|
|||
apiService: ApiService,
|
||||
logService: LogService,
|
||||
stateService: StateService,
|
||||
dialogService: DialogServiceAbstraction
|
||||
dialogService: DialogServiceAbstraction,
|
||||
environmentService: EnvironmentService
|
||||
) {
|
||||
super(i18nService, platformUtilsService, apiService, logService, stateService, dialogService);
|
||||
super(
|
||||
i18nService,
|
||||
platformUtilsService,
|
||||
apiService,
|
||||
logService,
|
||||
stateService,
|
||||
dialogService,
|
||||
environmentService
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import { RouterModule, Routes } from "@angular/router";
|
|||
import { BillingHistoryViewComponent } from "../../billing/settings/billing-history-view.component";
|
||||
import { PaymentMethodComponent } from "../../billing/settings/payment-method.component";
|
||||
import { UserSubscriptionComponent } from "../../billing/settings/user-subscription.component";
|
||||
import { PremiumComponent } from "../../settings/premium.component";
|
||||
import { PremiumComponent } from "../../vault/settings/premium.component";
|
||||
|
||||
import { SubscriptionComponent } from "./subscription.component";
|
||||
|
||||
|
|
|
@ -81,7 +81,6 @@ import { DeleteAccountComponent } from "../settings/delete-account.component";
|
|||
import { DomainRulesComponent } from "../settings/domain-rules.component";
|
||||
import { LowKdfComponent } from "../settings/low-kdf.component";
|
||||
import { PreferencesComponent } from "../settings/preferences.component";
|
||||
import { PremiumComponent } from "../settings/premium.component";
|
||||
import { ProfileComponent } from "../settings/profile.component";
|
||||
import { PurgeVaultComponent } from "../settings/purge-vault.component";
|
||||
import { SecurityKeysComponent } from "../settings/security-keys.component";
|
||||
|
@ -107,6 +106,7 @@ import { ShareComponent } from "../vault/individual-vault/share.component";
|
|||
import { AddEditComponent as OrgAddEditComponent } from "../vault/org-vault/add-edit.component";
|
||||
import { AttachmentsComponent as OrgAttachmentsComponent } from "../vault/org-vault/attachments.component";
|
||||
import { CollectionsComponent as OrgCollectionsComponent } from "../vault/org-vault/collections.component";
|
||||
import { PremiumComponent } from "../vault/settings/premium.component";
|
||||
|
||||
import { EnvironmentSelectorModule } from "./../components/environment-selector/environment-selector.module";
|
||||
import { AccountFingerprintComponent } from "./components/account-fingerprint/account-fingerprint.component";
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
</p>
|
||||
<a
|
||||
bitButton
|
||||
href="https://vault.bitwarden.com/#/settings/premium"
|
||||
href="{{ this.cloudWebVaultUrl }}/#/settings/premium"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
buttonType="secondary"
|
|
@ -3,6 +3,7 @@ import { Router } from "@angular/router";
|
|||
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { TokenService } from "@bitwarden/common/auth/abstractions/token.service";
|
||||
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
||||
|
@ -10,8 +11,8 @@ import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/pl
|
|||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||
|
||||
import { PaymentComponent } from "../billing/settings/payment.component";
|
||||
import { TaxInfoComponent } from "../billing/settings/tax-info.component";
|
||||
import { PaymentComponent } from "../../billing/settings/payment.component";
|
||||
import { TaxInfoComponent } from "../../billing/settings/tax-info.component";
|
||||
|
||||
@Component({
|
||||
selector: "app-premium",
|
||||
|
@ -27,6 +28,7 @@ export class PremiumComponent implements OnInit {
|
|||
familyPlanMaxUserCount = 6;
|
||||
storageGbPrice = 4;
|
||||
additionalStorage = 0;
|
||||
cloudWebVaultUrl: string;
|
||||
|
||||
formPromise: Promise<any>;
|
||||
|
||||
|
@ -39,9 +41,11 @@ export class PremiumComponent implements OnInit {
|
|||
private messagingService: MessagingService,
|
||||
private syncService: SyncService,
|
||||
private logService: LogService,
|
||||
private stateService: StateService
|
||||
private stateService: StateService,
|
||||
private environmentService: EnvironmentService
|
||||
) {
|
||||
this.selfHosted = platformUtilsService.isSelfHost();
|
||||
this.cloudWebVaultUrl = this.environmentService.getCloudWebVaultUrl();
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
|
@ -1,6 +1,7 @@
|
|||
import { Directive, OnInit } from "@angular/core";
|
||||
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
|
@ -13,6 +14,7 @@ export class PremiumComponent implements OnInit {
|
|||
isPremium = false;
|
||||
price = 10;
|
||||
refreshPromise: Promise<any>;
|
||||
cloudWebVaultUrl: string;
|
||||
|
||||
constructor(
|
||||
protected i18nService: I18nService,
|
||||
|
@ -20,8 +22,11 @@ export class PremiumComponent implements OnInit {
|
|||
protected apiService: ApiService,
|
||||
private logService: LogService,
|
||||
protected stateService: StateService,
|
||||
protected dialogService: DialogServiceAbstraction
|
||||
) {}
|
||||
protected dialogService: DialogServiceAbstraction,
|
||||
private environmentService: EnvironmentService
|
||||
) {
|
||||
this.cloudWebVaultUrl = this.environmentService.getCloudWebVaultUrl();
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.isPremium = await this.stateService.getCanAccessPremium();
|
||||
|
@ -46,7 +51,7 @@ export class PremiumComponent implements OnInit {
|
|||
});
|
||||
|
||||
if (confirmed) {
|
||||
this.platformUtilsService.launchUri("https://vault.bitwarden.com/#/?premium=purchase");
|
||||
this.platformUtilsService.launchUri(`${this.cloudWebVaultUrl}/#/?premium=purchase`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,7 +63,7 @@ export class PremiumComponent implements OnInit {
|
|||
});
|
||||
|
||||
if (confirmed) {
|
||||
this.platformUtilsService.launchUri("https://vault.bitwarden.com/#/?premium=manage");
|
||||
this.platformUtilsService.launchUri(`${this.cloudWebVaultUrl}/#/?premium=manage`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue