From 93899e72ea1aa6d071f01a9b95004970086d667b Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 8 Jan 2021 17:58:51 +0100 Subject: [PATCH] Deleting the content of the config --- .../UI/Spaces/Tutorial-Space/TutorialSpace.js | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js b/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js index 28284c407..6179d9720 100644 --- a/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js +++ b/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js @@ -1115,9 +1115,16 @@ function newSuperalgosTutorialSpace() { function buildDocument() { let nodeConfig = JSON.parse(currentNode.config) - if (nodeConfig.docs !== undefined) {return} + if (nodeConfig.docs !== undefined) { return } + + if ( + (nodeConfig.subTitle === undefined || nodeConfig.subTitle === "") && + (nodeConfig.gif === undefined || nodeConfig.gif === "") && + (nodeConfig.warning === undefined || nodeConfig.warning === "") + ) { + return + } - if ((nodeConfig.subTitle === undefined || nodeConfig.subTitle === "") && (nodeConfig.gif === undefined || nodeConfig.gif === "")) { return } PAGE_NUMBER = PAGE_NUMBER + 1 const project = 'Superalgos' @@ -1253,12 +1260,26 @@ function newSuperalgosTutorialSpace() { UI.projects.superalgos.spaces.docsSpace.navigateTo(project, 'Tutorial', template.type) /* Here we will store the keys to access the Content from the Docs */ - nodeConfig.docs = { project: project, category: 'Tutorial', type: template.type } + /* Deleting all the in-configuration content */ + nodeConfig.title = undefined + nodeConfig.subTitle = undefined + nodeConfig.gif = undefined + nodeConfig.definition = undefined + nodeConfig.summary = undefined + nodeConfig.bulletListIntro = undefined + nodeConfig.bulletArray = undefined + nodeConfig.paragraph1 = undefined + nodeConfig.paragraph2 = undefined + nodeConfig.note = undefined + nodeConfig.warning = undefined + nodeConfig.tip = undefined + nodeConfig.important = undefined + nodeConfig.callOut = undefined currentNode.config = JSON.stringify(nodeConfig, undefined, 4) @@ -1286,9 +1307,10 @@ function newSuperalgosTutorialSpace() { if (newConfig === currentConfig) { return } currentConfig = newConfig - buildDocument() - let nodeConfig = JSON.parse(currentNode.config) + + if (nodeConfig.docs !== undefined) { return } // TODO Added this + let html = '' if (nodeConfig.title !== undefined && nodeConfig.title !== '') { html = html + '

' + nodeConfig.title + '

' @@ -1362,6 +1384,8 @@ function newSuperalgosTutorialSpace() { tutorialDiv.innerHTML = html + buildDocument() + function addToolTips(text) { const TOOL_TIP_HTML = '
NODE_TYPENODE_DEFINITION
' let resultingText = ''