Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
c3e01dc
Created the Admin page to do work on
KyleHoNguyen Nov 3, 2023
2154526
Added Admin role and user on Strapi. sign in avail
KyleHoNguyen Nov 3, 2023
c66e601
SIlly little Admin template page
KyleHoNguyen Nov 7, 2023
fc2463f
Components folder
KyleHoNguyen Nov 7, 2023
d891086
Got Classrooms Functionality Working
medwards14 Nov 10, 2023
9c922e4
created an admin dashboard route - unfixed
annachxn Nov 10, 2023
9dce8b0
Added comments to the mock data file
medwards14 Nov 10, 2023
5c287ad
Added comments to Classrooms.jsx
medwards14 Nov 10, 2023
022597c
Added comments to Classrooms.css
medwards14 Nov 10, 2023
976a01d
Updated Classrooms.jsx
medwards14 Nov 10, 2023
5242774
Removed comments from classroomsData.json
medwards14 Nov 10, 2023
58c8560
Updated title in index.html to Classrooms Page
medwards14 Nov 11, 2023
f7fd40a
Updated title in index.html to 'Classrooms Page'
medwards14 Nov 11, 2023
c0b4672
Merge branch 'ClassroomPage' of https://github.com/Group4F/Sapphire-P…
medwards14 Nov 11, 2023
5069c81
added teacher list functionality
medwards14 Nov 12, 2023
3fb5f63
cleaned up naming conventions
medwards14 Nov 12, 2023
9671095
created the organizations page and got it working
medwards14 Nov 12, 2023
8e0d460
Fixed naming conventions
medwards14 Nov 12, 2023
af9a2fa
Fixed naming conventions
medwards14 Nov 12, 2023
25c92f9
changed index.html to center data in organizations
medwards14 Nov 12, 2023
5cde241
changed index.html to center organization data
medwards14 Nov 12, 2023
e4a7357
Updated index.html
medwards14 Nov 12, 2023
56a3cc8
Update Organizations.jsx
medwards14 Nov 12, 2023
83b1ee6
Fixed centering, fonts on classrooms and teachers
medwards14 Nov 12, 2023
58042c1
spacing
medwards14 Nov 12, 2023
40a1acb
Fixed Teachers title
medwards14 Nov 12, 2023
0374fb8
Fixed Classrooms title
medwards14 Nov 12, 2023
e8b1a24
Merge remote-tracking branch 'origin/ClassroomPage' into develop
KyleHoNguyen Nov 13, 2023
9c96244
Added buttons to route to lists from mason
KyleHoNguyen Nov 13, 2023
6d5415e
Adjusted routing and menu options for /admin
annachxn Nov 13, 2023
046066d
Merge branch 'develop' into lessonlists
annachxn Nov 13, 2023
9cdb97a
fixed merging with 'develop' into lessonlists
annachxn Nov 13, 2023
e565594
worked on lessonLists page
annachxn Nov 13, 2023
eea574d
cleaned up unused code
annachxn Nov 13, 2023
b1346f2
Edited/added comments to my Classrooms.jsx file
medwards14 Nov 14, 2023
0b9f670
Edited/added comments to my Classrooms.css file
medwards14 Nov 14, 2023
76299c2
Added comments to the main.jsx file for my Classrooms list page
medwards14 Nov 14, 2023
6a75fe6
updated comments on my Organizations.jsx file
medwards14 Nov 14, 2023
ee75235
Updated comments in my Classrooms.jsx file
medwards14 Nov 14, 2023
2783a71
Updated comments in Classrooms.jsx
medwards14 Nov 14, 2023
ff73d7f
Updated comments on my Teachers.jsx file
medwards14 Nov 14, 2023
f4a7be6
Updated comments on Teachers.css
medwards14 Nov 14, 2023
8545f12
Updated comments on main.jsx
medwards14 Nov 14, 2023
d7cfabe
Updated comments on main.jsx
medwards14 Nov 14, 2023
388b437
Updated comments in Organizations.css
medwards14 Nov 14, 2023
221f890
Updated comments in main.jsx
medwards14 Nov 14, 2023
f2ac1b3
Updated comments in Classrooms.jsx
medwards14 Nov 14, 2023
463e930
Updated comments in Classrooms.css
medwards14 Nov 14, 2023
051f031
Updated comments in Organizations.jsx
medwards14 Nov 14, 2023
fd28ee7
Updated comments in Teachers.jsx
medwards14 Nov 14, 2023
b41445d
fixed white page issue
annachxn Nov 14, 2023
1941ffb
fixed white page issue and deleted unused files
annachxn Nov 14, 2023
4ceffa7
Updated comments on Classrooms.jsx
medwards14 Nov 14, 2023
9312a05
Updated comments in Organizations.jsx
medwards14 Nov 14, 2023
55efe9b
Updated comments in Teachers.jsx
medwards14 Nov 14, 2023
900fc9e
Updated Classrooms.jsx
medwards14 Nov 15, 2023
66e6b4f
Updated Teachers.jsx
medwards14 Nov 15, 2023
d06b5fd
Updated Organizations.jsx
medwards14 Nov 15, 2023
f68833a
implemented GET for lesson modules
annachxn Nov 15, 2023
ac52c37
Removing useless imports
KyleHoNguyen Nov 16, 2023
339e878
Merge branch 'develop' of https://github.com/Group4F/Sapphire-Project…
KyleHoNguyen Nov 16, 2023
44453fd
Created new teacherlist page using strapi info
KyleHoNguyen Nov 16, 2023
d4b1740
worked on format and strapi GET data
annachxn Nov 27, 2023
afac9cc
deleting unnecessary files
KyleHoNguyen Nov 27, 2023
466bdfd
worked on lessonlist view button
annachxn Nov 27, 2023
1258f71
Got Strapi Data implemented in Classrooms List
medwards14 Nov 28, 2023
edef5b7
added lessons useEffect into Modal
annachxn Nov 28, 2023
a317724
finished lessonModule view and cleaned up code
annachxn Nov 28, 2023
25d27d9
merging lessonLists to develop
annachxn Nov 28, 2023
2c2605e
Implemented strapi data in Organizations list
medwards14 Nov 28, 2023
0cec83c
merge conflict
annachxn Nov 28, 2023
18e7f5a
Merge branch 'develop' of https://github.com/Group4F/Sapphire-Project…
annachxn Nov 28, 2023
8880841
cleaned up unused code in lessons
annachxn Nov 28, 2023
01e3358
Fixed Formatting for Organizations and Classrooms
medwards14 Nov 28, 2023
c9c0aec
Changed formatting to match lessonslist
KyleHoNguyen Nov 28, 2023
cce8888
Merge branch 'develop' of https://github.com/Group4F/Sapphire-Project…
KyleHoNguyen Nov 28, 2023
5174714
Manage pre-format
mariajaureguiim Dec 5, 2023
e027402
Manage Students Page good format except for view button
mariajaureguiim Dec 5, 2023
f294d44
Made main page nicer/ attempted remove/add buttons
KyleHoNguyen Dec 6, 2023
78a2684
Add/remove buttons for edit Teacher. WIP
KyleHoNguyen Dec 6, 2023
f8378e7
unfinished add/delete functions to lessons
annachxn Dec 6, 2023
78285ce
Merge branch 'develop' of https://github.com/Group4F/Sapphire-Project…
annachxn Dec 6, 2023
aeecef2
finished delete lessons functionality
annachxn Dec 6, 2023
b79aaf1
minor clean ups
annachxn Dec 6, 2023
f4ebe8a
Added Workspaces Folder and Code
medwards14 Dec 6, 2023
4668a5a
added workspaces functionality
medwards14 Dec 6, 2023
fec1b7b
Formatting main page better
KyleHoNguyen Dec 6, 2023
a9f901e
Changing names of Buttons
KyleHoNguyen Dec 6, 2023
4445bb5
changes for add functionality in lessons (WIP)
annachxn Dec 6, 2023
5038ccd
Merge branch 'develop' of https://github.com/Group4F/Sapphire-Project…
annachxn Dec 6, 2023
d64dc03
Remove button added but does not remove yet
mariajaureguiim Dec 6, 2023
a1aeb33
cleaned up code, added comments
annachxn Dec 9, 2023
6c1197e
Added comments for Classrooms
medwards14 Dec 11, 2023
d0514de
Added comments and additional fields for workspaces display
medwards14 Dec 11, 2023
f3c792c
Added comments to organizations files
medwards14 Dec 11, 2023
8c33697
Update README.md
KyleHoNguyen Dec 13, 2023
f2829ae
Update README.md
mariajaureguiim Dec 14, 2023
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
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# CaSMM
## Deployment
There are many branches on our GitHub Repository, but the Develop branch is the main branch where all our working features are currently located. The steps to launch our project is:
1. clone the repository
2. download Docker
3. install Node and Yarn
4. Run yarn from /client
5. Run yarn start from /client
6. Run npm install react-bootstrap bootstrap from /client
7. Run docker compose up from /
8. Open up the STRAPI admin page and login using these credentials:
superadmin@mail.com
TN9q6RZhDaw6
9. create the role “ Admin”
10. Create a temporary Admin user
11. Open local website. click the three lines at the top right in the navigation bar. click user login and use the same credentials as the temporary Admin user.
Hooray! You have now logged in as an Administrator and can see the Admin pages.

