Commit da4a2d9d559bef24de53c04b23da82b7c2008bac

Authored by Igor Kulikov
1 parent 5e3572e5

UI: Blur multiple input widget on submit. Fix datasource single entity resolution.

... ... @@ -367,6 +367,9 @@ export class MultipleInputWidgetComponent extends PageComponent implements OnIni
367 367 }
368 368
369 369 public save(dataToSave?: MultipleInputWidgetSource) {
  370 + if (document && document.activeElement) {
  371 + (document.activeElement as HTMLElement).blur();
  372 + }
370 373 const config: RequestConfig = {
371 374 ignoreLoading: !this.settings.showActionButtons
372 375 };
... ...
... ... @@ -615,7 +615,12 @@ export function entityDataToEntityInfo(entityData: EntityData): EntityInfo {
615 615 }
616 616
617 617 export function updateDatasourceFromEntityInfo(datasource: Datasource, entity: EntityInfo, createFilter = false) {
618   - datasource.entity = {};
  618 + datasource.entity = {
  619 + id: {
  620 + entityType: entity.entityType,
  621 + id: entity.id
  622 + }
  623 + };
619 624 datasource.entityId = entity.id;
620 625 datasource.entityType = entity.entityType;
621 626 if (datasource.type === DatasourceType.entity) {
... ... @@ -623,6 +628,8 @@ export function updateDatasourceFromEntityInfo(datasource: Datasource, entity: E
623 628 datasource.entityLabel = entity.label;
624 629 datasource.name = entity.name;
625 630 datasource.entityDescription = entity.entityDescription;
  631 + datasource.entity.label = entity.label;
  632 + datasource.entity.name = entity.name;
626 633 if (createFilter) {
627 634 datasource.entityFilter = {
628 635 type: AliasFilterType.singleEntity,
... ...