Commit 3165ba0105e630cf9b0e4c1d083f664fb9daf5eb

Authored by Igor Kulikov
1 parent af77d577

UI: Minor changes

... ... @@ -50,7 +50,7 @@
50 50 </mat-error>
51 51 </mat-form-field>
52 52 <tb-entity-autocomplete
53   - label="device-profile.default-rule-chain"
  53 + labelText="device-profile.default-rule-chain"
54 54 [entityType]="entityType.RULE_CHAIN"
55 55 formControlName="defaultRuleChainId">
56 56 </tb-entity-autocomplete>
... ...
... ... @@ -77,6 +77,12 @@ export class EntityAutocompleteComponent implements ControlValueAccessor, OnInit
77 77 @Input()
78 78 excludeEntityIds: Array<string>;
79 79
  80 + @Input()
  81 + labelText: string;
  82 +
  83 + @Input()
  84 + requiredText: string;
  85 +
80 86 private requiredValue: boolean;
81 87 get required(): boolean {
82 88 return this.requiredValue;
... ... @@ -89,21 +95,6 @@ export class EntityAutocompleteComponent implements ControlValueAccessor, OnInit
89 95 @Input()
90 96 disabled: boolean;
91 97
92   - labelValue: string;
93   -
94   - @Input()
95   - set label(label: string) {
96   - this.labelValue = label;
97   - this.entityText = label;
98   - }
99   -
100   - requiredTextValue: string;
101   -
102   - @Input()
103   - set requiredText(requiredText: string) {
104   - this.requiredTextValue = requiredText;
105   - }
106   -
107 98 @ViewChild('entityInput', {static: true}) entityInput: ElementRef;
108 99
109 100 entityText: string;
... ... @@ -227,13 +218,12 @@ export class EntityAutocompleteComponent implements ControlValueAccessor, OnInit
227 218 break;
228 219 }
229 220 }
230   - if (this.labelValue) {
231   - this.entityText = this.labelValue;
  221 + if (this.labelText && this.labelText.length) {
  222 + this.entityText = this.labelText;
232 223 }
233   - if (this.requiredTextValue) {
234   - this.entityRequiredText = this.requiredTextValue;
  224 + if (this.requiredText && this.requiredText.length) {
  225 + this.entityRequiredText = this.requiredText;
235 226 }
236   -
237 227 const currentEntity = this.getCurrentEntity();
238 228 if (currentEntity) {
239 229 const currentEntityType = currentEntity.id.entityType;
... ...