From d6d2505a4be321ed88552116284fa2578e0f0f3d Mon Sep 17 00:00:00 2001 From: fbruc03 <65135023+fbruc03@users.noreply.github.com> Date: Sun, 4 Dec 2022 21:09:54 +0100 Subject: [PATCH] get rid of most errors on Home page for migration --- src/actions/authActions.js | 1 + src/components/Blockly/toolbox/Toolbox.js | 1 - src/components/Navbar.js | 6 ++--- src/components/TooltipViewer.js | 2 +- src/components/Workspace/AutoSave.js | 4 ++-- src/components/Workspace/DownloadProject.js | 2 +- src/components/Workspace/OpenProject.js | 2 +- src/components/Workspace/ShareProject.js | 2 +- src/components/Workspace/WorkspaceFunc.js | 12 +++++----- src/components/Workspace/WorkspaceName.js | 25 ++++++++++----------- src/index.js | 4 +--- 11 files changed, 29 insertions(+), 32 deletions(-) diff --git a/src/actions/authActions.js b/src/actions/authActions.js index 086d703..4a54c34 100644 --- a/src/actions/authActions.js +++ b/src/actions/authActions.js @@ -81,6 +81,7 @@ export const login = axios .post(`${process.env.REACT_APP_BLOCKLY_API}/user`, body, config) .then((res) => { + console.log(res); dispatch(setLanguage(res.data.user.language)); dispatch({ type: LOGIN_SUCCESS, diff --git a/src/components/Blockly/toolbox/Toolbox.js b/src/components/Blockly/toolbox/Toolbox.js index 54a157c..6085724 100644 --- a/src/components/Blockly/toolbox/Toolbox.js +++ b/src/components/Blockly/toolbox/Toolbox.js @@ -611,7 +611,6 @@ class Toolbox extends React.Component { colour={getColour().procedures} custom="PROCEDURE" > - ) : null} {isHome ? ( - + ) : null} {isAssessment ? ( - + {item.text === "Code Editor" ? ( - + ) : ( diff --git a/src/components/TooltipViewer.js b/src/components/TooltipViewer.js index 1d1225d..8ae91d6 100644 --- a/src/components/TooltipViewer.js +++ b/src/components/TooltipViewer.js @@ -53,7 +53,7 @@ class TooltipViewer extends Component { {Blockly.Msg.tooltip_viewer} - + {this.props.tooltip} diff --git a/src/components/Workspace/AutoSave.js b/src/components/Workspace/AutoSave.js index 950cc8e..b563e37 100644 --- a/src/components/Workspace/AutoSave.js +++ b/src/components/Workspace/AutoSave.js @@ -58,8 +58,8 @@ AutoSave.propTypes = { xml: PropTypes.string.isRequired, name: PropTypes.string, workspaceName: PropTypes.func.isRequired, - setAutosave: PropTypes.func.isRequired, - autosave: PropTypes.bool.isRequired, + setAutosave: PropTypes.func, + autosave: PropTypes.bool, }; const mapStateToProps = (state) => ({ diff --git a/src/components/Workspace/DownloadProject.js b/src/components/Workspace/DownloadProject.js index 8603ae3..78582e4 100644 --- a/src/components/Workspace/DownloadProject.js +++ b/src/components/Workspace/DownloadProject.js @@ -57,7 +57,7 @@ class DownloadProject extends Component { DownloadProject.propTypes = { xml: PropTypes.string.isRequired, - name: PropTypes.string.isRequired + name: PropTypes.string }; const mapStateToProps = state => ({ diff --git a/src/components/Workspace/OpenProject.js b/src/components/Workspace/OpenProject.js index 5387e89..e0ece0f 100644 --- a/src/components/Workspace/OpenProject.js +++ b/src/components/Workspace/OpenProject.js @@ -129,7 +129,7 @@ OpenProject.propTypes = { clearStats: PropTypes.func.isRequired, workspaceName: PropTypes.func.isRequired, xml: PropTypes.string.isRequired, - name: PropTypes.string.isRequired + name: PropTypes.string }; const mapStateToProps = state => ({ diff --git a/src/components/Workspace/ShareProject.js b/src/components/Workspace/ShareProject.js index d13c194..e2309e8 100644 --- a/src/components/Workspace/ShareProject.js +++ b/src/components/Workspace/ShareProject.js @@ -301,7 +301,7 @@ class WorkspaceFunc extends Component { WorkspaceFunc.propTypes = { shareProject: PropTypes.func.isRequired, clearMessages: PropTypes.func.isRequired, - name: PropTypes.string.isRequired, + name: PropTypes.string, message: PropTypes.object.isRequired, }; diff --git a/src/components/Workspace/WorkspaceFunc.js b/src/components/Workspace/WorkspaceFunc.js index bec0a70..4b66684 100644 --- a/src/components/Workspace/WorkspaceFunc.js +++ b/src/components/Workspace/WorkspaceFunc.js @@ -75,7 +75,7 @@ class WorkspaceFunc extends Component { ({ diff --git a/src/components/Workspace/WorkspaceName.js b/src/components/Workspace/WorkspaceName.js index d53c027..b0bbbb2 100644 --- a/src/components/Workspace/WorkspaceName.js +++ b/src/components/Workspace/WorkspaceName.js @@ -105,9 +105,8 @@ class WorkspaceName extends Component { return ( @@ -126,8 +125,8 @@ class WorkspaceName extends Component { this.props.projectType === "gallery" ? "Projektdaten ändern" : this.props.projectType === "project" - ? "Projekt umbenennen" - : "Projekt benennen", + ? "Projekt umbenennen" + : "Projekt benennen", content: this.props.projectType === "gallery" ? "Bitte gib einen Titel und eine Beschreibung für das Galerie-Projekt ein und bestätige die Angaben mit einem Klick auf 'Eingabe'." @@ -136,13 +135,13 @@ class WorkspaceName extends Component { }} > {this.props.name && - !isWidthDown( - this.props.projectType === "project" || - this.props.projectType === "gallery" - ? "xl" - : "xs", - this.props.width - ) ? ( + !isWidthDown( + this.props.projectType === "project" || + this.props.projectType === "gallery" + ? "xl" + : "xs", + this.props.width + ) ? ( {this.props.name} @@ -184,7 +183,7 @@ class WorkspaceName extends Component { > {this.props.projectType === "gallery" || - this.state.projectType === "gallery" ? ( + this.state.projectType === "gallery" ? ( - - , + , document.getElementById("root") );