Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8757926
Initial setup
taiphlosion Nov 1, 2023
2258659
Initial setup
taiphlosion Nov 7, 2023
528e1f8
Draft of front-end
taiphlosion Nov 7, 2023
0f7167a
Implemented Parent Sign Up route and view
gab0link Nov 7, 2023
52e04e4
Added parent signup form
zhengiy Nov 7, 2023
8d2070a
changed routing url
zhengiy Nov 7, 2023
f14a34e
testing
osakellarides Nov 7, 2023
a7fb2a8
UI for share features
osakellarides Nov 7, 2023
5465398
Merge pull request #1 from CEN3031-FINAL/share_features
osakellarides Nov 7, 2023
8d7d4eb
Update dump command
DavidMagda Nov 7, 2023
21ee1b7
Merge branch 'develop' into missed-class
taiphlosion Nov 7, 2023
97025f3
Merge pull request #2 from CEN3031-FINAL/missed-class
taiphlosion Nov 7, 2023
8078617
Added access management page
zhengiy Nov 7, 2023
9b031dc
Changed parentSignUp to parentLogins and rerouted
gab0link Nov 7, 2023
2d8c3bf
Merge branch 'develop' into parent-login-ui
gab0link Nov 7, 2023
526ce71
Merge pull request #3 from CEN3031-FINAL/parent-login-ui
gab0link Nov 7, 2023
df68820
Merge branch 'develop' into parent-features
gab0link Nov 7, 2023
8878c8c
Merge pull request #4 from CEN3031-FINAL/parent-features
gab0link Nov 7, 2023
4ec7b4b
Linked parent login and signup to menu dropdown
gab0link Nov 9, 2023
9529773
Linked parent login to restrict-access
gab0link Nov 9, 2023
4d82942
typo
gab0link Nov 9, 2023
5d9793e
Merge pull request #5 from CEN3031-FINAL/parent-features-rerouting
gab0link Nov 9, 2023
574a803
Share feature pop-up
osakellarides Nov 14, 2023
68a7ba0
Current stuff before Strapi Update
taiphlosion Nov 16, 2023
dbd75b7
Got basic data displayed on frontend
taiphlosion Nov 20, 2023
da833dc
Standalone 'share program' page
osakellarides Nov 21, 2023
946baeb
Update
taiphlosion Nov 21, 2023
30e8bbb
Merge pull request #6 from CEN3031-FINAL/share_program_page
osakellarides Nov 21, 2023
7cb2492
Merge branch 'develop' into student-portal
zhengiy Nov 28, 2023
1081e04
completed student portal
zhengiy Nov 28, 2023
8910316
Merge pull request #7 from CEN3031-FINAL/student-portal
zhengiy Nov 28, 2023
8bdd2ed
minor fix
zhengiy Nov 28, 2023
944934f
Merge branch 'student-portal' into develop
zhengiy Nov 28, 2023
952c438
Merge branch 'develop' into missed-class
taiphlosion Nov 28, 2023
ba2a476
Cleaned up features
taiphlosion Dec 4, 2023
1687ba9
Cleaned up front-end stuff and added more entries in backend
taiphlosion Dec 5, 2023
fe7b390
Fixed some display issue
taiphlosion Dec 6, 2023
54d30cd
Updated dump files
taiphlosion Dec 6, 2023
c018140
Added check to see if there was no content available
taiphlosion Dec 6, 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
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"devDependencies": {
"@types/w3c-web-serial": "^1.0.3",
"@vitejs/plugin-react-swc": "^3.2.0",
"@vitejs/plugin-react-swc": "^3.4.0",
"parse-full-name": "^1.2.6"
}
}
27 changes: 27 additions & 0 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ 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 ParentSignup from './views/ParentAccount/ParentSignup';
import RestrictAccess from './views/ParentAccount/RestrictAccess'
import ParentLogin from './views/ParentAccount/ParentLogin';
import MissedClass from './views/MissedClass/MissedClass';
import StudentPortal from './views/StudentPortal/StudentPortal';
import ShareProgram from './views/ShareProgram/ShareProgram';


