From c211512cdc40539fec79cff49280c6933b77dcee Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 11 Oct 2020 10:49:25 +0200 Subject: [PATCH] fix --- DesignSpace/Workspace/Workspace.js | 8 -------- Spaces/TutorialSpace.js | 25 ++++++++++++++++++------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/DesignSpace/Workspace/Workspace.js b/DesignSpace/Workspace/Workspace.js index 490eb3c71..ac75c318d 100644 --- a/DesignSpace/Workspace/Workspace.js +++ b/DesignSpace/Workspace/Workspace.js @@ -183,14 +183,6 @@ function newWorkspace() { /* Validation if it is too early to save. */ if (isInitialized === false) { return } - /* Validation of that the user changed the workspace name at least once. */ - if (workspace.name === 'Default') { - canvas.cockpitSpace.setStatus( - 'Could not save the Workspace. Please rename the Workspace so that it can be saved.' - , 150, canvas.cockpitSpace.statusTypes.WARNING) - return - } - /* Validation of 2 sessions opened at the same time. */ let savedSessionTimestamp = window.localStorage.getItem('Session Timestamp') if (Number(savedSessionTimestamp) !== sessionTimestamp) { diff --git a/Spaces/TutorialSpace.js b/Spaces/TutorialSpace.js index 72ff6f7e1..f97be1c3d 100644 --- a/Spaces/TutorialSpace.js +++ b/Spaces/TutorialSpace.js @@ -65,6 +65,7 @@ function newTutorialSpace() { let changeNodeConfigCounterWithEval = 0 let documentationCounter = 0 let batchConfigChangesCounter = 0 + let workspacesCounter = 0 return thisObject @@ -275,6 +276,7 @@ function newTutorialSpace() { function checkWorkspaces() { if (currentNode === undefined) { return } let config = JSON.parse(currentNode.config) + workspacesCounter++ if (config.workspaces === undefined) { /* The worspaces panel will remain as it is, and the user will be free to open or close it at will. @@ -285,14 +287,18 @@ function newTutorialSpace() { /* This forces the tutorial to close the workspaces panel and to keep it closed. */ - canvas.sideSpace.sidePanelTab.close() + if (workspacesCounter === 5) { + canvas.sideSpace.sidePanelTab.close() + } return } if (config.workspaces === "Open") { /* - This forces the tutorial to close the workspaces panel and to keep it closed. + This forces the tutorial to open the workspaces panel and to keep it closed. */ - canvas.sideSpace.sidePanelTab.open() + if (workspacesCounter === 5) { + canvas.sideSpace.sidePanelTab.open() + } return } } @@ -308,7 +314,7 @@ function newTutorialSpace() { } sliderCounter++ if (sliderCounter === 10 || sliderCounter === 100) { - + switch (config.slider) { case "toTop": { /* @@ -444,10 +450,10 @@ function newTutorialSpace() { currentNode.payload.uiObject.setErrorMessage('Node Path is incorrect. See console log for details.') break } - } + } partialPath = partialPath + separator + part separator = '.' - + partialNode = eval(partialPath) if (partialNode === undefined) { console.log(MODULE_NAME + ' -> This part can not be undefined -> part = ' + part) @@ -743,6 +749,7 @@ function newTutorialSpace() { function resetAfterButtonPressed() { resetViewport() resetActions() + resetWorkspaces() resetDocumentation() resetRepositionAtTimeMachine() resetPositionAtNode() @@ -762,6 +769,10 @@ function newTutorialSpace() { viewportCentered = false } + function resetWorkspaces() { + workspacesCounter = 0 + } + function resetDocumentation() { currentDocumentationURL = '' documentationCounter = 0 @@ -987,7 +998,7 @@ function newTutorialSpace() { if (tutorialStep.id === currentNode.id) { found = true } - } + } } for (let i = 0; i < node.tutorialTopics.length; i++) {