Browse Source

Merge pull request #15427 from mtsymbarov-del/fix/relation-filed-size

Adjusted size of entity type select to fit error message
pull/15452/head
Vladyslav Prykhodko 6 months ago
committed by GitHub
parent
commit
3eef5e50f6
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      ui-ngx/src/app/shared/components/entity/entity-list-select.component.html
  2. 5
      ui-ngx/src/app/shared/components/entity/entity-type-select.component.html
  3. 5
      ui-ngx/src/app/shared/components/entity/entity-type-select.component.ts

1
ui-ngx/src/app/shared/components/entity/entity-list-select.component.html

@ -23,6 +23,7 @@
*ngIf="displayEntityTypeSelect" *ngIf="displayEntityTypeSelect"
[showLabel]="true" [showLabel]="true"
[required]="required" [required]="required"
subscriptSizing="dynamic"
[useAliasEntityTypes]="useAliasEntityTypes" [useAliasEntityTypes]="useAliasEntityTypes"
[allowedEntityTypes]="allowedEntityTypes" [allowedEntityTypes]="allowedEntityTypes"
[filterAllowedEntityTypes]="filterAllowedEntityTypes" [filterAllowedEntityTypes]="filterAllowedEntityTypes"

5
ui-ngx/src/app/shared/components/entity/entity-type-select.component.html

@ -16,7 +16,7 @@
--> -->
<mat-form-field [formGroup]="entityTypeFormGroup" <mat-form-field [formGroup]="entityTypeFormGroup"
[subscriptSizing]="inlineField ? 'dynamic' : 'fixed'" [subscriptSizing]="inlineField ? 'dynamic' : subscriptSizing"
[appearance]="inlineField ? 'outline' : appearance"> [appearance]="inlineField ? 'outline' : appearance">
<mat-label *ngIf="showLabel && !inlineField">{{ label }}</mat-label> <mat-label *ngIf="showLabel && !inlineField">{{ label }}</mat-label>
<mat-select [required]="required" formControlName="entityType"> <mat-select [required]="required" formControlName="entityType">
@ -24,6 +24,9 @@
{{ displayEntityTypeFn(type) }} {{ displayEntityTypeFn(type) }}
</mat-option> </mat-option>
</mat-select> </mat-select>
@if (!inlineField && subscriptSizing === 'dynamic') {
<mat-hint></mat-hint>
}
<mat-error *ngIf="!inlineField && entityTypeFormGroup.get('entityType').hasError('required')"> <mat-error *ngIf="!inlineField && entityTypeFormGroup.get('entityType').hasError('required')">
{{ 'entity.type-required' | translate }} {{ 'entity.type-required' | translate }}
</mat-error> </mat-error>

5
ui-ngx/src/app/shared/components/entity/entity-type-select.component.ts

@ -21,7 +21,7 @@ import { AliasEntityType, EntityType, entityTypeTranslations } from '@app/shared
import { EntityService } from '@core/http/entity.service'; import { EntityService } from '@core/http/entity.service';
import { coerceBoolean } from '@shared/decorators/coercion'; import { coerceBoolean } from '@shared/decorators/coercion';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { MatFormFieldAppearance } from '@angular/material/form-field'; import { MatFormFieldAppearance, SubscriptSizing } from '@angular/material/form-field';
@Component({ @Component({
selector: 'tb-entity-type-select', selector: 'tb-entity-type-select',
@ -69,6 +69,9 @@ export class EntityTypeSelectComponent implements ControlValueAccessor, OnInit,
@Input() @Input()
appearance: MatFormFieldAppearance = 'fill'; appearance: MatFormFieldAppearance = 'fill';
@Input()
subscriptSizing: SubscriptSizing = 'fixed';
@Input() @Input()
@coerceBoolean() @coerceBoolean()
inlineField: boolean; inlineField: boolean;

Loading…
Cancel
Save