const App = () => {
return (
Expand All @@ -27,6 +34,10 @@ const App = () => {
<Route path='/' element={<Home />} />
<Route path='/about' element={<About />} />
<Route path='/teacherlogin' element={<TeacherLogin />} />
<Route path='/parent-signup' element={<ParentSignup />} />
<Route path='/restrict-access' element={<RestrictAccess />} />
<Route path='/ParentLogin' element={<ParentLogin />} />
<Route path='/share-program' element={<ShareProgram />} />
<Route path='/forgot-password' element={<ForgetPassword />} />
<Route path='/reset-password' element={<ResetPassword />} />
<Route path='/login' element={<StudentLogin />} />
Expand Down Expand Up @@ -72,6 +83,14 @@ const App = () => {
</PrivateRoute>
}
/>
<Route
path="/student-portal"
element={
<PrivateRoute>
<StudentPortal />
</PrivateRoute>
}
/>
<Route
path='/student'
element={
Expand All @@ -80,6 +99,14 @@ const App = () => {
</PrivateRoute>
}
/>
<Route
path='/missed-class'
element={
<PrivateRoute>
<MissedClass />
</PrivateRoute>
}
/>
<Route
path='/classroom/:id'
element={
Expand Down
10 changes: 9 additions & 1 deletion client/src/Utils/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,5 +670,13 @@ export const getClassroomWorkspace = async (id) =>
method: GET,
path: `${server}/classroom/workspaces/${id}`,
auth: true,
error: 'Unable to retrive classroom workspaces',
error: 'Unable to retreive classroom workspaces',
});

export const getMissedContent = async () =>
makeRequest({
method: GET,
path: `${server}/missed-contents`,
auth: true,
error: 'Unable to retrieve missed content'
});
1 change: 1 addition & 0 deletions client/src/Utils/userState.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const getCurrUser = () => {
if (!result.role) {
return {
role: 'Student',
id: result,
};
} else if (result.role.type === 'content_creator') {
return {
Expand Down
Binary file added client/src/assets/share.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { message, Spin, Row, Col, Alert, Dropdown, Menu } from 'antd';
import { getSaves } from '../../../../Utils/requests';
import CodeModal from '../modals/CodeModal';
import ConsoleModal from '../modals/ConsoleModal';
import { Modal, Button } from 'antd';
import PlotterModal from '../modals/PlotterModal';
import DisplayDiagramModal from '../modals/DisplayDiagramModal'
import VersionHistoryModal from '../modals/VersionHistoryModal';
Expand Down Expand Up @@ -41,6 +42,8 @@ export default function StudentCanvas({ activity }) {
const workspaceRef = useRef(null);
const activityRef = useRef(null);

const [isShareProgramModalVisible, setShareProgramModalVisible] = useState(false);

const replayRef = useRef([]);
const clicks = useRef(0);

Expand Down Expand Up @@ -210,6 +213,16 @@ export default function StudentCanvas({ activity }) {
setUp();
}, [activity]);

const handleShareProgram = () => {
setShareProgramModalVisible(true);
// TODO: route to another screen or display list of selectable students
};

// close out modal if student chooses not to share
const handleCancelShareProgram = () => {
setShareProgramModalVisible(false);
};

const handleManualSave = async () => {
// save workspace then update load save options
pushEvent('save');
Expand Down Expand Up @@ -346,6 +359,9 @@ export default function StudentCanvas({ activity }) {
<Menu.Item>
<CodeModal title={'Arduino Code'} workspaceRef={workspaceRef.current} />
</Menu.Item>
<Menu.Item onClick={handleShareProgram}>
&nbsp; Share Program
</Menu.Item>
</Menu>
);

Expand Down Expand Up @@ -511,7 +527,25 @@ export default function StudentCanvas({ activity }) {
plotData={plotData}
setPlotData={setPlotData}
plotId={plotId}
/>
/>

{/* once parent accounts are linked with students, change pop-up to conditionally display "share enabled" or "share disabled" */}
{/* For now, a confirm share feature pop up displays */}
<Modal
title="Share Program"
visible={isShareProgramModalVisible}
onCancel={() => setShareProgramModalVisible(false)}
footer={[
<Button key="no" onClick={handleCancelShareProgram}>
No, cancel share request
</Button>,
<Button key="yes" type="primary" onClick={handleShareProgram}>
Yes, confirm share request
</Button>,
]}
>
<p>Are you sure you want to share this program?</p>
</Modal>
</div>

{/* This xml is for the blocks' menu we will provide. Here are examples on how to include categories and subcategories */}
Expand Down
23 changes: 22 additions & 1 deletion client/src/components/NavBar/NavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { DownOutlined } from '@ant-design/icons';
import { removeUserSession } from '../../Utils/AuthRequests';
import { useGlobalState } from '../../Utils/userState';


export default function NavBar() {
const [value] = useGlobalState('currUser');
let currentRoute = window.location.pathname;
Expand Down Expand Up @@ -99,6 +100,26 @@ export default function NavBar() {
&nbsp; Sign Out
</Menu.Item>
) : null}
{shouldShowRoute('ParentLogin') ? (
value.id % 2 == 0 ? (
<Menu.Item key='9' onClick={() => handleRouteChange(routes.ParentLogin)}>
<i className='fa fa-sign-in-alt' />
&nbsp; Parent Login
</Menu.Item>
) : (
<Menu.Item key='10' onClick={() => handleRouteChange(routes.ParentSignUp)}>
<i className='fa fa-sign-in-alt' />
&nbsp; Parent Sign Up
</Menu.Item>
)
) : null}
{shouldShowRoute('StudentPortal') ? (
<Menu.Item key='11' onClick={() => handleRouteChange(routes.StudentPortal)}>
<i className='fa fa-sign-in-alt' />
&nbsp; Student Portal
</Menu.Item>
) : null}

</Menu>
);

Expand All @@ -112,7 +133,7 @@ export default function NavBar() {
: value.role === 'Mentor'
? '/dashboard'
: value.role === 'Student'
? '/student'
? '/student-portal'
: value.role === 'Researcher'
? '/report'
: '/'
Expand Down
7 changes: 5 additions & 2 deletions client/src/components/NavBar/NavBarConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
"AccountInfo": "/account",
"ContentCreatorDashboard": "/ccdashboard",
"ResearcherDashboard": "/report",
"BugReport": "/bugreport"
"BugReport": "/bugreport",
"ParentSignUp": "/parent-signup",
"ParentLogin": "/parentlogin",
"StudentPortal": "/student-portal"
},
"users": {
"DefaultUser": ["Home", "TeacherLogin", "Sandbox", "About"],
"Mentor": ["Dashboard", "AccountInfo", "SignOut", "Sandbox", "BugReport"],
"Student": ["SignOut"],
"Student": ["StudentPortal", "ParentSignUp", "ParentLogin","SignOut"],
"ContentCreator": [
"ContentCreatorDashboard",
"AccountInfo",
Expand Down
67 changes: 0 additions & 67 deletions client/src/views/Dashboard/Dashboard.jsx

This file was deleted.

Loading