1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

[PM-15402] Remove TaxInfoComponent from trial-initiation.module.ts (#12996)

This commit is contained in:
Jonas Hendrickx
2025-02-13 10:23:38 +01:00
committed by GitHub
parent f827b9702c
commit 7984bb329f
5 changed files with 20 additions and 17 deletions

View File

@@ -50,7 +50,9 @@
<div class="tw-mb-4"> <div class="tw-mb-4">
<h2 class="tw-mb-3 tw-text-base tw-font-semibold">{{ "paymentType" | i18n }}</h2> <h2 class="tw-mb-3 tw-text-base tw-font-semibold">{{ "paymentType" | i18n }}</h2>
<app-payment [showAccountCredit]="false"></app-payment> <app-payment [showAccountCredit]="false"></app-payment>
<app-tax-info [trialFlow]="true" (countryChanged)="changedCountry()"></app-tax-info> <app-manage-tax-information
(taxInformationChanged)="changedCountry()"
></app-manage-tax-information>
</div> </div>
<div class="tw-flex tw-space-x-2"> <div class="tw-flex tw-space-x-2">
<button type="submit" buttonType="primary" bitButton [loading]="form.loading"> <button type="submit" buttonType="primary" bitButton [loading]="form.loading">

View File

@@ -3,6 +3,7 @@
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from "@angular/core"; import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from "@angular/core";
import { FormBuilder, Validators } from "@angular/forms"; import { FormBuilder, Validators } from "@angular/forms";
import { ManageTaxInformationComponent } from "@bitwarden/angular/billing/components";
import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { ApiService } from "@bitwarden/common/abstractions/api.service";
import { import {
BillingInformation, BillingInformation,
@@ -17,7 +18,7 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { ToastService } from "@bitwarden/components"; import { ToastService } from "@bitwarden/components";
import { BillingSharedModule, TaxInfoComponent } from "../../shared"; import { BillingSharedModule } from "../../shared";
import { PaymentComponent } from "../../shared/payment/payment.component"; import { PaymentComponent } from "../../shared/payment/payment.component";
export type TrialOrganizationType = Exclude<ProductTierType, ProductTierType.Free>; export type TrialOrganizationType = Exclude<ProductTierType, ProductTierType.Free>;
@@ -51,7 +52,7 @@ export enum SubscriptionProduct {
}) })
export class TrialBillingStepComponent implements OnInit { export class TrialBillingStepComponent implements OnInit {
@ViewChild(PaymentComponent) paymentComponent: PaymentComponent; @ViewChild(PaymentComponent) paymentComponent: PaymentComponent;
@ViewChild(TaxInfoComponent) taxInfoComponent: TaxInfoComponent; @ViewChild(ManageTaxInformationComponent) taxInfoComponent: ManageTaxInformationComponent;
@Input() organizationInfo: OrganizationInfo; @Input() organizationInfo: OrganizationInfo;
@Input() subscriptionProduct: SubscriptionProduct = SubscriptionProduct.PasswordManager; @Input() subscriptionProduct: SubscriptionProduct = SubscriptionProduct.PasswordManager;
@Output() steppedBack = new EventEmitter(); @Output() steppedBack = new EventEmitter();
@@ -89,8 +90,7 @@ export class TrialBillingStepComponent implements OnInit {
} }
async submit(): Promise<void> { async submit(): Promise<void> {
if (!this.taxInfoComponent.taxFormGroup.valid && this.taxInfoComponent?.taxFormGroup.touched) { if (!this.taxInfoComponent.validate()) {
this.taxInfoComponent.taxFormGroup.markAllAsTouched();
return; return;
} }
@@ -115,7 +115,8 @@ export class TrialBillingStepComponent implements OnInit {
} }
protected changedCountry() { protected changedCountry() {
this.paymentComponent.showBankAccount = this.taxInfoComponent.country === "US"; this.paymentComponent.showBankAccount =
this.taxInfoComponent.getTaxInformation().country === "US";
if ( if (
!this.paymentComponent.showBankAccount && !this.paymentComponent.showBankAccount &&
this.paymentComponent.selected === PaymentMethodType.BankAccount this.paymentComponent.selected === PaymentMethodType.BankAccount
@@ -210,13 +211,13 @@ export class TrialBillingStepComponent implements OnInit {
private getBillingInformationFromTaxInfoComponent(): BillingInformation { private getBillingInformationFromTaxInfoComponent(): BillingInformation {
return { return {
postalCode: this.taxInfoComponent.taxFormGroup?.value.postalCode, postalCode: this.taxInfoComponent.getTaxInformation()?.postalCode,
country: this.taxInfoComponent.taxFormGroup?.value.country, country: this.taxInfoComponent.getTaxInformation()?.country,
taxId: this.taxInfoComponent.taxFormGroup?.value.taxId, taxId: this.taxInfoComponent.getTaxInformation()?.taxId,
addressLine1: this.taxInfoComponent.taxFormGroup?.value.line1, addressLine1: this.taxInfoComponent.getTaxInformation()?.line1,
addressLine2: this.taxInfoComponent.taxFormGroup?.value.line2, addressLine2: this.taxInfoComponent.getTaxInformation()?.line2,
city: this.taxInfoComponent.taxFormGroup?.value.city, city: this.taxInfoComponent.getTaxInformation()?.city,
state: this.taxInfoComponent.taxFormGroup?.value.state, state: this.taxInfoComponent.getTaxInformation()?.state,
}; };
} }

View File

@@ -15,6 +15,9 @@ import { LogService } from "@bitwarden/common/platform/abstractions/log.service"
import { SharedModule } from "../../shared"; import { SharedModule } from "../../shared";
/**
* @deprecated Use `ManageTaxInformationComponent` instead.
*/
@Component({ @Component({
selector: "app-tax-info", selector: "app-tax-info",
templateUrl: "tax-info.component.html", templateUrl: "tax-info.component.html",

View File

@@ -6,7 +6,6 @@ import { InputPasswordComponent } from "@bitwarden/auth/angular";
import { FormFieldModule } from "@bitwarden/components"; import { FormFieldModule } from "@bitwarden/components";
import { OrganizationCreateModule } from "../../admin-console/organizations/create/organization-create.module"; import { OrganizationCreateModule } from "../../admin-console/organizations/create/organization-create.module";
import { TaxInfoComponent } from "../../billing";
import { TrialBillingStepComponent } from "../../billing/accounts/trial-initiation/trial-billing-step.component"; import { TrialBillingStepComponent } from "../../billing/accounts/trial-initiation/trial-billing-step.component";
import { SecretsManagerTrialFreeStepperComponent } from "../../billing/trial-initiation/secrets-manager/secrets-manager-trial-free-stepper.component"; import { SecretsManagerTrialFreeStepperComponent } from "../../billing/trial-initiation/secrets-manager/secrets-manager-trial-free-stepper.component";
import { SecretsManagerTrialPaidStepperComponent } from "../../billing/trial-initiation/secrets-manager/secrets-manager-trial-paid-stepper.component"; import { SecretsManagerTrialPaidStepperComponent } from "../../billing/trial-initiation/secrets-manager/secrets-manager-trial-paid-stepper.component";
@@ -48,7 +47,6 @@ import { VerticalStepperModule } from "./vertical-stepper/vertical-stepper.modul
FormFieldModule, FormFieldModule,
OrganizationCreateModule, OrganizationCreateModule,
EnvironmentSelectorModule, EnvironmentSelectorModule,
TaxInfoComponent,
TrialBillingStepComponent, TrialBillingStepComponent,
InputPasswordComponent, InputPasswordComponent,
], ],

View File

@@ -6,7 +6,7 @@ import { FormsModule } from "@angular/forms";
import { JslibModule } from "@bitwarden/angular/jslib.module"; import { JslibModule } from "@bitwarden/angular/jslib.module";
import { SearchModule } from "@bitwarden/components"; import { SearchModule } from "@bitwarden/components";
import { DangerZoneComponent } from "@bitwarden/web-vault/app/auth/settings/account/danger-zone.component"; import { DangerZoneComponent } from "@bitwarden/web-vault/app/auth/settings/account/danger-zone.component";
import { OrganizationPlansComponent, TaxInfoComponent } from "@bitwarden/web-vault/app/billing"; import { OrganizationPlansComponent } from "@bitwarden/web-vault/app/billing";
import { OssModule } from "@bitwarden/web-vault/app/oss.module"; import { OssModule } from "@bitwarden/web-vault/app/oss.module";
import { import {
@@ -47,7 +47,6 @@ import { VerifyRecoverDeleteProviderComponent } from "./verify-recover-delete-pr
OrganizationPlansComponent, OrganizationPlansComponent,
SearchModule, SearchModule,
ProvidersLayoutComponent, ProvidersLayoutComponent,
TaxInfoComponent,
DangerZoneComponent, DangerZoneComponent,
ScrollingModule, ScrollingModule,
], ],