Skip to content

Commit

Permalink
Merge pull request #541 from engaging-computing/dev
Browse files Browse the repository at this point in the history
Release 3.1.0
  • Loading branch information
kdvalin authored Feb 28, 2022
2 parents ce23c8b + a20a7b6 commit 728a4b3
Show file tree
Hide file tree
Showing 78 changed files with 2,570 additions and 1,659 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on: [push, pull_request]
jobs:
ci-checks:
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
container:
image: node:12.18

Expand Down
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@ 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 - 2.4.0 -> 3.0.0
- Removed undocumented aliases for `box` and `prisim`
- All scenes using these aliases have been automatically changed to reflect the new API
- Changed the behavior of `getRandomColor` to only return a random color
- Added `setRandomColor` to behave like `getRandomColor` did previously
- A migration has updated scenes to be properly using these functions
- If your scene broke as a result of this update, please let us know [[email protected]](mailto:[email protected])
- Misc. Package dependency updates
- Moved Model and Asset reference to their own page
- Removed broken links to non-existent example pages
## 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



Expand Down
Binary file added img/grid_alpha_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,308 changes: 700 additions & 608 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "myr",
"version": "3.0.0",
"version": "3.1.0",
"private": false,
"engines": {
"node": "^12.18.2"
},
"devDependencies": {
"@babel/core": "^7.9.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-adapter-react-16": "^1.15.6",
"esdoc": "^1.1.0",
"esdoc-standard-plugin": "^1.0.0",
"eslint-plugin-react": "^7.13.0",
Expand All @@ -17,10 +17,10 @@
},
"dependencies": {
"@engaging-computing/aframe-physics-system": "^4.0.0",
"@material-ui/core": "^4.11.2",
"@material-ui/core": "^4.12.3",
"aframe": "^1.0.4",
"aframe-animation-component": "^5.0.0",
"aframe-environment-component": "^1.0.0",
"aframe-environment-component": "^1.3.1",
"aframe-extras": "^4.1.2",
"aframe-react": "^4.4.0",
"bootstrap": "^4.6.0",
Expand All @@ -35,19 +35,19 @@
"qrcode.react": "^1.0.1",
"react": "^16.8.4",
"react-ace": "^6.0.0",
"react-color": "^2.17.0",
"react-color": "^2.19.3",
"react-dom": "^16.2.0",
"react-google-login": "^5.1.19",
"react-progressive-image": "^0.3.0",
"react-redux": "^5.0.7",
"react-router-dom": "^4.2.2",
"react-select": "^3.0.4",
"reactour": "^1.9.1",
"reactour": "^1.18.6",
"redux": "^3.7.2",
"redux-thunk": "^2.3.0",
"socket.io-client": "^4.0.0",
"socket.io-client": "^4.3.2",
"source-map-explorer": "^2.0.0",
"styled-components": "^5.0.0",
"styled-components": "^5.3.3",
"three": "^0.126.1",
"ua-parser-js": "^0.7.24"
},
Expand Down
11 changes: 9 additions & 2 deletions src/actions/authActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as types from "../constants/ActionTypes";
*
* @param {obj} user User data from the firebase auth obj
*
* @returns reducer action obj with type: LOGIN and user obj
* @returns {object} reducer action obj with type: LOGIN and user obj
*/
export function login(user) {
return { type: types.LOGIN, user };
Expand All @@ -14,12 +14,19 @@ export function login(user) {
/**
* Sends a signal to the reducer to logout the current user
*
* @returns reducer action obj with type: LOGOUT
* @returns {object} reducer action obj with type: LOGOUT
*/
export function logout() {
return { type: types.LOGOUT };
}

/**
* Sends a signal to the reducer to refresh the token
*
* @param {object} token
*
* @returns {object} reducer action object with type: REFRESH_TOKEN and token obj
*/
export function refreshToken(token) {
return { type: types.REFRESH_TOKEN, token };
}
Expand Down
52 changes: 44 additions & 8 deletions src/actions/collectionActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ import * as types from "../constants/ActionTypes";

export const collectRef = "/apiv1/collections";

export function asyncCollections(id) {

/**
* Fetch the list of the user collection asynchronously
* Use when user login or added a new collection
*
* @param {*} uid A JWT token to authenticate with the backend
*/
export function asyncCollections(uid) {
// fetch user's collections
return (dispatch) => {
if (id) {
if (uid) {
let userCollections = [];
fetch(collectRef, {headers: {"x-access-token": id}}).then((data) => {
fetch(collectRef, {headers: {"x-access-token": uid}}).then((data) => {
data.json().then((data) => {
data.forEach((doc) => {
userCollections.push(doc);
Expand All @@ -19,10 +26,23 @@ export function asyncCollections(id) {
};
}

/**
* Sends a signal to the reducer to sync the user collections
*
* @param {object} payload List of user collections
*
* @returns {object} reducer action obj with type SYNC_COLLECTIONS with payload
*/
export function syncCollections(payload) {
return { type: types.SYNC_CLASSES, payload: payload };
return { type: types.SYNC_COLLECTIONS, payload: payload };
}

/**
* Fetch the specific collection specify by user
*
* @param {string} collectionID Collection id
* @param {*} uid A JWT token to authenticate with the backend
*/
export function asyncCollection(collectionID, uid) {
// fetch projects in collection
return (dispatch) => {
Expand Down Expand Up @@ -62,13 +82,27 @@ export function asyncCollection(collectionID, uid) {
};
}

/**
* Sends a signal to the reducer to load the retrieved collection
*
* @param {object} payload Data of retrieved collection
*
* @returns {object} reducer action obj with type: SYNC_COLLECTION and payload
*/
export function syncCollection(payload) {
return { type: types.SYNC_CLASS, payload: payload };
return { type: types.SYNC_COLLECTION, payload: payload };
}

export function deleteCollection(id, name = null, uid) {
/**
* Sends a signal to the reducer to delete the specific collection of user
*
* @param {string} collectionID Collection ID
* @param {string} name Name of the collection if exists
* @param {*} uid A JWT token to authenticate with the backend
*/
export function deleteCollection(collectionID, name = null, uid) {
return (dispatch) => {
name = (name ? name : id);
name = (name ? name : collectionID);
if (window.confirm(`Are you sure you want to delete collection "${name}"?`)) {

// Delete Document
Expand All @@ -77,12 +111,14 @@ export function deleteCollection(id, name = null, uid) {
console.error(`Error deleting collection ${name}: ${resp.statusText}`);
return;
}
dispatch({ type: types.DELETE_CLASS, id: id });
dispatch({ type: types.DELETE_COLLECTION, id: collectionID });
});
}
};
}

/**
* Creates a new collection
*
* @param {string} name The name of the collection to be created
* @param {*} uid A JWT token to authenticate with the backend
Expand Down
78 changes: 54 additions & 24 deletions src/actions/courseActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as sceneActions from "./sceneActions";

const courseRef = "/apiv1/courses/";
const header = { headers: { "content-type": "application/json" } };
let noLessons = {
const noLessons = {
name: "",
id: -1,
prompt: "There are no lessons in this course",
Expand All @@ -19,9 +19,12 @@ const problem = {
code: ""
};

/**
/*
* Course Actions
*/
/**
* Fetch all the courses available
*/
export function fetchCourses() {
return (dispatch) => {
fetch(courseRef, header)
Expand All @@ -42,10 +45,22 @@ export function fetchCourses() {
};
}

/**
* Sends a signal to the reducer to synchronize the courses
*
* @param {*} payload List of courses retrieved
*
* @returns reducer action object with type: SYNC_COURSE and payload
*/
export function syncCourses(payload) {
return { type: types.SYNC_COURSES, payload: payload };
}

/**
* Fetch specific course
*
* @param {string} courseId id of the course getting
*/
export function fetchCourse(courseId) {
return (dispatch) => {
fetch(courseRef + courseId, header)
Expand Down Expand Up @@ -84,16 +99,23 @@ export function fetchCourse(courseId) {
};
}

/**
* Sends signal to the reducer to load the course retrieved
*
* @param {*} course Data of course retrieved
* @returns {object} reducer action obj with type: LOAD_COURSE and payload
*/
export function loadCourse(course) {
return {
type: types.LOAD_COURSE,
payload: course
};
return { type: types.LOAD_COURSE, payload: course };
}

/**
/*
* Lesson Actions
*/
/**
* Fetch the lesson that is supplied by the parameter.
* @param {*} json Lesson data
*/
export function fetchLesson(json) {
return (dispatch) => {
dispatch(loadLesson(json));
Expand All @@ -106,10 +128,21 @@ export function fetchLesson(json) {
}

/**
* Frontend disables option if out of bounds
* Sends signal to the reducer to load a new lesson supplied by parameter
*
* @param {object} lesson Lesson data
* @returns reducer action obj with type: LOAD_LESSON and payload: lesson
*/
export function loadLesson(lesson) {
return { type: types.LOAD_LESSON, payload: lesson };
}

/**
* Increment the lesson index and load the next lesson.
* Frontend disables option if out of bounds
*
* @param {*} currentIndex !!!DESCRIPTION NEEDED!!!
* @param {*} next !!!DESCRIPTION NEEDED!!!
* @param {number} currentIndex current index of the course
* @param {object} next Object of lesson to be load next
*/
export function nextLesson(currentIndex, next) {
return (dispatch) => {
Expand All @@ -119,10 +152,11 @@ export function nextLesson(currentIndex, next) {
}

/**
* Frontend disables option if out of bounds
* Decrement the lesson index and load the previous lesson.
* Frontend disables option if out of bounds
*
* @param {*} currentIndex !!!DESCRIPTION NEEDED!!!
* @param {*} prev !!!DESCRIPTION NEEDED!!!
* @param {number} currentIndex current index of the course
* @param {object} prev Object of lesson to be load previous
*/
export function previousLesson(currentIndex, prev) {
return (dispatch) => {
Expand All @@ -131,18 +165,14 @@ export function previousLesson(currentIndex, prev) {
};
}

/**
* Sends signal to the reducer to update the current index of the Course
*
* @param {number} newIndex New index to be set
* @returns {object} reducer action obj with type: SET_INDEX and payload: newIndex
*/
export function setCurrentIndex(newIndex) {
return {
type: types.SET_INDEX,
payload: newIndex
};
}

export function loadLesson(lesson) {
return {
type: types.LOAD_LESSON,
payload: lesson
};
return { type: types.SET_INDEX, payload: newIndex };
}

export default {
Expand Down
Loading

0 comments on commit 728a4b3

Please sign in to comment.