diff --git a/Projects/Ethereum/Schemas/AppSchema.json b/Projects/Ethereum/Schemas/AppSchema.json index 30e3ea6d2..bab02a56b 100644 --- a/Projects/Ethereum/Schemas/AppSchema.json +++ b/Projects/Ethereum/Schemas/AppSchema.json @@ -47,24 +47,7 @@ "name": "projectDefinition", "type": "node", "childType": "Project Definition", - "autoAdd": true - }, - { - "name": "spaces", - "type": "node", - "childType": "Spaces", - "autoAdd": true - }, - { - "name": "mines", - "type": "node", - "childType": "Mines", - "autoAdd": true - }, - { - "name": "otherHierarchies", - "type": "node", - "childType": "Other Hierarchies", + "project" : "Superalgos", "autoAdd": true } ] diff --git a/Projects/Superalgos/Function-Libraries/UiObjectsFromNodes.js b/Projects/Superalgos/Function-Libraries/UiObjectsFromNodes.js index 8f65c8eca..d2722b51f 100644 --- a/Projects/Superalgos/Function-Libraries/UiObjectsFromNodes.js +++ b/Projects/Superalgos/Function-Libraries/UiObjectsFromNodes.js @@ -341,10 +341,7 @@ function newSuperalgosFunctionLibraryUiObjectsFromNodes() { project: project } - let parentNodeDefinition = getNodeDefinition(parentNode, project) - if (parentNodeDefinition === undefined) { - console.log('Cannot addUIOBject from parent of ' + type + ' because that type it is not defined at the APP_SCHEMA.') - } + let parentNodeDefinition /* Resolve Initial Values */ let nodeDefinition = getNodeDefinition(object, project) @@ -372,7 +369,14 @@ function newSuperalgosFunctionLibraryUiObjectsFromNodes() { createUiObject(true, object.type, object.name, object, parentNode, undefined) autoAddChildren() return object + } else { + + parentNodeDefinition = getNodeDefinition(parentNode, parentNode.project) + if (parentNodeDefinition === undefined) { + console.log('Cannot addUIOBject from parent of ' + type + ' because that type it is not defined at the APP_SCHEMA.') + return + } checkChainToSelfTypeCollection() initializeArrayProperties() applyInitialValues() @@ -384,7 +388,7 @@ function newSuperalgosFunctionLibraryUiObjectsFromNodes() { function checkChainToSelfTypeCollection() { /* For the cases where a node is not chained to its parent but to the one at the parent before it at its own collection */ - + if (nodeDefinition.chainedToSameType === true) { if (parentNodeDefinition.properties !== undefined) { for (let i = 0; i < parentNodeDefinition.properties.length; i++) { @@ -474,7 +478,8 @@ function newSuperalgosFunctionLibraryUiObjectsFromNodes() { case 'node': { if (property.name !== previousPropertyName) { if (property.autoAdd === true) { - addUIObject(object, property.childType) + let project = property.project + addUIObject(object, property.childType, undefined, project) previousPropertyName = property.name } } @@ -485,7 +490,8 @@ function newSuperalgosFunctionLibraryUiObjectsFromNodes() { if (object[property.name] === undefined) { object[property.name] = [] } - addUIObject(object, property.childType) + let project = property.project + addUIObject(object, property.childType, undefined, project) } } break