From c77b9af992f29d02c443ad7abe3a1b7d32e5e4dc Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 18 Sep 2020 15:37:14 +0200 Subject: [PATCH] Tutorials Fixed --- AppSchema.json | 64 ++++++++++++++++++++++++++++++- CanvasApp/Spaces/TutorialSpace.js | 18 ++++++++- 2 files changed, 79 insertions(+), 3 deletions(-) diff --git a/AppSchema.json b/AppSchema.json index a22be4bc2..cf5384577 100644 --- a/AppSchema.json +++ b/AppSchema.json @@ -1432,6 +1432,12 @@ "label": "Add Tutorial", "relatedUiObject": "Tutorial", "actionFunction": "payload.onMenuItemClick" + }, + { + "action": "Add UI Object", + "label": "Add Includes", + "relatedUiObject": "Includes", + "actionFunction": "payload.onMenuItemClick" } ], "isTitleAllwaysVisible": true, @@ -14254,6 +14260,62 @@ } ] }, + { + "type": "Includes", + "menuItems": [ + { + "action": "Add Missing Children", + "label": "Add Missing Children", + "relatedUiObject": "Includes", + "actionFunction": "payload.onMenuItemClick" + }, + { + "action": "Delete UI Object", + "askConfirmation": true, + "confirmationLabel": "Confirm to Delete", + "label": "Delete", + "iconPathOn": "delete", + "iconPathOff": "delete", + "actionFunction": "payload.onMenuItemClick" + } + ], + "isHierarchyHead": true, + "addLeftIcons": true, + "level": 0, + "propertyNameAtParent": "includes", + "properties": [ + { + "name": "includedDataMines", + "type": "node", + "childType": "Included Data Mines", + "autoAdd": false + }, + { + "name": "includedTradingMines", + "type": "node", + "childType": "Included Trading Mines", + "autoAdd": false + }, + { + "name": "includedTradingSystems", + "type": "node", + "childType": "Included Trading Mines", + "autoAdd": false + }, + { + "name": "includedTradingEngines", + "type": "node", + "childType": "Included Trading Mines", + "autoAdd": false + }, + { + "name": "includedSuperScripts", + "type": "node", + "childType": "Included Trading Mines", + "autoAdd": false + } + ] + }, { "type": "Tutorial", "menuItems": [ @@ -14448,7 +14510,7 @@ }, "referenceAttachesTo": { "compatibleTypes": "->*Any Node*->", - "incompatibleTypes": "->Tutorial->Tutorial Topic->Tutorial Step->" + "incompatibleTypes": "->Tutorial Topic->Tutorial Step->" }, "chainAttachesTo": { "compatibleTypes": "->Tutorial->Tutorial Topic->" diff --git a/CanvasApp/Spaces/TutorialSpace.js b/CanvasApp/Spaces/TutorialSpace.js index e21a2eebd..76863cd51 100644 --- a/CanvasApp/Spaces/TutorialSpace.js +++ b/CanvasApp/Spaces/TutorialSpace.js @@ -328,6 +328,7 @@ function newTutorialSpace() { } function done() { + if (ckeckGoingToAnotherTutorial() === true ) {return} let tutorial = { status: 'Done' } @@ -335,6 +336,16 @@ function newTutorialSpace() { advance() } + function ckeckGoingToAnotherTutorial() { + if (currentNode.payload !== undefined) { + if (currentNode.payload.referenceParent !== undefined) { + if (currentNode.payload.referenceParent.type === 'Tutorial') { + playTutorial(currentNode.payload.referenceParent) + } + } + } + } + function playTutorialTopic(node) { currentTopicNode = node currentNode = node @@ -446,7 +457,6 @@ function newTutorialSpace() { } function findNextNode(node) { - for (let i = 0; i < node.tutorialSteps.length; i++) { let tutorialStep = node.tutorialSteps[i] @@ -519,6 +529,10 @@ function newTutorialSpace() { let html = '' if (nodeConfig.title !== undefined && nodeConfig.title !== '') { html = html + '

' + nodeConfig.title + '

' + } else { + if (currentNode.name !== 'New ' + currentNode.type) { + html = html + '

' + currentNode.name + '

' + } } html = html + '
' if (nodeConfig.summary !== undefined && nodeConfig.summary !== '') { @@ -554,7 +568,7 @@ function newTutorialSpace() { for (let i = 0; i < nodeConfig.bulletArray.length; i++) { let bullet = nodeConfig.bulletArray[i] html = html + '
  • ' - html = html + '

    ' + bullet[0] + ': ' + bullet[1] + '

    ' + html = html + '

    ' + bullet[0] + ' ' + bullet[1] + '

    ' html = html + '
  • ' } html = html + ''