Merge pull request #1122 from Luis-Fernando-Molina/develop

Contribution: Governance: Plugins Fully Implemented.
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-06-10 18:15:35 -04:00
commit bde8c178f4
41 files changed
+719 -221

No files matched your search

@@ -24,7 +24,7 @@ function newFoundationsDocsSearchEngine() {
let docsSpaceNode = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadByNodeType('Docs Space')
if (docsSpaceNode !== undefined) {
if (docsSpaceNode.spaceSettings !== undefined) {
let indexContent = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(docsSpaceNode.spaceSettings.payload, 'indexContent')
let indexContent = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(docsSpaceNode.spaceSettings.payload, 'indexContent')
if (indexContent === false) {
callbackFunction()
return
@@ -1,6 +1,13 @@
{
"type": "Plugin File",
"menuItems": [
{
"action": "Configure",
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration",
"actionFunction": "uiObject.configEditor.activate"
},
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
@@ -19,6 +26,12 @@
"actionFunction": "payload.executeAction"
}
],
"editors": {
"config": true
},
"initialValues": {
"config": "{\n\"codeName\": \"\"\n}"
},
"addLeftIcons": true,
"level": 2,
"propertyNameAtParent": "pluginFiles",
@@ -9,8 +9,8 @@
"iconPathOff": "configuration"
},
{
"action": "Add Missing Children",
"label": "Add Missing Children",
"action": "Add Missing Plugin Types",
"label": "Add Missing Plugin Types",
"relatedUiObject": "Plugins",
"actionFunction": "payload.executeAction"
},
@@ -90,6 +90,36 @@
"type": "node",
"childType": "Plugin API Maps",
"autoAdd": false
},
{
"name": "pluginUserProfiles",
"type": "node",
"childType": "Plugin User Profiles",
"autoAdd": false
},
{
"name": "pluginPools",
"type": "node",
"childType": "Plugin Pools",
"autoAdd": false
},
{
"name": "pluginAssets",
"type": "node",
"childType": "Plugin Assets",
"autoAdd": false
},
{
"name": "pluginFeatures",
"type": "node",
"childType": "Plugin Features",
"autoAdd": false
},
{
"name": "pluginPositions",
"type": "node",
"childType": "Plugin Positions",
"autoAdd": false
}
],
"alternativeIcons": [
@@ -100,6 +130,18 @@
{
"codeName": "Ethereum",
"iconName": "ethereum"
},
{
"codeName": "TensorFlow",
"iconName": "tensorflow"
},
{
"codeName": "Education",
"iconName": "education"
},
{
"codeName": "Governance",
"iconName": "governance"
}
]
}
@@ -32,7 +32,7 @@
},
{
"style": "Javascript",
"text": "UI.projects.foundations.functionLibraries.pluginsFunctions.pluginMissingTradingEngines(action.node, action.rootNodes)\n",
"text": "UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginTradingEngines(action.node, action.rootNodes)\n",
"updated": 1614938043930
},
{
@@ -640,52 +640,57 @@ function newFoundationsActionSwitch() {
break
case 'Add Missing Plugin Projects':
{
UI.projects.foundations.functionLibraries.pluginsFunctions.pluginMissingProjects(action.node, action.rootNodes)
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginProjects(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Types':
{
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginTypes(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Data Mines':
{
UI.projects.foundations.functionLibraries.pluginsFunctions.pluginMissingDataMines(action.node, action.rootNodes)
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginDataMines(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Trading Mines':
{
UI.projects.foundations.functionLibraries.pluginsFunctions.pluginMissingTradingMines(action.node, action.rootNodes)
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginTradingMines(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Trading Systems':
{
UI.projects.foundations.functionLibraries.pluginsFunctions.pluginMissingTradingSystems(action.node, action.rootNodes)
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginTradingSystems(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Trading Engines':
{
UI.projects.foundations.functionLibraries.pluginsFunctions.pluginMissingTradingEngines(action.node, action.rootNodes)
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginTradingEngines(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Learning Mines':
{
UI.projects.foundations.functionLibraries.pluginsFunctions.pluginMissingLearningMines(action.node, action.rootNodes)
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginLearningMines(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Learning Systems':
{
UI.projects.foundations.functionLibraries.pluginsFunctions.pluginMissingLearningSystems(action.node, action.rootNodes)
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginLearningSystems(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Learning Engines':
{
UI.projects.foundations.functionLibraries.pluginsFunctions.pluginMissingLearningEngines(action.node, action.rootNodes)
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginLearningEngines(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Tutorials':
{
UI.projects.foundations.functionLibraries.pluginsFunctions.pluginMissingTutorials(action.node, action.rootNodes)
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginTutorials(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin API Maps':
{
UI.projects.foundations.functionLibraries.pluginsFunctions.pluginMissingApiMaps(action.node, action.rootNodes)
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginApiMaps(action.node, action.rootNodes)
}
break
case 'Add Missing Workspace Projects':
@@ -129,7 +129,7 @@ function newFoundationsFunctionLibraryChartingSpaceFunctions() {
if (environment.id !== node.payload.referenceParent.id) { continue }
let market = UI.projects.foundations.utilities.meshes.findNodeInNodeMesh(session, 'Market Trading Tasks', undefined, true, false, true, false)
if (market.payload.referenceParent === undefined) { continue }
if (UI.projects.foundations.utilities.children.isMissingChildren(node, session, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(node, session, true) === true) {
createTimeMachine(node, session, market.payload.referenceParent, networkNode, rootNodes)
}
}
@@ -320,13 +320,13 @@ function newFoundationsFunctionLibraryChartingSpaceFunctions() {
let testingTradingTasks = UI.projects.foundations.utilities.branches.findInBranch(networkNode, 'Testing Trading Tasks', node, true)
let productionTradingTasks = UI.projects.foundations.utilities.branches.findInBranch(networkNode, 'Production Trading Tasks', node, true)
if (UI.projects.foundations.utilities.children.isMissingChildren(node, testingTradingTasks, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(node, testingTradingTasks, true) === true) {
let dashboard = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, 'Dashboard')
dashboard.payload.referenceParent = testingTradingTasks
dashboard.name = testingTradingTasks.type + ' ' + networkNode.name
}
if (UI.projects.foundations.utilities.children.isMissingChildren(node, productionTradingTasks, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(node, productionTradingTasks, true) === true) {
let dashboard = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, 'Dashboard')
dashboard.payload.referenceParent = productionTradingTasks
dashboard.name = productionTradingTasks.type + ' ' + networkNode.name
@@ -345,7 +345,7 @@ function newFoundationsFunctionLibraryChartingSpaceFunctions() {
if (rootNode.type === project + ' Project') {
let projectDefinition = rootNode.projectDefinition
if (projectDefinition !== undefined) {
if (UI.projects.foundations.utilities.children.isMissingChildren(node, projectDefinition, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(node, projectDefinition, true) === true) {
let projectTasks = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, 'Project Dashboards', undefined, project)
projectTasks.payload.referenceParent = projectDefinition
}
@@ -17,7 +17,7 @@ function newFoundationsFunctionLibraryCryptoEcosystemFunctions() {
let cryptoExchanges = parent.cryptoExchanges[i]
for (let j = 0; j < cryptoExchanges.exchanges.length; j++) {
let exchange = cryptoExchanges.exchanges[j]
let codeName = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(exchange.payload, 'codeName')
let codeName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(exchange.payload, 'codeName')
currentExchanges.set(codeName, exchange)
}
}
@@ -68,11 +68,11 @@ function newFoundationsFunctionLibraryCryptoEcosystemFunctions() {
let currentAssets = new Map()
for (let j = 0; j < node.assets.length; j++) {
let asset = node.assets[j]
let codeName = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(asset.payload, 'codeName')
let codeName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(asset.payload, 'codeName')
currentAssets.set(codeName, asset)
}
let exchangeId = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload.parentNode.payload, 'codeName')
let exchangeId = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload.parentNode.payload, 'codeName')
try {
let params = {
@@ -86,7 +86,7 @@ function newFoundationsFunctionLibraryCryptoEcosystemFunctions() {
node.payload.uiObject.setErrorMessage('Failed to Fetch Assets from the Exchange')
return
}
let queryParams = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload, 'addMissingAssetsFilter')
let queryParams = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload, 'addMissingAssetsFilter')
let markets = JSON.parse(data)
@@ -142,7 +142,7 @@ function newFoundationsFunctionLibraryCryptoEcosystemFunctions() {
let exchangeAssets = node.payload.parentNode.exchangeAssets
for (let j = 0; j < exchangeAssets.assets.length; j++) {
let asset = exchangeAssets.assets[j]
let codeName = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(asset.payload, 'codeName')
let codeName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(asset.payload, 'codeName')
currentAssets.set(codeName, asset)
}
@@ -150,11 +150,11 @@ function newFoundationsFunctionLibraryCryptoEcosystemFunctions() {
let exchangeMarkets = node
for (let j = 0; j < exchangeMarkets.markets.length; j++) {
let asset = exchangeMarkets.markets[j]
let codeName = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(asset.payload, 'codeName')
let codeName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(asset.payload, 'codeName')
currentMarkets.set(codeName, asset)
}
let exchangeId = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload.parentNode.payload, 'codeName')
let exchangeId = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload.parentNode.payload, 'codeName')
try {
let params = {
@@ -478,7 +478,7 @@ function newFoundationsFunctionLibraryCryptoEcosystemFunctions() {
*/
for (let i = 0; i < learningSessionsCreatedArray.length; i++) {
let session = learningSessionsCreatedArray[i]
if (UI.projects.foundations.utilities.children.isMissingChildren(marketLearningProducts, session, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(marketLearningProducts, session, true) === true) {
UI.projects.foundations.functionLibraries.dataStorageFunctions.createSessionReference(marketLearningProducts, session, 'Learning Session Reference')
}
}
@@ -533,7 +533,7 @@ function newFoundationsFunctionLibraryCryptoEcosystemFunctions() {
*/
for (let i = 0; i < tradingSessionsCreatedArray.length; i++) {
let session = tradingSessionsCreatedArray[i]
if (UI.projects.foundations.utilities.children.isMissingChildren(marketTradingProducts, session, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(marketTradingProducts, session, true) === true) {
UI.projects.foundations.functionLibraries.dataStorageFunctions.createSessionReference(marketTradingProducts, session, 'Trading Session Reference')
}
}
@@ -123,7 +123,7 @@ function newFoundationsFunctionLibraryDataStorageFunctions() {
/* We will filter out all the sessions that does not belong to the market we are in */
let marketTradingTasks = UI.projects.foundations.utilities.meshes.findNodeInNodeMesh(session, 'Market Trading Tasks', undefined, true, false, true, false)
if (node.payload.referenceParent.id !== marketTradingTasks.payload.referenceParent.id) { continue }
if (UI.projects.foundations.utilities.children.isMissingChildren(node, session, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(node, session, true) === true) {
createSessionReference(node, session, 'Trading Session Reference')
}
}
@@ -146,7 +146,7 @@ function newFoundationsFunctionLibraryDataStorageFunctions() {
/* We will filter out all the sessions that does not belong to the market we are in */
let marketLearningTasks = UI.projects.foundations.utilities.meshes.findNodeInNodeMesh(session, 'Market Learning Tasks', undefined, true, false, true, false)
if (node.payload.referenceParent.id !== marketLearningTasks.payload.referenceParent.id) { continue }
if (UI.projects.foundations.utilities.children.isMissingChildren(node, session, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(node, session, true) === true) {
createSessionReference(node, session, 'Learning Session Reference')
}
}
@@ -177,7 +177,7 @@ function newFoundationsFunctionLibraryDataStorageFunctions() {
for (let i = 0; i < marketsArray.length; i++) {
let market = marketsArray[i]
if (UI.projects.foundations.utilities.children.isMissingChildren(node, market, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(node, market, true) === true) {
let marketDataProducts = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, newNodeType)
marketDataProducts.payload.referenceParent = market
}
@@ -205,7 +205,7 @@ function newFoundationsFunctionLibraryDataStorageFunctions() {
let cryptoExchanges = cryptoEcosystem.cryptoExchanges[j]
for (let k = 0; k < cryptoExchanges.exchanges.length; k++) {
let cryptoExchange = cryptoExchanges.exchanges[k]
if (UI.projects.foundations.utilities.children.isMissingChildren(node, cryptoExchange, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(node, cryptoExchange, true) === true) {
let exchange = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, newNodeType)
exchange.payload.referenceParent = cryptoExchange
}
@@ -238,7 +238,7 @@ function newFoundationsFunctionLibraryDataStorageFunctions() {
if (rootNode.type === project + ' Project') {
let projectDefinition = rootNode.projectDefinition
if (projectDefinition !== undefined) {
if (UI.projects.foundations.utilities.children.isMissingChildren(node, projectDefinition, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(node, projectDefinition, true) === true) {
let projectTasks = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, newNodeType, undefined, project)
projectTasks.payload.referenceParent = projectDefinition
}
@@ -133,11 +133,11 @@ function newFoundationsFunctionLibraryLearningSessionFunctions() {
let session = UI.projects.foundations.functionLibraries.protocolNode.getProtocolNode(node, false, true, true, false, false, lightingPath)
let defaultExchange = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(validationsResult.exchange.payload, 'codeName')
let defaultExchange = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(validationsResult.exchange.payload, 'codeName')
let defaultMarket =
UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(validationsResult.market.baseAsset.payload.referenceParent.payload, 'codeName')
UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(validationsResult.market.baseAsset.payload.referenceParent.payload, 'codeName')
+ '-' +
UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(validationsResult.market.quotedAsset.payload.referenceParent.payload, 'codeName')
UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(validationsResult.market.quotedAsset.payload.referenceParent.payload, 'codeName')
let dependencyFilter = UI.projects.foundations.functionLibraries.dependenciesFilter.createDependencyFilter(
defaultExchange,
@@ -1,44 +1,20 @@
function newFoundationsFunctionLibraryPluginsFunctions() {
let thisObject = {
pluginMissingProjects: pluginMissingProjects,
pluginMissingDataMines: pluginMissingDataMines,
pluginMissingTradingMines: pluginMissingTradingMines,
pluginMissingTradingSystems: pluginMissingTradingSystems,
pluginMissingTradingEngines: pluginMissingTradingEngines,
pluginMissingLearningMines: pluginMissingLearningMines,
pluginMissingLearningSystems: pluginMissingLearningSystems,
pluginMissingLearningEngines: pluginMissingLearningEngines,
pluginMissingTutorials: pluginMissingTutorials,
pluginMissingApiMaps: pluginMissingApiMaps
addMissingPluginProjects: addMissingPluginProjects,
addMissingPluginTypes: addMissingPluginTypes,
addMissingPluginDataMines: addMissingPluginDataMines,
addMissingPluginTradingMines: addMissingPluginTradingMines,
addMissingPluginTradingSystems: addMissingPluginTradingSystems,
addMissingPluginTradingEngines: addMissingPluginTradingEngines,
addMissingPluginLearningMines: addMissingPluginLearningMines,
addMissingPluginLearningSystems: addMissingPluginLearningSystems,
addMissingPluginLearningEngines: addMissingPluginLearningEngines,
addMissingPluginTutorials: addMissingPluginTutorials,
addMissingPluginApiMaps: addMissingPluginApiMaps
}
return thisObject
function getPluginFileNames(projectName, pluginType, callBack) {
httpRequest(undefined, 'PluginFileNames/' + projectName + '/' + pluginType, onResponse)
function onResponse(err, data) {
if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
console.log('Failed to Fetch Plugin ' + pluginType + ' from the Client')
return
}
let pluginFileNames = JSON.parse(data)
callBack(pluginFileNames)
}
}
function addPluginFileIfNeeded(node, fileNames) {
for (let i = 0; i < fileNames.length; i++) {
let fileName = fileNames[i]
fileName = fileName.replace('.json', '')
if (UI.projects.foundations.utilities.children.isMissingChildrenByName(node, fileName) === true) {
let child = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, 'Plugin File')
child.name = fileName
}
}
}
function pluginMissingProjects(node, rootNodes) {
function addMissingPluginProjects(node, rootNodes) {
for (let k = 0; k < PROJECTS_SCHEMA.length; k++) {
let projectDefinition = PROJECTS_SCHEMA[k]
let project = projectDefinition.name
@@ -52,27 +28,25 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
function getProjectName(node) {
/* Validations to see if we can do this or not. */
if (node.payload === undefined) { return }
if (node.payload.uiObject === undefined) { return }
function addMissingPluginTypes(node, rootNodes) {
let project = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload, 'codeName')
if (project === undefined || project === "") { return }
for (let k = 0; k < PROJECTS_SCHEMA.length; k++) {
let projectDefinition = PROJECTS_SCHEMA[k]
if (projectDefinition.name !== project) { continue }
if (projectDefinition.plugins === undefined) { continue }
for (let i = 0; i < projectDefinition.plugins.length; i++) {
let pluginType = "Plugin" + " " + projectDefinition.plugins[i]
if (node.payload.parentNode === undefined) {
node.payload.uiObject.setErrorMessage('You need to have a Plugin Project node as a parent to execute this action.')
return
if (UI.projects.foundations.utilities.children.isMissingChildrenByType(node, pluginType) === true) {
UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, pluginType, undefined, project)
}
}
}
if (node.payload.parentNode.payload === undefined) {
node.payload.uiObject.setErrorMessage('You need to have a Plugin Project node as a parent to execute this action.')
return
}
let pluginProject = node.payload.parentNode
let config = JSON.parse(pluginProject.config)
return config.codeName
}
function pluginMissingDataMines(node, rootNodes) {
let projectName = getProjectName(node)
function addMissingPluginDataMines(node, rootNodes) {
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.")
@@ -80,15 +54,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
getPluginFileNames(projectName, 'Data-Mines', onNamesArrived)
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Data-Mines', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames)
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
}
}
function pluginMissingTradingMines(node, rootNodes) {
let projectName = getProjectName(node)
function addMissingPluginTradingMines(node, rootNodes) {
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.")
@@ -96,15 +70,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
getPluginFileNames(projectName, 'Trading-Mines', onNamesArrived)
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Mines', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames)
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
}
}
function pluginMissingTradingSystems(node, rootNodes) {
let projectName = getProjectName(node)
function addMissingPluginTradingSystems(node, rootNodes) {
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.")
@@ -112,15 +86,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
getPluginFileNames(projectName, 'Trading-Systems', onNamesArrived)
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Systems', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames)
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
}
}
function pluginMissingTradingEngines(node, rootNodes) {
let projectName = getProjectName(node)
function addMissingPluginTradingEngines(node, rootNodes) {
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.")
@@ -128,15 +102,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
getPluginFileNames(projectName, 'Trading-Engines', onNamesArrived)
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Engines', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames)
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
}
}
function pluginMissingLearningMines(node, rootNodes) {
let projectName = getProjectName(node)
function addMissingPluginLearningMines(node, rootNodes) {
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.")
@@ -144,15 +118,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
getPluginFileNames(projectName, 'Learning-Mines', onNamesArrived)
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Mines', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames)
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
}
}
function pluginMissingLearningSystems(node, rootNodes) {
let projectName = getProjectName(node)
function addMissingPluginLearningSystems(node, rootNodes) {
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.")
@@ -160,15 +134,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
getPluginFileNames(projectName, 'Learning-Systems', onNamesArrived)
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Systems', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames)
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
}
}
function pluginMissingLearningEngines(node, rootNodes) {
let projectName = getProjectName(node)
function addMissingPluginLearningEngines(node, rootNodes) {
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.")
@@ -176,15 +150,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
getPluginFileNames(projectName, 'Learning-Engines', onNamesArrived)
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Engines', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames)
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
}
}
function pluginMissingTutorials(node, rootNodes) {
let projectName = getProjectName(node)
function addMissingPluginTutorials(node, rootNodes) {
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.")
@@ -192,15 +166,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
getPluginFileNames(projectName, 'Tutorials', onNamesArrived)
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Tutorials', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames)
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
}
}
function pluginMissingApiMaps(node, rootNodes) {
let projectName = getProjectName(node)
function addMissingPluginApiMaps(node, rootNodes) {
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.")
@@ -208,10 +182,10 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
getPluginFileNames(projectName, 'API-Maps', onNamesArrived)
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'API-Maps', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames)
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
}
}
}
@@ -9,8 +9,8 @@ function newFoundationsFunctionLibrarySocialBotsFunctions() {
function sendTelegramTestMessage(node, callBackFunction) {
let botToken = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload, 'botToken')
let chatId = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload, 'chatId')
let botToken = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload, 'botToken')
let chatId = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload, 'chatId')
if (botToken === undefined) {
node.payload.uiObject.setErrorMessage('botToken parameter not defined.')
@@ -75,7 +75,7 @@ function newFoundationsFunctionLibrarySocialBotsFunctions() {
function sendDiscordTestMessage(node, callBackFunction) {
let webhookURL = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload, 'webhookURL')
let webhookURL = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload, 'webhookURL')
if (webhookURL === undefined) {
node.payload.uiObject.setErrorMessage('webhookURL parameter not defined.')
@@ -131,7 +131,7 @@ function newFoundationsFunctionLibrarySocialBotsFunctions() {
function sendSlackTestMessage(node, callBackFunction) {
let webhookURL = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload, 'webhookURL')
let webhookURL = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload, 'webhookURL')
if (webhookURL === undefined) {
node.payload.uiObject.setErrorMessage('webhookURL parameter not defined.')
@@ -290,17 +290,17 @@ function newFoundationsFunctionLibraryTaskFunctions() {
let networkNode = UI.projects.foundations.utilities.meshes.findNodeInNodeMesh(taskManager, 'Network Node', undefined, true, false, true, false)
if (UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(networkNode.payload, 'host') === undefined) {
if (UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(networkNode.payload, 'host') === undefined) {
node.payload.uiObject.setErrorMessage('Network Node needs to have a valid Host property at its config.')
return
}
if (UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(networkNode.payload, 'webPort') === undefined) {
if (UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(networkNode.payload, 'webPort') === undefined) {
node.payload.uiObject.setErrorMessage('Network Node needs to have a valid webPort property at its config.')
return
}
if (UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(networkNode.payload, 'webSocketsPort') === undefined) {
if (UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(networkNode.payload, 'webSocketsPort') === undefined) {
node.payload.uiObject.setErrorMessage('Network Node needs to have a valid webSocketsPort property at its config.')
return
}
@@ -609,7 +609,7 @@ function newFoundationsFunctionLibraryTaskFunctions() {
if (rootNode.type === project + ' Project') {
let projectDefinition = rootNode.projectDefinition
if (projectDefinition !== undefined) {
if (UI.projects.foundations.utilities.children.isMissingChildren(node, projectDefinition, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(node, projectDefinition, true) === true) {
let projectTasks = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, newNodeType, undefined, project)
projectTasks.payload.referenceParent = projectDefinition
}
@@ -640,7 +640,7 @@ function newFoundationsFunctionLibraryTaskFunctions() {
let cryptoExchanges = cryptoEcosystem.cryptoExchanges[j]
for (let k = 0; k < cryptoExchanges.exchanges.length; k++) {
let cryptoExchange = cryptoExchanges.exchanges[k]
if (UI.projects.foundations.utilities.children.isMissingChildren(node, cryptoExchange, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(node, cryptoExchange, true) === true) {
let exchangeTasks = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, newNodeType)
exchangeTasks.payload.referenceParent = cryptoExchange
}
@@ -672,7 +672,7 @@ function newFoundationsFunctionLibraryTaskFunctions() {
for (let i = 0; i < markets.length; i++) {
let market = markets[i]
if (UI.projects.foundations.utilities.children.isMissingChildren(node, market, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(node, market, true) === true) {
let marketDataTasks = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, newNodeType)
marketDataTasks.payload.referenceParent = market
}
@@ -697,7 +697,7 @@ function newFoundationsFunctionLibraryTaskFunctions() {
if (rootNode.type === rootNodeType) {
let mine = rootNode
if (UI.projects.foundations.utilities.children.isMissingChildren(node, mine, true) === true) {
if (UI.projects.foundations.utilities.children.isMissingChildrenById(node, mine, true) === true) {
let dataMineTasks = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, newNodeType)
dataMineTasks.payload.referenceParent = mine
}
@@ -859,8 +859,8 @@ function newFoundationsFunctionLibraryTaskFunctions() {
let apiMaps = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('API Map')
for (let i = 0; i < apiMaps.length; i++) {
let apiMap = apiMaps[i]
let apiMapCodeName = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(apiMap.payload, 'codeName')
let mineCodeName = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(mine.payload, 'codeName')
let apiMapCodeName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(apiMap.payload, 'codeName')
let mineCodeName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(mine.payload, 'codeName')
if (apiMapCodeName === mineCodeName) {
processInstance.apiMapReference.payload.referenceParent = apiMap
@@ -161,11 +161,11 @@ function newFoundationsFunctionLibraryTradingSessionFunctions() {
let session = UI.projects.foundations.functionLibraries.protocolNode.getProtocolNode(node, false, true, true, false, false, lightingPath)
let defaultExchange = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(validationsResult.exchange.payload, 'codeName')
let defaultExchange = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(validationsResult.exchange.payload, 'codeName')
let defaultMarket =
UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(validationsResult.market.baseAsset.payload.referenceParent.payload, 'codeName')
UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(validationsResult.market.baseAsset.payload.referenceParent.payload, 'codeName')
+ '-' +
UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(validationsResult.market.quotedAsset.payload.referenceParent.payload, 'codeName')
UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(validationsResult.market.quotedAsset.payload.referenceParent.payload, 'codeName')
let dependencyFilter = UI.projects.foundations.functionLibraries.dependenciesFilter.createDependencyFilter(
defaultExchange,
@@ -62,6 +62,9 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() {
if (plugins.pluginProjects === undefined) { continue }
for (let j = 0; j < plugins.pluginProjects.length; j++) {
let project = plugins.pluginProjects[j]
/*
Foundations Plugin Types
*/
if (project.pluginDataMines !== undefined) {
totalPlugin = totalPlugin + project.pluginDataMines.pluginFiles.length
pluginAllTheseFiles(project.pluginDataMines.pluginFiles, 'Data-Mines')
@@ -98,6 +101,29 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() {
totalPlugin = totalPlugin + project.pluginApiMaps.pluginFiles.length
pluginAllTheseFiles(project.pluginApiMaps.pluginFiles, 'API-Maps')
}
/*
Governance Plugin Types
*/
if (project.pluginUserProfiles !== undefined) {
totalPlugin = totalPlugin + project.pluginUserProfiles.pluginFiles.length
pluginAllTheseFiles(project.pluginUserProfiles.pluginFiles, 'User-Profiles')
}
if (project.pluginPools !== undefined) {
totalPlugin = totalPlugin + project.pluginPools.pluginFiles.length
pluginAllTheseFiles(project.pluginPools.pluginFiles, 'Pools')
}
if (project.pluginFeatures !== undefined) {
totalPlugin = totalPlugin + project.pluginFeatures.pluginFiles.length
pluginAllTheseFiles(project.pluginFeatures.pluginFiles, 'Features')
}
if (project.pluginAssets !== undefined) {
totalPlugin = totalPlugin + project.pluginAssets.pluginFiles.length
pluginAllTheseFiles(project.pluginAssets.pluginFiles, 'Assets')
}
if (project.pluginPositions !== undefined) {
totalPlugin = totalPlugin + project.pluginPositions.pluginFiles.length
pluginAllTheseFiles(project.pluginPositions.pluginFiles, 'Positions')
}
}
}
}
@@ -113,7 +139,14 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() {
for (let i = 0; i < pluginFiles.length; i++) {
let pluginFile = pluginFiles[i]
let name = pluginFile.name
httpRequest(undefined, 'LoadPlugin' + '/' + 'Foundations' + '/' + pluginType + '/' + name + '.json', onFileReceived)
let project = "Foundations"
try {
let config = JSON.parse(pluginFile.config)
project = config.project
name = config.fileName
} catch (err) { }
httpRequest(undefined, 'LoadPlugin' + '/' + project + '/' + pluginType + '/' + name + '.json', onFileReceived)
function onFileReceived(err, text, response) {
@@ -6,8 +6,8 @@ function newFoundationsFunctionLibraryWebhookFunctions() {
return thisObject
function sendTestMessage(node, callBackFunction) {
let testMessage = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload, 'testMessage')
let letURL = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload, 'webhookURL')
let testMessage = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload, 'testMessage')
let letURL = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload, 'webhookURL')
httpRequest(testMessage, letURL, onResponse)
@@ -707,7 +707,7 @@ function newTimeMachine() {
position = UI.projects.foundations.utilities.coordinateTransformations.transformThisPoint(position, thisObject.container)
let label = thisObject.payload.node.name
let description = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'description')
let description = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(thisObject.payload, 'description')
if (description !== undefined) {
label = description
@@ -543,17 +543,17 @@ function newConditionEditor() {
let rootNode = workspace.rootNodes[i]
if (rootNode.type !== 'Data Mine') { continue }
let dataMine = rootNode
let dataMineName = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(dataMine.payload, 'codeName')
let dataMineName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(dataMine.payload, 'codeName')
selector[dataMineName] = {}
let bots = dataMine.sensorBots.concat(dataMine.apiDataFetcherBots).concat(dataMine.indicatorBots)
for (let j = 0; j < bots.length; j++) {
let bot = bots[j]
let botName = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(bot.payload, 'codeName')
let botName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(bot.payload, 'codeName')
let selectorDataMine = selector[dataMineName]
selectorDataMine[botName] = {}
for (let k = 0; k < bot.products.length; k++) {
let product = bot.products[k]
let productName = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(product.payload, 'singularVariableName')
let productName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(product.payload, 'singularVariableName')
if (productName === undefined) { continue }
let selectorProduct = selectorDataMine[botName]
selectorProduct[productName] = {
@@ -562,11 +562,11 @@ function newConditionEditor() {
if (product.record === undefined) { continue }
for (let m = 0; m < product.record.properties.length; m++) {
let property = product.record.properties[m]
let propertyName = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(property.payload, 'codeName')
let propertyName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(property.payload, 'codeName')
let selectorProperty = selectorProduct[productName]
selectorProperty = selectorProperty.properties
selectorProperty[propertyName] = {}
let possibleValues = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(property.payload, 'possibleValues')
let possibleValues = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(property.payload, 'possibleValues')
if (possibleValues === undefined) { possibleValues = [] }
let selectorPossibleValue = selectorProperty[propertyName]
selectorPossibleValue.possibleValues = possibleValues
@@ -574,7 +574,7 @@ function newConditionEditor() {
let allPossibleTimeFrames = []
for (let m = 0; m < product.datasets.length; m++) {
let dataset = product.datasets[m]
let validTimeFrames = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(dataset.payload, 'validTimeFrames')
let validTimeFrames = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(dataset.payload, 'validTimeFrames')
if (validTimeFrames !== undefined) {
allPossibleTimeFrames = allPossibleTimeFrames.concat(validTimeFrames)
}
@@ -490,7 +490,7 @@ function newUiObjectConstructor() {
}
if (newMenuItem.actionProject === undefined) {
newMenuItem.actionProject = 'Foundations'
newMenuItem.actionProject = payload.node.project
}
menuItemsInitialValues.push(newMenuItem)
@@ -334,7 +334,7 @@ function newLayer() {
function checkStatusAtShutDown() {
/* Mechanism to recover a layer that was left loading the last time the browser was shut dowm. */
let storedValue = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'status')
let storedValue = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(thisObject.payload, 'status')
if (storedValue !== undefined) {
if (storedValue === LAYER_STATUS.LOADING) {
resetProgressBars()
@@ -499,7 +499,7 @@ function newLayer() {
if (thisObject.panels.length > 0) {
panelsVisibleButton = newPanelsVisibleButton()
let storedValue = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'showPanels')
let storedValue = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(thisObject.payload, 'showPanels')
if (storedValue !== undefined) {
if (storedValue === true || storedValue === false) {
panelsVisibleButton.showPanels = storedValue
@@ -519,7 +519,7 @@ function newLayer() {
function statusPhysics() {
/* We retrieve the stored status at the config. */
try {
let storedValue = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'status')
let storedValue = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(thisObject.payload, 'status')
if (storedValue !== undefined) {
if (storedValue !== thisObject.status) {
@@ -665,13 +665,13 @@ function newLayer() {
UI.projects.foundations.utilities.drawPrint.roundedCornersBackground(params)
let parentLabel1FontSize = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label1FontSize')
let parentlabelTwoFontSize = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'labelTwoFontSize')
let parentLabel3FontSize = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label3FontSize')
let parentLabel1FontSize = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(thisObject.payload.parentNode.payload, 'label1FontSize')
let parentlabelTwoFontSize = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(thisObject.payload.parentNode.payload, 'labelTwoFontSize')
let parentLabel3FontSize = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(thisObject.payload.parentNode.payload, 'label3FontSize')
let label1FontSize = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'label1FontSize')
let labelTwoFontSize = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'labelTwoFontSize')
let label3FontSize = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'label3FontSize')
let label1FontSize = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(thisObject.payload, 'label1FontSize')
let labelTwoFontSize = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(thisObject.payload, 'labelTwoFontSize')
let label3FontSize = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(thisObject.payload, 'label3FontSize')
if (parentLabel1FontSize !== undefined) {
label1FontSize = parentLabel1FontSize
@@ -128,7 +128,7 @@ function newLayersPanel() {
function readObjectState() {
let storedValue
storedValue = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'visibleLayers')
storedValue = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(thisObject.payload, 'visibleLayers')
if (isNaN(storedValue) || storedValue === null || storedValue === undefined) {
// not using this value
@@ -147,7 +147,7 @@ function newLayersPanel() {
}
}
storedValue = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'panelLocation')
storedValue = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(thisObject.payload, 'panelLocation')
if (storedValue === null || storedValue === undefined) {
// not using this value
@@ -1,6 +1,7 @@
function newFoundationsUtilitiesNodeChildren() {
let thisObject = {
isMissingChildren: isMissingChildren,
isMissingChildrenById: isMissingChildrenById,
isMissingChildrenByType: isMissingChildrenByType,
findChildReferencingThisNode: findChildReferencingThisNode,
findOrCreateChildWithReference: findOrCreateChildWithReference,
findAndRecreateChildWithReference: findAndRecreateChildWithReference,
@@ -10,7 +11,7 @@ function newFoundationsUtilitiesNodeChildren() {
return thisObject
function isMissingChildren(startingNode, checkNode, checkReferenceParent) {
function isMissingChildrenById(startingNode, checkNode, checkReferenceParent) {
/*
This functioin scan all the children of a node and returns true or false
depending if the checkNode is a missing children.
@@ -72,6 +73,92 @@ function newFoundationsUtilitiesNodeChildren() {
return true
}
}
function isMissingChildrenByName(startingNode, nodeName) {
/*
This functioin scan all the children of a node and returns true or false
depending if the node has a children with a certain name.
*/
if (startingNode === undefined) { return }
let schemaDocument = getSchemaDocument(startingNode)
if (schemaDocument === undefined) { return }
/* We scan through this node children */
if (schemaDocument.childrenNodesProperties !== undefined) {
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
let property = schemaDocument.childrenNodesProperties[i]
switch (property.type) {
case 'node': {
let child = startingNode[property.name]
if (child !== undefined) {
if (child.name === nodeName) {
return false
}
}
}
break
case 'array': {
let startingNodePropertyArray = startingNode[property.name]
if (startingNodePropertyArray !== undefined) {
for (let m = 0; m < startingNodePropertyArray.length; m++) {
let arrayItem = startingNodePropertyArray[m]
if (arrayItem.name === nodeName) {
return false
}
}
}
break
}
}
}
return true
}
}
function isMissingChildrenByType(startingNode, nodeType) {
/*
This functioin scan all the children of a node and returns true or false
depending if the node has a children with a certain type.
*/
if (startingNode === undefined) { return }
let schemaDocument = getSchemaDocument(startingNode)
if (schemaDocument === undefined) { return }
/* We scan through this node children */
if (schemaDocument.childrenNodesProperties !== undefined) {
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
let property = schemaDocument.childrenNodesProperties[i]
switch (property.type) {
case 'node': {
let child = startingNode[property.name]
if (child !== undefined) {
if (child.type === nodeType) {
return false
}
}
}
break
case 'array': {
let startingNodePropertyArray = startingNode[property.name]
if (startingNodePropertyArray !== undefined) {
for (let m = 0; m < startingNodePropertyArray.length; m++) {
let arrayItem = startingNodePropertyArray[m]
if (arrayItem.type === nodeType) {
return false
}
}
}
break
}
}
}
return true
}
}
function findChildReferencingThisNode(startingNode, checkNode) {
/*
@@ -131,7 +218,7 @@ function newFoundationsUtilitiesNodeChildren() {
the referecen.
*/
let child
if (isMissingChildren(startingNode, referencedNode, true) === true) {
if (isMissingChildrenById(startingNode, referencedNode, true) === true) {
child = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(startingNode, childType)
child.payload.referenceParent = referencedNode
} else {
@@ -198,46 +285,4 @@ function newFoundationsUtilitiesNodeChildren() {
}
}
function isMissingChildrenByName(startingNode, nodeName) {
/*
This functioin scan all the children of a node and returns true or false
depending if the node has a children with a certain name.
*/
if (startingNode === undefined) { return }
let schemaDocument = getSchemaDocument(startingNode)
if (schemaDocument === undefined) { return }
/* We scan through this node children */
if (schemaDocument.childrenNodesProperties !== undefined) {
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
let property = schemaDocument.childrenNodesProperties[i]
switch (property.type) {
case 'node': {
let child = startingNode[property.name]
if (child !== undefined) {
if (child.name === nodeName) {
return false
}
}
}
break
case 'array': {
let startingNodePropertyArray = startingNode[property.name]
if (startingNodePropertyArray !== undefined) {
for (let m = 0; m < startingNodePropertyArray.length; m++) {
let arrayItem = startingNodePropertyArray[m]
if (arrayItem.name === nodeName) {
return false
}
}
}
break
}
}
}
return true
}
}
}
@@ -1,7 +1,7 @@
function newFoundationsUtilitiesNodeConfig() {
let thisObject = {
savePropertyAtNodeConfig: savePropertyAtNodeConfig,
loadPropertyFromNodeConfig: loadPropertyFromNodeConfig
loadConfigProperty: loadConfigProperty
}
return thisObject
@@ -16,7 +16,7 @@ function newFoundationsUtilitiesNodeConfig() {
}
}
function loadPropertyFromNodeConfig(payload, propertyName) {
function loadConfigProperty(payload, propertyName) {
try {
let config = JSON.parse(payload.node.config)
return config[propertyName]
@@ -0,0 +1,57 @@
function newFoundationsUtilitiesPlugins() {
let thisObject = {
getPluginFileNames: getPluginFileNames,
addPluginFileIfNeeded: addPluginFileIfNeeded,
getProjectName: getProjectName
}
return thisObject
function getPluginFileNames(projectName, pluginType, callBack) {
httpRequest(undefined, 'PluginFileNames/' + projectName + '/' + pluginType, onResponse)
function onResponse(err, data) {
if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
console.log('Failed to Fetch Plugin ' + pluginType + ' from the Client')
return
}
let pluginFileNames = JSON.parse(data)
callBack(pluginFileNames)
}
}
function addPluginFileIfNeeded(node, fileNames) {
for (let i = 0; i < fileNames.length; i++) {
let fileName = fileNames[i]
fileName = fileName.replace('.json', '')
if (UI.projects.foundations.utilities.children.isMissingChildrenByName(node, fileName) === true) {
let child = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, 'Plugin File', undefined, 'Foundations')
child.name = fileName
child.config = JSON.stringify({
project: node.project,
fileName: fileName
})
}
}
}
function getProjectName(node) {
/* Validations to see if we can do this or not. */
if (node.payload === undefined) { return }
if (node.payload.uiObject === undefined) { return }
if (node.payload.parentNode === undefined) {
node.payload.uiObject.setErrorMessage('You need to have a Plugin Project node as a parent to execute this action.')
return
}
if (node.payload.parentNode.payload === undefined) {
node.payload.uiObject.setErrorMessage('You need to have a Plugin Project node as a parent to execute this action.')
return
}
let pluginProject = node.payload.parentNode
let config = JSON.parse(pluginProject.config)
return config.codeName
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

@@ -0,0 +1 @@
{"type":"Pools","name":"Starting Pool","config":"{\n \"tokens\": \"10000000\"\n}","project":"Governance","poolClasses":[{"type":"Pool Class","name":"Software","config":"{\n \"description\": \"\"\n}","project":"Governance","poolClasses":[{"type":"Pool Class","name":"Assets","config":"{}","project":"Governance","poolClasses":[],"pools":[{"type":"Pool","name":"Software Assets ","config":"{\n \"description\": \"\", \"relativeWeight\": 0 \n}","project":"Governance","poolClasses":[],"pools":[],"id":"05da7d34-dbc4-486c-8054-891747d17572","savedPayload":{"position":{"x":22012.002643857435,"y":29477.614859746653},"targetPosition":{"x":21980.644104877138,"y":29775.971428357134},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Assets","name":"Software","id":"3361629f-04c3-4da8-87a2-3a9de9896eb0"}}},{"type":"Pool","name":"Community Assets","config":"{}","project":"Governance","poolClasses":[],"pools":[],"id":"af54f5d9-a58c-4d05-8b58-af6379c58fa4","savedPayload":{"position":{"x":22254.707742169918,"y":29653.950435434395},"targetPosition":{"x":21980.644104877138,"y":29775.971428357134},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Assets","name":"Community","id":"199f2793-8072-4ac1-8d1d-5ea5c2f2dcf3"}}}],"id":"301a35d2-37bc-4cb3-b95e-ad777ab2b13f","savedPayload":{"position":{"x":21980.644104877138,"y":29775.971428357134},"targetPosition":{"x":21804.308529189395,"y":30018.676526669617},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Pool Class","name":"Features","config":"{}","project":"Governance","poolClasses":[],"pools":[{"type":"Pool","name":"Features","config":"{\n \"description\": \"\", \"relativeWeight\": 0 \n}","project":"Governance","poolClasses":[],"pools":[],"id":"7a256c07-dfb5-4f89-8cf7-424f9ce257e5","savedPayload":{"position":{"x":22374.942438966485,"y":29833.26633004465},"targetPosition":{"x":22089.62548407794,"y":29925.971428357134},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Features","name":"Software","id":"1d2c1985-c762-4ece-b350-15bd893bd1f4"}}}],"id":"41a9403c-2e4d-4432-8169-86579f2e34b6","savedPayload":{"position":{"x":22089.62548407794,"y":29925.971428357134},"targetPosition":{"x":21804.308529189395,"y":30018.676526669617},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Pool Class","name":"Organization","config":"{}","project":"Governance","poolClasses":[],"pools":[{"type":"Pool","name":"Positions","config":"{\n \"description\": \"\", \"relativeWeight\": 0 \n}","project":"Governance","poolClasses":[],"pools":[],"id":"f54a5953-de81-4c7b-af6a-f41bce854590","savedPayload":{"position":{"x":22374.942438966485,"y":30204.086723294582},"targetPosition":{"x":22089.62548407794,"y":30111.3816249821},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Positions","name":"Organization Chart","id":"50c68665-5da2-48a8-b229-7a1563ae82d2"}}}],"id":"34876a2a-9cf0-4d58-8534-56d0d5ca7693","savedPayload":{"position":{"x":22089.62548407794,"y":30111.3816249821},"targetPosition":{"x":21804.308529189395,"y":30018.676526669617},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Pool Class","name":"Mantainance","config":"{}","project":"Governance","poolClasses":[],"pools":[{"type":"Pool","name":"Bug Fixes","config":"{}","project":"Governance","poolClasses":[],"pools":[],"id":"654f41c2-a640-4021-acf8-9b6b924bbc63","savedPayload":{"position":{"x":22254.707742169918,"y":30383.402617904838},"targetPosition":{"x":21980.644104877138,"y":30261.3816249821},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Pool","name":"Improvements","config":"{}","project":"Governance","poolClasses":[],"pools":[],"id":"a9d8e26e-e18a-4014-89e1-8eb5d1fcf703","savedPayload":{"position":{"x":22012.002643857435,"y":30559.73819359258},"targetPosition":{"x":21980.644104877138,"y":30261.3816249821},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"a6a443dd-9b50-4aa7-9cef-21Line truncated
@@ -1 +1 @@
{"type":"Workspace","name":"Governance Demo","rootNodes":[{"type":"Plugins","name":"New Plugins","project":"Foundations","pluginProjects":[{"type":"Plugin Project","name":"Foundations","config":"{ \n \"codeName\": \"Foundations\"\n}","project":"Foundations","id":"c4e402d7-5228-408c-9d67-379d6ef40bae","savedPayload":{"position":{"x":36401.378281255034,"y":10710.552375894946},"targetPosition":{"x":36101.378281255034,"y":10710.552375894946},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plugin Project","name":"Governance","config":"{\"codeName\":\"Governance\"}","project":"Foundations","id":"22eadd2a-38ab-4c0c-a49d-48747c927855","savedPayload":{"position":{"x":35801.378281255034,"y":10710.552375894946},"targetPosition":{"x":36101.378281255034,"y":10710.552375894946},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"bfb0b514-3b9f-4e9a-85ca-d0ca714b09f6","savedPayload":{"position":{"x":36101.378281255034,"y":10710.552375894946},"targetPosition":{"x":36101.378281255034,"y":10710.552375894946},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Design Space","name":"My Design Space","project":"Foundations","spaceStyle":{"type":"Space Style","name":"My Space Style","config":"{\n \"backgroundColor\": \"UI_COLOR.BLACK\",\n \"node\": {\n \"fontSize\": 16,\n \"imageSize\": 60,\n \"type\": {\n \"fontColor\": \"UI_COLOR.WHITE\"\n },\n \"name\": {\n \"fontColor\": \"UI_COLOR.WHITE\"\n },\n \"menuItem\": {\n \"backgroundColor\": \"UI_COLOR.BLACK\",\n \"fontColor\": \"UI_COLOR.WHITE\",\n \"fontSize\": 14,\n \"imageSize\": 14\n }\n }\n}","project":"Foundations","id":"fad0e429-f7a7-4b62-a2a5-2ead29b8f695","savedPayload":{"position":{"x":25240.875,"y":10717.347826086958},"targetPosition":{"x":24940.875,"y":10717.347826086958},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"spaceSettings":{"type":"Space Settings","name":"New Space Settings","config":"{\n \"node\": {\n \"distancePercentage\": 60,\n \"radiusPercentage\": 85,\n \"massPercentage\": 100,\n \"animationSteps\": 2,\n \"menuItem\": {\n \"widthPercentage\": 100,\n \"heightPercentage\": 60,\n \"radiusPercentage\": 90\n }\n },\n \"physics\": false\n}","project":"Foundations","id":"05c9d6d5-24c4-4eec-9aca-9668d6486fdd","savedPayload":{"position":{"x":24640.875,"y":10717.347826086958},"targetPosition":{"x":24940.875,"y":10717.347826086958},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"f8485ce5-67f3-4476-b9e2-80994e49c318","savedPayload":{"position":{"x":24940.875,"y":10717.347826086958},"targetPosition":{"x":24940.875,"y":10717.347826086958},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"frame":{"position":{"x":255,"y":588.3125}}}},{"type":"APIs","name":"New APIs","project":"Foundations","githubAPI":{"type":"Github API","name":"New Github API","config":"{\n \"username\": \"\",\n \"token\": \"\"\n}","project":"Foundations","id":"90d121ab-9f19-4437-a051-1222287085fc","savedPayload":{"position":{"x":30630.458333333332,"y":10730.006707946337},"targetPosition":{"x":30330.458333333332,"y":10730.006707946337},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"23021bb7-9997-4fe6-8199-71ebf70aef76","savedPayload":{"position":{"x":30330.458333333332,"y":10730.006707946337},"targetPosition":{"x":30330.458333333332,"y":10730.006707946337},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Governance Project","name":"New Governance Project","project":"Governance","projectDefinition":{"type":"Project Definition","name":"Governance","config":"{ \n \"codeName\": \"Governance\"\n}","project":"Foundations","id":"ba1aa656-d184-493a-b332-e4db109065f0","savedPayload":{"position":{"x":13832,"y":10738.5},"targetPosition":{"x":13532,"y":10738.5},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"db380c52-cf90-475b-87df-c005dd51cdf6","savedPayload":{"position":{"x":135Line truncated
{"type":"Workspace","name":"Governance-Demo","rootNodes":[{"type":"Design Space","name":"My Design Space","project":"Foundations","spaceStyle":{"type":"Space Style","name":"My Space Style","config":"{\n \"backgroundColor\": \"UI_COLOR.BLACK\",\n \"node\": {\n \"fontSize\": 16,\n \"imageSize\": 60,\n \"type\": {\n \"fontColor\": \"UI_COLOR.WHITE\"\n },\n \"name\": {\n \"fontColor\": \"UI_COLOR.WHITE\"\n },\n \"menuItem\": {\n \"backgroundColor\": \"UI_COLOR.BLACK\",\n \"fontColor\": \"UI_COLOR.WHITE\",\n \"fontSize\": 14,\n \"imageSize\": 14\n }\n }\n}","project":"Foundations","id":"fad0e429-f7a7-4b62-a2a5-2ead29b8f695","savedPayload":{"position":{"x":25240.875,"y":10717.347826086958},"targetPosition":{"x":24940.875,"y":10717.347826086958},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"spaceSettings":{"type":"Space Settings","name":"New Space Settings","config":"{\n \"node\": {\n \"distancePercentage\": 60,\n \"radiusPercentage\": 85,\n \"massPercentage\": 100,\n \"animationSteps\": 2,\n \"menuItem\": {\n \"widthPercentage\": 100,\n \"heightPercentage\": 60,\n \"radiusPercentage\": 90\n }\n },\n \"physics\": false\n}","project":"Foundations","id":"05c9d6d5-24c4-4eec-9aca-9668d6486fdd","savedPayload":{"position":{"x":24640.875,"y":10717.347826086958},"targetPosition":{"x":24940.875,"y":10717.347826086958},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"f8485ce5-67f3-4476-b9e2-80994e49c318","savedPayload":{"position":{"x":24940.875,"y":10717.347826086958},"targetPosition":{"x":24940.875,"y":10717.347826086958},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"frame":{"position":{"x":255,"y":588.3125}}}},{"type":"APIs","name":"New APIs","project":"Foundations","githubAPI":{"type":"Github API","name":"New Github API","config":"{\n \"username\": \"\",\n \"token\": \"\"\n}","project":"Foundations","id":"90d121ab-9f19-4437-a051-1222287085fc","savedPayload":{"position":{"x":30630.458333333332,"y":10730.006707946337},"targetPosition":{"x":30330.458333333332,"y":10730.006707946337},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"23021bb7-9997-4fe6-8199-71ebf70aef76","savedPayload":{"position":{"x":30330.458333333332,"y":10730.006707946337},"targetPosition":{"x":30330.458333333332,"y":10730.006707946337},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Governance Project","name":"New Governance Project","project":"Governance","projectDefinition":{"type":"Project Definition","name":"Governance","config":"{ \n \"codeName\": \"Governance\"\n}","project":"Foundations","id":"ba1aa656-d184-493a-b332-e4db109065f0","savedPayload":{"position":{"x":13832,"y":10738.5},"targetPosition":{"x":13532,"y":10738.5},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"db380c52-cf90-475b-87df-c005dd51cdf6","savedPayload":{"position":{"x":13532,"y":10738.5},"targetPosition":{"x":13532,"y":10738.5},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"User Profile","name":"Luis Fernando Molina","config":"{\n \"codeName\": \"Jun 2021\",\n \"tokens\": 1000000\n}","project":"Governance","contributionClaims":{"type":"Contribution Claims","name":"New Contribution Claims","config":"{\n\"codeName\": \"\"\n}","project":"Governance","assetContributionsFolder":[{"type":"Asset Contributions Folder","name":"Software","config":"{\n \"description\": \"\"\n}","project":"Governance","assetContributionsFolder":[{"type":"Asset Contributions Folder","name":"Plugins","config":"{\n \"description\": \"\"\n}","project":"Governance","assetContributionsFolder":[{"type":"Asset Contributions Folder","name":"Data-Mines","config":"{\n \"description\": \"\"\n}","project":"Governance","assetContributionsFolder":[],"assetContributionClaims":[{"type":"Asset Contribution Claim","name":"Plugins Data-Mines Candles","config":"{\n \"description\": \"\"\n}","project":"Governance","id":"f44b3d0f-cb22-4f0f-a550-ce53224db391","savedPayload":{"position":{"x":29746.912956127882,"y":22479.311870400597},"targetPosition":{"x":30184.228161873478,"y":22373.220349421354},"floatingObject":{"isPinneLine truncated
@@ -0,0 +1,37 @@
{
"type": "Plugin Assets",
"menuItems": [
{
"action": "Add Missing Plugin Assets",
"label": "Add Missing Assets",
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "Assets",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
}
],
"addLeftIcons": true,
"level": 1,
"propertyNameAtParent": "pluginAssets",
"attachingRules": {
"compatibleTypes": "->Plugin Project->"
},
"childrenNodesProperties": [
{
"name": "pluginFiles",
"type": "array",
"childType": "Plugin File",
"autoAdd": false
}
]
}
@@ -0,0 +1,37 @@
{
"type": "Plugin Features",
"menuItems": [
{
"action": "Add Missing Plugin Features",
"label": "Add Missing Features",
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "Features",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
}
],
"addLeftIcons": true,
"level": 1,
"propertyNameAtParent": "pluginFeatures",
"attachingRules": {
"compatibleTypes": "->Plugin Project->"
},
"childrenNodesProperties": [
{
"name": "pluginFiles",
"type": "array",
"childType": "Plugin File",
"autoAdd": false
}
]
}
@@ -0,0 +1,37 @@
{
"type": "Plugin Pools",
"menuItems": [
{
"action": "Add Missing Plugin Pools",
"label": "Add Missing Pools",
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "Pools",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
}
],
"addLeftIcons": true,
"level": 1,
"propertyNameAtParent": "pluginPools",
"attachingRules": {
"compatibleTypes": "->Plugin Project->"
},
"childrenNodesProperties": [
{
"name": "pluginFiles",
"type": "array",
"childType": "Plugin File",
"autoAdd": false
}
]
}
@@ -0,0 +1,37 @@
{
"type": "Plugin Positions",
"menuItems": [
{
"action": "Add Missing Plugin Positions",
"label": "Add Missing Positions",
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "Positions",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
}
],
"addLeftIcons": true,
"level": 1,
"propertyNameAtParent": "pluginPositions",
"attachingRules": {
"compatibleTypes": "->Plugin Project->"
},
"childrenNodesProperties": [
{
"name": "pluginFiles",
"type": "array",
"childType": "Plugin File",
"autoAdd": false
}
]
}
@@ -0,0 +1,37 @@
{
"type": "Plugin User Profiles",
"menuItems": [
{
"action": "Add Missing Plugin User Profiles",
"label": "Add Missing User Profiles",
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "User Profile",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
}
],
"addLeftIcons": true,
"level": 1,
"propertyNameAtParent": "pluginUserProfiles",
"attachingRules": {
"compatibleTypes": "->Plugin Project->"
},
"childrenNodesProperties": [
{
"name": "pluginFiles",
"type": "array",
"childType": "Plugin File",
"autoAdd": false
}
]
}
@@ -24,6 +24,31 @@ function newGovernanceActionSwitch() {
break
}
}
case 'Add Missing Plugin User Profiles':
{
UI.projects.governance.functionLibraries.pluginsFunctions.addMissingPluginUserProfiles(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Pools':
{
UI.projects.governance.functionLibraries.pluginsFunctions.addMissingPluginPools(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Features':
{
UI.projects.governance.functionLibraries.pluginsFunctions.addMissingPluginFeatures(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Assets':
{
UI.projects.governance.functionLibraries.pluginsFunctions.addMissingPluginAssets(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Positions':
{
UI.projects.governance.functionLibraries.pluginsFunctions.addMissingPluginPositions(action.node, action.rootNodes)
}
break
}
}
}
@@ -9,7 +9,7 @@ function newGovernanceFunctionLibraryAssets() {
node,
rootNodes
) {
let folderPath = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload, 'folderPath')
let folderPath = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload, 'folderPath')
if (folderPath === undefined || folderPath === "") {
node.payload.uiObject.setErrorMessage("folderPath Config Property undefined.")
@@ -71,7 +71,7 @@ function newGovernanceFunctionLibraryAssets() {
case 'node': {
let childNode = node[property.name]
if (childNode !== undefined) {
let codeName = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(childNode.payload, 'codeName')
let codeName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(childNode.payload, 'codeName')
if (nextItem === codeName) {
exist = true
createNodesFromPath(childNode, pathArray)
@@ -85,7 +85,7 @@ function newGovernanceFunctionLibraryAssets() {
for (let m = 0; m < propertyArray.length; m++) {
let childNode = propertyArray[m]
if (childNode !== undefined) {
let codeName = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(childNode.payload, 'codeName')
let codeName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(childNode.payload, 'codeName')
if (nextItem === codeName) {
exist = true
createNodesFromPath(childNode, pathArray)
@@ -0,0 +1,90 @@
function newGovernanceFunctionLibraryPluginsFunctions() {
let thisObject = {
addMissingPluginUserProfiles: addMissingPluginUserProfiles,
addMissingPluginPools: addMissingPluginPools,
addMissingPluginAssets: addMissingPluginAssets,
addMissingPluginFeatures: addMissingPluginFeatures,
addMissingPluginPositions: addMissingPluginPositionss
}
return thisObject
function addMissingPluginUserProfiles(node, rootNodes) {
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.")
return
}
}
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'User-Profiles', onNamesArrived)
function onNamesArrived(fileNames) {
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
}
}
function addMissingPluginPools(node, rootNodes) {
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.")
return
}
}
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Pools', onNamesArrived)
function onNamesArrived(fileNames) {
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
}
}
function addMissingPluginAssets(node, rootNodes) {
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.")
return
}
}
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Assets', onNamesArrived)
function onNamesArrived(fileNames) {
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
}
}
function addMissingPluginFeatures(node, rootNodes) {
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.")
return
}
}
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Features', onNamesArrived)
function onNamesArrived(fileNames) {
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
}
}
function addMissingPluginPositionss(node, rootNodes) {
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.")
return
}
}
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Positions', onNamesArrived)
function onNamesArrived(fileNames) {
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
}
}
}
@@ -26,7 +26,7 @@ function newGovernanceFunctionLibraryTokens() {
}
function poolsDistribute(pools) {
let tokens = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(pools.payload, 'tokens')
let tokens = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(pools.payload, 'tokens')
distributeTokens(pools, tokens)
}
@@ -105,7 +105,7 @@ function newGovernanceFunctionLibraryVotes() {
}
function distributeForProfile(userProfile) {
let votes = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(userProfile.payload, 'tokens')
let votes = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(userProfile.payload, 'tokens')
distributeVotes(userProfile, votes)
}
@@ -160,7 +160,7 @@ function newGovernanceFunctionLibraryVotes() {
if (node.type === 'User Profile' && property.name === "votesDistribution") {
let childNode = node[property.name]
if (childNode === undefined) { continue }
let percentage = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(childNode.payload, 'percentage')
let percentage = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(childNode.payload, 'percentage')
if (percentage !== undefined && isNaN(percentage) !== true) {
totalPercentage = totalPercentage + percentage
} else {
@@ -175,7 +175,7 @@ function newGovernanceFunctionLibraryVotes() {
for (let m = 0; m < propertyArray.length; m++) {
let childNode = propertyArray[m]
if (childNode === undefined) { continue }
let percentage = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(childNode.payload, 'percentage')
let percentage = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(childNode.payload, 'percentage')
if (percentage !== undefined && isNaN(percentage) !== true) {
totalPercentage = totalPercentage + percentage
} else {
@@ -208,7 +208,7 @@ function newGovernanceFunctionLibraryVotes() {
if (node.type === 'User Profile' && property.name === "votesDistribution") {
let childNode = node[property.name]
if (childNode === undefined) { continue }
let percentage = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(childNode.payload, 'percentage')
let percentage = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(childNode.payload, 'percentage')
if (percentage === undefined || isNaN(percentage) === true) {
percentage = defaultPercentage
}
@@ -222,7 +222,7 @@ function newGovernanceFunctionLibraryVotes() {
for (let m = 0; m < propertyArray.length; m++) {
let childNode = propertyArray[m]
if (childNode === undefined) { continue }
let percentage = UI.projects.foundations.utilities.nodeConfig.loadPropertyFromNodeConfig(childNode.payload, 'percentage')
let percentage = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(childNode.payload, 'percentage')
if (percentage === undefined || isNaN(percentage) === true) {
percentage = defaultPercentage
}
+32 -4
View File
@@ -212,6 +212,11 @@
"name": "Status Bar",
"propertyName": "statusBar",
"functionName": "newFoundationsUtilitiesStatusBar"
},
{
"name": "Plugins",
"propertyName": "plugins",
"functionName": "newFoundationsUtilitiesPlugins"
}
],
"spaces": [
@@ -247,7 +252,7 @@
"functionName": "newFoundationsCockpitSpace",
"initializationIndex": 2,
"animationPhysicsIndex": 0,
"animationDrawIndex": 6,
"animationDrawIndex": 5,
"onMouseWheelIndex": 3,
"onMouseOverIndex": 2,
"onMouseClickIndex": 2,
@@ -299,7 +304,7 @@
"functionName": "newFoundationsSideSpace",
"initializationIndex": 6,
"animationPhysicsIndex": 6,
"animationDrawIndex": 5,
"animationDrawIndex": 6,
"onMouseWheelIndex": 1,
"onMouseOverIndex": 2,
"onMouseClickIndex": 6,
@@ -853,7 +858,18 @@
}
]
},
"CL": {}
"CL": {},
"plugins": [
"Data Mines",
"Trading Mines",
"Learning Mines",
"Trading Systems",
"Learning Systems",
"Trading Engines",
"Learning Engines",
"Tutorials",
"API Maps"
]
},
{
"name": "Ethereum",
@@ -971,6 +987,11 @@
"name": "Distribution Process",
"propertyName": "distributionProcess",
"functionName": "newGovernanceFunctionLibraryDistributionProcess"
},
{
"name": "Plugins Functions",
"propertyName": "pluginsFunctions",
"functionName": "newGovernanceFunctionLibraryPluginsFunctions"
}
],
"utilities": [],
@@ -1043,7 +1064,14 @@
]
},
"TS": {},
"CL": {}
"CL": {},
"plugins": [
"User Profiles",
"Pools",
"Assets",
"Features",
"Positions"
]
},
{
"name": "Education",