> Computation and Science Modeling through Making

Expand Down Expand Up @@ -86,9 +102,18 @@ The production environment is a Heroku app. It is composed of a web dyno, compil
* The compile dyno runs `compile`

#### Running

`casmm` is automatically built from the latest commits to `master`. Heroku runs the container orchestration from there.

Access STRAPI Admin Page:

Open the STRAPI admin page and log in using these credentials:
Email: superadmin@mail.com
Password: TN9q6RZhDaw6
Create the role "Admin".
Create a temporary Admin user.
Log in as Admin:

Open the local website.
Click the three lines at the top right in the navigation bar.
Click user login and use the same credentials as the temporary Admin user.
<br/>

## Maintenance
Expand Down
Binary file not shown.

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

1 change: 1 addition & 0 deletions bin/yarn--1699064612949-0.9986850656299113/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions bin/yarn--1699064612949-0.9986850656299113/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
2 changes: 1 addition & 1 deletion client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Stars a basic http server (using [http-server](https://www.npmjs.com/package/htt
Builds the app for production to the `build` folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

<br />
<br />+

## Styling

Expand Down
Binary file not shown.

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

1 change: 1 addition & 0 deletions client/bin/yarn--1698517071991-0.7056936130386515/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1698517071991-0.7056936130386515/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1698519670578-0.5195432677065672/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1698519670578-0.5195432677065672/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1698519856924-0.4267300156529026/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1698519881420-0.5974132261069294/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1698519881420-0.5974132261069294/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1698764317129-0.8961084066099729/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1698764317129-0.8961084066099729/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1699033816913-0.3322156484620793/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1699033816913-0.3322156484620793/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1699288291421-0.452872308541749/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1699288291421-0.452872308541749/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1699481438574-0.4306832134488694/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1699481438574-0.4306832134488694/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1700152822182-0.7365502444867742/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1700152822182-0.7365502444867742/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701123533856-0.3861208787184569/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701123533856-0.3861208787184569/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701712953949-0.1337658205693424/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701712953997-0.8152966625021165/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701712953997-0.8152966625021165/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701712953997-0.9080707031844724/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701712974379-0.5821689302080872/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701712974379-0.5821689302080872/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701713200894-0.3101917901501041/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701713200894-0.3101917901501041/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701728607717-0.9192737898566874/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701728607717-0.9192737898566874/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701879358031-0.7514135625290843/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701879358031-0.7514135625290843/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701893574113-0.8226167922204364/node.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" %*
1 change: 1 addition & 0 deletions client/bin/yarn--1701893574113-0.8226167922204364/yarn.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" %*
4 changes: 4 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
name="description"
content="Computation and Science Modeling through Making"
/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="apple-touch-icon" href="/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
Expand Down Expand Up @@ -36,6 +37,9 @@
<script src="/lib/arduino_compressed.js"></script>
<script src="/lib/javascript_compressed.js"></script>
<script src="/lib/avrgirl-arduino.global.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script>
const global = globalThis
</script>
Expand Down
4 changes: 3 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
"@loadable/component": "^5.15.2",
"antd": "^4.24.8",
"axios": "^1.4.0",
"bootstrap": "^5.3.2",
"cross-env": "^7.0.3",
"emoji-picker-react": "^3.6.1",
"http-server": "^0.12.3",
"less": "^4.1.3",
"react": "^18.2.0",
"react-bootstrap": "^2.9.1",
"react-dom": "^18.2.0",
"react-hooks-global-state": "^2.1.0",
"react-papaparse": "^3.17.1",
"react-router-dom": "^6.9.0",
"react-router-dom": "^6.18.0",
"recharts": "^2.5.0",
"vite": "^4.5.0",
"yarn": "^1.22.10"
Expand Down
24 changes: 24 additions & 0 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
//App.jsx
import React from 'react';
import { Route, Routes } from 'react-router-dom';
import PrivateRoute from './Utils/PrivateRoute';
import About from './views/About/About';
import Admin from './views/Admin/Admin';
import Teachers from './views/Admin/Teachers/TeacherList';
import Classrooms from './views/Admin/Classrooms/executable/src/Classrooms';
import Organizations from './views/Admin/Organizations/executable/src/Organizations';
import Workspaces from './views/Admin/Workspaces/WorkspaceList';
import ManageStudents from './views/Admin/ManageStudents/ManageStudents';
import BlocklyPage from './views/BlocklyPage/BlocklyPage';
import BugReport from './views/BugReport/BugReport';
import ContentCreator from './views/ContentCreator/ContentCreator';
Expand All @@ -19,6 +26,7 @@ import StudentLogin from './views/StudentLogin/StudentLogin';
import ForgetPassword from './views/TeacherLogin/ForgetPassword';
import ResetPassword from './views/TeacherLogin/ResetPassword';
import TeacherLogin from './views/TeacherLogin/TeacherLogin';
import Lessons from './views/Admin/Lessons/lessons';

const App = () => {
return (
Expand All @@ -40,6 +48,22 @@ const App = () => {
</PrivateRoute>
}
/>
<Route
path='/admin'
element={
// <PrivateRoute>
<Admin />
// </PrivateRoute>
}
/>
<Route path='/organizationlist' element={<Organizations />} />
<Route path='/classroomlist' element={<Classrooms />} />
<Route path='/workspacelist' element={<Workspaces />} />
<Route path='/lessonlist' element={<Lessons />} />
<Route path='/teacherlist' element={<Teachers />} />
<Route path='/managestudents' element={<ManageStudents />} />


<Route
path='/activityLevel'
element={
Expand Down
72 changes: 72 additions & 0 deletions client/src/Utils/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ const makeRequest = async ({ method, path, data, auth = false, error }) => {
try {
switch (method) {
case GET:
console.log("HERE");
res = (await axios.get(path, config)).data;

break;
case POST:
res = (await axios.post(path, data, config)).data;
Expand Down Expand Up @@ -52,13 +54,48 @@ export const getActivities = async () =>
error: 'Activities could not be retrieved.',
});

export const addTeacher = async (firstName,lastName, school, user) =>
makeRequest({
method: POST,
path: `${server}/mentors`,
data: {
firstName: firstName,
lastName: lastName,
school: school,
user: user,
},
auth: true,
error: 'Failed to add teacher.',
});
export const deleteTeacher = async (id) =>
makeRequest({
method: DELETE,
path: `${server}/mentors/${id}`,
auth: true,
error: 'Failed to delete teacher.',
});
export const getTeachers = async () =>
makeRequest({
method: GET,
path: `${server}/mentors`,
auth: true,
error: 'Teachers could not be retrieved.',
});
export const getTeacher = async (id) =>
makeRequest({
method: GET,
path: `${server}/mentors/${id}`,
auth: true,
error: 'Failed to retrieve learning standard.',
});

export const getAdmin = async () =>
makeRequest({
method: GET,
path: `${server}/admin`,
auth: true,
error: 'Your admin information could not be retrieved.',
});

export const getAllClassrooms = async () =>
makeRequest({
Expand All @@ -68,6 +105,14 @@ export const getAllClassrooms = async () =>
error: 'Classrooms could not be retrieved.',
});

export const getSchools = async () =>
makeRequest({
method: GET,
path: `${server}/schools`,
auth: true,
error: 'Schools could not be retrieved.',
});

export const getAllStudents = async () =>
makeRequest({
method: GET,
Expand Down Expand Up @@ -330,6 +375,33 @@ export const deleteStudent = async (student) =>
error: 'Failed to delete student.',
});

// LESSON ADD/DELETE IMPLEMENTATION
export const addLesson = async (lessonData) =>
makeRequest({
method: POST,
path: `${server}/lesson-modules`,
data: lessonData,
auth: true,
error: 'Failed to add lesson module.',
});

export const addClassroomLesson = async (lesson, classroom) =>
makeRequest({
method: POST,
path: `${server}/lesson-modules`,
data: { lesson: lesson, classroom: classroom },
auth: true,
error: 'Failed to add lesson module to a classroom.',
});

export const deleteLesson = async (key) =>
makeRequest({
method: DELETE,
path: `${server}/lesson-modules/${key}`,
auth: true,
error: 'Failed to delete lesson module.',
});

export const updateActivityLevelTemplate = async (id, workspace, blocksList) =>
makeRequest({
method: PUT,
Expand Down
7 changes: 6 additions & 1 deletion client/src/Utils/userState.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export const getCurrUser = () => {
role: 'ContentCreator',
name: result.role.name,
};
} else if (result.role.type === 'admin') {
return {
role: 'Admin',
name: result.role.name,
};
} else if (result.role.type === 'researcher') {
return {
role: 'Researcher',
Expand All @@ -27,7 +32,7 @@ export const getCurrUser = () => {
role: 'Mentor',
name: result.role.name,
};
}
}
};

const { setGlobalState, useGlobalState } = createGlobalState({
Expand Down
40 changes: 40 additions & 0 deletions client/src/components/AdminSubHeader/AdminSubHeader.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// taken from MentorSubHeader.jsx

import React from 'react';
import { Link } from 'react-router-dom';
import AddLessonModal from '../../views/admin/Lessons/Roster/AddLesson/AddLessonModal';
import './AdminSubHeader.less';

export default function AdminSubHeader(props) {
const {
title,
listViewActive,
checkoutActive,
setListView,
addUserActive,
addLessonToTable,
} = props;

return (
<div id='page-header'>
<h1>{title}</h1>
<span id='header-nav'>
{listViewActive ? (
<button onClick={() => setListView(true)} id='link'>
<i className='fa fa-list-alt' />
</button>
) : null}
{addUserActive ? (
<AddLessonModal
addLessonToTable={addLessonToTable}
/>
) : null}
{checkoutActive ? (
<Link id='link' to={'/dashboard'}>
<i className='fa fa-shopping-cart' />
</Link>
) : null}
</span>
</div>
);
}
Loading