From 5e80ab63b0e096ea52bdc145af031fc0cad86bb9 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 30 Sep 2021 15:19:58 +0200 Subject: [PATCH] Governance Bugs Fixed --- .../UI/Function-Libraries/ClaimsProgram.js | 4 ++++ .../UI/Spaces/User-Profile-Space/UserProfile.js | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Projects/Governance/UI/Function-Libraries/ClaimsProgram.js b/Projects/Governance/UI/Function-Libraries/ClaimsProgram.js index c0b331f38..a5d9c34e8 100644 --- a/Projects/Governance/UI/Function-Libraries/ClaimsProgram.js +++ b/Projects/Governance/UI/Function-Libraries/ClaimsProgram.js @@ -188,10 +188,12 @@ function newGovernanceFunctionLibraryClaimsProgram() { node.payload.votingProgram.votes > 0 && node.payload.referenceParent !== undefined && node.payload.referenceParent.payload !== undefined && + node.payload.referenceParent.payload.votingProgram !== undefined && node.payload.referenceParent.payload.votingProgram.votes !== undefined && node.payload.referenceParent.payload.votingProgram.votes > 0 && node.payload.referenceParent.payload.weight !== undefined && node.payload.referenceParent.payload.weight > 0 && + node.payload.referenceParent.payload.claimsProgram !== undefined && node.payload.referenceParent.payload.claimsProgram.count !== undefined && node.payload.referenceParent.payload.claimsProgram.votes !== undefined ) { @@ -262,10 +264,12 @@ function newGovernanceFunctionLibraryClaimsProgram() { node.payload.votingProgram.votes > 0 && node.payload.referenceParent !== undefined && node.payload.referenceParent.payload !== undefined && + node.payload.referenceParent.payload.votingProgram !== undefined && node.payload.referenceParent.payload.votingProgram.votes !== undefined && node.payload.referenceParent.payload.votingProgram.votes > 0 && node.payload.referenceParent.payload.weight !== undefined && node.payload.referenceParent.payload.weight > 0 && + node.payload.referenceParent.payload.claimsProgram !== undefined && node.payload.referenceParent.payload.claimsProgram.count !== undefined && node.payload.referenceParent.payload.claimsProgram.votes !== undefined ) { diff --git a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js index 296f32f61..a40745969 100644 --- a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js +++ b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js @@ -43,16 +43,18 @@ function newGovernanceUserProfileSpace() { thisObject.container.initialize(MODULE_NAME) thisObject.container.isDraggeable = false - let userProfiles = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('User Profile') /* - We are going to collapse all User Profiles to save processing resources at the UI + We are going to collapse all User rootNodes 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() + let rootNodes = UI.projects.foundations.spaces.designSpace.workspace.workspaceNode.rootNodes + + for (let i = 0; i < rootNodes.length; i++) { + let rootNode = rootNodes[i] + if (rootNode.payload.floatingObject.isCollapsed !== true) { + rootNode.payload.floatingObject.collapseToggle() } } + let userProfiles = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('User Profile') /* Here we will change the Y position of all profiles so that they are all at the same level. */