rename callback

This commit is contained in:
Jonas Hendrickx 2024-11-26 15:52:57 +01:00
parent d2425ae5fa
commit 44c3bed329
8 changed files with 16 additions and 16 deletions

View File

@ -58,7 +58,7 @@
*ngIf="deprecateStripeSourcesAPI"
[showAccountCredit]="false"
></app-payment-v2>
<app-tax-info [trialFlow]="true" (onCountryChanged)="changedCountry()"></app-tax-info>
<app-tax-info [trialFlow]="true" (countryChanged)="changedCountry()"></app-tax-info>
</div>
<div class="tw-flex tw-space-x-2">
<button type="submit" buttonType="primary" bitButton [loading]="form.loading">

View File

@ -131,7 +131,7 @@
<bit-section>
<h3 bitTypography="h2">{{ "paymentInformation" | i18n }}</h3>
<app-payment-v2 [showBankAccount]="false"></app-payment-v2>
<app-tax-info (onTaxInformationChanged)="onTaxInformationChanged()"></app-tax-info>
<app-tax-info (taxInformationChanged)="onTaxInformationChanged()"></app-tax-info>
<div class="tw-mb-4">
<div class="tw-text-muted tw-text-sm tw-flex tw-flex-col">
<span>{{ "planPrice" | i18n }}: {{ subtotal | currency: "USD $" }}</span>

View File

@ -122,7 +122,7 @@
<bit-section>
<h3 bitTypography="h2">{{ "paymentInformation" | i18n }}</h3>
<app-payment [hideBank]="true"></app-payment>
<app-tax-info (onTaxInformationChanged)="onTaxInformationChanged()" />
<app-tax-info (taxInformationChanged)="onTaxInformationChanged()" />
<div id="price" class="tw-my-4">
<div class="tw-text-muted tw-text-sm">
{{ "planPrice" | i18n }}: {{ subtotal | currency: "USD $" }}

View File

@ -361,8 +361,8 @@
</app-payment-v2>
<app-tax-info
*ngIf="showPayment || upgradeRequiresPaymentMethod || isPaymentSourceEmpty()"
(onCountryChanged)="changedCountry()"
(onTaxInformationChanged)="onTaxInformationChanged()"
(countryChanged)="changedCountry()"
(taxInformationChanged)="onTaxInformationChanged()"
></app-tax-info>
<div id="price" class="tw-mt-4">
<p class="tw-text-lg tw-mb-1">

View File

@ -441,8 +441,8 @@
*ngIf="deprecateStripeSourcesAPI && (createOrganization || upgradeRequiresPaymentMethod)"
></app-payment-v2>
<app-tax-info
(onCountryChanged)="changedCountry()"
(onTaxInformationChanged)="onTaxInformationChanged()"
(countryChanged)="changedCountry()"
(taxInformationChanged)="onTaxInformationChanged()"
class="tw-my-4"
/>
<div id="price" class="tw-my-4">

View File

@ -5,7 +5,7 @@
[showBankAccount]="!!organizationId"
[initialPaymentMethod]="initialPaymentMethod"
></app-payment-v2>
<app-tax-info (onCountryChanged)="onCountryChanged()"></app-tax-info>
<app-tax-info (countryChanged)="onCountryChanged()"></app-tax-info>
</ng-container>
<ng-container bitDialogFooter>
<button type="submit" bitButton bitFormButton buttonType="primary" [bitAction]="submit">

View File

@ -5,7 +5,7 @@
>
<ng-container bitDialogContent>
<app-payment [hideBank]="!organizationId" [hideCredit]="true"></app-payment>
<app-tax-info (onCountryChanged)="changeCountry()"></app-tax-info>
<app-tax-info (countryChanged)="changeCountry()"></app-tax-info>
</ng-container>
<ng-container bitDialogFooter>
<button type="submit" bitButton bitFormButton buttonType="primary">

View File

@ -24,8 +24,8 @@ export class TaxInfoComponent implements OnInit, OnDestroy {
private destroy$ = new Subject<void>();
@Input() trialFlow = false;
@Output() onCountryChanged = new EventEmitter();
@Output() onTaxInformationChanged: EventEmitter<void> = new EventEmitter<void>();
@Output() countryChanged = new EventEmitter();
@Output() taxInformationChanged: EventEmitter<void> = new EventEmitter<void>();
taxFormGroup = new FormGroup({
country: new FormControl<string>(null, [Validators.required]),
@ -121,7 +121,7 @@ export class TaxInfoComponent implements OnInit, OnDestroy {
this.taxFormGroup.controls.country.value,
);
this.onCountryChanged.emit();
this.countryChanged.emit();
});
this.taxFormGroup.controls.country.valueChanges
@ -144,21 +144,21 @@ export class TaxInfoComponent implements OnInit, OnDestroy {
this.taxFormGroup.controls.state.setValue(null);
}
this.onCountryChanged.emit();
this.countryChanged.emit();
});
this.onTaxInformationChanged.emit();
this.taxInformationChanged.emit();
});
this.taxFormGroup.controls.postalCode.valueChanges
.pipe(debounceTime(1000), takeUntil(this.destroy$))
.subscribe(() => {
this.onTaxInformationChanged.emit();
this.taxInformationChanged.emit();
});
this.taxFormGroup.controls.taxId.valueChanges
.pipe(debounceTime(1000), takeUntil(this.destroy$))
.subscribe(() => {
this.onTaxInformationChanged.emit();
this.taxInformationChanged.emit();
});
this.loading = false;