From 8f28d5bfa104d1cb5f7db654d26dbefdeec38fd0 Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Wed, 14 Aug 2019 16:36:13 -0400 Subject: [PATCH 1/7] built myr and myr admin page to work with backend --- public/admin/index.html | 3 +-- public/myr/index.html | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/public/admin/index.html b/public/admin/index.html index fd1d2bfd..149dc2b4 100644 --- a/public/admin/index.html +++ b/public/admin/index.html @@ -1,2 +1 @@ -

ADMIN PORTAL PLACEHOLDER

-

This should only appear if you have not built the MYR Admin Portal yet. To do so, go to the MYR backend wiki and follow the directions. Hint, it involved running 'yarn prod' on the MYR admin portal.

+React App
\ No newline at end of file diff --git a/public/myr/index.html b/public/myr/index.html index af536ca3..9e021098 100644 --- a/public/myr/index.html +++ b/public/myr/index.html @@ -1,2 +1 @@ -

MYR PLACEHOLDER

-

This should only appear if you have not built MYR yet. To do so, go to the MYR backend wiki and follow the directions. Hint, it involved running 'yarn prod' on MYR.

+Myr.js
\ No newline at end of file From 0f88a97458b69c7ee33b736803c4bd9018e97303 Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Thu, 15 Aug 2019 16:17:08 -0400 Subject: [PATCH 2/7] updated schema to include categories & difficulty levels 1-4 --- apiv1/controllers/CourseController.js | 2 ++ apiv1/models/CourseModel.js | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apiv1/controllers/CourseController.js b/apiv1/controllers/CourseController.js index 54606e0b..6e560447 100644 --- a/apiv1/controllers/CourseController.js +++ b/apiv1/controllers/CourseController.js @@ -160,6 +160,7 @@ module.exports = { shortname: req.body.shortname, lessons: req.body.lessons, difficulty: req.body.difficulty, + categories: req.body.categories, description: req.body.description }); let token = req.headers['x-access-token']; @@ -228,6 +229,7 @@ module.exports = { Course.shortname = req.body.shortname ? req.body.shortname : Course.shortname; Course.lessons = req.body.lessons ? req.body.lessons : Course.lessons; Course.difficulty = req.body.difficulty ? req.body.difficulty : Course.difficulty; + Course.difficulty = req.body.categories ? req.body.categories : Course.categories; Course.description = req.body.description ? req.body.description : Course.description; Course.save(function (err, Course) { diff --git a/apiv1/models/CourseModel.js b/apiv1/models/CourseModel.js index 17800d4f..baba35e9 100644 --- a/apiv1/models/CourseModel.js +++ b/apiv1/models/CourseModel.js @@ -4,7 +4,14 @@ let Schema = mongoose.Schema; let CourseSchema = new Schema({ 'shortname': String, 'name': String, - 'difficulty': Number, + 'difficulty': { + type: Number, + enum: [1, 2, 3, 4], + }, + 'categories': [{ + type: String, + enum: ["geometry", "transformations", "animations", "groups", "firstTimer", "teachers"], + }], 'description': String, 'lessons': Array }); From 7dd13d3275201a1b4b94c5e8d8cfb5b711b86626 Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Thu, 15 Aug 2019 17:54:33 -0400 Subject: [PATCH 3/7] fixed updating categories in CourseController --- apiv1/controllers/CourseController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apiv1/controllers/CourseController.js b/apiv1/controllers/CourseController.js index 6e560447..758251a0 100644 --- a/apiv1/controllers/CourseController.js +++ b/apiv1/controllers/CourseController.js @@ -229,7 +229,7 @@ module.exports = { Course.shortname = req.body.shortname ? req.body.shortname : Course.shortname; Course.lessons = req.body.lessons ? req.body.lessons : Course.lessons; Course.difficulty = req.body.difficulty ? req.body.difficulty : Course.difficulty; - Course.difficulty = req.body.categories ? req.body.categories : Course.categories; + Course.categories = req.body.categories ? req.body.categories : Course.categories; Course.description = req.body.description ? req.body.description : Course.description; Course.save(function (err, Course) { From 3b094830be7aeada485bbacde957f3b552ee0639 Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Fri, 16 Aug 2019 11:50:30 -0400 Subject: [PATCH 4/7] changed difficulties to be zero-indexed --- apiv1/models/CourseModel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apiv1/models/CourseModel.js b/apiv1/models/CourseModel.js index baba35e9..3b44ef6b 100644 --- a/apiv1/models/CourseModel.js +++ b/apiv1/models/CourseModel.js @@ -6,7 +6,7 @@ let CourseSchema = new Schema({ 'name': String, 'difficulty': { type: Number, - enum: [1, 2, 3, 4], + enum: [0, 1, 2, 3], }, 'categories': [{ type: String, From ac1e47ace634bfb132a4863f33caae00582247d6 Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Fri, 16 Aug 2019 13:07:21 -0400 Subject: [PATCH 5/7] added 'misc' category --- .gitignore | 1 + apiv1/models/CourseModel.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index deed5d62..029102f4 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ yarn-debug.log* yarn-error.log* .vscode package-lock.json +mongofix.sh \ No newline at end of file diff --git a/apiv1/models/CourseModel.js b/apiv1/models/CourseModel.js index 3b44ef6b..baf11db9 100644 --- a/apiv1/models/CourseModel.js +++ b/apiv1/models/CourseModel.js @@ -10,7 +10,7 @@ let CourseSchema = new Schema({ }, 'categories': [{ type: String, - enum: ["geometry", "transformations", "animations", "groups", "firstTimer", "teachers"], + enum: ["geometry", "transformations", "animations", "groups", "firstTimer", "teachers", "misc"], }], 'description': String, 'lessons': Array From d926065b5a8b9c01d8608567ef2e4f5bc36ce7f4 Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Mon, 19 Aug 2019 10:33:50 -0400 Subject: [PATCH 6/7] reset index.html --- public/admin/index.html | 3 ++- public/myr/index.html | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/admin/index.html b/public/admin/index.html index 149dc2b4..fd1d2bfd 100644 --- a/public/admin/index.html +++ b/public/admin/index.html @@ -1 +1,2 @@ -React App
\ No newline at end of file +

ADMIN PORTAL PLACEHOLDER

+

This should only appear if you have not built the MYR Admin Portal yet. To do so, go to the MYR backend wiki and follow the directions. Hint, it involved running 'yarn prod' on the MYR admin portal.

diff --git a/public/myr/index.html b/public/myr/index.html index 9e021098..af536ca3 100644 --- a/public/myr/index.html +++ b/public/myr/index.html @@ -1 +1,2 @@ -Myr.js
\ No newline at end of file +

MYR PLACEHOLDER

+

This should only appear if you have not built MYR yet. To do so, go to the MYR backend wiki and follow the directions. Hint, it involved running 'yarn prod' on MYR.

From dd25a5eacf6b1e1afd77919376d45f73432ce83b Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Mon, 20 Jul 2020 17:43:53 -0400 Subject: [PATCH 7/7] update package-lock --- package-lock.json | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 556fd818..7ec29f1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3077,7 +3077,7 @@ "dependencies": { "combined-stream": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "dev": true, "requires": { @@ -3146,8 +3146,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -3190,8 +3189,7 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", @@ -3202,8 +3200,7 @@ "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -3320,8 +3317,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -3333,7 +3329,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3356,14 +3351,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -3382,7 +3375,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -3476,7 +3468,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -3562,8 +3553,7 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -3599,7 +3589,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -3619,7 +3608,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -3663,14 +3651,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, @@ -7476,7 +7462,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }