From 4fd57ad93c207cb808097cffa342762b963be24b Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 2 Sep 2021 18:15:51 +0200 Subject: [PATCH] Governance Bug Fixed: Flashing status and values --- .../UI/Function-Libraries/AirdropProgram.js | 23 ++++++++--- .../UI/Function-Libraries/Assets.js | 15 +++++-- .../UI/Function-Libraries/ClaimsProgram.js | 22 ++++++---- .../Function-Libraries/DelegationProgram.js | 25 ++++++++---- .../UI/Function-Libraries/GithubProgram.js | 23 ++++++++--- .../UI/Function-Libraries/PluginsFunctions.js | 25 +++++++++--- .../Function-Libraries/ProfileConstructor.js | 40 +++++++++++++++---- .../UI/Function-Libraries/StakingProgram.js | 18 ++++++--- .../UI/Function-Libraries/TokenMining.js | 4 +- .../UI/Function-Libraries/TokenPower.js | 23 ++++++++--- .../UI/Function-Libraries/Tokens.js | 4 +- .../UI/Function-Libraries/VotingProgram.js | 30 +++++++++----- Projects/Governance/UI/Globals/Designer.js | 11 +++++ .../Spaces/User-Profile-Space/UserProfile.js | 18 +++++++-- .../Governance/UI/Utilities/BonusProgram.js | 14 +++++-- .../UI/Utilities/DecendentProgram.js | 36 ++++++++++++----- .../Governance/UI/Utilities/Validations.js | 5 ++- Projects/ProjectsSchema.json | 5 +++ 18 files changed, 256 insertions(+), 85 deletions(-) create mode 100644 Projects/Governance/UI/Globals/Designer.js diff --git a/Projects/Governance/UI/Function-Libraries/AirdropProgram.js b/Projects/Governance/UI/Function-Libraries/AirdropProgram.js index ec5bb3a57..8b36e5fb7 100644 --- a/Projects/Governance/UI/Function-Libraries/AirdropProgram.js +++ b/Projects/Governance/UI/Function-Libraries/AirdropProgram.js @@ -106,8 +106,13 @@ function newGovernanceFunctionLibraryAirdropProgram() { userProfile.payload.blockchainTokens === undefined ) { node.payload.airdropProgram.isActive = false - userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.") + userProfile.payload.uiObject.setErrorMessage( + "Airdrop Program: You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return + } else { + userProfile.payload.uiObject.resetErrorMessage() } /* Next thing to do is to validate if the airdrop user profile has a star at the Superalgos repository. @@ -117,7 +122,10 @@ function newGovernanceFunctionLibraryAirdropProgram() { profileSignature === undefined ) { node.payload.airdropProgram.isActive = false - userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, and produce a signature of your Airdrop Username.") + userProfile.payload.uiObject.setErrorMessage( + "You need to setup this profile with the Profile Constructor, and produce a signature of your Airdrop Username.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } @@ -154,7 +162,10 @@ function newGovernanceFunctionLibraryAirdropProgram() { if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 } if (programNode.tokensAwarded === undefined || programNode.tokensAwarded.payload === undefined) { - programNode.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.") + programNode.payload.uiObject.setErrorMessage( + "Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } programNode.payload.airdropProgram.awarded.tokens = programNode.payload.airdropProgram.ownPower / totalPowerRewardRatio @@ -170,7 +181,7 @@ function newGovernanceFunctionLibraryAirdropProgram() { node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = false - node.payload.uiObject.setStatus(ownPowerText + ' Airdrop Power') + node.payload.uiObject.setStatus(ownPowerText + ' Airdrop Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) { @@ -180,12 +191,12 @@ function newGovernanceFunctionLibraryAirdropProgram() { node.tokensAwarded.payload.uiObject.valueAngleOffset = 0 node.tokensAwarded.payload.uiObject.valueAtAngle = false - node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC) + node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC, UI.projects.governance.globals.designer.SET_VALUE_COUNTER) node.tokensAwarded.payload.uiObject.statusAngleOffset = 0 node.tokensAwarded.payload.uiObject.statusAtAngle = false - node.tokensAwarded.payload.uiObject.setStatus('For creating your Superalgos profile!') + node.tokensAwarded.payload.uiObject.setStatus('For creating your Superalgos profile!', UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } } } diff --git a/Projects/Governance/UI/Function-Libraries/Assets.js b/Projects/Governance/UI/Function-Libraries/Assets.js index 64be554bf..d9e629570 100644 --- a/Projects/Governance/UI/Function-Libraries/Assets.js +++ b/Projects/Governance/UI/Function-Libraries/Assets.js @@ -12,10 +12,16 @@ function newGovernanceFunctionLibraryAssets() { let folderPath = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload, 'folderPath') if (folderPath === undefined || folderPath === "") { - node.payload.uiObject.setErrorMessage("folderPath Config Property undefined.") + node.payload.uiObject.setErrorMessage( + "folderPath Config Property undefined.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } - node.payload.uiObject.setInfoMessage("Hold on while we install all the assets inside the this path: " + folderPath + ". This might take a minute or two.") + node.payload.uiObject.setInfoMessage( + "Hold on while we install all the assets inside the this path: " + folderPath + ". This might take a minute or two.", + UI.projects.governance.globals.designer.SET_INFO_COUNTER_FACTOR + ) httpRequest(undefined, 'DirContent' + '/' + folderPath, onResponse) function onResponse(err, data) { @@ -32,7 +38,10 @@ function newGovernanceFunctionLibraryAssets() { totalAssets++ createNodesFromPath(node, foldersArray) } - node.payload.uiObject.setInfoMessage("A total of : " + totalAssets + " assets have been installed.") + node.payload.uiObject.setInfoMessage( + "A total of : " + totalAssets + " assets have been installed.", + UI.projects.governance.globals.designer.SET_INFO_COUNTER_FACTOR + ) } function removeFirstFromArray(array) { diff --git a/Projects/Governance/UI/Function-Libraries/ClaimsProgram.js b/Projects/Governance/UI/Function-Libraries/ClaimsProgram.js index eb70f7fba..6ec856aa8 100644 --- a/Projects/Governance/UI/Function-Libraries/ClaimsProgram.js +++ b/Projects/Governance/UI/Function-Libraries/ClaimsProgram.js @@ -350,7 +350,10 @@ function newGovernanceFunctionLibraryClaimsProgram() { } } if (totalPercentage > 100) { - node.payload.uiObject.setErrorMessage('Claim Power Switching Error. Total Percentage of children nodes is grater that 100.') + node.payload.uiObject.setErrorMessage( + 'Claim Power Switching Error. Total Percentage of children nodes is grater that 100.', + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } let defaultPercentage = 0 @@ -446,7 +449,7 @@ function newGovernanceFunctionLibraryClaimsProgram() { 'Shared Between: ' + node.payload.claimsProgram.share.count + ' claims' + ' - ' + 'Share of Claims: ' + node.payload.claimsProgram.share.percentage.toFixed(2) + '%' - node.payload.uiObject.setStatus(status) + node.payload.uiObject.setStatus(status, UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } function drawProgram(node) { @@ -457,7 +460,7 @@ function newGovernanceFunctionLibraryClaimsProgram() { node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = false - node.payload.uiObject.setStatus(ownPowerText + ' Claim Power') + node.payload.uiObject.setStatus(ownPowerText + ' Claim Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } } @@ -472,8 +475,8 @@ function newGovernanceFunctionLibraryClaimsProgram() { node.tokensAwarded.payload.uiObject.statusAngleOffset = 0 node.tokensAwarded.payload.uiObject.statusAtAngle = true - node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC) - node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload.claimsProgram.count + ' Claims.') + node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC, UI.projects.governance.globals.designer.SET_VALUE_COUNTER) + node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload.claimsProgram.count + ' Claims.', UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } } @@ -489,7 +492,9 @@ function newGovernanceFunctionLibraryClaimsProgram() { node.payload.uiObject.setValue(programPowerText) if (percentage !== undefined) { - node.payload.uiObject.setPercentage(percentage.toFixed(2)) + node.payload.uiObject.setPercentage(percentage.toFixed(2), + UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER + ) } } } @@ -498,7 +503,10 @@ function newGovernanceFunctionLibraryClaimsProgram() { function installMissingClaims(node, rootNodes) { if (node.payload === undefined) { return } if (node.payload.referenceParent === undefined) { - node.payload.uiObject.setErrorMessage('To Install Missing Claims you need a Reference Parent') + node.payload.uiObject.setErrorMessage( + 'To Install Missing Claims you need a Reference Parent', + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } scanNodeBranch(node, node.payload.referenceParent) diff --git a/Projects/Governance/UI/Function-Libraries/DelegationProgram.js b/Projects/Governance/UI/Function-Libraries/DelegationProgram.js index 764efd923..b429ed4a0 100644 --- a/Projects/Governance/UI/Function-Libraries/DelegationProgram.js +++ b/Projects/Governance/UI/Function-Libraries/DelegationProgram.js @@ -211,7 +211,10 @@ function newGovernanceFunctionLibraryDelegationProgram() { } } if (totalPercentage > 100) { - node.payload.uiObject.setErrorMessage('Delegate Power Switching Error. Total Percentage of children nodes is grater that 100.') + node.payload.uiObject.setErrorMessage( + 'Delegate Power Switching Error. Total Percentage of children nodes is grater that 100.', + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } let defaultPercentage = 0 @@ -278,7 +281,9 @@ function newGovernanceFunctionLibraryDelegationProgram() { drawProgram(node) if (percentage !== undefined) { - node.payload.uiObject.setPercentage(percentage.toFixed(2)) + node.payload.uiObject.setPercentage(percentage.toFixed(2), + UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER + ) } return } @@ -294,10 +299,12 @@ function newGovernanceFunctionLibraryDelegationProgram() { let powerType = 'Delegate Power' const programPowerText = parseFloat(programPower.toFixed(0)).toLocaleString('en') + ' ' + powerType - node.payload.uiObject.setValue(programPowerText) + node.payload.uiObject.setValue(programPowerText, UI.projects.governance.globals.designer.SET_VALUE_COUNTER) if (percentage !== undefined) { - node.payload.uiObject.setPercentage(percentage.toFixed(2)) + node.payload.uiObject.setPercentage(percentage.toFixed(2), + UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER + ) } } } @@ -310,18 +317,20 @@ function newGovernanceFunctionLibraryDelegationProgram() { node.payload.uiObject.valueAngleOffset = 180 node.payload.uiObject.valueAtAngle = true - node.payload.uiObject.setValue(outgoingPowerText + ' Delegate Power') + node.payload.uiObject.setValue(outgoingPowerText + ' Delegate Power', UI.projects.governance.globals.designer.SET_VALUE_COUNTER) node.payload.uiObject.percentageAngleOffset = 180 node.payload.uiObject.percentageAtAngle = true - node.payload.uiObject.setPercentage(percentage) + node.payload.uiObject.setPercentage(percentage, + UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER + ) if (node.payload.referenceParent !== undefined) { node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = true - node.payload.uiObject.setStatus(outgoingPowerText + ' ' + ' Outgoing Power') + node.payload.uiObject.setStatus(outgoingPowerText + ' ' + ' Outgoing Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } } } @@ -334,7 +343,7 @@ function newGovernanceFunctionLibraryDelegationProgram() { node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = false - node.payload.uiObject.setStatus(ownPowerText + ' Delegate Power') + node.payload.uiObject.setStatus(ownPowerText + ' Delegate Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } } } diff --git a/Projects/Governance/UI/Function-Libraries/GithubProgram.js b/Projects/Governance/UI/Function-Libraries/GithubProgram.js index 30b919aa0..92711ecd4 100644 --- a/Projects/Governance/UI/Function-Libraries/GithubProgram.js +++ b/Projects/Governance/UI/Function-Libraries/GithubProgram.js @@ -106,8 +106,13 @@ function newGovernanceFunctionLibraryGithubProgram() { userProfile.payload.blockchainTokens === undefined ) { node.payload.githubProgram.isActive = false - userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.") + userProfile.payload.uiObject.setErrorMessage( + "Github Program: You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return + } else { + userProfile.payload.uiObject.resetErrorMessage() } /* Next thing to do is to validate if the github user profile has a star at the Superalgos repository. @@ -117,7 +122,10 @@ function newGovernanceFunctionLibraryGithubProgram() { profileSignature === undefined ) { node.payload.githubProgram.isActive = false - userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, and produce a signature of your Github Username.") + userProfile.payload.uiObject.setErrorMessage( + "You need to setup this profile with the Profile Constructor, and produce a signature of your Github Username.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } let githubUsername = profileSignature.message @@ -168,7 +176,10 @@ function newGovernanceFunctionLibraryGithubProgram() { if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 } if (programNode.tokensAwarded === undefined || programNode.tokensAwarded.payload === undefined) { - programNode.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.") + programNode.payload.uiObject.setErrorMessage( + "Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } const MAX_ENGAGEMENT = 3 @@ -185,7 +196,7 @@ function newGovernanceFunctionLibraryGithubProgram() { node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = false - node.payload.uiObject.setStatus(ownPowerText + ' Github Power') + node.payload.uiObject.setStatus(ownPowerText + ' Github Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) { @@ -195,7 +206,7 @@ function newGovernanceFunctionLibraryGithubProgram() { node.tokensAwarded.payload.uiObject.valueAngleOffset = 0 node.tokensAwarded.payload.uiObject.valueAtAngle = false - node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC) + node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC, UI.projects.governance.globals.designer.SET_VALUE_COUNTER) node.tokensAwarded.payload.uiObject.statusAngleOffset = 0 node.tokensAwarded.payload.uiObject.statusAtAngle = false @@ -211,7 +222,7 @@ function newGovernanceFunctionLibraryGithubProgram() { extraText = extraText + ' + 1 Fork' } - node.tokensAwarded.payload.uiObject.setStatus('From' + extraText) + node.tokensAwarded.payload.uiObject.setStatus('From' + extraText, UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } } } diff --git a/Projects/Governance/UI/Function-Libraries/PluginsFunctions.js b/Projects/Governance/UI/Function-Libraries/PluginsFunctions.js index c31b3a2b7..e8a4a29e5 100644 --- a/Projects/Governance/UI/Function-Libraries/PluginsFunctions.js +++ b/Projects/Governance/UI/Function-Libraries/PluginsFunctions.js @@ -12,7 +12,10 @@ function newGovernanceFunctionLibraryPluginsFunctions() { let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node) if (projectName === "" || projectName === undefined) { if (node.payload.parentNode !== undefined) { - node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.") + node.payload.parentNode.payload.uiObject.setErrorMessage( + "Config codeName must have the name of the project.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } } @@ -28,7 +31,10 @@ function newGovernanceFunctionLibraryPluginsFunctions() { let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node) if (projectName === "" || projectName === undefined) { if (node.payload.parentNode !== undefined) { - node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.") + node.payload.parentNode.payload.uiObject.setErrorMessage( + "Config codeName must have the name of the project.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } } @@ -44,7 +50,10 @@ function newGovernanceFunctionLibraryPluginsFunctions() { let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node) if (projectName === "" || projectName === undefined) { if (node.payload.parentNode !== undefined) { - node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.") + node.payload.parentNode.payload.uiObject.setErrorMessage( + "Config codeName must have the name of the project.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } } @@ -60,7 +69,10 @@ function newGovernanceFunctionLibraryPluginsFunctions() { let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node) if (projectName === "" || projectName === undefined) { if (node.payload.parentNode !== undefined) { - node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.") + node.payload.parentNode.payload.uiObject.setErrorMessage( + "Config codeName must have the name of the project.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } } @@ -76,7 +88,10 @@ function newGovernanceFunctionLibraryPluginsFunctions() { let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node) if (projectName === "" || projectName === undefined) { if (node.payload.parentNode !== undefined) { - node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.") + node.payload.parentNode.payload.uiObject.setErrorMessage( + "Config codeName must have the name of the project.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } } diff --git a/Projects/Governance/UI/Function-Libraries/ProfileConstructor.js b/Projects/Governance/UI/Function-Libraries/ProfileConstructor.js index 54eb74f35..eb09d4f6f 100644 --- a/Projects/Governance/UI/Function-Libraries/ProfileConstructor.js +++ b/Projects/Governance/UI/Function-Libraries/ProfileConstructor.js @@ -16,7 +16,10 @@ function newGovernanceFunctionLibraryProfileConstructor() { let mnemonic = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload, 'mnemonic') if (githubUsername === undefined || githubUsername === "") { - node.payload.uiObject.setErrorMessage("githubUsername config property missing.") + node.payload.uiObject.setErrorMessage( + "githubUsername config property missing.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } @@ -48,7 +51,10 @@ function newGovernanceFunctionLibraryProfileConstructor() { function onResponse(err, data) { /* Lets check the result of the call through the http interface */ if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) { - node.payload.uiObject.setErrorMessage('Call via HTTP Interface failed.') + node.payload.uiObject.setErrorMessage( + 'Call via HTTP Interface failed.', + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } @@ -58,11 +64,17 @@ function newGovernanceFunctionLibraryProfileConstructor() { if (response.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) { if (mnemonic === undefined || mnemonic === "") { - node.payload.uiObject.setErrorMessage('Call to WEB3 Server failed. ' + response.error) + node.payload.uiObject.setErrorMessage( + 'Call to WEB3 Server failed. ' + response.error, + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) console.log('Call to WEB3 Server failed. ' + response.error) return } else { - node.payload.uiObject.setErrorMessage('Call to WEB3 Server failed. Most likely the Mnemonic provided is not correct or you need to run node setup because a dependency is missing. ' + response.error) + node.payload.uiObject.setErrorMessage( + 'Call to WEB3 Server failed. Most likely the Mnemonic provided is not correct or you need to run node setup because a dependency is missing. ' + response.error, + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) console.log('Call to WEB3 Server failed. Most likely the Mnemonic provided is not correct or you need to run node setup because a dependency is missing. ' + response.error) return } @@ -88,7 +100,10 @@ function newGovernanceFunctionLibraryProfileConstructor() { function onResponse(err, data) { /* Lets check the result of the call through the http interface */ if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) { - node.payload.uiObject.setErrorMessage('Call via HTTP Interface failed.') + node.payload.uiObject.setErrorMessage( + 'Call via HTTP Interface failed.', + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } @@ -96,7 +111,10 @@ function newGovernanceFunctionLibraryProfileConstructor() { /* Lets check the result of the method call */ if (response.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) { - node.payload.uiObject.setErrorMessage('Call to WEB3 Server failed. ' + response.error) + node.payload.uiObject.setErrorMessage( + 'Call to WEB3 Server failed. ' + response.error, + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) console.log('Call to WEB3 Server failed. ' + response.error) return } @@ -124,9 +142,15 @@ function newGovernanceFunctionLibraryProfileConstructor() { Show nice message. */ if (mnemonic === undefined || mnemonic === "") { - node.payload.uiObject.setInfoMessage("Profile Private Key has been successfully created. User Profile installed as a plugin and saved. Use the Private Key at a crypto wallet and delete this node once done.", 10000) + node.payload.uiObject.setInfoMessage( + "Profile Private Key has been successfully created. User Profile installed as a plugin and saved. Use the Private Key at a crypto wallet and delete this node once done.", + UI.projects.governance.globals.designer.SET_INFO_COUNTER_FACTOR + ) } else { - node.payload.uiObject.setInfoMessage("Mnemonic successfully imported. User Profile installed as a plugin and saved. Your external wallet was sucessfully linked to your profile.", 10000) + node.payload.uiObject.setInfoMessage( + "Mnemonic successfully imported. User Profile installed as a plugin and saved. Your external wallet was sucessfully linked to your profile.", + UI.projects.governance.globals.designer.SET_INFO_COUNTER_FACTOR + ) } } } diff --git a/Projects/Governance/UI/Function-Libraries/StakingProgram.js b/Projects/Governance/UI/Function-Libraries/StakingProgram.js index 46c3f8338..4e8b94db5 100644 --- a/Projects/Governance/UI/Function-Libraries/StakingProgram.js +++ b/Projects/Governance/UI/Function-Libraries/StakingProgram.js @@ -106,10 +106,15 @@ function newGovernanceFunctionLibraryStakingProgram() { userProfile.payload.blockchainTokens === undefined ) { node.payload.stakingProgram.isActive = false - userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.") + userProfile.payload.uiObject.setErrorMessage( + "Staking Program: You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return + } else { + userProfile.payload.uiObject.resetErrorMessage() + node.payload.stakingProgram.isActive = true } - node.payload.stakingProgram.isActive = true } function distributeProgram(programNode) { @@ -142,7 +147,10 @@ function newGovernanceFunctionLibraryStakingProgram() { if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 } if (programNode.tokensAwarded === undefined || programNode.tokensAwarded.payload === undefined) { - programNode.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.") + programNode.payload.uiObject.setErrorMessage( + "Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } programNode.payload.stakingProgram.awarded.tokens = programNode.payload.stakingProgram.ownPower / totalPowerRewardRatio @@ -158,7 +166,7 @@ function newGovernanceFunctionLibraryStakingProgram() { node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = false - node.payload.uiObject.setStatus(ownPowerText + ' Staking Power') + node.payload.uiObject.setStatus(ownPowerText + ' Staking Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) { @@ -168,7 +176,7 @@ function newGovernanceFunctionLibraryStakingProgram() { node.tokensAwarded.payload.uiObject.valueAngleOffset = 0 node.tokensAwarded.payload.uiObject.valueAtAngle = false - node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC) + node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC, UI.projects.governance.globals.designer.SET_VALUE_COUNTER) } } } diff --git a/Projects/Governance/UI/Function-Libraries/TokenMining.js b/Projects/Governance/UI/Function-Libraries/TokenMining.js index 7db6b6595..68abe13c7 100644 --- a/Projects/Governance/UI/Function-Libraries/TokenMining.js +++ b/Projects/Governance/UI/Function-Libraries/TokenMining.js @@ -174,8 +174,8 @@ function newGovernanceFunctionLibraryTokenMining() { userProfile.tokensMined.payload.uiObject.valueAngleOffset = 0 userProfile.tokensMined.payload.uiObject.valueAtAngle = true - userProfile.tokensMined.payload.uiObject.setStatus(awarded + ' Awarded + ' + bonus + ' Bonus') - userProfile.tokensMined.payload.uiObject.setValue(total + ' SA Tokens' + tokensAwardedBTC) + userProfile.tokensMined.payload.uiObject.setStatus(awarded + ' Awarded + ' + bonus + ' Bonus', UI.projects.governance.globals.designer.SET_STATUS_COUNTER) + userProfile.tokensMined.payload.uiObject.setValue(total + ' SA Tokens' + tokensAwardedBTC, UI.projects.governance.globals.designer.SET_VALUE_COUNTER) } } } \ No newline at end of file diff --git a/Projects/Governance/UI/Function-Libraries/TokenPower.js b/Projects/Governance/UI/Function-Libraries/TokenPower.js index 7e38746ad..d588bc777 100644 --- a/Projects/Governance/UI/Function-Libraries/TokenPower.js +++ b/Projects/Governance/UI/Function-Libraries/TokenPower.js @@ -96,7 +96,10 @@ function newGovernanceFunctionLibraryTokenPower() { Before we start we will do some validations: */ if (userProfile.tokenPowerSwitch === undefined) { - userProfile.payload.uiObject.setErrorMessage("You need to have a Token Power Switch child node.") + userProfile.payload.uiObject.setErrorMessage( + "You need to have a Token Power Switch child node.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } distributeTokenPower( @@ -119,7 +122,10 @@ function newGovernanceFunctionLibraryTokenPower() { Before we start we will do some validations: */ if (userProfile.tokenPowerSwitch === undefined) { - userProfile.payload.uiObject.setErrorMessage("You need to have a Token Power Switch child node.") + userProfile.payload.uiObject.setErrorMessage( + "You need to have a Token Power Switch child node.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } distributeTokenPower( @@ -213,7 +219,10 @@ function newGovernanceFunctionLibraryTokenPower() { } } if (totalPercentage > 100) { - node.payload.uiObject.setErrorMessage('Token Power Switching Error. Total Percentage of children nodes is grater that 100.') + node.payload.uiObject.setErrorMessage( + 'Token Power Switching Error. Total Percentage of children nodes is grater that 100.', + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } let defaultPercentage = 0 @@ -287,7 +296,7 @@ function newGovernanceFunctionLibraryTokenPower() { node.payload.uiObject.valueAngleOffset = 0 node.payload.uiObject.valueAtAngle = false - node.payload.uiObject.setStatus(ownPowerText + ' + ' + incomingPowerText) + node.payload.uiObject.setStatus(ownPowerText + ' + ' + incomingPowerText, UI.projects.governance.globals.designer.SET_STATUS_COUNTER) return } @@ -297,12 +306,14 @@ function newGovernanceFunctionLibraryTokenPower() { node.payload.uiObject.valueAngleOffset = 180 node.payload.uiObject.valueAtAngle = true - node.payload.uiObject.setValue(tokenPowerText) + node.payload.uiObject.setValue(tokenPowerText, UI.projects.governance.globals.designer.SET_VALUE_COUNTER) if (percentage !== undefined) { node.payload.uiObject.percentageAngleOffset = 180 node.payload.uiObject.percentageAtAngle = true - node.payload.uiObject.setPercentage(percentage.toFixed(2)) + node.payload.uiObject.setPercentage(percentage.toFixed(2), + UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER + ) } } } diff --git a/Projects/Governance/UI/Function-Libraries/Tokens.js b/Projects/Governance/UI/Function-Libraries/Tokens.js index 4d30f56b0..2810130be 100644 --- a/Projects/Governance/UI/Function-Libraries/Tokens.js +++ b/Projects/Governance/UI/Function-Libraries/Tokens.js @@ -173,7 +173,7 @@ function newGovernanceFunctionLibraryTokens() { node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = true - node.payload.uiObject.setStatus(status) + node.payload.uiObject.setStatus(status, UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } else { status = 'Reward: ' + tokens.toLocaleString('en') + ' ' + 'SA' + ' ≃ ' + UI.projects.governance.utilities.conversions.estimateSATokensInBTC(tokens | 0) + ' BTC ' @@ -181,7 +181,7 @@ function newGovernanceFunctionLibraryTokens() { node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = false - node.payload.uiObject.setStatus(status) + node.payload.uiObject.setStatus(status, UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } } } \ No newline at end of file diff --git a/Projects/Governance/UI/Function-Libraries/VotingProgram.js b/Projects/Governance/UI/Function-Libraries/VotingProgram.js index e69bbe127..1ab72bf36 100644 --- a/Projects/Governance/UI/Function-Libraries/VotingProgram.js +++ b/Projects/Governance/UI/Function-Libraries/VotingProgram.js @@ -334,7 +334,10 @@ function newGovernanceFunctionLibraryVotingProgram() { } } if (totalPercentage > 100) { - node.payload.uiObject.setErrorMessage('Voting Power Switching Error. Total Percentage of children nodes is grater that 100.') + node.payload.uiObject.setErrorMessage( + 'Voting Power Switching Error. Total Percentage of children nodes is grater that 100.', + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } let defaultPercentage = 0 @@ -406,7 +409,9 @@ function newGovernanceFunctionLibraryVotingProgram() { drawProgram(node, userProfile) if (percentage !== undefined) { - node.payload.uiObject.setPercentage(percentage.toFixed(2)) + node.payload.uiObject.setPercentage(percentage.toFixed(2), + UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER + ) } return } @@ -457,10 +462,12 @@ function newGovernanceFunctionLibraryVotingProgram() { node.payload.uiObject.valueAngleOffset = 0 node.payload.uiObject.valueAtAngle = true - node.payload.uiObject.setValue(votesText) + node.payload.uiObject.setValue(votesText, UI.projects.governance.globals.designer.SET_VALUE_COUNTER) if (percentage !== undefined) { - node.payload.uiObject.setPercentage(percentage.toFixed(2)) + node.payload.uiObject.setPercentage(percentage.toFixed(2), + UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER + ) } } @@ -472,18 +479,20 @@ function newGovernanceFunctionLibraryVotingProgram() { node.payload.uiObject.valueAngleOffset = 180 node.payload.uiObject.valueAtAngle = true - node.payload.uiObject.setValue(outgoingPowerText + ' Voting Power') + node.payload.uiObject.setValue(outgoingPowerText + ' Voting Power', UI.projects.governance.globals.designer.SET_VALUE_COUNTER) node.payload.uiObject.percentageAngleOffset = 180 node.payload.uiObject.percentageAtAngle = true - node.payload.uiObject.setPercentage(percentage) + node.payload.uiObject.setPercentage(percentage, + UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER + ) if (node.payload.referenceParent !== undefined) { node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = true - node.payload.uiObject.setStatus(outgoingPowerText + ' ' + ' Outgoing Power') + node.payload.uiObject.setStatus(outgoingPowerText + ' ' + ' Outgoing Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } } } @@ -502,7 +511,7 @@ function newGovernanceFunctionLibraryVotingProgram() { node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = false - node.payload.uiObject.setStatus(ownPowerText + ' Own Power' + ' + ' + incomingPowerText + ' Incoming Voting Power' + ' + ' + reputationPowerText + ' Reputation Power') + node.payload.uiObject.setStatus(ownPowerText + ' Own Power' + ' + ' + incomingPowerText + ' Incoming Voting Power' + ' + ' + reputationPowerText + ' Reputation Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } } } @@ -510,7 +519,10 @@ function newGovernanceFunctionLibraryVotingProgram() { function installMissingVotes(node, rootNodes) { if (node.payload === undefined) { return } if (node.payload.referenceParent === undefined) { - node.payload.uiObject.setErrorMessage('To install votes you need a Reference Parent') + node.payload.uiObject.setErrorMessage( + 'To install votes you need a Reference Parent', + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } scanNodeBranch(node, node.payload.referenceParent) diff --git a/Projects/Governance/UI/Globals/Designer.js b/Projects/Governance/UI/Globals/Designer.js new file mode 100644 index 000000000..9be7ea241 --- /dev/null +++ b/Projects/Governance/UI/Globals/Designer.js @@ -0,0 +1,11 @@ +function newGovernanceGlobalsDesigner() { + let thisObject = { + SET_VALUE_COUNTER: 1000, + SET_STATUS_COUNTER: 1000, + SET_ERROR_COUNTER_FACTOR: 10, + SET_INFO_COUNTER_FACTOR: 10, + SET_WARNING_COUNTER: 1000, + SET_PERCENTAGE_COUNTER: 1000 + } + return thisObject +} \ No newline at end of file diff --git a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js index 8aa24af72..d37d0f684 100644 --- a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js +++ b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js @@ -365,7 +365,10 @@ function newGovernanceUserProfileSpace() { function onResponse(err, data) { /* Lets check the result of the call through the http interface */ if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) { - userProfile.payload.uiObject.setErrorMessage('Call via HTTP Interface failed.') + userProfile.payload.uiObject.setErrorMessage( + 'Call via HTTP Interface failed.', + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } @@ -373,7 +376,10 @@ function newGovernanceUserProfileSpace() { /* Lets check the result of the method call */ if (response.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) { - userProfile.payload.uiObject.setErrorMessage('Call to WEB3 Server failed. ' + response.error) + userProfile.payload.uiObject.setErrorMessage( + 'Call to WEB3 Server failed. ' + response.error, + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) console.log('Call to WEB3 Server failed. ' + response.error) return } @@ -403,7 +409,9 @@ function newGovernanceUserProfileSpace() { if (data.result === "Max rate limit reached, please use API Key for higher rate limit") { userProfile.payload.blockchainTokens = undefined // This enables this profile to query the blockchain again. } else { - userProfile.payload.uiObject.setInfoMessage(data) + userProfile.payload.uiObject.setInfoMessage(data, + UI.projects.governance.globals.designer.SET_INFO_COUNTER_FACTOR + ) userProfile.payload.blockchainTokens = Number(data.result) / 1000000000000000000 userProfile.payload.reputation = Math.min(reputationByAddress.get(blockchainAccount.toLowerCase()) | 0, userProfile.payload.blockchainTokens) } @@ -412,7 +420,9 @@ function newGovernanceUserProfileSpace() { const message = err.message + ' - ' + 'Can not access BSC SCAN servers.' console.log(message) if (userProfile.payload !== undefined) { - userProfile.payload.uiObject.setErrorMessage(message, 1000) + userProfile.payload.uiObject.setErrorMessage(message, + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) } waitingForResponses-- }); diff --git a/Projects/Governance/UI/Utilities/BonusProgram.js b/Projects/Governance/UI/Utilities/BonusProgram.js index e89450c32..97c3c3659 100644 --- a/Projects/Governance/UI/Utilities/BonusProgram.js +++ b/Projects/Governance/UI/Utilities/BonusProgram.js @@ -101,8 +101,13 @@ function newGovernanceUtilitiesBonusProgram() { userProfile.payload.blockchainTokens === undefined ) { node.payload[programPropertyName].isActive = false - userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.") + userProfile.payload.uiObject.setErrorMessage( + "Bonus Program: You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return + } else { + userProfile.payload.uiObject.resetErrorMessage() } } @@ -135,7 +140,10 @@ function newGovernanceUtilitiesBonusProgram() { if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 } if (programNode.tokensBonus === undefined || programNode.tokensBonus.payload === undefined) { - programNode.payload.uiObject.setErrorMessage("Tokens Bonus Node is needed in order for this Program to get Tokens from the Bonus Program Pool.") + programNode.payload.uiObject.setErrorMessage( + "Tokens Bonus Node is needed in order for this Program to get Tokens from the Bonus Program Pool.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } programNode.payload[programPropertyName].bonus.tokens = programNode.payload[programPropertyName].bonusPower / totalPowerRewardRatio @@ -152,7 +160,7 @@ function newGovernanceUtilitiesBonusProgram() { node.tokensBonus.payload.uiObject.valueAngleOffset = 0 node.tokensBonus.payload.uiObject.valueAtAngle = true - node.tokensBonus.payload.uiObject.setValue(tokensBonusText + ' SA Tokens' + tokensAwardedBTC) + node.tokensBonus.payload.uiObject.setValue(tokensBonusText + ' SA Tokens' + tokensAwardedBTC, UI.projects.governance.globals.designer.SET_VALUE_COUNTER) } } } diff --git a/Projects/Governance/UI/Utilities/DecendentProgram.js b/Projects/Governance/UI/Utilities/DecendentProgram.js index b38ce2397..7b0b57a30 100644 --- a/Projects/Governance/UI/Utilities/DecendentProgram.js +++ b/Projects/Governance/UI/Utilities/DecendentProgram.js @@ -168,8 +168,13 @@ function newGovernanceUtilitiesDecendentProgram() { userProfile.payload.blockchainTokens === undefined ) { node.payload[programPropertyName].isActive = false - userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.") + userProfile.payload.uiObject.setErrorMessage( + "Decendent Program: You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return + } else { + userProfile.payload.uiObject.resetErrorMessage() } /* As per the system rules, the Program will not give tokens @@ -182,7 +187,10 @@ function newGovernanceUtilitiesDecendentProgram() { (node[usersArrayPropertyName] === undefined || hasUsersDefined(node[usersArrayPropertyName]) === false) ) { node.payload[programPropertyName].isActive = false - node.payload.uiObject.setErrorMessage("In order to enable this program you need to add " + userNodeType + " nodes and reference a User Profile from each one.") + node.payload.uiObject.setErrorMessage( + "In order to enable this program you need to add " + userNodeType + " nodes and reference a User Profile from each one.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) } else { node.payload[programPropertyName].isActive = true } @@ -282,7 +290,10 @@ function newGovernanceUtilitiesDecendentProgram() { } } if (totalPercentage > 100) { - node.payload.uiObject.setErrorMessage('Program Power Switching Error. Total Percentage of children nodes is grater that 100.') + node.payload.uiObject.setErrorMessage( + 'Program Power Switching Error. Total Percentage of children nodes is grater that 100.', + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } let defaultPercentage = 0 @@ -371,7 +382,10 @@ function newGovernanceUtilitiesDecendentProgram() { if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 } if (programNode.tokensAwarded === undefined || programNode.tokensAwarded.payload === undefined) { - programNode.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.") + programNode.payload.uiObject.setErrorMessage( + "Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.", + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } programNode.payload[programPropertyName].awarded.tokens = programNode.payload[programPropertyName].incomingPower / totalPowerRewardRatio @@ -387,17 +401,19 @@ function newGovernanceUtilitiesDecendentProgram() { node.payload.uiObject.valueAngleOffset = 180 node.payload.uiObject.valueAtAngle = true - node.payload.uiObject.setValue(outgoingPowerText + ' ' + programPowerName) + node.payload.uiObject.setValue(outgoingPowerText + ' ' + programPowerName, UI.projects.governance.globals.designer.SET_VALUE_COUNTER) node.payload.uiObject.percentageAngleOffset = 180 node.payload.uiObject.percentageAtAngle = true - node.payload.uiObject.setPercentage(percentage) + node.payload.uiObject.setPercentage(percentage, + UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER + ) node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = true - node.payload.uiObject.setStatus(outgoingPowerText + ' ' + ' Outgoing Power') + node.payload.uiObject.setStatus(outgoingPowerText + ' ' + ' Outgoing Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } } @@ -410,7 +426,7 @@ function newGovernanceUtilitiesDecendentProgram() { node.payload.uiObject.statusAngleOffset = 0 node.payload.uiObject.statusAtAngle = false - node.payload.uiObject.setStatus(ownPowerText + ' Own Power' + ' + ' + incomingPowerText + ' Incoming ' + programPowerName) + node.payload.uiObject.setStatus(ownPowerText + ' Own Power' + ' + ' + incomingPowerText + ' Incoming ' + programPowerName, UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) { @@ -422,8 +438,8 @@ function newGovernanceUtilitiesDecendentProgram() { node.tokensAwarded.payload.uiObject.valueAngleOffset = 0 node.tokensAwarded.payload.uiObject.valueAtAngle = true - node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC) - node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload[programPropertyName].count + ' Descendants.') + node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC, UI.projects.governance.globals.designer.SET_VALUE_COUNTER) + node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload[programPropertyName].count + ' Descendants.', UI.projects.governance.globals.designer.SET_STATUS_COUNTER) } } } diff --git a/Projects/Governance/UI/Utilities/Validations.js b/Projects/Governance/UI/Utilities/Validations.js index 4b23c27ce..6abe955b3 100644 --- a/Projects/Governance/UI/Utilities/Validations.js +++ b/Projects/Governance/UI/Utilities/Validations.js @@ -12,7 +12,10 @@ function newGovernanceUtilitiesValidations () { let programs = UI.projects.foundations.utilities.branches.nodeBranchToArray(userProfile, programNodeType) if (programs !== undefined) { if (programs.length > 1) { - userProfile.payload.uiObject.setErrorMessage('Only one ' + programNodeType + ' is allowed.') + userProfile.payload.uiObject.setErrorMessage( + 'Only one ' + programNodeType + ' is allowed.', + UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR + ) return } if (programs.length === 1) { diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json index 7858df6f8..9f9fd3da6 100644 --- a/Projects/ProjectsSchema.json +++ b/Projects/ProjectsSchema.json @@ -1079,6 +1079,11 @@ "propertyName": "governance", "UI": { "globals": [ + { + "name": "Designer", + "propertyName": "designer", + "functionName": "newGovernanceGlobalsDesigner" + }, { "name": "Reports", "propertyName": "reports",