forge
Explore
Log in

Don't you dare go Hollow

🧭 add a Services nav group for meals and payment statement

Browse files at this commit

083afa3ecfb29d5f364a677b0b2290753cdc8cc8Burak BoduroğluParent: e3aba15
  • feat
    • 🧭 add a Services nav group for meals and payment statement
Show full message
feat: 🧭 add a Services nav group for meals and payment statement
- meals + payment-statement move out of Community into a dedicated
  Services group for every role, keeping the flow consistent
- parent primary strip loses Meals (now reachable under Services), and
  the Academics group icon becomes IconSchool
src/components/layout/nav-items.test.tsmodified+9 -3
@@ -5,7 +5,7 @@ test.each([
55 ["teacher", ["/", "/courses", "/calendar"]],
66 ["manager", ["/", "/courses", "/calendar"]],
77 ["admin", ["/", "/courses", "/calendar"]],
8- ["parent", ["/", "/students", "/calendar", "/meals"]],
8+ ["parent", ["/", "/students", "/calendar"]],
99 ] as const)("%s gets role-specific primary destinations", (role, expected) => {
1010 expect(primaryNavItems(role).map((item) => item.to)).toEqual(expected);
1111 });
@@ -16,7 +16,7 @@ test("invalid role destinations stay hidden", () => {
1616 expect(visibleNavItems("teacher").map((item) => item.to)).not.toContain("/admin/users");
1717 });
1818
19-test("student secondary navigation follows the academic, planning, workspace, community flow", () => {
19+test("student secondary navigation follows the academic, planning, workspace, services, community flow", () => {
2020 expect(
2121 sidebarNavGroups("student").map((group) => ({
2222 id: group.id,
@@ -26,10 +26,16 @@ test("student secondary navigation follows the academic, planning, workspace, co
2626 { id: "classes", items: ["homework", "exams"] },
2727 { id: "planning", items: ["events", "appointments"] },
2828 { id: "workspace", items: ["notes", "whiteboards", "pomodoro"] },
29- { id: "community", items: ["meals", "payment-statement", "messages", "questions"] },
29+ { id: "services", items: ["meals", "payment-statement"] },
30+ { id: "community", items: ["messages", "questions"] },
3031 ]);
3132 });
3233
34+test("parent's services group includes meals and payment-statement, consistent with every other role", () => {
35+ const services = sidebarNavGroups("parent").find((group) => group.id === "services");
36+ expect(services?.items.map((item) => item.id)).toEqual(["meals", "payment-statement"]);
37+});
38+
3339 test.each(["student", "parent", "teacher", "manager", "admin"] as const)(
3440 "%s can reach every visible feature and appointments from the sidebar",
3541 (role) => {
src/components/layout/nav-items.tsmodified+14 -4
@@ -20,6 +20,7 @@ import {
2020 IconEdit,
2121 IconNote,
2222 IconReportAnalytics,
23+ IconSchool,
2324 IconSettings,
2425 IconUserCog,
2526 IconUsers,
@@ -96,14 +97,16 @@ const PRIMARY_BY_ROLE: Record<Role, NavItem[]> = {
9697 teacher: [HOME_ITEM, CLASSES_ITEM, CALENDAR_ITEM],
9798 manager: [HOME_ITEM, CLASSES_ITEM, CALENDAR_ITEM],
9899 admin: [HOME_ITEM, CLASSES_ITEM, CALENDAR_ITEM],
99- parent: [HOME_ITEM, CHILDREN_ITEM, CALENDAR_ITEM, MEALS_ITEM],
100+ // Meals stays out of the primary strip so it lives under "Community" for
101+ // every role consistently, same as teacher/manager/admin/student.
102+ parent: [HOME_ITEM, CHILDREN_ITEM, CALENDAR_ITEM],
100103 };
101104
102105 const NAV_GROUPS: NavGroup[] = [
103106 {
104107 id: "classes",
105108 labelKey: "nav.group.classes",
106- Icon: IconGuide,
109+ Icon: IconSchool,
107110 items: [
108111 CLASSES_ITEM,
109112 { id: "homework", to: "/homework", labelKey: "nav.homework", Icon: IconHomework },
@@ -144,13 +147,20 @@ const NAV_GROUPS: NavGroup[] = [
144147 { id: "student-pomodoro", to: "/management/pomodoros", labelKey: "nav.studentPomodoro", Icon: IconClock, minRole: "teacher" },
145148 ],
146149 },
150+ {
151+ id: "services",
152+ labelKey: "nav.group.services",
153+ Icon: IconGuide,
154+ items: [
155+ MEALS_ITEM,
156+ { id: "payment-statement", to: "/payments", labelKey: "nav.paymentStatement", Icon: IconChart, maxRole: "student" },
157+ ],
158+ },
147159 {
148160 id: "community",
149161 labelKey: "nav.group.community",
150162 Icon: IconGlobe,
151163 items: [
152- MEALS_ITEM,
153- { id: "payment-statement", to: "/payments", labelKey: "nav.paymentStatement", Icon: IconChart, maxRole: "student" },
154164 { id: "messages", to: "/messages", labelKey: "nav.messages", Icon: IconMessage },
155165 { id: "questions", to: "/questions", labelKey: "nav.questions", Icon: IconHelpCircle },
156166 { id: "work", to: "/work", labelKey: "nav.work", Icon: IconBriefcase, minRole: "teacher", maxRole: "manager" },
src/i18n/messages.tsmodified+3 -0
@@ -107,6 +107,7 @@ export type MessageKey =
107107 | "nav.group.reports"
108108 | "nav.group.settings"
109109 | "nav.group.community"
110+ | "nav.group.services"
110111 | "nav.darkMode"
111112 | "rightPanel.messagesTitle"
112113 | "rightPanel.calendarTitle"
@@ -1370,6 +1371,7 @@ const en: Dict = {
13701371 "nav.group.reports": "Reports",
13711372 "nav.group.settings": "Settings",
13721373 "nav.group.community": "Community",
1374+ "nav.group.services": "Services",
13731375 "nav.darkMode": "Dark mode",
13741376 "nav.myStudents": "My Students",
13751377 "parents.title": "My Students",
@@ -2638,6 +2640,7 @@ const tr: Dict = {
26382640 "nav.group.reports": "Raporlar",
26392641 "nav.group.settings": "Ayarlar",
26402642 "nav.group.community": "Topluluk",
2643+ "nav.group.services": "Hizmetler",
26412644 "nav.darkMode": "Karanlık mod",
26422645 "nav.myStudents": "Öğrencilerim",
26432646 "parents.title": "Öğrencilerim",