mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
[PM-24552] - remove code for feature flag (#16022)
This commit is contained in:
@@ -12,50 +12,30 @@
|
||||
</div>
|
||||
<p>{{ "setupProviderDesc" | i18n }}</p>
|
||||
<form [formGroup]="formGroup" [bitSubmit]="submit">
|
||||
@if (!(requireProviderPaymentMethodDuringSetup$ | async)) {
|
||||
<h2 class="tw-mt-5">{{ "generalInformation" | i18n }}</h2>
|
||||
<div class="tw-grid tw-grid-flow-col tw-grid-cols-12 tw-gap-4">
|
||||
<div class="tw-col-span-6">
|
||||
<bit-form-field>
|
||||
<bit-label>{{ "providerName" | i18n }}</bit-label>
|
||||
<input type="text" bitInput formControlName="name" />
|
||||
</bit-form-field>
|
||||
</div>
|
||||
<div class="tw-col-span-6">
|
||||
<bit-form-field>
|
||||
<bit-label>{{ "billingEmail" | i18n }}</bit-label>
|
||||
<input type="email" bitInput formControlName="billingEmail" />
|
||||
<bit-hint>{{ "providerBillingEmailHint" | i18n }}</bit-hint>
|
||||
</bit-form-field>
|
||||
</div>
|
||||
<h2 class="tw-mt-5">{{ "billingInformation" | i18n }}</h2>
|
||||
<div class="tw-grid tw-grid-flow-col tw-grid-cols-12 tw-gap-4">
|
||||
<div class="tw-col-span-6">
|
||||
<bit-form-field>
|
||||
<bit-label>{{ "providerName" | i18n }}</bit-label>
|
||||
<input type="text" bitInput formControlName="name" />
|
||||
</bit-form-field>
|
||||
</div>
|
||||
<app-manage-tax-information />
|
||||
} @else {
|
||||
<h2 class="tw-mt-5">{{ "billingInformation" | i18n }}</h2>
|
||||
<div class="tw-grid tw-grid-flow-col tw-grid-cols-12 tw-gap-4">
|
||||
<div class="tw-col-span-6">
|
||||
<bit-form-field>
|
||||
<bit-label>{{ "providerName" | i18n }}</bit-label>
|
||||
<input type="text" bitInput formControlName="name" />
|
||||
</bit-form-field>
|
||||
</div>
|
||||
<div class="tw-col-span-6">
|
||||
<bit-form-field>
|
||||
<bit-label>{{ "billingEmail" | i18n }}</bit-label>
|
||||
<input type="email" bitInput formControlName="billingEmail" />
|
||||
<bit-hint>{{ "providerBillingEmailHint" | i18n }}</bit-hint>
|
||||
</bit-form-field>
|
||||
</div>
|
||||
<div class="tw-col-span-6">
|
||||
<bit-form-field>
|
||||
<bit-label>{{ "billingEmail" | i18n }}</bit-label>
|
||||
<input type="email" bitInput formControlName="billingEmail" />
|
||||
<bit-hint>{{ "providerBillingEmailHint" | i18n }}</bit-hint>
|
||||
</bit-form-field>
|
||||
</div>
|
||||
<h2 class="tw-mt-5">{{ "paymentMethod" | i18n }}</h2>
|
||||
<app-payment
|
||||
[showAccountCredit]="false"
|
||||
[bankAccountWarningOverride]="
|
||||
'verifyProviderBankAccountWithStatementDescriptorWarning' | i18n
|
||||
"
|
||||
/>
|
||||
<app-manage-tax-information />
|
||||
}
|
||||
</div>
|
||||
<h2 class="tw-mt-5">{{ "paymentMethod" | i18n }}</h2>
|
||||
<app-payment
|
||||
[showAccountCredit]="false"
|
||||
[bankAccountWarningOverride]="
|
||||
'verifyProviderBankAccountWithStatementDescriptorWarning' | i18n
|
||||
"
|
||||
/>
|
||||
<app-manage-tax-information />
|
||||
<button class="tw-mt-8" bitButton bitFormButton buttonType="primary" type="submit">
|
||||
{{ "submit" | i18n }}
|
||||
</button>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { Component, OnDestroy, OnInit, ViewChild } from "@angular/core";
|
||||
import { FormBuilder, Validators } from "@angular/forms";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { firstValueFrom, Subject, switchMap } from "rxjs";
|
||||
import { Subject, switchMap } from "rxjs";
|
||||
import { first, takeUntil } from "rxjs/operators";
|
||||
|
||||
import { ManageTaxInformationComponent } from "@bitwarden/angular/billing/components";
|
||||
@@ -11,8 +11,6 @@ import { ProviderApiServiceAbstraction } from "@bitwarden/common/admin-console/a
|
||||
import { ProviderSetupRequest } from "@bitwarden/common/admin-console/models/request/provider/provider-setup.request";
|
||||
import { PaymentMethodType } from "@bitwarden/common/billing/enums";
|
||||
import { ExpandedTaxInfoUpdateRequest } from "@bitwarden/common/billing/models/request/expanded-tax-info-update.request";
|
||||
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 { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service";
|
||||
import { ProviderKey } from "@bitwarden/common/types/key";
|
||||
@@ -41,10 +39,6 @@ export class SetupComponent implements OnInit, OnDestroy {
|
||||
|
||||
private destroy$ = new Subject<void>();
|
||||
|
||||
requireProviderPaymentMethodDuringSetup$ = this.configService.getFeatureFlag$(
|
||||
FeatureFlag.PM19956_RequireProviderPaymentMethodDuringSetup,
|
||||
);
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private i18nService: I18nService,
|
||||
@@ -52,7 +46,6 @@ export class SetupComponent implements OnInit, OnDestroy {
|
||||
private keyService: KeyService,
|
||||
private syncService: SyncService,
|
||||
private validationService: ValidationService,
|
||||
private configService: ConfigService,
|
||||
private providerApiService: ProviderApiServiceAbstraction,
|
||||
private formBuilder: FormBuilder,
|
||||
private toastService: ToastService,
|
||||
@@ -117,15 +110,9 @@ export class SetupComponent implements OnInit, OnDestroy {
|
||||
|
||||
submit = async () => {
|
||||
try {
|
||||
const requireProviderPaymentMethodDuringSetup = await firstValueFrom(
|
||||
this.requireProviderPaymentMethodDuringSetup$,
|
||||
);
|
||||
|
||||
this.formGroup.markAllAsTouched();
|
||||
|
||||
const paymentValid = requireProviderPaymentMethodDuringSetup
|
||||
? this.paymentComponent.validate()
|
||||
: true;
|
||||
const paymentValid = this.paymentComponent.validate();
|
||||
const taxInformationValid = this.taxInformationComponent.validate();
|
||||
|
||||
if (!paymentValid || !taxInformationValid || !this.formGroup.valid) {
|
||||
@@ -152,9 +139,7 @@ export class SetupComponent implements OnInit, OnDestroy {
|
||||
request.taxInfo.city = taxInformation.city;
|
||||
request.taxInfo.state = taxInformation.state;
|
||||
|
||||
if (requireProviderPaymentMethodDuringSetup) {
|
||||
request.paymentSource = await this.paymentComponent.tokenize();
|
||||
}
|
||||
request.paymentSource = await this.paymentComponent.tokenize();
|
||||
|
||||
const provider = await this.providerApiService.postProviderSetup(this.providerId, request);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user