diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 91cd174a6b6..9a9749e69ef 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -58,6 +58,7 @@ libs/admin-console @bitwarden/team-admin-console-dev ## Billing team files ## 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 libs/angular/src/billing @bitwarden/team-billing-dev libs/common/src/billing @bitwarden/team-billing-dev diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index 666dea3f5b8..fe5b3e4fc19 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -1280,9 +1280,6 @@ "premiumPurchase": { "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": { "message": "You can purchase Premium from your account settings on the Bitwarden web app." }, diff --git a/apps/browser/src/billing/popup/settings/premium-v2.component.ts b/apps/browser/src/billing/popup/settings/premium-v2.component.ts index da3d2c07e4b..ff0e8efd646 100644 --- a/apps/browser/src/billing/popup/settings/premium-v2.component.ts +++ b/apps/browser/src/billing/popup/settings/premium-v2.component.ts @@ -4,12 +4,11 @@ import { CommonModule, CurrencyPipe, Location } from "@angular/common"; import { Component } from "@angular/core"; import { RouterModule } from "@angular/router"; +import { PremiumComponent as BasePremiumComponent } from "@bitwarden/angular/billing/components/premium.component"; 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 { AccountService } from "@bitwarden/common/auth/abstractions/account.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 { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; @@ -51,7 +50,6 @@ export class PremiumV2Component extends BasePremiumComponent { i18nService: I18nService, platformUtilsService: PlatformUtilsService, apiService: ApiService, - configService: ConfigService, logService: LogService, private location: Location, private currencyPipe: CurrencyPipe, @@ -65,7 +63,6 @@ export class PremiumV2Component extends BasePremiumComponent { i18nService, platformUtilsService, apiService, - configService, logService, dialogService, environmentService, diff --git a/apps/desktop/src/app/app.component.ts b/apps/desktop/src/app/app.component.ts index fc05f33cebd..9d317b8276a 100644 --- a/apps/desktop/src/app/app.component.ts +++ b/apps/desktop/src/app/app.component.ts @@ -58,8 +58,8 @@ import { PasswordGenerationServiceAbstraction } from "@bitwarden/generator-legac import { KeyService, BiometricStateService } from "@bitwarden/key-management"; import { DeleteAccountComponent } from "../auth/delete-account.component"; +import { PremiumComponent } from "../billing/app/accounts/premium.component"; 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 { SettingsComponent } from "./accounts/settings.component"; diff --git a/apps/desktop/src/app/app.module.ts b/apps/desktop/src/app/app.module.ts index ea0a2c4c546..9516066ac7b 100644 --- a/apps/desktop/src/app/app.module.ts +++ b/apps/desktop/src/app/app.module.ts @@ -22,8 +22,8 @@ import { SsoComponentV1 } from "../auth/sso-v1.component"; import { TwoFactorOptionsComponent } from "../auth/two-factor-options.component"; import { TwoFactorComponent } from "../auth/two-factor.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 { PremiumComponent } from "../vault/app/accounts/premium.component"; import { AddEditCustomFieldsComponent } from "../vault/app/vault/add-edit-custom-fields.component"; import { AddEditComponent } from "../vault/app/vault/add-edit.component"; import { AttachmentsComponent } from "../vault/app/vault/attachments.component"; diff --git a/apps/desktop/src/vault/app/accounts/premium.component.html b/apps/desktop/src/billing/app/accounts/premium.component.html similarity index 100% rename from apps/desktop/src/vault/app/accounts/premium.component.html rename to apps/desktop/src/billing/app/accounts/premium.component.html diff --git a/apps/desktop/src/vault/app/accounts/premium.component.ts b/apps/desktop/src/billing/app/accounts/premium.component.ts similarity index 88% rename from apps/desktop/src/vault/app/accounts/premium.component.ts rename to apps/desktop/src/billing/app/accounts/premium.component.ts index bfdaf084648..1b4573fe6d6 100644 --- a/apps/desktop/src/vault/app/accounts/premium.component.ts +++ b/apps/desktop/src/billing/app/accounts/premium.component.ts @@ -1,10 +1,9 @@ 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 { AccountService } from "@bitwarden/common/auth/abstractions/account.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 { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; @@ -20,7 +19,6 @@ export class PremiumComponent extends BasePremiumComponent { i18nService: I18nService, platformUtilsService: PlatformUtilsService, apiService: ApiService, - configService: ConfigService, logService: LogService, dialogService: DialogService, environmentService: EnvironmentService, @@ -32,7 +30,6 @@ export class PremiumComponent extends BasePremiumComponent { i18nService, platformUtilsService, apiService, - configService, logService, dialogService, environmentService, diff --git a/apps/desktop/src/locales/en/messages.json b/apps/desktop/src/locales/en/messages.json index 4f18a88d994..fde39ef3d57 100644 --- a/apps/desktop/src/locales/en/messages.json +++ b/apps/desktop/src/locales/en/messages.json @@ -1388,9 +1388,6 @@ "premiumPurchase": { "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": { "message": "You can purchase Premium from your account settings on the Bitwarden web app." }, diff --git a/libs/angular/src/billing/components/index.ts b/libs/angular/src/billing/components/index.ts index 675d7555ed2..dacb5b265bd 100644 --- a/libs/angular/src/billing/components/index.ts +++ b/libs/angular/src/billing/components/index.ts @@ -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"; diff --git a/libs/angular/src/vault/components/premium.component.ts b/libs/angular/src/billing/components/premium.component.ts similarity index 82% rename from libs/angular/src/vault/components/premium.component.ts rename to libs/angular/src/billing/components/premium.component.ts index e86c6beda47..6d0b90385ba 100644 --- a/libs/angular/src/vault/components/premium.component.ts +++ b/libs/angular/src/billing/components/premium.component.ts @@ -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; 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);