Skip to content

Commit

Permalink
Merge pull request #431 from engaging-computing/dev
Browse files Browse the repository at this point in the history
v2.1.1 | Updates, Documentation and Configurations
  • Loading branch information
kdvalin authored Feb 3, 2021
2 parents 047ecb9 + 9aa7b39 commit c3085d6
Show file tree
Hide file tree
Showing 33 changed files with 1,694 additions and 668 deletions.
10 changes: 10 additions & 0 deletions .esdoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"source": "./src",
"destination": "./docs",
"plugins": [
{"name": "esdoc-standard-plugin"},
{"name": "esdoc-react-plugin"},
{"name": "esdoc-ecmascript-proposal-plugin", "option": {"all": true}},
{"name": "esdoc-jsx-plugin", "option": {"enable": true}}
]
}
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2

updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
target-branch: "dev"
reviewers:
- "engaging-computing/myr-leadership-team"
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@

# production
/build
/docs/*
!docs/.gitkeep

# api keys
/src/keys

# doc scripts
GenerateDocsWindows.bat

# misc
.DS_Store
.env*
Expand Down
1 change: 1 addition & 0 deletions docs/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h
1,225 changes: 822 additions & 403 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
"babel-eslint": "^9.0.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"esdoc": "^1.1.0",
"esdoc-standard-plugin": "^1.0.0",
"eslint-plugin-react": "^7.13.0",
"react-scripts": "2.1.1",
"redux-devtools": "^3.4.1"
},
"dependencies": {
"@material-ui/core": "^1.5.1",
"@material-ui/core": "^4.11.2",
"aframe": "^0.8.2",
"aframe-animation-component": "^5.0.0",
"aframe-environment-component": "^1.0.0",
Expand All @@ -25,6 +27,9 @@
"browserslist": "^4.6.2",
"cannon": "^0.6.2",
"create-react-app": "^3.0.1",
"esdoc-ecmascript-proposal-plugin": "^1.0.0",
"esdoc-jsx-plugin": "^1.0.0",
"esdoc-react-plugin": "^1.0.1",
"eslint": "5.6.0",
"jquery": "^3.3.1",
"qrcode": "^1.2.0",
Expand All @@ -50,11 +55,12 @@
"start": "react-scripts start",
"build": "react-scripts build",
"lint": "./node_modules/.bin/eslint \"src/**/*.js\"",
"prod": "react-scripts build && mv build ../MYR-backend && rm -r ../MYR-backend/public/myr && mv ../MYR-backend/build ../MYR-backend/public/myr",
"prod": "react-scripts build && mv build ../MYR-backend && rm -r ../MYR-backend/public/myr && mv ../MYR-backend/build ../MYR-backend/public/myr && esdoc && rm -r ../MYR-backend/public/docs && mv docs ../MYR-backend/public",
"coverage": "react-scripts test --env=jsdom --coverage --collectCoverageFrom=src/**/*.{js,jsx} --browser --silent",
"test": "react-scripts test --env=jsdom --browser --silent",
"eject": "react-scripts eject",
"analyze": "source-map-explorer build/static/js/main.*"
"analyze": "source-map-explorer build/static/js/main.*",
"doc": "./node_modules/.bin/esdoc"
},
"proxy": "http://localhost:1337/",
"browserslist": [
Expand Down
10 changes: 5 additions & 5 deletions src/actions/authActions.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import * as types from "../constants/ActionTypes";

/**
* @function - Sends a signal to the reducer to login with the given user
* Sends a signal to the reducer to login with the given user
*
* @param {obj} user - User data from the firebase auth obj
* @param {obj} user User data from the firebase auth obj
*
* @returns - reducer action obj with type: LOGIN and user obj
* @returns reducer action obj with type: LOGIN and user obj
*/
export function login(user) {
return { type: types.LOGIN, user };
}

/**
* @function - Sends a signal to the reducer to logout the current user
* Sends a signal to the reducer to logout the current user
*
* @returns - reducer action obj with type: LOGOUT
* @returns reducer action obj with type: LOGOUT
*/
export function logout() {
return { type: types.LOGOUT };
Expand Down
22 changes: 18 additions & 4 deletions src/actions/courseActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const problem = {
code: ""
};

//Course Actions
/**
* Course Actions
*/
export function fetchCourses() {
return (dispatch) => {
fetch(courseRef, header)
Expand Down Expand Up @@ -88,7 +90,9 @@ export function loadCourse(course) {
};
}

//Lesson Actions
/**
* Lesson Actions
*/
export function fetchLesson(json) {
return (dispatch) => {
dispatch(loadLesson(json));
Expand All @@ -98,15 +102,25 @@ export function fetchLesson(json) {
};
}

// Frontend disables option if out of bounds
/**
* Frontend disables option if out of bounds
*
* @param {*} currentIndex !!!DESCRIPTION NEEDED!!!
* @param {*} next !!!DESCRIPTION NEEDED!!!
*/
export function nextLesson(currentIndex, next) {
return (dispatch) => {
dispatch(setCurrentIndex(currentIndex + 1));
dispatch(fetchLesson(next));
};
}

// Frontend disables option if out of bounds
/**
* Frontend disables option if out of bounds
*
* @param {*} currentIndex !!!DESCRIPTION NEEDED!!!
* @param {*} prev !!!DESCRIPTION NEEDED!!!
*/
export function previousLesson(currentIndex, prev) {
return (dispatch) => {
dispatch(setCurrentIndex(currentIndex - 1));
Expand Down
31 changes: 15 additions & 16 deletions src/actions/editorActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,40 @@ import * as types from "../constants/ActionTypes";
const sceneRef = "/apiv1/scenes";

/**
* @function - Sends a signal to the reducer to render the scene
* Sends a signal to the reducer to render the scene
*
* @param {string} text - Text from the Ace Editor component
* @param {string} text Text from the Ace Editor component
*
* @returns - reducer action obj with action type and text
* @returns reducer action obj with action type and text
*/
export function render(text, uid) {
return { type: types.EDITOR_RENDER, text, uid };
}

/**
* @function - Sends a signal to the reducer to refresh with the given text
* Sends a signal to the reducer to refresh with the given text
*
* @param {string} text - Text from the Ace Editor component
* @param {string} text Text from the Ace Editor component
*
* @returns - reducer action obj with action type and text
* @returns reducer action obj with action type and text
*/
export function refresh(text, uid) {
return { type: types.EDITOR_REFRESH, text, uid };
}

/**
* @function - Sends a signal to the reducer to 'rewind' until last stable render
* Sends a signal to the reducer to 'rewind' until last stable render
*
* @returns - reducer action obj with action type
* @returns reducer action obj with action type
*/
export function recover() {
return { type: types.EDITOR_RECOVER };
}

/**
* @summary - This does an async fetch to Firebase to grab the scene, then
* dispatches the necessary functions to update the state.
*
*/
* This does an async fetch to Firebase to grab the scene, then
* dispatches the necessary functions to update the state.
*/
export function fetchScene(id, uid = "anon") {
return (dispatch) => { // Return a func that dispatches events after async
fetch(`${sceneRef}/id/${id}`, {redirect: "follow"}).then((response) =>{
Expand Down Expand Up @@ -86,10 +85,10 @@ export function fetchScene(id, uid = "anon") {
}

/**
* @function - Sends a signal to the reducer to update the savedText when user try to save or open scene/course
*
* @returns - reducer action obj with action type
*/
* Sends a signal to the reducer to update the savedText when user try to save or open scene/course
*
* @returns reducer action obj with action type
*/

export function updateSavedText(savedText){
return {type: types.EDITOR_UPDATE_SAVEDTEXT, savedText};
Expand Down
1 change: 1 addition & 0 deletions src/actions/projectActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export function deleteProj(uid, id, name) {

/**
* Saves a scene to MongoDB
*
* @param {*} uid The id of the logged in user
* @param {*} scene JSON data of the scene to be saved
* @param {*} img JPEG Image file of the Scene
Expand Down
6 changes: 5 additions & 1 deletion src/actions/referenceExampleActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ const notFound = {
code: ""
};

//Lesson Actions
/**
* Lesson Actions
*
* @param {*} funcName !!!DESCRIPTION NEEDED!!!
*/
export function fetchReferenceExample(funcName) {
return (dispatch) => {
fetch(refExRef + funcName, header)
Expand Down
24 changes: 12 additions & 12 deletions src/actions/sceneActions.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import * as types from "../constants/ActionTypes";

/**
* @summary - This function registers the scene"s name with Redux
*
* @param {string} name - the name is given by the user or when a scene is loaded
*
* @returns - a reducer action with type:NAME_SCENE
*/
* This function registers the scene"s name with Redux
*
* @param {string} name the name is given by the user or when a scene is loaded
*
* @returns a reducer action with type:NAME_SCENE
*/
export function nameScene(name) {
return { type: types.NAME_SCENE, name };
}

/**
* @summary - This function registers the scene's id with Redux
*
* @param {string} id - the id of the loaded scene
*
* @returns - a reducer action with type:LOAD_SCENE
*/
* This function registers the scene's id with Redux
*
* @param {string} id the id of the loaded scene
*
* @returns a reducer action with type:LOAD_SCENE
*/
export function loadScene(data) {
return { type: types.LOAD_SCENE, data };
}
Expand Down
20 changes: 14 additions & 6 deletions src/components/collection/Collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import { withStyles } from "@material-ui/core/styles";

import "../../css/Collection.css";

// FUNC to position modal in the middle of the screen
/**
* FUNC to position modal in the middle of the screen
*/
function getModalStyle() {
const top = 50;
const left = 50;
Expand All @@ -25,17 +27,21 @@ function getModalStyle() {
};
}

// CSS for modal
/**
* CSS for modal
*
* @param {*} theme !!!DESCRIPTION NEEDED!!!
*/
const modelStyles = theme => ({
paper: {
position: "absolute",
width: theme.spacing.unit * 60,
width: theme.spacing(60),
backgroundColor: theme.palette.background.paper,
boxShadow: theme.shadows[5],
padding: theme.spacing.unit * 4,
padding: theme.spacing(4),
},
button: {
margin: theme.spacing.unit,
margin: theme.spacing(1),
}
});

Expand Down Expand Up @@ -202,7 +208,9 @@ class CollectionModal extends Component {
</div>
);

// Render all of the elements
/**
* Render all of the elements
*/
render() {
const { classes } = this.props;
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/collection/SelectProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const selectStyle = {

class SelectProject extends PureComponent {
handleChange = (projectID) => {
//show warning if there's unsaved change
// show warning if there's unsaved change
if(this.hasEditorChanged()){
if((window.confirm("Are you sure you want to continue?\nYou will lose any unsaved work!"))){
if (this.props.user && this.props.user.uid) {
Expand Down
6 changes: 4 additions & 2 deletions src/components/courses/Course.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ class Lesson extends Component {
onClick={() => this.lastLesson()}
color="primary"
disabled={prevValid ? courses.currentIndex <= 0 : true}
fullWidth
variant="text"
fullWidth={true}
className="">
<Icon className="material-icons">chevron_left</Icon>
</Button>
Expand All @@ -72,7 +73,8 @@ class Lesson extends Component {
onClick={() => this.nextLesson()}
color="primary"
disabled={nextValid ? courses.currentIndex >= course.lessons.length - 1 : true}
fullWidth
variant="text"
fullWidth={true}
className="">
<Icon className="material-icons">chevron_right</Icon>
</Button>
Expand Down
Loading

0 comments on commit c3085d6

Please sign in to comment.