Browse Source

UI: Refactoring

pull/8965/head
Artem Dzhereleiko 3 years ago
parent
commit
3f963107da
  1. 15
      ui-ngx/src/app/shared/components/entity/entity-select.component.ts

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

@ -121,10 +121,17 @@ export class EntitySelectComponent implements ControlValueAccessor, OnInit, Afte
}
writeValue(value: EntityId | null): void {
this.modelValue = {
entityType: value?.entityType ? value.entityType : this.defaultEntityType,
id: value?.id ? value.id : null
};
if (value != null) {
this.modelValue = {
entityType: value.entityType,
id: value.id !== NULL_UUID ? value.id : null
};
} else {
this.modelValue = {
entityType: value?.entityType ? value.entityType : this.defaultEntityType,
id: null
};
}
this.entitySelectFormGroup.get('entityType').patchValue(this.modelValue.entityType, {emitEvent: false});
this.entitySelectFormGroup.get('entityId').patchValue(this.modelValue.id, {emitEvent: false});
}

Loading…
Cancel
Save