From 72bf5129a89c511d23f55927600b4e40904daf62 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 28 Aug 2021 19:04:09 +0200 Subject: [PATCH 1/2] User Profiles auto ordered. --- .../Spaces/User-Profile-Space/UserProfile.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js index 18b2be814..cc7abf935 100644 --- a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js +++ b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js @@ -41,6 +41,30 @@ function newGovernanceUserProfileSpace() { /* We are going to collapse all User Profiles to save processing resources at the UI */ + for (let i = 0; i < userProfiles.length; i++) { + let userProfile = userProfiles[i] + if (userProfile.payload.floatingObject.isCollapsed !== true) { + userProfile.payload.floatingObject.collapseToggle() + } + } + /* + Here we will change the Y position of all profiles so that they are all at the same level. + */ + let spaceWitdh = UI.projects.foundations.spaces.floatingSpace.container.frame.width + const X_STEP = spaceWitdh / (userProfiles.length + 1) + const Y_LEVEL = userProfiles[0].payload.floatingObject.container.frame.position.y + let xOffset = X_STEP + let yOffset = 2000 + + for (let i = 0; i < userProfiles.length; i++) { + userProfiles[i].payload.floatingObject.container.frame.position.x = xOffset + xOffset = xOffset + X_STEP + } + for (let i = 1; i < userProfiles.length; i++) { + userProfiles[i].payload.floatingObject.container.frame.position.y = Y_LEVEL + yOffset + yOffset = -yOffset + } + for (let i = 0; i < userProfiles.length; i++) { let userProfile = userProfiles[i] if (userProfile.payload.floatingObject.isCollapsed !== true) { From 31a8a5c473ca469453ae9a0812bb32fd310c4be9 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 28 Aug 2021 19:12:06 +0200 Subject: [PATCH 2/2] Goverannce System auto positioning of Profiles --- .../Spaces/User-Profile-Space/UserProfile.js | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js index cc7abf935..871916170 100644 --- a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js +++ b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js @@ -52,17 +52,36 @@ function newGovernanceUserProfileSpace() { */ let spaceWitdh = UI.projects.foundations.spaces.floatingSpace.container.frame.width const X_STEP = spaceWitdh / (userProfiles.length + 1) + const Y_STEP = 3000 + const Y_LEVEL = userProfiles[0].payload.floatingObject.container.frame.position.y let xOffset = X_STEP - let yOffset = 2000 - + let yOffset = 0 + for (let i = 0; i < userProfiles.length; i++) { - userProfiles[i].payload.floatingObject.container.frame.position.x = xOffset + userProfiles[i].payload.floatingObject.container.frame.position.x = xOffset xOffset = xOffset + X_STEP } for (let i = 1; i < userProfiles.length; i++) { + switch (true) { + case (yOffset === 0): { + yOffset = Y_STEP + break + } + case (yOffset === Y_STEP): { + yOffset = 1 + break + } + case (yOffset === 1): { + yOffset = -Y_STEP + break + } + case (yOffset === -Y_STEP): { + yOffset = 0 + break + } + } userProfiles[i].payload.floatingObject.container.frame.position.y = Y_LEVEL + yOffset - yOffset = -yOffset } for (let i = 0; i < userProfiles.length; i++) {