mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 05:13:29 +00:00
Fix the failing billing steps (#15459)
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -33,6 +33,7 @@ export enum FeatureFlag {
|
||||
PM17772_AdminInitiatedSponsorships = "pm-17772-admin-initiated-sponsorships",
|
||||
PM19956_RequireProviderPaymentMethodDuringSetup = "pm-19956-require-provider-payment-method-during-setup",
|
||||
UseOrganizationWarningsService = "use-organization-warnings-service",
|
||||
AllowTrialLengthZero = "pm-20322-allow-trial-length-0",
|
||||
|
||||
/* Data Insights and Reporting */
|
||||
EnableRiskInsightsNotifications = "enable-risk-insights-notifications",
|
||||
@@ -114,6 +115,7 @@ export const DefaultFeatureFlagValue = {
|
||||
[FeatureFlag.PM17772_AdminInitiatedSponsorships]: FALSE,
|
||||
[FeatureFlag.PM19956_RequireProviderPaymentMethodDuringSetup]: FALSE,
|
||||
[FeatureFlag.UseOrganizationWarningsService]: FALSE,
|
||||
[FeatureFlag.AllowTrialLengthZero]: FALSE,
|
||||
|
||||
/* Key Management */
|
||||
[FeatureFlag.PrivateKeyRegeneration]: FALSE,
|
||||
|
||||
Reference in New Issue
Block a user