Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shane #1

Open
wants to merge 44 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c0072de
navigate to gallery page
rpaigemei Nov 2, 2023
b03f7bd
search bar and icon
rpaigemei Nov 2, 2023
7eedce3
v0
100472150 Nov 2, 2023
a7c9972
something
MaxPlummer Nov 3, 2023
31ae8ab
something else
MaxPlummer Nov 3, 2023
3fed9c4
Merge remote-tracking branch 'origin/paige' into max
MaxPlummer Nov 3, 2023
9aaa8ee
NavBar updated to direct to Gallery/Search page
MaxPlummer Nov 3, 2023
b70dad3
saved workspaces -> gallery
rpaigemei Nov 3, 2023
ddde073
content creator gallery navigation + formatting
rpaigemei Nov 3, 2023
2f80c4b
add views
ShaneBarrera Nov 4, 2023
60a4770
Added temporary gallery view for content creator
MaxPlummer Nov 5, 2023
d155c11
Added Liked tab to content creator view and added icons
MaxPlummer Nov 5, 2023
97f2026
Added navbar to temporary public gallery page
MaxPlummer Nov 6, 2023
9a556ce
Fixed formatting for public and content creator gallery views
MaxPlummer Nov 6, 2023
d3263c2
Privacy buttons
100472150 Nov 6, 2023
6a635f4
More temporary gallery formatting
MaxPlummer Nov 6, 2023
35a03ba
navigate to gallery from menu dropdown
rpaigemei Nov 7, 2023
48a08c8
Merge pull request #1 from Sapphire-Project02-3b/paige
rpaigemei Nov 7, 2023
a83c43f
Merge branch 'develop' into max
rpaigemei Nov 7, 2023
f7ee214
Merge pull request #2 from Sapphire-Project02-3b/max
rpaigemei Nov 7, 2023
891c223
Merge branch 'develop' into pablo
rpaigemei Nov 7, 2023
1a1fe12
Merge pull request #3 from Sapphire-Project02-3b/pablo
rpaigemei Nov 7, 2023
08c55b3
Merge branch 'develop' into shane
rpaigemei Nov 7, 2023
13699c9
Merge pull request #4 from Sapphire-Project02-3b/shane
rpaigemei Nov 7, 2023
ac877dd
Merge pull request #5 from Sapphire-Project02-3b/develop
rpaigemei Nov 7, 2023
8d48ac8
edit
rpaigemei Nov 7, 2023
34662b1
DemoData
100472150 Nov 7, 2023
73189b5
Merge branch 'pablo' of https://github.com/Sapphire-Project02-3b/Sapp…
100472150 Nov 7, 2023
24a8d85
Display demo data and filter it with privacy setting
100472150 Nov 7, 2023
35d4acc
Merge branch 'paige' into pablo
rpaigemei Nov 9, 2023
238a02a
Merge pull request #6 from Sapphire-Project02-3b/pablo
rpaigemei Nov 9, 2023
9a3361a
gallery grid view - basic
rpaigemei Nov 9, 2023
9d0df71
Added searchbar filter, Paige's grid layout, and Pablo's privacy filter
MaxPlummer Nov 10, 2023
d12362a
Filter from search bar
MaxPlummer Nov 10, 2023
405a906
Merge branch 'max' of https://github.com/Sapphire-Project02-3b/Sapphi…
MaxPlummer Nov 10, 2023
a3ee9be
Changed demo data and cleaned up some code
MaxPlummer Nov 10, 2023
5b9f912
cleaned up code + added comments
rpaigemei Nov 12, 2023
9812c4d
Cleaned up code, added comments, added to DemoData
MaxPlummer Nov 12, 2023
81b995f
Added copy/edit icons
MaxPlummer Nov 14, 2023
8c84df9
Merge branch 'paige' into max
rpaigemei Nov 15, 2023
4b8a1dd
Implemented new gallery & edit page !NEEDS REFORMATTING!
MaxPlummer Nov 17, 2023
dae7ca3
Merge branch 'UFWebApps2-0:develop' into max
ShaneBarrera Nov 18, 2023
633ee10
fix
ShaneBarrera Nov 28, 2023
c5261c5
back-end implementation
ShaneBarrera Dec 2, 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
47 changes: 47 additions & 0 deletions client/DemoData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{

"entries": [
{
"name": "Movement of the Sun: Activity 1",
"description": "Students will create program that will read the value of a photoresistor on specific user input.",
"author": "Content Creator",
"privacy": "classroom"
},
{
"name": "Movement of the Sun: Activity 2",
"description": "Students will utilize a while loop in their program.",
"author": "Content Creator",
"privacy": "classroom"
},
{
"name": "Movement of the Sun: Activity 3",
"description": "Students will learn how to nest loops.",
"author": "Content Creator",
"privacy": "classroom"
},
{
"name": "Force, Motion, and Energy: Activity 1",
"description": "Students will use a ballista to learn about force, motion, and energy.",
"author": "Content Creator",
"privacy": "public"
},
{
"name": "Force, Motion, and Energy: Activity 2",
"description": "Students will use a ballista to learn about force, motion, and energy.",
"author": "Content Creator",
"privacy": "public"
},
{
"name": "Force, Motion, and Energy: Activity 3",
"description": "Students will use a ballista to learn about force, motion, and energy.",
"author": "Content Creator",
"privacy": "public"
},
{
"name": "Circuits: Activity 1",
"description": "Students will use if-else statements to predict energy flow in circuits.",
"author": "Content Creator",
"privacy": "public"
}
]
}
194 changes: 98 additions & 96 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { Route, Routes } from 'react-router-dom';
import PrivateRoute from './Utils/PrivateRoute';
import About from './views/About/About';
import Gallery from './views/Gallery/Gallery';
import BlocklyPage from './views/BlocklyPage/BlocklyPage';
import BugReport from './views/BugReport/BugReport';
import ContentCreator from './views/ContentCreator/ContentCreator';
Expand All @@ -21,102 +22,103 @@ import ResetPassword from './views/TeacherLogin/ResetPassword';
import TeacherLogin from './views/TeacherLogin/TeacherLogin';

