From bb8082739af9ecb7b8a32c65d8776744e79027f7 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 19 Jun 2021 18:16:45 +0200 Subject: [PATCH] Governance: Install Claims upgraded to Install Missing Claims --- .../User-Profiles/Luis-Fernando-Molina.json | 159 +++++++++++++++++- .../asset-contributions-folder.json | 4 +- .../feature-contributions-folder.json | 4 +- .../position-contributions-folder.json | 4 +- .../UI/Function-Libraries/ActionSwitch.js | 4 +- .../UI/Function-Libraries/Claims.js | 30 ++-- 6 files changed, 169 insertions(+), 36 deletions(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index cc47573ad..ac3a2f21f 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -1514,19 +1514,161 @@ "name": "New Claims Program", "config": "{}", "project": "Governance", - "assetContributionsFolder": [ + "assetContributionsFolder": [], + "featureContributionsFolder": [ { - "type": "Asset Contributions Folder", - "name": "New Asset Contributions Folder", + "type": "Feature Contributions Folder", + "name": "Superalgos Feature Class", "config": "{}", "project": "Governance", - "assetContributionsFolder": [], - "assetContributionClaims": [], - "id": "182c7646-a839-4a71-84b7-3bf154b93371", + "featureContributionsFolder": [ + { + "type": "Feature Contributions Folder", + "name": "Visual Debugger Feature Class", + "config": "{}", + "project": "Governance", + "featureContributionsFolder": [], + "featureContributionClaims": [], + "id": "842754e5-a050-40dd-b9dc-e799df666dfe", + "savedPayload": { + "position": { + "x": 34699.91303591268, + "y": 38376.04719845434 + }, + "targetPosition": { + "x": 34546.043252690906, + "y": 38118.51256037378 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 1, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Feature Class", + "name": "Visual Debugger", + "id": "0e329071-a542-405f-ae8c-2933098759c1" + } + } + }, + { + "type": "Feature Contributions Folder", + "name": "Charting System Feature Class", + "config": "{}", + "project": "Governance", + "featureContributionsFolder": [], + "featureContributionClaims": [], + "id": "d9c25551-bcfd-459a-a773-e073f414438c", + "savedPayload": { + "position": { + "x": 34348.66163490899, + "y": 38344.434000174864 + }, + "targetPosition": { + "x": 34546.043252690906, + "y": 38118.51256037378 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 1, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Feature Class", + "name": "Charting System", + "id": "7edc83c0-74fc-4427-816d-4db5d840577f" + } + } + }, + { + "type": "Feature Contributions Folder", + "name": "Data Mining Feature Class", + "config": "{}", + "project": "Governance", + "featureContributionsFolder": [], + "featureContributionClaims": [], + "id": "ebad23ed-1a02-4edf-a9d7-fc4b2fd0dacb", + "savedPayload": { + "position": { + "x": 34270.18492092547, + "y": 38000.60505087761 + }, + "targetPosition": { + "x": 34546.043252690906, + "y": 38118.51256037378 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 1, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Feature Class", + "name": "Data Mining", + "id": "025c0e15-ad8d-49ae-b501-577bb82c207d" + } + } + }, + { + "type": "Feature Contributions Folder", + "name": "Visual Designer Feature Class", + "config": "{}", + "project": "Governance", + "featureContributionsFolder": [], + "featureContributionClaims": [], + "id": "942d8eea-3303-4d6f-af60-374e59cf715d", + "savedPayload": { + "position": { + "x": 34572.93504536193, + "y": 37819.72027217521 + }, + "targetPosition": { + "x": 34546.043252690906, + "y": 38118.51256037378 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 1, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "Feature Class", + "name": "Visual Designer", + "id": "18584f3f-6e48-4a68-89f1-0268185156e9" + } + } + } + ], + "featureContributionClaims": [], + "id": "f8a482c4-dee0-475a-831b-7514fd255ba6", "savedPayload": { "position": { - "x": 34902.043252690906, - "y": 38030.51256037378 + "x": 34546.043252690906, + "y": 38118.51256037378 }, "targetPosition": { "x": 30023.521626345453, @@ -1551,7 +1693,6 @@ } } ], - "featureContributionsFolder": [], "positionContributionsFolder": [], "id": "796dd30f-c90d-4b8d-a63d-89867347407b", "savedPayload": { diff --git a/Projects/Governance/Schemas/App-Schema/asset-contributions-folder.json b/Projects/Governance/Schemas/App-Schema/asset-contributions-folder.json index c5ae64383..d9989ec12 100644 --- a/Projects/Governance/Schemas/App-Schema/asset-contributions-folder.json +++ b/Projects/Governance/Schemas/App-Schema/asset-contributions-folder.json @@ -9,10 +9,10 @@ "iconPathOff": "configuration" }, { - "action": "Install Claims", + "action": "Install Missing Claims", "actionProject": "Governance", "actionFunction": "payload.executeAction", - "label": "Install Claims", + "label": "Install Missing Claims", "relatedUiObject": "Asset Contribution Claim", "askConfirmation": true, "confirmationLabel": "Confirm to Install" diff --git a/Projects/Governance/Schemas/App-Schema/feature-contributions-folder.json b/Projects/Governance/Schemas/App-Schema/feature-contributions-folder.json index c9cd7a8a0..4af143e4d 100644 --- a/Projects/Governance/Schemas/App-Schema/feature-contributions-folder.json +++ b/Projects/Governance/Schemas/App-Schema/feature-contributions-folder.json @@ -9,10 +9,10 @@ "iconPathOff": "configuration" }, { - "action": "Install Claims", + "action": "Install Missing Claims", "actionProject": "Governance", "actionFunction": "payload.executeAction", - "label": "Install Claims", + "label": "Install Missing Claims", "relatedUiObject": "Feature Contribution Claim", "askConfirmation": true, "confirmationLabel": "Confirm to Install" diff --git a/Projects/Governance/Schemas/App-Schema/position-contributions-folder.json b/Projects/Governance/Schemas/App-Schema/position-contributions-folder.json index 8e5366f9b..356654e21 100644 --- a/Projects/Governance/Schemas/App-Schema/position-contributions-folder.json +++ b/Projects/Governance/Schemas/App-Schema/position-contributions-folder.json @@ -9,10 +9,10 @@ "iconPathOff": "configuration" }, { - "action": "Install Claims", + "action": "Install Missing Claims", "actionProject": "Governance", "actionFunction": "payload.executeAction", - "label": "Install Claims", + "label": "Install Missing Claims", "relatedUiObject": "Position Contribution Claim", "askConfirmation": true, "confirmationLabel": "Confirm to Install" diff --git a/Projects/Governance/UI/Function-Libraries/ActionSwitch.js b/Projects/Governance/UI/Function-Libraries/ActionSwitch.js index be4f0df83..ef96b4bfc 100644 --- a/Projects/Governance/UI/Function-Libraries/ActionSwitch.js +++ b/Projects/Governance/UI/Function-Libraries/ActionSwitch.js @@ -28,9 +28,9 @@ function newGovernanceActionSwitch() { UI.projects.governance.functionLibraries.votes.installVotes(action.node, action.rootNodes) break } - case 'Install Claims': + case 'Install Missing Claims': { - UI.projects.governance.functionLibraries.claims.installClaims(action.node, action.rootNodes) + UI.projects.governance.functionLibraries.claims.installMissingClaims(action.node, action.rootNodes) break } case 'Build Profile': diff --git a/Projects/Governance/UI/Function-Libraries/Claims.js b/Projects/Governance/UI/Function-Libraries/Claims.js index d66953564..ebec33221 100644 --- a/Projects/Governance/UI/Function-Libraries/Claims.js +++ b/Projects/Governance/UI/Function-Libraries/Claims.js @@ -1,7 +1,7 @@ function newGovernanceFunctionLibraryClaims() { let thisObject = { calculate: calculate, - installClaims: installClaims + installMissingClaims: installMissingClaims } return thisObject @@ -257,10 +257,10 @@ function newGovernanceFunctionLibraryClaims() { } } - function installClaims(node, rootNodes) { + function installMissingClaims(node, rootNodes) { if (node.payload === undefined) { return } if (node.payload.referenceParent === undefined) { - node.payload.uiObject.setErrorMessage('To install claims you need a Reference Parent') + node.payload.uiObject.setErrorMessage('To Install Missing Claims you need a Reference Parent') return } scanNodeBranch(node, node.payload.referenceParent) @@ -289,16 +289,12 @@ function newGovernanceFunctionLibraryClaims() { 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 === '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 @@ -310,16 +306,12 @@ function newGovernanceFunctionLibraryClaims() { 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 === '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) } }