Merge pull request #11650 from rusikv/bug/country-autocomplete

Fixed country autocomplete blocking tenant creation
This commit is contained in:
Igor Kulikov 2024-09-20 16:11:45 +03:00 committed by GitHub
commit 831c1514e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View File

@ -20,27 +20,30 @@
formControlName="country" formControlName="country"
(selectCountryCode)="changeCountry($event)"> (selectCountryCode)="changeCountry($event)">
</tb-country-autocomplete> </tb-country-autocomplete>
<div fxLayout.gt-sm="row" fxLayoutGap.gt-sm="10px"> <div class="tb-form-row column-xs tb-standard-fields no-border no-padding">
<mat-form-field class="mat-block"> <mat-form-field class="flex" subscriptSizing="dynamic">
<mat-label translate>contact.city</mat-label> <mat-label translate>contact.city</mat-label>
<input matInput formControlName="city"> <input matInput formControlName="city">
<mat-error *ngIf="parentForm.get('city').hasError('maxlength')"> <mat-error *ngIf="parentForm.get('city').hasError('maxlength')">
{{ 'contact.city-max-length' | translate }} {{ 'contact.city-max-length' | translate }}
</mat-error> </mat-error>
<mat-hint></mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field class="mat-block"> <mat-form-field class="flex" subscriptSizing="dynamic">
<mat-label translate>contact.state</mat-label> <mat-label translate>contact.state</mat-label>
<input matInput formControlName="state"> <input matInput formControlName="state">
<mat-error *ngIf="parentForm.get('state').hasError('maxlength')"> <mat-error *ngIf="parentForm.get('state').hasError('maxlength')">
{{ 'contact.state-max-length' | translate }} {{ 'contact.state-max-length' | translate }}
</mat-error> </mat-error>
<mat-hint></mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field class="mat-block"> <mat-form-field class="flex" subscriptSizing="dynamic">
<mat-label translate>contact.postal-code</mat-label> <mat-label translate>contact.postal-code</mat-label>
<input matInput formControlName="zip"> <input matInput formControlName="zip">
<mat-error *ngIf="parentForm.get('zip').hasError('pattern')"> <mat-error *ngIf="parentForm.get('zip').hasError('pattern')">
{{ 'contact.postal-code-invalid' | translate }} {{ 'contact.postal-code-invalid' | translate }}
</mat-error> </mat-error>
<mat-hint></mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
<mat-form-field class="mat-block"> <mat-form-field class="mat-block">

View File

@ -200,7 +200,7 @@ export class CountryAutocompleteComponent implements OnInit, ControlValueAccesso
private updateView(value: Country | null) { private updateView(value: Country | null) {
if (this.modelValue?.name !== value?.name) { if (this.modelValue?.name !== value?.name) {
this.modelValue = value; this.modelValue = value;
this.propagateChange(this.modelValue); this.propagateChange(this.modelValue?.name);
if (value) { if (value) {
this.selectCountryCode.emit(value.iso2); this.selectCountryCode.emit(value.iso2);
} }