get rid of most errors on Home page for migration

This commit is contained in:
fbruc03 2022-12-04 21:09:54 +01:00
parent 77b338ffb6
commit d6d2505a4b
11 changed files with 29 additions and 32 deletions

View File

@ -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,

View File

@ -611,7 +611,6 @@ class Toolbox extends React.Component {
colour={getColour().procedures}
custom="PROCEDURE"
></Category>
<sep></sep>
<Category name={Blockly.Msg.toolbox_advanced} colour={getColour().io}>
<Category
name={Blockly.Msg.toolbox_serial}

View File

@ -142,7 +142,7 @@ class Navbar extends Component {
</Link>
) : null}
{isHome ? (
<Tooltip title={Blockly.Msg.tooltip_start_tour} arrow>
<Tooltip title={'Start Tour'} arrow>
<IconButton
color="inherit"
className={`openTour ${this.props.classes.button}`}
@ -156,7 +156,7 @@ class Navbar extends Component {
</Tooltip>
) : null}
{isAssessment ? (
<Tooltip title={Blockly.Msg.tooltip_start_tour} arrow>
<Tooltip title={'Start tour'} arrow>
<IconButton
color="inherit"
className={`openTour ${this.props.classes.button}`}
@ -267,7 +267,7 @@ class Navbar extends Component {
<FontAwesomeIcon icon={item.icon} />
</ListItemIcon>
{item.text === "Code Editor" ? (
<Badge badgeContent={"Experimental"} color="primary">
<Badge badgeContent={"Experimental"} color="primary" overlap="rectangular">
<ListItemText primary={item.text} />
</Badge>
) : (

View File

@ -53,7 +53,7 @@ class TooltipViewer extends Component {
{Blockly.Msg.tooltip_viewer}
</Typography>
<Typography variant="body2" component="p">
<Typography variant="body2" component="span">
<ReactMarkdown linkTarget="_blank">
{this.props.tooltip}
</ReactMarkdown>

View File

@ -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) => ({

View File

@ -57,7 +57,7 @@ class DownloadProject extends Component {
DownloadProject.propTypes = {
xml: PropTypes.string.isRequired,
name: PropTypes.string.isRequired
name: PropTypes.string
};
const mapStateToProps = state => ({

View File

@ -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 => ({

View File

@ -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,
};

View File

@ -75,7 +75,7 @@ class WorkspaceFunc extends Component {
<ResetWorkspace
style={
this.props.projectType === "project" ||
this.props.projectType === "gallery"
this.props.projectType === "gallery"
? { marginRight: "5px" }
: null
}
@ -83,10 +83,10 @@ class WorkspaceFunc extends Component {
) : null}
{!this.props.assessment &&
(this.props.projectType === "project" ||
this.props.projectType === "gallery") &&
this.props.user &&
this.props.user.email === this.props.project.creator ? (
(this.props.projectType === "project" ||
this.props.projectType === "gallery") &&
this.props.user &&
this.props.user.email === this.props.project.creator ? (
<DeleteProject
project={this.props.project}
projectType={this.props.projectType}
@ -99,7 +99,7 @@ class WorkspaceFunc extends Component {
WorkspaceFunc.propTypes = {
user: PropTypes.object,
autosave: PropTypes.bool.isRequired,
autosave: PropTypes.bool,
};
const mapStateToProps = (state) => ({

View File

@ -105,9 +105,8 @@ class WorkspaceName extends Component {
return (
<div style={this.props.style}>
<Tooltip
title={`${Blockly.Msg.tooltip_project_title} ${
this.props.name ? `: ${this.props.name}` : ""
}`}
title={`${Blockly.Msg.tooltip_project_title} ${this.props.name ? `: ${this.props.name}` : ""
}`}
arrow
style={{ height: "100%" }}
>
@ -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
) ? (
<Typography style={{ margin: "auto -3px auto 12px" }}>
{this.props.name}
</Typography>
@ -184,7 +183,7 @@ class WorkspaceName extends Component {
>
<div style={{ marginTop: "10px" }}>
{this.props.projectType === "gallery" ||
this.state.projectType === "gallery" ? (
this.state.projectType === "gallery" ? (
<div>
<TextField
autoFocus

View File

@ -11,9 +11,7 @@ store.dispatch(fetchSensors());
fetchSensors();
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
<App />,
document.getElementById("root")
);