Add Black Friday Dashboard

This commit is contained in:
2025-11-27 15:57:22 -05:00
parent 9be0f34f07
commit b81dfb9649
7 changed files with 1411 additions and 1 deletions

View File

@@ -84,6 +84,7 @@
"@eslint/js": "^9.17.0",
"@types/fs-extra": "^11.0.4",
"@types/lodash": "^4.17.15",
"@types/luxon": "^3.7.1",
"@types/node": "^22.10.5",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
@@ -3153,6 +3154,13 @@
"dev": true,
"license": "MIT"
},
"node_modules/@types/luxon": {
"version": "3.7.1",
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.7.1.tgz",
"integrity": "sha512-H3iskjFIAn5SlJU7OuxUmTEpebK6TKB8rxZShDslBMZJ5u9S//KM1sbdAisiSrqwLQncVjnpi2OK2J51h+4lsg==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/node": {
"version": "22.13.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.4.tgz",

View File

@@ -87,6 +87,7 @@
"@eslint/js": "^9.17.0",
"@types/fs-extra": "^11.0.4",
"@types/lodash": "^4.17.15",
"@types/luxon": "^3.7.1",
"@types/node": "^22.10.5",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",

View File

@@ -27,6 +27,7 @@ const Vendors = lazy(() => import('./pages/Vendors'));
const Categories = lazy(() => import('./pages/Categories'));
const Brands = lazy(() => import('./pages/Brands'));
const PurchaseOrders = lazy(() => import('./pages/PurchaseOrders'));
const BlackFridayDashboard = lazy(() => import('./pages/BlackFridayDashboard'));
// 2. Dashboard app - separate chunk
const Dashboard = lazy(() => import('./pages/Dashboard'));
@@ -210,6 +211,13 @@ function App() {
</Suspense>
</Protected>
} />
<Route path="/dashboard/black-friday" element={
<Protected page="black_friday_dashboard">
<Suspense fallback={<PageLoading />}>
<BlackFridayDashboard />
</Suspense>
</Protected>
} />
<Route path="*" element={<Navigate to="/" replace />} />
</Route>

View File

@@ -6,6 +6,7 @@ import { AuthContext } from "@/contexts/AuthContext";
// Dashboard is first so users with dashboard access default to it
const PAGES = [
{ path: "/dashboard", permission: "access:dashboard" },
{ path: "/dashboard/black-friday", permission: "access:black_friday_dashboard" },
{ path: "/overview", permission: "access:overview" },
{ path: "/products", permission: "access:products" },
{ path: "/categories", permission: "access:categories" },

View File

@@ -12,6 +12,7 @@ import {
LayoutDashboard,
Percent,
FileSearch,
ShoppingCart,
} from "lucide-react";
import { IconCrystalBall } from "@tabler/icons-react";
import {
@@ -40,6 +41,12 @@ const dashboardItems = [
icon: LayoutDashboard,
url: "/dashboard",
permission: "access:dashboard"
},
{
title: "Black Friday",
icon: ShoppingCart,
url: "/dashboard/black-friday",
permission: "access:black_friday_dashboard"
}
];

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long