const App = () => {
return (
<div>
<Routes>
<Route path='/' element={<Home />} />
<Route path='/about' element={<About />} />
<Route path='/teacherlogin' element={<TeacherLogin />} />
<Route path='/forgot-password' element={<ForgetPassword />} />
<Route path='/reset-password' element={<ResetPassword />} />
<Route path='/login' element={<StudentLogin />} />
<Route path='/replay/:saveID' element={<Replay />} />
<Route path='/sandbox' element={<BlocklyPage isSandbox={true} />} />
<Route
path='/report'
element={
<PrivateRoute>
<Report />
</PrivateRoute>
}
/>
<Route
path='/activityLevel'
element={
<PrivateRoute>
<ActivityLevelReport />
</PrivateRoute>
}
/>
<Route
path='/activityLevel/:id'
element={
<PrivateRoute>
<ActivityLevelReportView />
</PrivateRoute>
}
/>
<Route
path='/group-report'
element={
<PrivateRoute>
<GroupReport />
</PrivateRoute>
}
/>
<Route
path='/dashboard'
element={
<PrivateRoute>
<Dashboard />
</PrivateRoute>
}
/>
<Route
path='/student'
element={
<PrivateRoute>
<Student />
</PrivateRoute>
}
/>
<Route
path='/classroom/:id'
element={
<PrivateRoute>
<Classroom />
</PrivateRoute>
}
/>
<Route
path='/workspace'
element={
<PrivateRoute>
<BlocklyPage isSandbox={false} />
</PrivateRoute>
}
/>
<Route
path='/activity'
element={
<PrivateRoute>
<BlocklyPage isSandbox={false} />
</PrivateRoute>
}
/>
<Route
path='/ccdashboard'
element={
<PrivateRoute>
<ContentCreator />
</PrivateRoute>
}
/>
<Route path='/bugreport' element={<BugReport />} />
<Route path='*' element={<NotFound/>} />
</Routes>
</div>
);
return (
<div>
<Routes>
<Route path='/' element={<Home />} />
<Route path='/about' element={<About />} />
<Route path='/teacherlogin' element={<TeacherLogin />} />
<Route path='/forgot-password' element={<ForgetPassword />} />
<Route path='/reset-password' element={<ResetPassword />} />
<Route path='/login' element={<StudentLogin />} />
<Route path='/replay/:saveID' element={<Replay />} />
<Route path='/sandbox' element={<BlocklyPage isSandbox={true} />} />
<Route path='/gallery' element={<Gallery />} />
<Route
path='/report'
element={
<PrivateRoute>
<Report />
</PrivateRoute>
}
/>
<Route
path='/activityLevel'
element={
<PrivateRoute>
<ActivityLevelReport />
</PrivateRoute>
}
/>
<Route
path='/activityLevel/:id'
element={
<PrivateRoute>
<ActivityLevelReportView />
</PrivateRoute>
}
/>
<Route
path='/group-report'
element={
<PrivateRoute>
<GroupReport />
</PrivateRoute>
}
/>
<Route
path='/dashboard'
element={
<PrivateRoute>
<Dashboard />
</PrivateRoute>
}
/>
<Route
path='/student'
element={
<PrivateRoute>
<Student />
</PrivateRoute>
}
/>
<Route
path='/classroom/:id'
element={
<PrivateRoute>
<Classroom />
</PrivateRoute>
}
/>
<Route
path='/workspace'
element={
<PrivateRoute>
<BlocklyPage isSandbox={false} />
</PrivateRoute>
}
/>
<Route
path='/activity'
element={
<PrivateRoute>
<BlocklyPage isSandbox={false} />
</PrivateRoute>
}
/>
<Route
path='/ccdashboard'
element={
<PrivateRoute>
<ContentCreator />
</PrivateRoute>
}
/>
<Route path='/bugreport' element={<BugReport />} />
<Route path='*' element={<NotFound/>} />
</Routes>
</div>
);
};

