Commit d009009cdf7f07c0cc47a32a3ecd57be29788d49

Authored by Igor Kulikov
1 parent b36e8a1b

Improve entity select component.

... ... @@ -32,9 +32,11 @@ export default function EntitySelect($compile, $templateCache, entityService) {
32 32
33 33 var entityTypes = entityService.prepareAllowedEntityTypesList(scope.allowedEntityTypes, scope.useAliasEntityTypes);
34 34
35   - if (entityTypes.length === 1) {
  35 + var entityTypeKeys = Object.keys(entityTypes);
  36 +
  37 + if (entityTypeKeys.length === 1) {
36 38 scope.displayEntityTypeSelect = false;
37   - scope.defaultEntityType = entityTypes[0];
  39 + scope.defaultEntityType = entityTypes[entityTypeKeys[0]];
38 40 } else {
39 41 scope.displayEntityTypeSelect = true;
40 42 }
... ...