1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 06:13:38 +00:00

Billing/pm 26686/update upgrade account component to be responsive (#16808)

* fix(billing): Update initialization of payment component

* fix(billing): Add more signal validation

* fix(billing): Add responsiveness to upgrade-account component
This commit is contained in:
Stephon Brown
2025-10-10 12:05:27 -04:00
committed by GitHub
parent e9cd6d2b7f
commit 9c7d794cac
4 changed files with 24 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
@if (step() == PlanSelectionStep) { @if (step() == PlanSelectionStep) {
<app-upgrade-account (planSelected)="onPlanSelected($event)" (closeClicked)="onCloseClicked()" /> <app-upgrade-account (planSelected)="onPlanSelected($event)" (closeClicked)="onCloseClicked()" />
} @else if (step() == PaymentStep && selectedPlan() !== null) { } @else if (step() == PaymentStep && selectedPlan() !== null && account() !== null) {
<app-upgrade-payment <app-upgrade-payment
[selectedPlanId]="selectedPlan()" [selectedPlanId]="selectedPlan()"
[account]="account()" [account]="account()"

View File

@@ -1,6 +1,6 @@
@if (!loading()) { @if (!loading()) {
<section <section
class="tw-bg-background tw-rounded-xl tw-shadow-lg tw-max-w-5xl tw-min-w-[332px] tw-w-[870px] tw-border-secondary-100 tw-border-solid tw-border" class="tw-w-screen tw-max-h-screen tw-min-w-[332px] md:tw-max-w-4xl tw-overflow-y-auto tw-self-center tw-bg-background tw-rounded-xl tw-shadow-lg tw-border-secondary-100 tw-border-solid tw-border"
cdkTrapFocus cdkTrapFocus
cdkTrapFocusAutoCapture cdkTrapFocusAutoCapture
> >
@@ -24,10 +24,10 @@
</p> </p>
</div> </div>
<div class="tw-flex tw-flex-row tw-gap-6 tw-mb-4"> <div class="tw-grid tw-grid-cols-1 sm:tw-grid-cols-2 tw-gap-5 tw-mb-4">
@if (premiumCardDetails) { @if (premiumCardDetails) {
<billing-pricing-card <billing-pricing-card
class="tw-flex-1 tw-basis-0 tw-min-w-0" class="tw-w-full tw-min-w-[216px] tw-max-w-[456px]"
[tagline]="premiumCardDetails.tagline" [tagline]="premiumCardDetails.tagline"
[price]="premiumCardDetails.price" [price]="premiumCardDetails.price"
[button]="premiumCardDetails.button" [button]="premiumCardDetails.button"
@@ -42,7 +42,7 @@
@if (familiesCardDetails) { @if (familiesCardDetails) {
<billing-pricing-card <billing-pricing-card
class="tw-flex-1 tw-basis-0 tw-min-w-0" class="tw-w-full tw-min-w-[216px] tw-max-w-[456px]"
[tagline]="familiesCardDetails.tagline" [tagline]="familiesCardDetails.tagline"
[price]="familiesCardDetails.price" [price]="familiesCardDetails.price"
[button]="familiesCardDetails.button" [button]="familiesCardDetails.button"

View File

@@ -26,6 +26,7 @@
<section> <section>
@if (passwordManager) { @if (passwordManager) {
<billing-cart-summary <billing-cart-summary
#cartSummaryComponent
[passwordManager]="passwordManager" [passwordManager]="passwordManager"
[estimatedTax]="estimatedTax" [estimatedTax]="estimatedTax"
></billing-cart-summary> ></billing-cart-summary>

View File

@@ -118,14 +118,6 @@ export class UpgradePaymentComponent implements OnInit, AfterViewInit {
tier: this.selectedPlanId(), tier: this.selectedPlanId(),
details: planDetails, details: planDetails,
}; };
}
});
if (!this.selectedPlan) {
this.complete.emit({ status: UpgradePaymentStatus.Closed, organizationId: null });
return;
}
this.passwordManager = { this.passwordManager = {
name: this.isFamiliesPlan ? "familiesMembership" : "premiumMembership", name: this.isFamiliesPlan ? "familiesMembership" : "premiumMembership",
cost: this.selectedPlan.details.passwordManager.annualPrice, cost: this.selectedPlan.details.passwordManager.annualPrice,
@@ -138,6 +130,11 @@ export class UpgradePaymentComponent implements OnInit, AfterViewInit {
); );
this.estimatedTax = 0; this.estimatedTax = 0;
} else {
this.complete.emit({ status: UpgradePaymentStatus.Closed, organizationId: null });
return;
}
});
this.formGroup.valueChanges this.formGroup.valueChanges
.pipe(debounceTime(1000), takeUntilDestroyed(this.destroyRef)) .pipe(debounceTime(1000), takeUntilDestroyed(this.destroyRef))
@@ -146,8 +143,10 @@ export class UpgradePaymentComponent implements OnInit, AfterViewInit {
} }
ngAfterViewInit(): void { ngAfterViewInit(): void {
if (this.cartSummaryComponent) {
this.cartSummaryComponent.isExpanded.set(false); this.cartSummaryComponent.isExpanded.set(false);
} }
}
protected get isPremiumPlan(): boolean { protected get isPremiumPlan(): boolean {
return this.selectedPlanId() === PersonalSubscriptionPricingTierIds.Premium; return this.selectedPlanId() === PersonalSubscriptionPricingTierIds.Premium;