diff --git a/src/actions/tutorialActions.js b/src/actions/tutorialActions.js index c6efc3e..ec0e67b 100644 --- a/src/actions/tutorialActions.js +++ b/src/actions/tutorialActions.js @@ -18,13 +18,14 @@ export const getTutorial = (id) => (dispatch, getState) => { type: GET_TUTORIAL, payload: tutorial }); + dispatch(returnSuccess(res.data.message, res.status)); }); }) .catch(err => { - dispatch({type: TUTORIAL_PROGRESS}); if(err.response){ dispatch(returnErrors(err.response.data.message, err.response.status, 'GET_TUTORIAL_FAIL')); } + dispatch({type: TUTORIAL_PROGRESS}); }); }; @@ -44,13 +45,14 @@ export const getTutorials = () => (dispatch, getState) => { payload: tutorials }); dispatch({type: TUTORIAL_PROGRESS}); + dispatch(returnSuccess(res.data.message, res.status)); }); }) .catch(err => { - dispatch({type: TUTORIAL_PROGRESS}); if(err.response){ dispatch(returnErrors(err.response.data.message, err.response.status, 'GET_TUTORIALS_FAIL')); } + dispatch({type: TUTORIAL_PROGRESS}); }); }; diff --git a/src/components/Tutorial/Assessment.js b/src/components/Tutorial/Assessment.js index 14ad23b..be845ee 100644 --- a/src/components/Tutorial/Assessment.js +++ b/src/components/Tutorial/Assessment.js @@ -34,7 +34,7 @@ class Assessment extends Component { return (
{currentTask.headline} -
+
{this.props.isLoading ? null : - !this.props.tutorial ? + !this.props.tutorial ? + this.props.message.id === 'GET_TUTORIAL_FAIL' ? : null : (() => { var tutorial = this.props.tutorial; var steps = this.props.tutorial.steps; diff --git a/src/components/Tutorial/TutorialHome.js b/src/components/Tutorial/TutorialHome.js index f6bb7b9..9c7a2ce 100644 --- a/src/components/Tutorial/TutorialHome.js +++ b/src/components/Tutorial/TutorialHome.js @@ -58,7 +58,6 @@ class TutorialHome extends Component { componentDidUpdate(props, state) { if(this.props.message.id === 'GET_TUTORIALS_FAIL'){ alert(this.props.message.msg); - this.props.clearMessages(); } } diff --git a/src/components/WorkspaceFunc.js b/src/components/WorkspaceFunc.js index c78c4f8..fc80724 100644 --- a/src/components/WorkspaceFunc.js +++ b/src/components/WorkspaceFunc.js @@ -208,7 +208,7 @@ class WorkspaceFunc extends Component { this.setState({ open: true, file: false, title: 'Keine Blöcke', content: 'Es wurden keine Blöcke detektiert. Bitte überprüfe den XML-Code und versuche es erneut.' }); } else { - if (!this.props.solutionCheck) { + if (!this.props.assessment) { var extensionPosition = xmlFile.name.lastIndexOf('.'); this.props.workspaceName(xmlFile.name.substr(0, extensionPosition)); } @@ -237,7 +237,7 @@ class WorkspaceFunc extends Component { workspace.options.maxBlocks = Infinity; this.props.onChangeCode(); this.props.clearStats(); - if (!this.props.solutionCheck) { + if (!this.props.assessment) { this.props.workspaceName(null); } this.setState({ snackbar: true, type: 'success', key: Date.now(), message: 'Das Projekt wurde erfolgreich zurückgesetzt.' }); @@ -248,7 +248,7 @@ class WorkspaceFunc extends Component { render() { return (
- {!this.props.solutionCheck ? + {!this.props.assessment ?
{ this.setState({ file: true, open: true, saveFile: false, title: 'Projekt benennen', content: 'Bitte gib einen Namen für das Projekt ein und bestätige diesen mit einem Klick auf \'Eingabe\'.' }) }}> {this.props.name && !isWidthDown('xs', this.props.width) ? {this.props.name} : null} @@ -258,7 +258,7 @@ class WorkspaceFunc extends Component {
: null} - {this.props.solutionCheck ? : } + {this.props.assessment ? : } -
- { this.uploadXmlFile(e.target.files[0]) }} - id="open-blocks" - type="file" - /> - -
- - { this.createFileName('svg'); }} - > - - - + {!this.props.assessment? +
+ { this.uploadXmlFile(e.target.files[0]) }} + id="open-blocks" + type="file" + /> + +
+ : null} + {!this.props.assessment? + + { this.createFileName('svg'); }} + > + + + + : null} - - this.shareBlocks()} - > - - - + {!this.props.assessment? + + this.shareBlocks()} + > + + + + :null}