1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 07:13:32 +00:00

Fix the failing billing steps (#15459)

This commit is contained in:
cyprain-okeke
2025-07-03 18:07:51 +01:00
committed by GitHub
parent 913c3ddbec
commit 2d897e8cea
3 changed files with 19 additions and 2 deletions

View File

@@ -48,7 +48,7 @@
<app-vertical-step
label="Billing"
[subLabel]="billingSubLabel"
*ngIf="(trialPaymentOptional$ | async) && trialLength === 0 && !isSecretsManagerFree"
*ngIf="showBillingStep$ | async"
>
<app-trial-billing-step
*ngIf="stepper.selectedIndex === 2"

View File

@@ -4,7 +4,7 @@ import { StepperSelectionEvent } from "@angular/cdk/stepper";
import { Component, OnDestroy, OnInit, ViewChild } from "@angular/core";
import { FormBuilder, Validators } from "@angular/forms";
import { ActivatedRoute, Router } from "@angular/router";
import { firstValueFrom, Subject, switchMap, takeUntil } from "rxjs";
import { combineLatest, firstValueFrom, map, Subject, switchMap, takeUntil } from "rxjs";
import {
InputPasswordFlow,
@@ -101,6 +101,9 @@ export class CompleteTrialInitiationComponent implements OnInit, OnDestroy {
protected trialPaymentOptional$ = this.configService.getFeatureFlag$(
FeatureFlag.TrialPaymentOptional,
);
protected allowTrialLengthZero$ = this.configService.getFeatureFlag$(
FeatureFlag.AllowTrialLengthZero,
);
constructor(
protected router: Router,
@@ -334,6 +337,18 @@ export class CompleteTrialInitiationComponent implements OnInit, OnDestroy {
return this.productTier;
}
readonly showBillingStep$ = combineLatest([
this.trialPaymentOptional$,
this.allowTrialLengthZero$,
]).pipe(
map(([trialPaymentOptional, allowTrialLengthZero]) => {
return (
(!trialPaymentOptional && !this.isSecretsManagerFree) ||
(trialPaymentOptional && allowTrialLengthZero && this.trialLength === 0)
);
}),
);
/** Create an organization unless the trial is for secrets manager */
async conditionallyCreateOrganization(): Promise<void> {
if (!this.isSecretsManagerFree) {