Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move premium component into billing ownership #12927

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions apps/browser/src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
import { Component } from "@angular/core";
import { RouterModule } from "@angular/router";

import { PremiumComponent as BasePremiumComponent } from "@bitwarden/angular/billing/components/premium.component";

Check warning on line 7 in apps/browser/src/billing/popup/settings/premium-v2.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/billing/popup/settings/premium-v2.component.ts#L7

Added line #L7 was not covered by tests
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";
Expand Down Expand Up @@ -51,7 +50,6 @@
i18nService: I18nService,
platformUtilsService: PlatformUtilsService,
apiService: ApiService,
configService: ConfigService,
logService: LogService,
private location: Location,
private currencyPipe: CurrencyPipe,
Expand All @@ -65,7 +63,6 @@
i18nService,
platformUtilsService,
apiService,
configService,
logService,
dialogService,
environmentService,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
import { KeyService, BiometricStateService } from "@bitwarden/key-management";

import { DeleteAccountComponent } from "../auth/delete-account.component";
import { PremiumComponent } from "../billing/app/accounts/premium.component";

Check warning on line 61 in apps/desktop/src/app/app.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/desktop/src/app/app.component.ts#L61

Added line #L61 was not covered by tests
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";
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
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";

Check warning on line 25 in apps/desktop/src/app/app.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/desktop/src/app/app.module.ts#L25

Added line #L25 was not covered by tests
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";
Expand Down
Original file line number Diff line number Diff line change
@@ -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";

Check warning on line 3 in apps/desktop/src/billing/app/accounts/premium.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/desktop/src/billing/app/accounts/premium.component.ts#L3

Added line #L3 was not covered by tests
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";
Expand All @@ -20,7 +19,6 @@
i18nService: I18nService,
platformUtilsService: PlatformUtilsService,
apiService: ApiService,
configService: ConfigService,
logService: LogService,
dialogService: DialogService,
environmentService: EnvironmentService,
Expand All @@ -32,7 +30,6 @@
i18nService,
platformUtilsService,
apiService,
configService,
logService,
dialogService,
environmentService,
Expand Down
3 changes: 0 additions & 3 deletions apps/desktop/src/locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
},
Expand Down
1 change: 1 addition & 0 deletions libs/angular/src/billing/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
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";
Expand All @@ -20,13 +18,11 @@
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,
Expand All @@ -43,9 +39,6 @@

async ngOnInit() {
this.cloudWebVaultUrl = await firstValueFrom(this.environmentService.cloudWebVaultUrl$);
this.extensionRefreshFlagEnabled = await this.configService.getFeatureFlag(
FeatureFlag.ExtensionRefresh,
);
}

async refresh() {
Expand All @@ -66,15 +59,13 @@
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" };

Check warning on line 68 in libs/angular/src/billing/components/premium.component.ts

View check run for this annotation

Codecov / codecov/patch

libs/angular/src/billing/components/premium.component.ts#L67-L68

Added lines #L67 - L68 were not covered by tests

const confirmed = await this.dialogService.openSimpleDialog(dialogOpts);

Expand Down
Loading