Browse Source

UI: Fixed show label in select cf entity

pull/14694/head
Vladyslav_Prykhodko 9 months ago
parent
commit
9823c78076
  1. 1
      ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rule-dialog.component.html
  2. 1
      ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rules.component.html
  3. 1
      ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.html
  4. 1
      ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.html
  5. 1
      ui-ngx/src/app/shared/components/entity/entity-select.component.html
  6. 3
      ui-ngx/src/app/shared/components/entity/entity-select.component.ts
  7. 10
      ui-ngx/src/app/shared/components/entity/entity-type-select.component.ts

1
ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rule-dialog.component.html

@ -61,6 +61,7 @@
<tb-entity-select formControlName="entityId"
appearance="outline"
required
entityTypeLabel="{{ 'entity.entity-type' | translate }}"
[filterAllowedEntityTypes]="false"
[allowedEntityTypes]="alarmRuleEntityTypeList"
[defaultEntityType]="EntityType.DEVICE_PROFILE"

1
ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rules.component.html

@ -66,6 +66,7 @@
<tb-entity-select formControlName="entityId"
appearance="outline"
required
entityTypeLabel="{{ 'entity.entity-type' | translate }}"
[filterAllowedEntityTypes]="false"
[allowedEntityTypes]="calculatedFieldsEntityTypeList"
(entityChanged)="changeEntity($event)">

1
ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.html

@ -66,6 +66,7 @@
<tb-entity-select formControlName="entityId"
appearance="outline"
required
entityTypeLabel="{{ 'entity.entity-type' | translate }}"
[filterAllowedEntityTypes]="false"
[allowedEntityTypes]="calculatedFieldsEntityTypeList"
(entityChanged)="changeEntity($event)">

1
ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.html

@ -59,6 +59,7 @@
<tb-entity-select formControlName="entityId"
appearance="outline"
required
entityTypeLabel="{{ 'entity.entity-type' | translate }}"
[filterAllowedEntityTypes]="false"
[allowedEntityTypes]="calculatedFieldsEntityTypeList"
[defaultEntityType]="EntityType.DEVICE_PROFILE"

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

@ -19,6 +19,7 @@
<tb-entity-type-select
*ngIf="displayEntityTypeSelect"
class="flex-1"
[label]="entityTypeLabel ?? null"
[appearance]="appearance"
[showLabel]="true"
[required]="required"

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

@ -73,6 +73,9 @@ export class EntitySelectComponent implements ControlValueAccessor, OnInit {
@Input()
defaultEntityType: AliasEntityType | EntityType;
@Input()
entityTypeLabel: string;
@Output()
entityChanged = new EventEmitter<BaseData<EntityId>>();

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

@ -52,8 +52,16 @@ export class EntityTypeSelectComponent implements ControlValueAccessor, OnInit,
@coerceBoolean()
showLabel: boolean;
private labelValue = this.translate.instant('entity.type');
get label(): string {
return this.labelValue;
}
@Input()
label = this.translate.instant('entity.type');
set label(value: string) {
this.labelValue = value ?? this.translate.instant('entity.type');
}
@Input()
@coerceBoolean()

Loading…
Cancel
Save