export default App;
31 changes: 26 additions & 5 deletions client/src/Utils/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const makeRequest = async ({ method, path, data, auth = false, error }) => {
let err = null;
const config = auth
? {
headers: {
Authorization: `Bearer ${getToken()}`,
},
}
headers: {
Authorization: `Bearer ${getToken()}`,
},
}
: null;

try {
Expand Down Expand Up @@ -504,7 +504,7 @@ export const getLessonModuleActivities = async (lsId) =>
error: 'Activity cannot be retrived',
});

export const getActivityLevels = async (lsId) =>
export const getActivityLevels = async (lsId) =>
makeRequest({
method: GET,
path: `${server}/authorized-workspaces?activities.id=${lsId}`,
Expand All @@ -520,6 +520,27 @@ export const getActivity = async (id) =>
error: 'Activity cannot be retrived',
});

export const getGalleryActivity = async (id) => {
if (!id) {
throw new Error('Invalid gallery ID');
}

try {
return await makeRequest({
method: GET,
path: `${server}/galleries/${id}`,
auth: true,
error: 'Failed to retrieve gallery activity',
});
} catch (error) {
console.error('Error fetching gallery data:', error.message);
throw error; // Rethrow the error to handle it in the component
}
};




export const forgetPassword = async (email) =>
makeRequest({
method: POST,
Expand Down
Binary file added client/src/assets/placeholder-gallery-image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/placeholder-gallery-image1.jpg
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 @@ -23,19 +23,25 @@ export default function ConsoleModal({
const [deviceDisconnect, setDeviceDisconnect] = useState(false);

useEffect(() => {
navigator.serial.addEventListener('disconnect', (e) => {
console.log('device disconnected');
window.port = undefined;
setConnectionOpen(false);
document.getElementById('connect-button').innerHTML = 'Connect';
setDeviceDisconnect(true);
message.error('Device Disconnected');
});
navigator.serial.addEventListener('connect', (e) => {
setDeviceDisconnect(false);
message.success('Device Connected');
});
if ('serial' in navigator) {
navigator.serial.addEventListener('disconnect', (e) => {
console.log('device disconnected');
window.port = undefined;
setConnectionOpen(false);
document.getElementById('connect-button').innerHTML = 'Connect';
setDeviceDisconnect(true);
message.error('Device Disconnected');
});
navigator.serial.addEventListener('connect', (e) => {
setDeviceDisconnect(false);
message.success('Device Connected');
});
} else {
console.error('Serial not supported in this environment.');
}
}, [deviceDisconnect, setConnectionOpen]);



const handleKeyPress = async (e) => {
if (e.key === 'Enter') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,24 @@ export default function PlotterModal({
const [forceUpdate] = useReducer((x) => x + 1, 0);

useEffect(() => {
navigator.serial.addEventListener('disconnect', (e) => {
console.log('device disconnected');
window.port = undefined;
setConnectionOpen(false);
document.getElementById('connect-button').innerHTML = 'Connect';
setDeviceDisconnect(true);
message.error('Device Disconnected');
});
navigator.serial.addEventListener('connect', (e) => {
setDeviceDisconnect(false);
message.success('Device Connected');
});
if ('serial' in navigator) {
navigator.serial.addEventListener('disconnect', (e) => {
console.log('device disconnected');
window.port = undefined;
setConnectionOpen(false);
document.getElementById('connect-button').innerHTML = 'Connect';
setDeviceDisconnect(true);
message.error('Device Disconnected');
});
navigator.serial.addEventListener('connect', (e) => {
setDeviceDisconnect(false);
message.success('Device Connected');
});
} else {
console.error('Serial not supported in this environment.');
}
}, [deviceDisconnect, setConnectionOpen]);


const handleConnect = async () => {
if (!connectionOpen) {
Expand All @@ -62,10 +67,11 @@ export default function PlotterModal({
setDeviceDisconnect(false);
} else {
await handleCloseConnection();
plotId = 1;
setPlotId(1); // Assuming you have a state variable for plotId
setConnectionOpen(false);
}
};


const handleChange = (value) => {
setBaudRate(value);
Expand Down
Loading