From 89777a0aef1faf2cedbcf5c7663dd990075c0d15 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 16 Sep 2020 16:44:54 +0200 Subject: [PATCH] Issues fixed --- .../ChartingSpaceFunctions.js | 3 +- .../CryptoEcosystemFunctions.js | 34 +++++-------------- Panels/Layer.js | 2 +- 3 files changed, 11 insertions(+), 28 deletions(-) diff --git a/DesignSpace/Workspace/FunctionLibraries/ChartingSpaceFunctions.js b/DesignSpace/Workspace/FunctionLibraries/ChartingSpaceFunctions.js index f58d93b0c..ded2d034d 100644 --- a/DesignSpace/Workspace/FunctionLibraries/ChartingSpaceFunctions.js +++ b/DesignSpace/Workspace/FunctionLibraries/ChartingSpaceFunctions.js @@ -147,8 +147,7 @@ function newChartingSpaceFunctions() { that are not the one we are interested in, we do the following: */ if (mineProduct.payload.parentNode === undefined) { continue } - if (mineProduct.payload.parentNode.payload.parentNode.payload.referenceParent === undefined) { continue } - if (mineProduct.payload.parentNode.payload.parentNode.payload.referenceParent.id !== session.id) { continue } + if (mineProduct.payload.parentNode.payload.referenceParent.id !== session.id) { continue } /* At the current version of Superalgos, beta 6, there is only one Trading Mine, with only one bot, and it has so many data products that we want to put them diff --git a/DesignSpace/Workspace/FunctionLibraries/CryptoEcosystemFunctions.js b/DesignSpace/Workspace/FunctionLibraries/CryptoEcosystemFunctions.js index 579d3a0c9..b010b2525 100644 --- a/DesignSpace/Workspace/FunctionLibraries/CryptoEcosystemFunctions.js +++ b/DesignSpace/Workspace/FunctionLibraries/CryptoEcosystemFunctions.js @@ -316,41 +316,25 @@ function newCryptoEcosystemFunctions() { let exchangeTradingProducts = findOrCreateChildWithReference(tradingMinesData, 'Exchange Trading Products', cryptoExchange, functionLibraryUiObjectsFromNodes) exchangeTradingProducts.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180 - /* - We need to delete all the session references related to the market we are installing. - We make a copy of the array so that if we need to delete some nodes it does not - affect the loop evaluating the nodes. - */ - let sessionReferencesArray = [] - for (let i = 0; i < exchangeTradingProducts.sessionReferences.length; i++) { - sessionReference = exchangeTradingProducts.sessionReferences[i] - sessionReferencesArray.push(sessionReference) - } - for (let i = 0; i < sessionReferencesArray.length; i++) { - sessionReference = sessionReferencesArray[i] - if (sessionReference.marketTradingProducts === undefined) { continue } - if (sessionReference.marketTradingProducts.payload.referenceParent === undefined) { continue } - if (sessionReference.marketTradingProducts.payload.referenceParent.id === node.id) { - functionLibraryNodeDeleter.deleteUIObject(sessionReference, rootNodes) - } - } + let marketTradingProducts = findAndRecreateChildWithReference(exchangeTradingProducts, 'Market Trading Products', market, rootNodes, functionLibraryUiObjectsFromNodes, functionLibraryNodeDeleter) + marketTradingProducts.payload.floatingObject.collapseToggle() /* Create the new session references. */ for (let i = 0; i < sessionsCreatedArray.length; i++) { let session = sessionsCreatedArray[i] - if (isMissingChildren(exchangeTradingProducts, session, true) === true) { - functionLibraryDataStorageFunctions.createSessionReference(exchangeTradingProducts, session, functionLibraryUiObjectsFromNodes) + if (isMissingChildren(marketTradingProducts, session, true) === true) { + functionLibraryDataStorageFunctions.createSessionReference(marketTradingProducts, session, functionLibraryUiObjectsFromNodes) } } /* Create everything inside the session references. */ - for (let j = 0; j < exchangeTradingProducts.sessionReferences.length; j++) { - sessionReference = exchangeTradingProducts.sessionReferences[j] - menuClick(sessionReference.marketTradingProducts, 'Add All Trading Mine Products', true) - menuClickOfNodeArray(sessionReference.marketTradingProducts.tradingMineProducts, 'Add All Data Products', true) - sessionReference.marketTradingProducts.payload.floatingObject.collapseToggle() + for (let j = 0; j < marketTradingProducts.sessionReferences.length; j++) { + sessionReference = marketTradingProducts.sessionReferences[j] + menuClick(sessionReference, 'Add All Trading Mine Products', true) + menuClickOfNodeArray(sessionReference.tradingMineProducts, 'Add All Data Products', true) + sessionReference.payload.floatingObject.collapseToggle() } } } diff --git a/Panels/Layer.js b/Panels/Layer.js index 885280d3e..db36f4226 100644 --- a/Panels/Layer.js +++ b/Panels/Layer.js @@ -163,7 +163,7 @@ function newLayer() { 'Data Product Folder->Data Product Folder->Data Product Folder->Data Product Folder->Data Product Folder->' + 'Bot Products->Data Mine Products->Trading Mine Products->' + 'Market Data Products->Exchange Data Products->' + - 'Market Trading Products->Session Reference->Exchange Trading Products->' + + 'Session Reference->Market Trading Products->Exchange Trading Products->' + 'Data Mines Data->Trading Mines Data->Data Storage->Network Node->' + 'Data Storage->Network Node->' + 'Backtesting Session->Paper Trading Session->Forward Testing Session->Live Trading Session->' +