mirror of
https://github.com/bitwarden/browser
synced 2026-01-08 11:33:28 +00:00
[PM-21881] Manage payment details outside of checkout (#15458)
* Add billable-entity * Add payment types * Add billing.client * Update stripe.service * Add payment method components * Add address.pipe * Add billing address components * Add account credit components * Add component index * Add feature flag * Re-work organization warnings code * Add organization-payment-details.component * Backfill translations * Set up organization FF routing * Add account-payment-details.component * Set up account FF routing * Add provider-payment-details.component * Set up provider FF routing * Use inline component templates for re-usable payment components * Remove errant rebase file * Removed public accessibility modifier * Fix failing test
This commit is contained in:
@@ -8,6 +8,7 @@ import { I18nPipe } from "@bitwarden/angular/platform/pipes/i18n.pipe";
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { TokenService } from "@bitwarden/common/auth/abstractions/token.service";
|
||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
import { MessageListener } from "@bitwarden/common/platform/messaging";
|
||||
@@ -87,6 +88,10 @@ describe("VaultBannersComponent", () => {
|
||||
allMessages$: messageSubject.asObservable(),
|
||||
}),
|
||||
},
|
||||
{
|
||||
provide: ConfigService,
|
||||
useValue: mock<ConfigService>(),
|
||||
},
|
||||
],
|
||||
})
|
||||
.overrideProvider(VaultBannersService, { useValue: bannerService })
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { Component, Input, OnInit } from "@angular/core";
|
||||
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
||||
import { Router } from "@angular/router";
|
||||
import { firstValueFrom, map, Observable, switchMap, filter } from "rxjs";
|
||||
import { filter, firstValueFrom, map, Observable, switchMap } from "rxjs";
|
||||
|
||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { MessageListener } from "@bitwarden/common/platform/messaging";
|
||||
import { UserId } from "@bitwarden/common/types/guid";
|
||||
@@ -35,6 +37,7 @@ export class VaultBannersComponent implements OnInit {
|
||||
private i18nService: I18nService,
|
||||
private accountService: AccountService,
|
||||
private messageListener: MessageListener,
|
||||
private configService: ConfigService,
|
||||
) {
|
||||
this.premiumBannerVisible$ = this.activeUserId$.pipe(
|
||||
filter((userId): userId is UserId => userId != null),
|
||||
@@ -68,12 +71,16 @@ export class VaultBannersComponent implements OnInit {
|
||||
}
|
||||
|
||||
async navigateToPaymentMethod(organizationId: string): Promise<void> {
|
||||
const managePaymentDetailsOutsideCheckout = await this.configService.getFeatureFlag(
|
||||
FeatureFlag.PM21881_ManagePaymentDetailsOutsideCheckout,
|
||||
);
|
||||
const route = managePaymentDetailsOutsideCheckout ? "payment-details" : "payment-method";
|
||||
const navigationExtras = {
|
||||
state: { launchPaymentModalAutomatically: true },
|
||||
};
|
||||
|
||||
await this.router.navigate(
|
||||
["organizations", organizationId, "billing", "payment-method"],
|
||||
["organizations", organizationId, "billing", route],
|
||||
navigationExtras,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user