From f252811b34452779b99aa2fe7abd8eabc8414754 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 23 Nov 2020 16:07:14 +0100 Subject: [PATCH] Project Data Products --- .../LearningSessionFunctions.js | 2 +- .../Function-Libraries/TaskFunctions.js | 3 +- .../TradingSessionFunctions.js | 2 +- Projects/Superalgos/Schemas/AppSchema.json | 62 +++++++++++++++++-- 4 files changed, 60 insertions(+), 9 deletions(-) diff --git a/Projects/Superalgos/Function-Libraries/LearningSessionFunctions.js b/Projects/Superalgos/Function-Libraries/LearningSessionFunctions.js index 83a1f2ebf..e56e35759 100644 --- a/Projects/Superalgos/Function-Libraries/LearningSessionFunctions.js +++ b/Projects/Superalgos/Function-Libraries/LearningSessionFunctions.js @@ -209,7 +209,7 @@ function newSuperalgosFunctionLibraryLearningSessionFunctions() { return } - let networkNode = taskManager.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode + let networkNode = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(taskManager, 'Network Node', undefined, true, false, true, false) if (node.tradingSystemReference === undefined) { node.payload.uiObject.setErrorMessage('Session needs a child Trading System Reference.') diff --git a/Projects/Superalgos/Function-Libraries/TaskFunctions.js b/Projects/Superalgos/Function-Libraries/TaskFunctions.js index bc8a8c399..029231c0f 100644 --- a/Projects/Superalgos/Function-Libraries/TaskFunctions.js +++ b/Projects/Superalgos/Function-Libraries/TaskFunctions.js @@ -249,7 +249,8 @@ function newSuperalgosFunctionLibraryTaskFunctions() { return } - let networkNode = taskManager.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode + let networkNode = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(taskManager, 'Network Node', undefined, true, false, true, false) + if (UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(networkNode.payload, 'host') === undefined) { node.payload.uiObject.setErrorMessage('Network Node needs to have a valid Host property at its config.') return diff --git a/Projects/Superalgos/Function-Libraries/TradingSessionFunctions.js b/Projects/Superalgos/Function-Libraries/TradingSessionFunctions.js index 60b43580a..4ece16d05 100644 --- a/Projects/Superalgos/Function-Libraries/TradingSessionFunctions.js +++ b/Projects/Superalgos/Function-Libraries/TradingSessionFunctions.js @@ -209,7 +209,7 @@ function newSuperalgosFunctionLibraryTradingSessionFunctions() { return } - let networkNode = taskManager.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode + let networkNode = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(taskManager, 'Network Node', undefined, true, false, true, false) if (node.tradingSystemReference === undefined) { node.payload.uiObject.setErrorMessage('Session needs a child Trading System Reference.') diff --git a/Projects/Superalgos/Schemas/AppSchema.json b/Projects/Superalgos/Schemas/AppSchema.json index 075c13f46..d8dd947b6 100644 --- a/Projects/Superalgos/Schemas/AppSchema.json +++ b/Projects/Superalgos/Schemas/AppSchema.json @@ -16562,7 +16562,7 @@ "compatibleTypes": "->Crypto Exchange->" }, "chainAttachesTo": { - "compatibleTypes": "->Data Mines Data->" + "compatibleTypes": "->Project Data Products->" }, "propertyNameAtParent": "exchangeDataProducts", "properties": [ @@ -16575,6 +16575,48 @@ }, { "type": "Data Mines Data", + "menuItems": [ + { + "action": "Add UI Object", + "label": "Add Project Data Products", + "relatedUiObject": "Project Data Products", + "actionFunction": "payload.executeAction" + }, + { + "action": "Add Missing Project Data Products", + "label": "Add Missing Projects", + "askConfirmation": true, + "confirmationLabel": "Confirm to Proceed", + "workDoneLabel": "Done", + "relatedUiObject": "Project Data Products", + "actionFunction": "payload.executeAction" + }, + { + "action": "Delete UI Object", + "askConfirmation": true, + "confirmationLabel": "Confirm to Delete", + "label": "Delete", + "iconPathOn": "delete", + "iconPathOff": "delete", + "actionFunction": "payload.executeAction" + } + ], + "addLeftIcons": true, + "level": 3, + "chainAttachesTo": { + "compatibleTypes": "->Data Storage->" + }, + "propertyNameAtParent": "dataMinesData", + "properties": [ + { + "name": "projectDataProducts", + "type": "array", + "childType": "Project Data Products" + } + ] + }, + { + "type": "Project Data Products", "menuItems": [ { "action": "Add UI Object", @@ -16601,19 +16643,27 @@ "actionFunction": "payload.executeAction" } ], + "title": [ + "Use Reference Parent" + ], + "alternativeIcons": "Use Reference Parent Parent", "addLeftIcons": true, - "level": 3, - "chainAttachesTo": { - "compatibleTypes": "->Data Storage->" + "level": 2, + "referenceAttachesTo": { + "compatibleTypes": "->Project Definition->" }, - "propertyNameAtParent": "dataMinesData", + "chainAttachesTo": { + "compatibleTypes": "->Data Mines Data->Trading Mines Data->Learning Mines Data->" + }, + "propertyNameAtParent": "projectDataProducts", "properties": [ { "name": "exchangeDataProducts", "type": "array", "childType": "Exchange Data Products" } - ] + ], + "icon":"bitcoin" }, { "type": "Exchange Trading Products",