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