Skip to content

Commit

Permalink
Merge branch 'release/v0.7' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
syuChen1 authored Jun 13, 2021
2 parents 693df57 + 7f12f61 commit 9722692
Show file tree
Hide file tree
Showing 15 changed files with 9,066 additions and 9,334 deletions.
1 change: 0 additions & 1 deletion client/.gitignore

This file was deleted.

3 changes: 1 addition & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"react-dom": "^16.13.1",
"react-papaparse": "^3.7.0",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.1",
"yarn": "^1.22.10"
"react-scripts": "3.4.1"
},
"scripts": {
"start": "craco start",
Expand Down
29 changes: 0 additions & 29 deletions client/public/lib/arduino_compressed.js
Original file line number Diff line number Diff line change
Expand Up @@ -1204,33 +1204,4 @@ Blockly.Arduino.variables_set = function(a) {
Blockly.Arduino.variables_set_type = function(a) {
var b = Blockly.Arduino.valueToCode(a, "VARIABLE_SETTYPE_INPUT", Blockly.Arduino.ORDER_ASSIGNMENT) || "0";
return ["(" + Blockly.Arduino.getArduinoType_(Blockly.Types[a.getFieldValue("VARIABLE_SETTYPE_TYPE")]) + ")(" + b + ")", Blockly.Arduino.ORDER_ATOMIC]
};

//inline comment
Blockly.Arduino.insert_comment = function(a) {
var b;
var x;
if (0 == a.itemCount_) return "// \n";
if (1 == a.itemCount_) {
x = (Blockly.Arduino.valueToCode(a, "ADD0", Blockly.Arduino.ORDER_UNARY_POSTFIX) || '');
x = x.slice(0,-1);
x = x.substring(1);
return "// " + x + "\n";
}
var c;
b = [];
for (var d = 0; d < a.itemCount_; d++){
c = Blockly.Arduino.valueToCode(a, "ADD" + d, Blockly.Arduino.ORDER_NONE);
c = c.slice(0,-1);
c = c.substring(1);
b[d] = "" == c ? '' : "// " + c + "\n";
}
b = b.join("");
return b;
};

//block comment
Blockly.Arduino.block_comment = function(a) {
var b = Blockly.Arduino.statementToCode(a, 'comment');
return "/* " + a.getFieldValue("comment_input") + "\n" + b + "*/\n";
};
129 changes: 1 addition & 128 deletions client/public/lib/blocks_compressed.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions client/public/lib/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,3 @@ Blockly.Msg.NEW_INSTANCE = "New instance...";
Blockly.Msg.NEW_INSTANCE_TITLE = "New instance name:";
Blockly.Msg.RENAME_INSTANCE = "Rename instance...";
Blockly.Msg.RENAME_INSTANCE_TITLE = "Rename all '%1' instances to:";
Blockly.Msg.COMMENT_TIP = "Put comment in the same line";
Blockly.Msg.BLOCK_COMMENT_TIP = "Put multiple line comment";
Blockly.Msg.COMMENT_HELPURL = "https://www.arduino.cc/reference/en/language/structure/further-syntax/singlelinecomment/";
Blockly.Msg.COMMENT_JOIN_ITEM_TOOLTIP = "Add one line of comment.";
Blockly.Msg.COMMENT_CREATE_JOIN_TOOLTIP = "Add, remove, or reorder sections to reconfigure this comment block.";
Blockly.Msg.COMMENT_CREATEWITH = "comments";



Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,92 @@ export default function BlocklyCanvasPanel(props) {
return (

<div id='horizontal-container' className="flex flex-column">

<Spin tip="Compiling Code Please Wait..." className="compilePop" spinning={selectedCompile}>
<div id='top-container' className="flex flex-column vertical-container">
<div id='description-container' className="flex flex-row space-between card">
<div className='flex flex-row'>
{homePath ? <Link id='link' to={homePath} className="flex flex-column">
<i className="fa fa-home"/>
</Link> : null}
{handleGoBack ? <button onClick={handleGoBack} id='link' className="flex flex-column">
<i id='icon-btn' className="fa fa-arrow-left"/>
</button> : null}
</div>
<div>
{isStudent && lastSavedTime ?
`Last changes saved ${lastSavedTime}`
: null
}
</div>
<div className='flex flex-row'>
{isStudent ?
<div className='flex flex-row'>
<VersionHistoryModal
saves={saves}
lastAutoSave={lastAutoSave}
defaultTemplate={day}
getFormattedDate={getFormattedDate}
loadSave={loadSave}
/>
<button onClick={handleManualSave} id='link' className="flex flex-column">
<i id='icon-btn' className="fa fa-save"/>
</button>
</div>
: null
}
{isContentCreator ?
<div className='flex flex-row'>
<button onClick={handleCreatorSave} id='link' className="flex flex-column">
<i id='icon-btn' className="fa fa-save"/>
</button>
</div>
: null}
<div className='flex flex-row'>
<button onClick={handleUndo} id='link' className="flex flex-column">
<i id='icon-btn' className="fa fa-undo-alt"
style={workspaceRef.current ?
workspaceRef.current.undoStack_.length < 1 ?
{ color: 'grey', cursor: 'default' } : null
: null}
/>
</button>
<button onClick={handleRedo} id='link' className="flex flex-column">
<i id='icon-btn' className="fa fa-redo-alt"
style={workspaceRef.current ?
workspaceRef.current.redoStack_.length < 1 ?
{ color: 'grey', cursor: 'default' } : null
: null}
/>
</button>
</div>
</div>
<div style={{ "width": "10%" }}>
<div id='action-btn-container' className="flex space-between">
{!isStudent ?
<CodeModal
title={'XML'}
workspaceRef={workspaceRef.current}
setHover={setHoverXml}
hover={hoverXml}
/>
: null}
<CodeModal
title={'Arduino Code'}
workspaceRef={workspaceRef.current}
setHover={setHoverArduino}
hover={hoverArduino}
/>
<i onClick={() => compileArduinoCode(workspaceRef.current, setSelectedCompile, day, isStudent)}
className="fas fa-upload hvr-info"
onMouseEnter={() => setHoverCompile(true)}
onMouseLeave={() => setHoverCompile(false)}/>

{hoverCompile && <div className="popup ModalCompile">Upload to Arduino</div>}
</div>
</div>
</div>
</div>
</Spin>
<div className='flex flex-row'>
<div id='bottom-container' className="flex flex-column vertical-container overflow-visible">
<Row>
Expand Down Expand Up @@ -396,7 +481,6 @@ export default function BlocklyCanvasPanel(props) {
{isContentCreator ?
<div id='side-container'>
Current Student Toolbox Selection

<Input
placeholder="Search Block"
prefix={<i className="fa fa-search" />}
Expand Down
24 changes: 3 additions & 21 deletions client/src/components/DayPanels/BlocklyCanvasPanel/CodeModal.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {Modal, Button, Typography} from 'antd';
import React, {useState} from "react";
import {getArduino, getXml} from "../helpers";
import icon from "./textIcon.json";

export default function CodeModal(props) {
const [visible, setVisible] = useState(false);
Expand All @@ -22,26 +21,9 @@ export default function CodeModal(props) {

return (
<div id='code-modal'>
{
title === 'XML' ?
<i onClick={showModal} id='link' className="fa fa-code hvr-info"
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}/>
:
<svg xmlns="http://www.w3.org/2000/svg"
className="hvr-info"
viewBox="0 0 172 172"
onClick={showModal}
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}
>
<g>
<path d={icon.path}></path>
</g>
</svg>
}


<i onClick={showModal} className={title === 'XML' ? "fa fa-code hvr-info" : "fa fa-font hvr-info"}
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}/>
{hover &&
(title === 'XML' ?
<div className="popup ModalCompile2">Shows XML</div> :
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion client/src/components/DayPanels/DayInfoPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import PlaceHolderImg1 from "../../assets/science.png";
import PlaceHolderImg2 from "../../assets/arduino.png";
import PlaceHolderImg3 from "../../assets/maker.png";

// THIS PAGE IS NO LONGER IN USE, SOME OF THE STYLING MAY NO LONGER APPLY
export default function DayInfoPanel(props) {
const {day} = props;

Expand Down
Loading

0 comments on commit 9722692

Please sign in to comment.