From f5e626242fbee3ef9b07cd74d52c90e6758d1d15 Mon Sep 17 00:00:00 2001 From: "david.watkins@db.com" Date: Fri, 18 Aug 2023 14:05:27 +0100 Subject: [PATCH] Adding child elements to a diagram uses the display default position #CTCTOWALTZ-2831 #6711 --- .../main/java/org/finos/waltz/data/data_type/DataTypeDao.java | 1 + .../java/org/finos/waltz/data/measurable/MeasurableDao.java | 1 + .../src/main/java/org/finos/waltz/data/person/PersonDao.java | 4 ++-- .../entity-overlay-diagrams/builder/diagram-builder-store.js | 2 +- .../java/org/finos/waltz/service/person/PersonService.java | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/waltz-data/src/main/java/org/finos/waltz/data/data_type/DataTypeDao.java b/waltz-data/src/main/java/org/finos/waltz/data/data_type/DataTypeDao.java index 3379f633b4..a1ae3cc995 100644 --- a/waltz-data/src/main/java/org/finos/waltz/data/data_type/DataTypeDao.java +++ b/waltz-data/src/main/java/org/finos/waltz/data/data_type/DataTypeDao.java @@ -156,6 +156,7 @@ public Collection findByParentId(long id) { .selectDistinct(DATA_TYPE.fields()) .from(DATA_TYPE) .where(DATA_TYPE.PARENT_ID.eq(id)) + .orderBy(DATA_TYPE.NAME) .fetchSet(TO_DOMAIN); } } diff --git a/waltz-data/src/main/java/org/finos/waltz/data/measurable/MeasurableDao.java b/waltz-data/src/main/java/org/finos/waltz/data/measurable/MeasurableDao.java index 722d3e62f5..063151f353 100644 --- a/waltz-data/src/main/java/org/finos/waltz/data/measurable/MeasurableDao.java +++ b/waltz-data/src/main/java/org/finos/waltz/data/measurable/MeasurableDao.java @@ -280,6 +280,7 @@ public List findByParentId(Long parentId) { .from(MEASURABLE) .where(MEASURABLE.PARENT_ID.eq(parentId)) .and(MEASURABLE.ENTITY_LIFECYCLE_STATUS.eq(EntityLifecycleStatus.ACTIVE.name())) + .orderBy(MEASURABLE.POSITION, MEASURABLE.NAME) .fetch(TO_DOMAIN_MAPPER); } diff --git a/waltz-data/src/main/java/org/finos/waltz/data/person/PersonDao.java b/waltz-data/src/main/java/org/finos/waltz/data/person/PersonDao.java index a2da651568..a53d42b422 100644 --- a/waltz-data/src/main/java/org/finos/waltz/data/person/PersonDao.java +++ b/waltz-data/src/main/java/org/finos/waltz/data/person/PersonDao.java @@ -260,7 +260,7 @@ public Set findActivePeopleByUserRole(String role) { } - public Set findDirectsForPersonIds(List personIds) { + public List findDirectsForPersonIds(List personIds) { Condition cond = PERSON.MANAGER_EMPLOYEE_ID.in(DSL .select(PERSON.EMPLOYEE_ID) .from(PERSON) @@ -274,6 +274,6 @@ public Set findDirectsForPersonIds(List personIds) { .orderBy(PERSON.DISPLAY_NAME); return qry - .fetchSet(personMapper); + .fetch(personMapper); } } diff --git a/waltz-ng/client/entity-diagrams/components/entity-overlay-diagrams/builder/diagram-builder-store.js b/waltz-ng/client/entity-diagrams/components/entity-overlay-diagrams/builder/diagram-builder-store.js index a6fa017381..bf38fd7636 100644 --- a/waltz-ng/client/entity-diagrams/components/entity-overlay-diagrams/builder/diagram-builder-store.js +++ b/waltz-ng/client/entity-diagrams/components/entity-overlay-diagrams/builder/diagram-builder-store.js @@ -8,7 +8,7 @@ export const DiagramModes = { } export function createInitialGroup() { - return mkGroup("Diagram Title", generateUUID(), null, 1); + return mkGroup("Initial Group", generateUUID(), null, 1); } export let movingGroup = writable(null); diff --git a/waltz-service/src/main/java/org/finos/waltz/service/person/PersonService.java b/waltz-service/src/main/java/org/finos/waltz/service/person/PersonService.java index 4d386e6cec..6182044abf 100644 --- a/waltz-service/src/main/java/org/finos/waltz/service/person/PersonService.java +++ b/waltz-service/src/main/java/org/finos/waltz/service/person/PersonService.java @@ -74,9 +74,9 @@ public List findDirectsByEmployeeId(String employeeId) { } - public Set findDirectsForPersonIds(List personIds) { + public List findDirectsForPersonIds(List personIds) { if (CollectionUtilities.isEmpty(personIds)) { - return Collections.emptySet(); + return Collections.emptyList(); } return time("PS.findDirectsByPersonIds", () -> personDao.findDirectsForPersonIds(personIds)); }