Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3141a10
Bump ua-parser-js from 0.7.24 to 1.0.2
dependabot[bot] Nov 29, 2021
888d3be
Bump bootstrap from 4.6.0 to 5.1.3
dependabot[bot] Nov 29, 2021
1493f8b
Bump aframe from 1.0.4 to 1.3.0
dependabot[bot] Apr 1, 2022
748c672
Created class for notification and new file for cookies
Apr 13, 2022
11b51de
Added material-ui/lab
Apr 13, 2022
cd1a9b8
Bump redux from 3.7.2 to 4.2.0
dependabot[bot] Apr 19, 2022
d07b786
Updating MYR 3.1.0 -> 3.1.1
Apr 22, 2022
fabc2b9
Merge pull request #561 from bryanmontalvan/rc-3.1.1
Apr 22, 2022
5e5cef0
Fixed issue targeting legacy scenes that have no name crashing the ap…
kdvalin Apr 25, 2022
11c0288
Updated check to verify both scenes in projectSort
kdvalin Apr 25, 2022
c712ff8
Merge pull request #564 from kdvalin/hotfix/project-sorting
kdvalin Apr 25, 2022
9cdfdfb
Release notes for 3.1.2
kdvalin Apr 25, 2022
83372f9
Merge pull request #565 from kdvalin/rc/3.1.2
kdvalin Apr 25, 2022
175edf2
Add check to the collection response to not process if the response h…
Jlu18 Apr 26, 2022
bd2c007
Revert "Add check to the collection response to not process if the re…
Jlu18 Apr 26, 2022
b13f654
Add check to the asyncCollections to not process the data if api retu…
Jlu18 Apr 26, 2022
5f53ed6
Merge pull request #567 from Jlu18/dev
Apr 27, 2022
a583e3b
Changed scale of the grid so that it lines up with positioning
Jun 7, 2022
b5a92f8
Added the font size and keyboard shortcut buttons to the tour
jf-kelly Jun 14, 2022
5c215d3
Fixed the bug with reference examples not showing up
jf-kelly Jun 16, 2022
cb04f17
Added the keyboard shortcut for F, which puts the user in full screen…
jf-kelly Jun 23, 2022
9a698f1
Made the code editor slightly smaller to make more space for buttons.…
Jun 23, 2022
45d3107
Merge pull request #531 from engaging-computing/dependabot/npm_and_ya…
Jun 28, 2022
5f985c4
Merge pull request #524 from engaging-computing/dependabot/npm_and_ya…
Jun 28, 2022
14a9588
Bump react from 16.13.1 to 17.0.2
dependabot[bot] Jun 28, 2022
9f1fda0
Merge pull request #503 from engaging-computing/dependabot/npm_and_ya…
Jun 28, 2022
eb9700a
Merge pull request #549 from engaging-computing/dependabot/npm_and_ya…
Jun 28, 2022
8710a60
Merge pull request #578 from jf-kelly/gridFix
Jun 28, 2022
6a7cbc9
Merge pull request #584 from jf-kelly/exampleFix
Jun 28, 2022
822c200
Merge pull request #585 from jf-kelly/addedF
Jun 28, 2022
46afbb6
Merge pull request #586 from jf-kelly/newTour
Jun 28, 2022
0faffe0
Merge branch 'dev' into buttonVisibility
Jun 28, 2022
2a67a58
Merge pull request #587 from RJMaradiaga/buttonVisibility
Jun 28, 2022
d3c237f
Merge pull request #559 from engaging-computing/dependabot/npm_and_ya…
Jun 28, 2022
0b0b3fe
Updated these two files to resolve merge conflict
jf-kelly Jun 28, 2022
97e6d3b
Ran npm install material-ui/lab to update json files
jf-kelly Jun 30, 2022
55e8504
Fix deployment pipeline issues
kdvalin Jun 30, 2022
12e82bf
Merge pull request #593 from kdvalin/dev
Jun 30, 2022
547d126
Reverted grid back to original size per Bryan's request
jf-kelly Jul 14, 2022
54caa29
Merge pull request #605 from jf-kelly/gridFix
Jul 15, 2022
bc87ac3
Replaced depricated no-gutters with g-0
Jul 19, 2022
cac893b
Merge pull request #608 from bryanmontalvan/gutter-fix
Jul 19, 2022
a4ad34f
Updated all the code to reflect dependency changes
jf-kelly Jul 19, 2022
851671a
Merge pull request #609 from jf-kelly/dependencyChanges
Jul 21, 2022
615d8f0
Created class for notification and new file for cookies
Apr 13, 2022
26bc61f
Added material-ui/lab
Apr 13, 2022
356f92c
Updated these two files to resolve merge conflict
jf-kelly Jun 28, 2022
4b3e6d9
Ran npm install material-ui/lab to update json files
jf-kelly Jun 30, 2022
8bf4ed7
Merge branch 'notification' of https://github.com/jf-kelly/MYR into n…
jf-kelly Aug 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ The Engaging Computing Group develops new technologies to enable learners—yout
## Status
[![CircleCI](https://circleci.com/gh/engaging-computing/MYR.svg?style=shield)](https://circleci.com/gh/engaging-computing/MYR)

## Change Log - 3.0.0 -> 3.1.0
- Updated sorting for user projects to be case insensitive.
- Added ability to change code font size for an account.
- Added transparency to helper grid
- Additional Documentation for development.
- Misc. Dependency updates

## Change Log - 3.1.1 -> 3.1.2
- Fixed a bug where an old scene without a name can crash the client view


## Acknowledgments
Expand Down
275 changes: 183 additions & 92 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "myr",
"version": "3.1.0",
"version": "3.1.2",
"private": false,
"engines": {
"node": "^12.18.2"
Expand All @@ -18,12 +18,13 @@
"dependencies": {
"@engaging-computing/aframe-physics-system": "^4.0.0",
"@material-ui/core": "^4.12.3",
"aframe": "^1.0.4",
"@material-ui/lab": "^4.0.0-alpha.61",
"aframe": "^1.3.0",
"aframe-animation-component": "^5.0.0",
"aframe-environment-component": "^1.3.1",
"aframe-extras": "^4.1.2",
"aframe-react": "^4.4.0",
"bootstrap": "^4.6.0",
"bootstrap": "^5.1.3",
"browserslist": "^4.6.2",
"cannon": "^0.6.2",
"create-react-app": "^4.0.1",
Expand All @@ -33,7 +34,7 @@
"jquery": "^3.3.1",
"qrcode": "^1.2.0",
"qrcode.react": "^1.0.1",
"react": "^16.8.4",
"react": "^16.14.0",
"react-ace": "^6.0.0",
"react-color": "^2.19.3",
"react-dom": "^16.2.0",
Expand All @@ -43,13 +44,13 @@
"react-router-dom": "^4.2.2",
"react-select": "^3.0.4",
"reactour": "^1.18.6",
"redux": "^3.7.2",
"redux": "^4.2.0",
"redux-thunk": "^2.3.0",
"socket.io-client": "^4.4.1",
"source-map-explorer": "^2.0.0",
"styled-components": "^5.3.3",
"three": "^0.126.1",
"ua-parser-js": "^0.7.24"
"ua-parser-js": "^1.0.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down
3 changes: 3 additions & 0 deletions src/actions/collectionActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export function asyncCollections(uid) {
if (uid) {
let userCollections = [];
fetch(collectRef, {headers: {"x-access-token": uid}}).then((data) => {
if(data.status === 204){
return;
}
data.json().then((data) => {
data.forEach((doc) => {
userCollections.push(doc);
Expand Down
2 changes: 1 addition & 1 deletion src/components/editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Editor extends Component {
editorProps={{
$blockScrolling: Infinity,
}}
height="90vh"
height="88vh"
mode="javascript"
name="ace-editor"
// eslint-disable-next-line
Expand Down
1 change: 1 addition & 0 deletions src/components/editor/FontSize.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class FontSize extends React.Component {
<div className="font">
<Tooltip title="Font Size">
<Button className="font-button"
id="font-size"
variant="contained"
size="small"
color="primary">
Expand Down
10 changes: 8 additions & 2 deletions src/components/editor/KeyboardShortcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ const scene = [
shortcut: ["D"],
description: "Move right"
},
{
shortcut: ["F"],
description: "Enter full screen"
},
{
shortcut: ["Space"],
description: "Move up"
Expand Down Expand Up @@ -124,9 +128,11 @@ class KeyboardShortcut extends React.Component {
*/
render(){
return(
<div className="whole-keyboard">
<div className="whole-keyboard"
spacing={10}>
<Tooltip title="Keyboard Shortcut">
<Button
<Button
className="shortcut-button"
variant="contained"
size="small"
color="primary"
Expand Down
2 changes: 1 addition & 1 deletion src/components/layouts/AssetReference.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const AssetReference = ({ editor, editorActions, user, authActions, scene
collections={collections}
layoutType={layoutTypes.REFERENCE}
/>
<div className="row no-gutters">
<div className="row g-0">
<AssetReferencePage />
</div>
<Footer />
Expand Down
2 changes: 1 addition & 1 deletion src/components/layouts/Collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const Collection = ({ editor, editorActions, user, userSettings, userActi
collection={match.params.collection}
layoutType={layoutTypes.COLLECTION}
/>
<div className="row no-gutters">
<div className="row g-0">
<div id="interface" className="col-12 col-md-4">
<SelectProject
selectedCollection={match.params.collection}
Expand Down
2 changes: 1 addition & 1 deletion src/components/layouts/Guided.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const Guided = ({ editor, user, usersettings, userActions, scene, editorA
collectionActions={collectionActions}
collections={collections}
/>
<div className="row no-gutters">
<div className="row g-0">
{
scene.settings.viewOnly
?
Expand Down
4 changes: 3 additions & 1 deletion src/components/layouts/Ide.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Header from "../structural/header/Header";
import Footer from "../structural/Footer";
import View from "../structural/View";
import Banner from "../structural/header/Banner";
import AndroidNotification from "../structural/AndroidNotification";

import * as layoutTypes from "../../constants/LayoutTypes.js";

Expand All @@ -20,6 +21,7 @@ export const Ide = ({ editor, editorActions, user, usersettings, userActions, au
new URLSearchParams(window.location.search).get("redirected") === "true"
}
/>
<AndroidNotification/>
<Header
viewOnly={scene.settings.viewOnly}
logging={authActions}
Expand All @@ -41,7 +43,7 @@ export const Ide = ({ editor, editorActions, user, usersettings, userActions, au
collections={collections}
layoutType={layoutTypes.IDE}
/>
<div className="row no-gutters">
<div className="row g-0">
{
scene.settings.viewOnly
?
Expand Down
2 changes: 1 addition & 1 deletion src/components/layouts/Reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const Reference = ({ editor, editorActions, user, authActions, scene, sce
collections={collections}
layoutType={layoutTypes.REFERENCE}
/>
<div className="row no-gutters">
<div className="row g-0">
<ReferencePage />
</div>
<Footer />
Expand Down
6 changes: 3 additions & 3 deletions src/components/layouts/ReferenceExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import "../../css/ReferencePage.css";
* @param {object} param0 List of props that will be use in components
* @returns {HTMLElement} Layout for example scene page
*/
export const ReferenceExample = ({ editor, user, scene, referenceExample, referenceExampleActions, editorActions, authActions, projectActions, projects, courseActions, courses, match, sceneActions, collectionActions, collections }) => (
export const ReferenceExample = ({ editor, user, scene, referenceExample, referenceExampleActions, editorActions, authActions, projectActions, projects, courseActions, courses, match, sceneActions, collectionActions, collections, userSettings, userActions }) => (
<div className="App">
<Header
logging={authActions}
Expand All @@ -36,7 +36,7 @@ export const ReferenceExample = ({ editor, user, scene, referenceExample, refere
referenceExampleActions={referenceExampleActions}
layoutType={layoutTypes.REF_EXAMPLE}
/>
<div className="row no-gutters">
<div className="row g-0">
{
scene.settings.viewOnly
?
Expand All @@ -48,7 +48,7 @@ export const ReferenceExample = ({ editor, user, scene, referenceExample, refere
<div id="interface" className="col-12 col-md-4">
<RefExInfo referenceExample={referenceExample} />
<div className='ref-ex-edit'>
<Editor refresh={editorActions.refresh} render={editorActions.render} text={editor.text} user={user} />
<Editor refresh={editorActions.refresh} render={editorActions.render} text={editor.text} user={user} settings={userSettings} userActions={userActions} />
</div>
</div>
<div id="scene" className="col-12 col-md-8" >
Expand Down
52 changes: 52 additions & 0 deletions src/components/structural/AndroidNotification.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import CookieHandler from "../../utils/CookieHandler";
import React, { Component } from "react";
import { Alert } from "@material-ui/lab";
import { Button } from "@material-ui/core";

class AndroidNotification extends Component{
constructor(props){
super(props);
this.state = {
isOpen: this.isAndroid() && this.isChrome()
};
}
/**
* @returns {boolean} true if the device is on AndroidOS and cookie is false
*/
isAndroid = () => {
let ua = navigator.userAgent.toLowerCase();
return (ua.indexOf("android") > -1 && !CookieHandler.getCookie("hasSeenNotification"));
}

/**
* @returns {boolean} true if browser being used is Google Chrome
*/
isChrome = () => {
let isChrome = window.chrome;
let winNav = window.navigator;
let vendorName = winNav.vendor;
let isOpera = typeof window.opr !== "undefined";
let IEedge = winNav.userAgent.indexOf("Edg") > -1;

return (isChrome !== null && typeof isChrome !== "undefined" && vendorName === "Google Inc."
&& isOpera === false && IEedge === false);
}

/**
* @returns Creates alert for Chrome users on Android to switch browsers
*/
render = ()=>(
<>
{ this.state.isOpen ?
<Alert severity="warning" action={
<Button color="inherit" size="small" onClick={()=>{
this.setState({isOpen:false});
CookieHandler.neverAgainCookie("hasSeenNotification");
}}>
DON'T SHOW AGAIN
</Button> } >Chrome on Android may have unexpected behavior. We recommend you switch to Firefox for the full experience.</Alert> : null}
</>
)
}

export default AndroidNotification;
67 changes: 13 additions & 54 deletions src/components/structural/WelcomeScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import CourseSelect from "../courses/CourseSelect.js";

import { withStyles } from "@material-ui/core/styles";
import "../../css/WelcomeScreen.css";
import CookieHandler from "../../utils/CookieHandler";

/**
* @returns {object} Center the Welcome Screen
Expand Down Expand Up @@ -89,71 +90,29 @@ class Welcome extends React.Component {
* So if user hasn't visisted the MYR, toggle the state to true.
*/
componentDidMount() {
if (!this.getCookie("hasVisited")) {
if (!CookieHandler.getCookie("hasVisited")) {
this.props.handleWelcomeToggle();
}
}

/**
* Get value of cookie
* @param {string} cookieName name of cookie
* @returns {string} value of cookie if it exist, return empty string otherwise
*/
getCookie = (cookieName) => {
let name = cookieName + "=";
let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(";");
for (let i = 0; i < ca.length; i++) {
let c = ca[i];
while (c.charAt(0) === " ") {
c = c.substring(1);
}
if (c.indexOf(name) === 0) {
return c.substring(name.length, c.length);
}
}
return "";
}

/**
* If the user is first visiting the MYR, set "hasVisisted" to true
* and set the expiration date to current date + 24 hrs
* So it will re-appear after 24 hrs
*/
setCookie = () => {
if (!this.getCookie("hasVisited")) {
let date = new Date();
date.setTime(date.getTime() + (1000 * 60 * 60 * 24));
let expiration = "; expires=" + date.toGMTString();
let cookie = "hasVisited=true" + expiration;
document.cookie = cookie;
}
}

/**
* Handler for when the welcome screen is close either by close button or clicking outside of modal
*/
handleClose = () => {
this.setCookie();
CookieHandler.setCookie("hasVisited");
this.props.handleWelcomeToggle();
};

/**
* Handler for when user click "never again" button
* It sets a long expiration date so it will "never" expireds
*/
neverAgainCookie = () => {
document.cookie = "hasVisited=true; expires=Thu, 31 Dec 2099 12:00:00 UTC;";
this.handleClose();
}

/**
* @returns {*} Button with don't show again option
*/
neverAgain = () => {
return (
<Button
onClick={this.neverAgainCookie}
onClick={()=>{
CookieHandler.neverAgainCookie("hasVisited");
this.handleClose();
}}
className="neverAgain-btn">
Don't show again
</Button >
Expand All @@ -164,7 +123,7 @@ class Welcome extends React.Component {
* Handler for when user click on example project button
*/
handleProjectToggle = () => {
this.setCookie();
CookieHandler.setCookie("hasVisited");
this.setState({ projectsOpen: !this.state.projectsOpen });
this.setState({ projectTab: "b" });
};
Expand All @@ -173,15 +132,15 @@ class Welcome extends React.Component {
* Handler for when user click on courses button
*/
handleCoursesToggle = () => {
this.setCookie();
CookieHandler.setCookie("hasVisited");
this.setState({ coursesOpen: !this.state.coursesOpen });
};

/**
* Handler for when user click on tour button
*/
handleTourToggle = () => {
this.setCookie();
CookieHandler.setCookie("hasVisited");
this.setState({ tourOpen: !this.state.tourOpen });
};

Expand Down Expand Up @@ -216,7 +175,7 @@ class Welcome extends React.Component {
href="/reference"
target="_blank"
rel="noopener noreferrer"
onClick={this.setCookie}
onClick={()=>{CookieHandler.setCookie("hasVisited");}}
className="welcome-btn">
<Icon className="material-icons">help</Icon>
Open the Reference
Expand Down Expand Up @@ -252,7 +211,7 @@ class Welcome extends React.Component {
href="https://github.com/engaging-computing/MYR"
target="_blank"
rel="noopener noreferrer"
onClick={this.setCookie}
onClick={()=>{CookieHandler.setCookie("hasVisited");}}
className="welcome-btn">
<Icon className="material-icons">code</Icon>
Visit our GitHub
Expand Down Expand Up @@ -322,7 +281,7 @@ class Welcome extends React.Component {
<this.cookieMessage />
</Hidden>
<hr />
<div className="row no-gutters">
<div className="row g-0">
<div id="welcome-description" className="col-12 col-md-6 col-lg-8">
<p>MYR is an educational tool that strikes a balance with the ease of use and challenge. We drew inspiration from Logo Turtle and Processing to provide a beginner friendly experience for teaching and learning with MYR. If you want to learn more about MYR itself, visit our <a href="/about" target="_blank" rel="noopener noreferrer">about page</a>.</p>
<p>Within the editor you can create 3D scenes using JavaScript and the MYR API. You can then view your scene in the viewer using a computer, tablet, smartphone, or a VR headset.</p>
Expand Down
Loading