Merge pull request #1170 from Luis-Fernando-Molina/develop
Contribution: Install Votes Upgraded to Install Missing Votes
This commit is contained in:
10 files changed
+551
-454
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -9,9 +9,9 @@
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
{
|
||||
"action": "Install Assets",
|
||||
"action": "Install Missing Assets",
|
||||
"actionProject": "Governance",
|
||||
"label": "Install Assets",
|
||||
"label": "Install Missing Assets",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
{
|
||||
"action": "Install Assets",
|
||||
"action": "Install Missing Assets",
|
||||
"actionProject": "Governance",
|
||||
"label": "Install Assets",
|
||||
"label": "Install Missing Assets",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
{
|
||||
"action": "Install Votes",
|
||||
"action": "Install Missing Votes",
|
||||
"actionProject": "Governance",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Install Votes",
|
||||
"label": "Install Missing Votes",
|
||||
"relatedUiObject": "Weight Votes Switch",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Install"
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
{
|
||||
"action": "Install Votes",
|
||||
"action": "Install Missing Votes",
|
||||
"actionProject": "Governance",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Install Votes",
|
||||
"label": "Install Missing Votes",
|
||||
"relatedUiObject": "Weight Votes Switch",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Install"
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
{
|
||||
"action": "Install Votes",
|
||||
"action": "Install Missing Votes",
|
||||
"actionProject": "Governance",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Install Votes",
|
||||
"label": "Install Missing Votes",
|
||||
"relatedUiObject": "Weight Votes Switch",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Install"
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
{
|
||||
"action": "Install Votes",
|
||||
"action": "Install Missing Votes",
|
||||
"actionProject": "Governance",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Install Votes",
|
||||
"label": "Install Missing Votes",
|
||||
"relatedUiObject": "Weight Votes Switch",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Install"
|
||||
|
||||
@@ -18,14 +18,14 @@ function newGovernanceActionSwitch() {
|
||||
|
||||
async function executeAction(action) {
|
||||
switch (action.name) {
|
||||
case 'Install Assets':
|
||||
case 'Install Missing Assets':
|
||||
{
|
||||
UI.projects.governance.functionLibraries.assets.installAssets(action.node, action.rootNodes)
|
||||
UI.projects.governance.functionLibraries.assets.installMissingAssets(action.node, action.rootNodes)
|
||||
break
|
||||
}
|
||||
case 'Install Votes':
|
||||
case 'Install Missing Votes':
|
||||
{
|
||||
UI.projects.governance.functionLibraries.votes.installVotes(action.node, action.rootNodes)
|
||||
UI.projects.governance.functionLibraries.votes.installMissingVotes(action.node, action.rootNodes)
|
||||
break
|
||||
}
|
||||
case 'Install Missing Claims':
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
function newGovernanceFunctionLibraryAssets() {
|
||||
let thisObject = {
|
||||
installAssets: installAssets
|
||||
installMissingAssets: installMissingAssets
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function installAssets(
|
||||
function installMissingAssets(
|
||||
node,
|
||||
rootNodes
|
||||
) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
function newGovernanceFunctionLibraryVotes() {
|
||||
let thisObject = {
|
||||
calculate: calculate,
|
||||
installVotes: installVotes
|
||||
installMissingVotes: installMissingVotes
|
||||
}
|
||||
|
||||
return thisObject
|
||||
@@ -313,7 +313,7 @@ function newGovernanceFunctionLibraryVotes() {
|
||||
}
|
||||
}
|
||||
|
||||
function installVotes(node, rootNodes) {
|
||||
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')
|
||||
@@ -346,17 +346,12 @@ function newGovernanceFunctionLibraryVotes() {
|
||||
let destinationNodeChild = destinationNode[property.name]
|
||||
|
||||
let originNodeChildType = getOriginNodeChildType(destinationNodeChild)
|
||||
let originNodeChild = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(originNode, originNodeChildType)
|
||||
let originNodeChild = UI.projects.foundations.utilities.children.findChildReferencingThisNode(originNode, destinationNodeChild)
|
||||
|
||||
if (
|
||||
destinationNodeChild.type === 'Pool' ||
|
||||
destinationNodeChild.type === 'Asset' ||
|
||||
destinationNodeChild.type === 'Feature' ||
|
||||
destinationNodeChild.type === 'Position'
|
||||
) {
|
||||
originNodeChild.payload.referenceParent = destinationNodeChild
|
||||
if (originNodeChild === undefined) {
|
||||
originNodeChild = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(originNode, originNodeChildType)
|
||||
}
|
||||
|
||||
originNodeChild.payload.referenceParent = destinationNodeChild
|
||||
scanNodeBranch(originNodeChild, destinationNodeChild)
|
||||
}
|
||||
break
|
||||
@@ -368,17 +363,12 @@ function newGovernanceFunctionLibraryVotes() {
|
||||
let destinationNodeChild = propertyArray[m]
|
||||
|
||||
let originNodeChildType = getOriginNodeChildType(destinationNodeChild)
|
||||
let originNodeChild = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(originNode, originNodeChildType)
|
||||
let originNodeChild = UI.projects.foundations.utilities.children.findChildReferencingThisNode(originNode, destinationNodeChild)
|
||||
|
||||
if (
|
||||
destinationNodeChild.type === 'Pool' ||
|
||||
destinationNodeChild.type === 'Asset' ||
|
||||
destinationNodeChild.type === 'Feature' ||
|
||||
destinationNodeChild.type === 'Position'
|
||||
) {
|
||||
originNodeChild.payload.referenceParent = destinationNodeChild
|
||||
if (originNodeChild === undefined) {
|
||||
originNodeChild = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(originNode, originNodeChildType)
|
||||
}
|
||||
|
||||
originNodeChild.payload.referenceParent = destinationNodeChild
|
||||
scanNodeBranch(originNodeChild, destinationNodeChild)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user