Spaces:
Sleeping
Sleeping
Upload 46 files
Browse files- components/Sidebar.tsx +2 -2
- pages/WishesAndFeedback.tsx +2 -2
components/Sidebar.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
|
| 2 |
import React from 'react';
|
| 3 |
-
import { LayoutDashboard, Users, BookOpen, GraduationCap, Settings, LogOut, FileText, School, UserCog, Palette, X, Building, Gamepad2, CalendarCheck, UserCircle,
|
| 4 |
import { UserRole } from '../types';
|
| 5 |
|
| 6 |
interface SidebarProps {
|
|
@@ -19,7 +19,7 @@ export const Sidebar: React.FC<SidebarProps> = ({ currentView, onChangeView, use
|
|
| 19 |
{ id: 'dashboard', label: '工作台', icon: LayoutDashboard, roles: [UserRole.ADMIN, UserRole.PRINCIPAL, UserRole.TEACHER, UserRole.STUDENT] },
|
| 20 |
{ id: 'attendance', label: '考勤管理', icon: CalendarCheck, roles: [UserRole.TEACHER, UserRole.PRINCIPAL] },
|
| 21 |
{ id: 'games', label: '互动教学', icon: Gamepad2, roles: [UserRole.TEACHER, UserRole.STUDENT] }, // Removed PRINCIPAL
|
| 22 |
-
{ id: 'wishes', label: '心愿与反馈', icon:
|
| 23 |
{ id: 'students', label: '学生管理', icon: Users, roles: [UserRole.ADMIN, UserRole.PRINCIPAL, UserRole.TEACHER] },
|
| 24 |
{ id: 'classes', label: '班级管理', icon: School, roles: [UserRole.ADMIN, UserRole.PRINCIPAL] },
|
| 25 |
{ id: 'schools', label: '学校管理', icon: Building, roles: [UserRole.ADMIN] }, // Only Super Admin can manage schools
|
|
|
|
| 1 |
|
| 2 |
import React from 'react';
|
| 3 |
+
import { LayoutDashboard, Users, BookOpen, GraduationCap, Settings, LogOut, FileText, School, UserCog, Palette, X, Building, Gamepad2, CalendarCheck, UserCircle, MessageSquare } from 'lucide-react';
|
| 4 |
import { UserRole } from '../types';
|
| 5 |
|
| 6 |
interface SidebarProps {
|
|
|
|
| 19 |
{ id: 'dashboard', label: '工作台', icon: LayoutDashboard, roles: [UserRole.ADMIN, UserRole.PRINCIPAL, UserRole.TEACHER, UserRole.STUDENT] },
|
| 20 |
{ id: 'attendance', label: '考勤管理', icon: CalendarCheck, roles: [UserRole.TEACHER, UserRole.PRINCIPAL] },
|
| 21 |
{ id: 'games', label: '互动教学', icon: Gamepad2, roles: [UserRole.TEACHER, UserRole.STUDENT] }, // Removed PRINCIPAL
|
| 22 |
+
{ id: 'wishes', label: '心愿与反馈', icon: MessageSquare, roles: [UserRole.ADMIN, UserRole.PRINCIPAL, UserRole.TEACHER, UserRole.STUDENT] }, // NEW
|
| 23 |
{ id: 'students', label: '学生管理', icon: Users, roles: [UserRole.ADMIN, UserRole.PRINCIPAL, UserRole.TEACHER] },
|
| 24 |
{ id: 'classes', label: '班级管理', icon: School, roles: [UserRole.ADMIN, UserRole.PRINCIPAL] },
|
| 25 |
{ id: 'schools', label: '学校管理', icon: Building, roles: [UserRole.ADMIN] }, // Only Super Admin can manage schools
|
pages/WishesAndFeedback.tsx
CHANGED
|
@@ -166,7 +166,7 @@ export const WishesAndFeedback: React.FC = () => {
|
|
| 166 |
// Load MY wishes
|
| 167 |
const myWishes = await api.wishes.getAll({ studentId: studentInfo._id || String(studentInfo.id) });
|
| 168 |
setWishes(myWishes);
|
| 169 |
-
setMyPendingWish(myWishes.find(w => w.status === 'PENDING') || null);
|
| 170 |
} else if (isTeacher) {
|
| 171 |
// Load wishes FOR ME
|
| 172 |
const myWishes = await api.wishes.getAll({ teacherId: currentUser?._id });
|
|
@@ -478,4 +478,4 @@ export const WishesAndFeedback: React.FC = () => {
|
|
| 478 |
</div>
|
| 479 |
</div>
|
| 480 |
);
|
| 481 |
-
};
|
|
|
|
| 166 |
// Load MY wishes
|
| 167 |
const myWishes = await api.wishes.getAll({ studentId: studentInfo._id || String(studentInfo.id) });
|
| 168 |
setWishes(myWishes);
|
| 169 |
+
setMyPendingWish(myWishes.find((w: Wish) => w.status === 'PENDING') || null);
|
| 170 |
} else if (isTeacher) {
|
| 171 |
// Load wishes FOR ME
|
| 172 |
const myWishes = await api.wishes.getAll({ teacherId: currentUser?._id });
|
|
|
|
| 478 |
</div>
|
| 479 |
</div>
|
| 480 |
);
|
| 481 |
+
};
|