mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
Move premium component into billing ownership (#12927)
* Move premium component into billing ownership Update CODEOWNERS Move files within libs/angular Move files within desktop Adjust import paths * Remove configService --------- Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
ab197049f5
commit
e73cb3e3ff
@@ -2,3 +2,4 @@ export * from "./add-account-credit-dialog/add-account-credit-dialog.component";
|
||||
export * from "./invoices/invoices.component";
|
||||
export * from "./invoices/no-invoices.component";
|
||||
export * from "./manage-tax-information/manage-tax-information.component";
|
||||
export * from "./premium.component";
|
||||
|
||||
@@ -6,8 +6,6 @@ import { firstValueFrom, Observable, switchMap } from "rxjs";
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service";
|
||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.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";
|
||||
@@ -20,13 +18,11 @@ export class PremiumComponent implements OnInit {
|
||||
price = 10;
|
||||
refreshPromise: Promise<any>;
|
||||
cloudWebVaultUrl: string;
|
||||
extensionRefreshFlagEnabled: boolean;
|
||||
|
||||
constructor(
|
||||
protected i18nService: I18nService,
|
||||
protected platformUtilsService: PlatformUtilsService,
|
||||
protected apiService: ApiService,
|
||||
protected configService: ConfigService,
|
||||
private logService: LogService,
|
||||
protected dialogService: DialogService,
|
||||
private environmentService: EnvironmentService,
|
||||
@@ -43,9 +39,6 @@ export class PremiumComponent implements OnInit {
|
||||
|
||||
async ngOnInit() {
|
||||
this.cloudWebVaultUrl = await firstValueFrom(this.environmentService.cloudWebVaultUrl$);
|
||||
this.extensionRefreshFlagEnabled = await this.configService.getFeatureFlag(
|
||||
FeatureFlag.ExtensionRefresh,
|
||||
);
|
||||
}
|
||||
|
||||
async refresh() {
|
||||
@@ -66,15 +59,13 @@ export class PremiumComponent implements OnInit {
|
||||
const dialogOpts: SimpleDialogOptions = {
|
||||
title: { key: "continueToBitwardenDotCom" },
|
||||
content: {
|
||||
key: this.extensionRefreshFlagEnabled ? "premiumPurchaseAlertV2" : "premiumPurchaseAlert",
|
||||
key: "premiumPurchaseAlertV2",
|
||||
},
|
||||
type: "info",
|
||||
};
|
||||
|
||||
if (this.extensionRefreshFlagEnabled) {
|
||||
dialogOpts.acceptButtonText = { key: "continue" };
|
||||
dialogOpts.cancelButtonText = { key: "close" };
|
||||
}
|
||||
dialogOpts.acceptButtonText = { key: "continue" };
|
||||
dialogOpts.cancelButtonText = { key: "close" };
|
||||
|
||||
const confirmed = await this.dialogService.openSimpleDialog(dialogOpts);
|
||||
|
||||
Reference in New Issue
Block a user