This commit is contained in:
2025-11-14 14:47:26 +00:00
parent 69ecf2c7c1
commit 3b4876793e
104 changed files with 231517 additions and 1029 deletions
+8 -8
View File
@@ -22,7 +22,7 @@ interface Event {
subjectClass: string;
color: string;
periodCode: string;
tldraw_snapshot?: string;
node_storage_path?: string;
};
}
@@ -155,12 +155,12 @@ const CalendarPage: React.FC = () => {
try {
logger.debug('calendar', 'Fetching events', {
unique_id: workerNode.nodeData.unique_id,
uuid_string: workerNode.nodeData.uuid_string,
school_db_name: workerDbName
});
const events = await TimetableNeoDBService.fetchTeacherTimetableEvents(
workerNode.nodeData.unique_id,
workerNode.nodeData.uuid_string,
workerDbName || ''
);
@@ -168,7 +168,7 @@ const CalendarPage: React.FC = () => {
...event,
extendedProps: {
...event.extendedProps,
tldraw_snapshot: workerNode?.nodeData?.tldraw_snapshot
node_storage_path: workerNode?.nodeData?.node_storage_path
}
}));
@@ -196,11 +196,11 @@ const CalendarPage: React.FC = () => {
}, [fetchEvents]);
const handleEventClick = useCallback((clickInfo: EventClickArg) => {
const tldraw_snapshot = clickInfo.event.extendedProps?.tldraw_snapshot;
if (tldraw_snapshot) {
// TODO: Implement tldraw_snapshot retrieval from storage API
const node_storage_path = clickInfo.event.extendedProps?.node_storage_path;
if (node_storage_path) {
// TODO: Implement node_storage_path retrieval from storage API
// For now, we'll just log it
console.log('TLDraw snapshot:', tldraw_snapshot);
console.log('TLDraw snapshot:', node_storage_path);
}
}, []);
+96
View File
@@ -0,0 +1,96 @@
import React from 'react';
import { useNavigate } from 'react-router-dom';
import {
Box,
Button,
Container,
Grid,
Paper,
Stack,
Typography
} from '@mui/material';
import { useAuth } from '../../contexts/AuthContext';
import { useUser } from '../../contexts/UserContext';
const DashboardPage: React.FC = () => {
const navigate = useNavigate();
const { user: authUser } = useAuth();
const { profile, loading } = useUser();
const displayName = profile?.display_name || authUser?.display_name || authUser?.username || 'Member';
const emailAddress = profile?.email || authUser?.email || '';
const userType = profile?.user_type || authUser?.user_type || '';
return (
<Container maxWidth="lg" sx={{ py: 6 }}>
<Stack spacing={6}>
<Box>
<Typography variant="h3" component="h1" gutterBottom>
Welcome back{displayName ? `, ${displayName}` : ''}!
</Typography>
<Typography variant="body1" color="text.secondary" sx={{ maxWidth: 560 }}>
This is your starting point inside ClassroomCopilot. We keep things simple here so you
can decide what to explore next.
</Typography>
</Box>
<Grid container spacing={3}>
<Grid item xs={12} md={6}>
<Paper elevation={2} sx={{ p: 3 }}>
<Typography variant="h6" gutterBottom>
Account overview
</Typography>
<Stack spacing={1}>
<Typography variant="body2" color="text.secondary">
Signed in as
</Typography>
<Typography variant="body1">
{emailAddress || 'No email on file'}
</Typography>
{userType && (
<Typography variant="body2" color="text.secondary">
Role: {userType}
</Typography>
)}
<Typography variant="body2" color="text.secondary">
{loading ? 'Checking profile details...' : 'Profile ready'}
</Typography>
</Stack>
</Paper>
</Grid>
<Grid item xs={12} md={6}>
<Paper elevation={2} sx={{ p: 3, height: '100%' }}>
<Typography variant="h6" gutterBottom>
Quick actions
</Typography>
<Stack spacing={2}>
<Button
variant="contained"
color="primary"
onClick={() => navigate('/single-player')}
>
Open workspace
</Button>
<Button
variant="outlined"
onClick={() => navigate('/calendar')}
>
View calendar
</Button>
<Button
variant="outlined"
onClick={() => navigate('/settings')}
>
Update settings
</Button>
</Stack>
</Paper>
</Grid>
</Grid>
</Stack>
</Container>
);
};
export default DashboardPage;