mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +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
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
@@ -58,6 +58,7 @@ libs/admin-console @bitwarden/team-admin-console-dev
|
|||||||
|
|
||||||
## Billing team files ##
|
## Billing team files ##
|
||||||
apps/browser/src/billing @bitwarden/team-billing-dev
|
apps/browser/src/billing @bitwarden/team-billing-dev
|
||||||
|
apps/desktop/src/billing @bitwarden/team-billing-dev
|
||||||
apps/web/src/app/billing @bitwarden/team-billing-dev
|
apps/web/src/app/billing @bitwarden/team-billing-dev
|
||||||
libs/angular/src/billing @bitwarden/team-billing-dev
|
libs/angular/src/billing @bitwarden/team-billing-dev
|
||||||
libs/common/src/billing @bitwarden/team-billing-dev
|
libs/common/src/billing @bitwarden/team-billing-dev
|
||||||
|
|||||||
@@ -1280,9 +1280,6 @@
|
|||||||
"premiumPurchase": {
|
"premiumPurchase": {
|
||||||
"message": "Purchase Premium"
|
"message": "Purchase Premium"
|
||||||
},
|
},
|
||||||
"premiumPurchaseAlert": {
|
|
||||||
"message": "You can purchase Premium membership on the bitwarden.com web vault. Do you want to visit the website now?"
|
|
||||||
},
|
|
||||||
"premiumPurchaseAlertV2": {
|
"premiumPurchaseAlertV2": {
|
||||||
"message": "You can purchase Premium from your account settings on the Bitwarden web app."
|
"message": "You can purchase Premium from your account settings on the Bitwarden web app."
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,12 +4,11 @@ import { CommonModule, CurrencyPipe, Location } from "@angular/common";
|
|||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
import { RouterModule } from "@angular/router";
|
import { RouterModule } from "@angular/router";
|
||||||
|
|
||||||
|
import { PremiumComponent as BasePremiumComponent } from "@bitwarden/angular/billing/components/premium.component";
|
||||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||||
import { PremiumComponent as BasePremiumComponent } from "@bitwarden/angular/vault/components/premium.component";
|
|
||||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||||
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service";
|
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service";
|
||||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
|
||||||
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
@@ -51,7 +50,6 @@ export class PremiumV2Component extends BasePremiumComponent {
|
|||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
platformUtilsService: PlatformUtilsService,
|
platformUtilsService: PlatformUtilsService,
|
||||||
apiService: ApiService,
|
apiService: ApiService,
|
||||||
configService: ConfigService,
|
|
||||||
logService: LogService,
|
logService: LogService,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
private currencyPipe: CurrencyPipe,
|
private currencyPipe: CurrencyPipe,
|
||||||
@@ -65,7 +63,6 @@ export class PremiumV2Component extends BasePremiumComponent {
|
|||||||
i18nService,
|
i18nService,
|
||||||
platformUtilsService,
|
platformUtilsService,
|
||||||
apiService,
|
apiService,
|
||||||
configService,
|
|
||||||
logService,
|
logService,
|
||||||
dialogService,
|
dialogService,
|
||||||
environmentService,
|
environmentService,
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ import { PasswordGenerationServiceAbstraction } from "@bitwarden/generator-legac
|
|||||||
import { KeyService, BiometricStateService } from "@bitwarden/key-management";
|
import { KeyService, BiometricStateService } from "@bitwarden/key-management";
|
||||||
|
|
||||||
import { DeleteAccountComponent } from "../auth/delete-account.component";
|
import { DeleteAccountComponent } from "../auth/delete-account.component";
|
||||||
|
import { PremiumComponent } from "../billing/app/accounts/premium.component";
|
||||||
import { MenuAccount, MenuUpdateRequest } from "../main/menu/menu.updater";
|
import { MenuAccount, MenuUpdateRequest } from "../main/menu/menu.updater";
|
||||||
import { PremiumComponent } from "../vault/app/accounts/premium.component";
|
|
||||||
import { FolderAddEditComponent } from "../vault/app/vault/folder-add-edit.component";
|
import { FolderAddEditComponent } from "../vault/app/vault/folder-add-edit.component";
|
||||||
|
|
||||||
import { SettingsComponent } from "./accounts/settings.component";
|
import { SettingsComponent } from "./accounts/settings.component";
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ import { SsoComponentV1 } from "../auth/sso-v1.component";
|
|||||||
import { TwoFactorOptionsComponent } from "../auth/two-factor-options.component";
|
import { TwoFactorOptionsComponent } from "../auth/two-factor-options.component";
|
||||||
import { TwoFactorComponent } from "../auth/two-factor.component";
|
import { TwoFactorComponent } from "../auth/two-factor.component";
|
||||||
import { UpdateTempPasswordComponent } from "../auth/update-temp-password.component";
|
import { UpdateTempPasswordComponent } from "../auth/update-temp-password.component";
|
||||||
|
import { PremiumComponent } from "../billing/app/accounts/premium.component";
|
||||||
import { SshAgentService } from "../platform/services/ssh-agent.service";
|
import { SshAgentService } from "../platform/services/ssh-agent.service";
|
||||||
import { PremiumComponent } from "../vault/app/accounts/premium.component";
|
|
||||||
import { AddEditCustomFieldsComponent } from "../vault/app/vault/add-edit-custom-fields.component";
|
import { AddEditCustomFieldsComponent } from "../vault/app/vault/add-edit-custom-fields.component";
|
||||||
import { AddEditComponent } from "../vault/app/vault/add-edit.component";
|
import { AddEditComponent } from "../vault/app/vault/add-edit.component";
|
||||||
import { AttachmentsComponent } from "../vault/app/vault/attachments.component";
|
import { AttachmentsComponent } from "../vault/app/vault/attachments.component";
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
|
|
||||||
import { PremiumComponent as BasePremiumComponent } from "@bitwarden/angular/vault/components/premium.component";
|
import { PremiumComponent as BasePremiumComponent } from "@bitwarden/angular/billing/components/premium.component";
|
||||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||||
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service";
|
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service";
|
||||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
|
||||||
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
@@ -20,7 +19,6 @@ export class PremiumComponent extends BasePremiumComponent {
|
|||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
platformUtilsService: PlatformUtilsService,
|
platformUtilsService: PlatformUtilsService,
|
||||||
apiService: ApiService,
|
apiService: ApiService,
|
||||||
configService: ConfigService,
|
|
||||||
logService: LogService,
|
logService: LogService,
|
||||||
dialogService: DialogService,
|
dialogService: DialogService,
|
||||||
environmentService: EnvironmentService,
|
environmentService: EnvironmentService,
|
||||||
@@ -32,7 +30,6 @@ export class PremiumComponent extends BasePremiumComponent {
|
|||||||
i18nService,
|
i18nService,
|
||||||
platformUtilsService,
|
platformUtilsService,
|
||||||
apiService,
|
apiService,
|
||||||
configService,
|
|
||||||
logService,
|
logService,
|
||||||
dialogService,
|
dialogService,
|
||||||
environmentService,
|
environmentService,
|
||||||
@@ -1388,9 +1388,6 @@
|
|||||||
"premiumPurchase": {
|
"premiumPurchase": {
|
||||||
"message": "Purchase Premium"
|
"message": "Purchase Premium"
|
||||||
},
|
},
|
||||||
"premiumPurchaseAlert": {
|
|
||||||
"message": "You can purchase premium membership on the bitwarden.com web vault. Do you want to visit the website now?"
|
|
||||||
},
|
|
||||||
"premiumPurchaseAlertV2": {
|
"premiumPurchaseAlertV2": {
|
||||||
"message": "You can purchase Premium from your account settings on the Bitwarden web app."
|
"message": "You can purchase Premium from your account settings on the Bitwarden web app."
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ export * from "./add-account-credit-dialog/add-account-credit-dialog.component";
|
|||||||
export * from "./invoices/invoices.component";
|
export * from "./invoices/invoices.component";
|
||||||
export * from "./invoices/no-invoices.component";
|
export * from "./invoices/no-invoices.component";
|
||||||
export * from "./manage-tax-information/manage-tax-information.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 { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||||
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.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 { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
@@ -20,13 +18,11 @@ export class PremiumComponent implements OnInit {
|
|||||||
price = 10;
|
price = 10;
|
||||||
refreshPromise: Promise<any>;
|
refreshPromise: Promise<any>;
|
||||||
cloudWebVaultUrl: string;
|
cloudWebVaultUrl: string;
|
||||||
extensionRefreshFlagEnabled: boolean;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected i18nService: I18nService,
|
protected i18nService: I18nService,
|
||||||
protected platformUtilsService: PlatformUtilsService,
|
protected platformUtilsService: PlatformUtilsService,
|
||||||
protected apiService: ApiService,
|
protected apiService: ApiService,
|
||||||
protected configService: ConfigService,
|
|
||||||
private logService: LogService,
|
private logService: LogService,
|
||||||
protected dialogService: DialogService,
|
protected dialogService: DialogService,
|
||||||
private environmentService: EnvironmentService,
|
private environmentService: EnvironmentService,
|
||||||
@@ -43,9 +39,6 @@ export class PremiumComponent implements OnInit {
|
|||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.cloudWebVaultUrl = await firstValueFrom(this.environmentService.cloudWebVaultUrl$);
|
this.cloudWebVaultUrl = await firstValueFrom(this.environmentService.cloudWebVaultUrl$);
|
||||||
this.extensionRefreshFlagEnabled = await this.configService.getFeatureFlag(
|
|
||||||
FeatureFlag.ExtensionRefresh,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async refresh() {
|
async refresh() {
|
||||||
@@ -66,15 +59,13 @@ export class PremiumComponent implements OnInit {
|
|||||||
const dialogOpts: SimpleDialogOptions = {
|
const dialogOpts: SimpleDialogOptions = {
|
||||||
title: { key: "continueToBitwardenDotCom" },
|
title: { key: "continueToBitwardenDotCom" },
|
||||||
content: {
|
content: {
|
||||||
key: this.extensionRefreshFlagEnabled ? "premiumPurchaseAlertV2" : "premiumPurchaseAlert",
|
key: "premiumPurchaseAlertV2",
|
||||||
},
|
},
|
||||||
type: "info",
|
type: "info",
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.extensionRefreshFlagEnabled) {
|
dialogOpts.acceptButtonText = { key: "continue" };
|
||||||
dialogOpts.acceptButtonText = { key: "continue" };
|
dialogOpts.cancelButtonText = { key: "close" };
|
||||||
dialogOpts.cancelButtonText = { key: "close" };
|
|
||||||
}
|
|
||||||
|
|
||||||
const confirmed = await this.dialogService.openSimpleDialog(dialogOpts);
|
const confirmed = await this.dialogService.openSimpleDialog(dialogOpts);
|
||||||
|
|
||||||
Reference in New Issue
Block a user