feat: finalize navigation integration and permissions
Add Reports section to menuconfig with Operational submenu. Add Schedules link to Payroll submenu. Update Layout2 with role-based visibility: Operations (roles 1-4), Services (roles 1-6), Reports (roles 1-2). Add activeSection matching for /app/schedules and /app/operational-reports routes. Verified .env.example has JWT_SECRET entries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,9 @@ export default function Layout() {
|
|||||||
section.label === "Payroll" ? (user >= 1 && user <= 4 ? false : true) :
|
section.label === "Payroll" ? (user >= 1 && user <= 4 ? false : true) :
|
||||||
section.label === "Hotel" ? (user === 1 ? false : true) :
|
section.label === "Hotel" ? (user === 1 ? false : true) :
|
||||||
section.label === "Income" ? (user >= 1 && user <= 4 ? false : true) :
|
section.label === "Income" ? (user >= 1 && user <= 4 ? false : true) :
|
||||||
|
section.label === "Operations" ? (user >= 1 && user <= 4 ? false : true) :
|
||||||
|
section.label === "Services" ? (user >= 1 && user <= 6 ? false : true) :
|
||||||
|
section.label === "Reports" ? (user >= 1 && user <= 2 ? false : true) :
|
||||||
section.label === "Housekeeper" ? (user === 6 ? false : true) :
|
section.label === "Housekeeper" ? (user === 6 ? false : true) :
|
||||||
false,
|
false,
|
||||||
submenu: section.submenu?.map(item => ({
|
submenu: section.submenu?.map(item => ({
|
||||||
@@ -79,6 +82,14 @@ export default function Layout() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (section.label === "Payroll" && location.pathname.startsWith("/app/schedules")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (section.label === "Reports" && location.pathname.startsWith("/app/operational-reports")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,8 @@ export const menuConfig = {
|
|||||||
{ label: "Attendance", spanish_label: "Asistencia", route: "/app/payroll/attendance" },
|
{ label: "Attendance", spanish_label: "Asistencia", route: "/app/payroll/attendance" },
|
||||||
{ label: "Employees", spanish_label: "Empleados", route: "/app/payroll/employees" },
|
{ label: "Employees", spanish_label: "Empleados", route: "/app/payroll/employees" },
|
||||||
{ label: "New Employee", spanish_label: "Nuevo Empleado", route: "/app/payroll/newemployee" },
|
{ label: "New Employee", spanish_label: "Nuevo Empleado", route: "/app/payroll/newemployee" },
|
||||||
{ label: "Contracts", spanish_label: "Contratos", route: "/app/payroll/contract" }
|
{ label: "Contracts", spanish_label: "Contratos", route: "/app/payroll/contract" },
|
||||||
|
{ label: "Schedules", spanish_label: "Horarios", route: "/app/schedules" }
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
services: {
|
services: {
|
||||||
@@ -101,6 +102,14 @@ export const menuConfig = {
|
|||||||
{ label: "Events & Venues", spanish_label: "Eventos y Salones", route: "/app/events" },
|
{ label: "Events & Venues", spanish_label: "Eventos y Salones", route: "/app/events" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
reports: {
|
||||||
|
label: "Reports",
|
||||||
|
spanish_label: "Reportes",
|
||||||
|
basePath: "/app/operational-reports",
|
||||||
|
submenu: [
|
||||||
|
{ label: "Operational", spanish_label: "Operativos", route: "/app/operational-reports" },
|
||||||
|
],
|
||||||
|
},
|
||||||
// hotel: {
|
// hotel: {
|
||||||
// label: "Hotel",
|
// label: "Hotel",
|
||||||
// spanish_label: "Hotel",
|
// spanish_label: "Hotel",
|
||||||
|
|||||||
Reference in New Issue
Block a user