2026-06-26 15:59:40 +00:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import Link from "next/link";
|
|
|
|
|
import { usePathname } from "next/navigation";
|
|
|
|
|
import { useAuth } from "./auth-provider";
|
|
|
|
|
import { useTheme } from "next-themes";
|
|
|
|
|
import type { LucideIcon } from "lucide-react";
|
|
|
|
|
import {
|
|
|
|
|
LayoutDashboard,
|
|
|
|
|
Users,
|
|
|
|
|
Building2,
|
|
|
|
|
Truck,
|
|
|
|
|
FileText,
|
feat: add UI components for separator, sheet, sonner, switch, table, tabs, textarea, tooltip
- Introduced a new Separator component for visual separation in UI.
- Added Sheet component for modal-like functionality with triggers and overlays.
- Implemented Toaster component for notifications using Sonner library.
- Created Switch component for toggle functionality.
- Developed Table component with headers, body, footer, and rows for structured data display.
- Added Tabs component for organizing content into tabbed interfaces.
- Implemented Textarea component for multi-line text input.
- Created Tooltip component for displaying additional information on hover.
feat: add PocketBase helpers and types
- Implemented various helper functions for interacting with PocketBase collections (customers, companies, suppliers, quotes, orders).
- Added type definitions for entities such as Customer, Company, Supplier, Quote, Order, and their respective items.
- Included utility functions for generating unique identifiers for quotes, orders, and purchase orders.
- Added functions for calculating totals and formatting currency and dates.
chore: add TypeScript configuration
- Added tsconfig.json for TypeScript support with strict type checking and module resolution.
2026-05-24 14:31:01 +00:00
|
|
|
ShoppingCart,
|
|
|
|
|
LogOut,
|
|
|
|
|
Sun,
|
|
|
|
|
Moon,
|
|
|
|
|
Menu,
|
|
|
|
|
CheckCircle,
|
|
|
|
|
Archive,
|
Add PocketBase collections, APIs & migration docs
Introduce PocketBase workflow support, migration tooling, server APIs and documentation. Adds a set of PocketBase collection JSONs (order_items, order_items_v2, collection_pool, delivery_notes, delivery_note_items, repairs) and a large import manifest for workflow collections; includes docs describing MCP/API layer, migration audit, order-item schema and rollout plans. Adds server-side agent/MCP endpoints and services (api/mcp, api/v1/orders, collection-pool, order-items status, health) plus helper modules (pocketbase-admin, orders-service, order-item-status, agent-auth) and a migration script to create order_items_v2/collection_pool. UI: new pages for collection-pool, delivery-notes, repairs and several updates to orders/quotes pages, sidebar, tooltip and pb helpers/types. Also updates package.json (migration script and related changes) and global styles. Required env vars and suggested migration command are documented (e.g. NEXT_PUBLIC_POCKETBASE_URL, PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD, ORDER_ITEMS_COLLECTION; run npm run pb:migrate:orders-v2).
2026-05-25 16:39:33 +00:00
|
|
|
Package,
|
|
|
|
|
ClipboardList,
|
|
|
|
|
Wrench,
|
2026-05-27 12:39:00 +00:00
|
|
|
MapPinned,
|
2026-07-07 15:22:03 +00:00
|
|
|
MapPin,
|
2026-06-29 11:06:01 +00:00
|
|
|
Plus,
|
2026-06-26 15:59:40 +00:00
|
|
|
Settings as SettingsIcon,
|
2026-06-30 07:14:36 +00:00
|
|
|
Tag,
|
2026-07-03 05:29:43 +00:00
|
|
|
Zap,
|
2026-07-07 15:22:03 +00:00
|
|
|
ChevronDown,
|
feat: add UI components for separator, sheet, sonner, switch, table, tabs, textarea, tooltip
- Introduced a new Separator component for visual separation in UI.
- Added Sheet component for modal-like functionality with triggers and overlays.
- Implemented Toaster component for notifications using Sonner library.
- Created Switch component for toggle functionality.
- Developed Table component with headers, body, footer, and rows for structured data display.
- Added Tabs component for organizing content into tabbed interfaces.
- Implemented Textarea component for multi-line text input.
- Created Tooltip component for displaying additional information on hover.
feat: add PocketBase helpers and types
- Implemented various helper functions for interacting with PocketBase collections (customers, companies, suppliers, quotes, orders).
- Added type definitions for entities such as Customer, Company, Supplier, Quote, Order, and their respective items.
- Included utility functions for generating unique identifiers for quotes, orders, and purchase orders.
- Added functions for calculating totals and formatting currency and dates.
chore: add TypeScript configuration
- Added tsconfig.json for TypeScript support with strict type checking and module resolution.
2026-05-24 14:31:01 +00:00
|
|
|
} from "lucide-react";
|
2026-06-26 15:59:40 +00:00
|
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
|
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
|
|
|
|
import { Separator } from "@/components/ui/separator";
|
|
|
|
|
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
|
|
|
import { Sheet, SheetContent, SheetTrigger, SheetTitle } from "@/components/ui/sheet";
|
2026-06-29 11:06:01 +00:00
|
|
|
import { useEffect, useState } from "react";
|
2026-07-07 15:22:03 +00:00
|
|
|
import { cn } from "@/lib/utils";
|
2026-06-26 15:59:40 +00:00
|
|
|
|
|
|
|
|
/* ============================================================================
|
2026-07-07 15:22:03 +00:00
|
|
|
* Sidebar nav structure
|
2026-06-26 15:59:40 +00:00
|
|
|
*
|
2026-07-07 15:22:03 +00:00
|
|
|
* Six flat sections. The active state is the theme's single accent.
|
|
|
|
|
* No per-category brand colours — every section reads the same so the eye
|
|
|
|
|
* scans label + icon, not colour.
|
2026-06-26 15:59:40 +00:00
|
|
|
* ========================================================================== */
|
|
|
|
|
|
|
|
|
|
type NavEntry = {
|
|
|
|
|
href: string;
|
|
|
|
|
label: string;
|
|
|
|
|
icon: LucideIcon;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const dashboardItems: NavEntry[] = [
|
2026-07-07 15:22:03 +00:00
|
|
|
{ href: "/dashboard", label: "Dashboard", icon: LayoutDashboard },
|
Add PocketBase collections, APIs & migration docs
Introduce PocketBase workflow support, migration tooling, server APIs and documentation. Adds a set of PocketBase collection JSONs (order_items, order_items_v2, collection_pool, delivery_notes, delivery_note_items, repairs) and a large import manifest for workflow collections; includes docs describing MCP/API layer, migration audit, order-item schema and rollout plans. Adds server-side agent/MCP endpoints and services (api/mcp, api/v1/orders, collection-pool, order-items status, health) plus helper modules (pocketbase-admin, orders-service, order-item-status, agent-auth) and a migration script to create order_items_v2/collection_pool. UI: new pages for collection-pool, delivery-notes, repairs and several updates to orders/quotes pages, sidebar, tooltip and pb helpers/types. Also updates package.json (migration script and related changes) and global styles. Required env vars and suggested migration command are documented (e.g. NEXT_PUBLIC_POCKETBASE_URL, PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD, ORDER_ITEMS_COLLECTION; run npm run pb:migrate:orders-v2).
2026-05-25 16:39:33 +00:00
|
|
|
];
|
|
|
|
|
|
2026-06-26 15:59:40 +00:00
|
|
|
const managementItems: NavEntry[] = [
|
2026-07-07 15:22:03 +00:00
|
|
|
{ href: "/companies", label: "Companies", icon: Building2 },
|
|
|
|
|
{ href: "/customers", label: "Customers", icon: Users },
|
|
|
|
|
{ href: "/suppliers", label: "Suppliers", icon: Truck },
|
|
|
|
|
{ href: "/supplier-map", label: "Supplier Map", icon: MapPinned },
|
|
|
|
|
{ href: "/pricelist", label: "Pricelist", icon: Tag },
|
Add PocketBase collections, APIs & migration docs
Introduce PocketBase workflow support, migration tooling, server APIs and documentation. Adds a set of PocketBase collection JSONs (order_items, order_items_v2, collection_pool, delivery_notes, delivery_note_items, repairs) and a large import manifest for workflow collections; includes docs describing MCP/API layer, migration audit, order-item schema and rollout plans. Adds server-side agent/MCP endpoints and services (api/mcp, api/v1/orders, collection-pool, order-items status, health) plus helper modules (pocketbase-admin, orders-service, order-item-status, agent-auth) and a migration script to create order_items_v2/collection_pool. UI: new pages for collection-pool, delivery-notes, repairs and several updates to orders/quotes pages, sidebar, tooltip and pb helpers/types. Also updates package.json (migration script and related changes) and global styles. Required env vars and suggested migration command are documented (e.g. NEXT_PUBLIC_POCKETBASE_URL, PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD, ORDER_ITEMS_COLLECTION; run npm run pb:migrate:orders-v2).
2026-05-25 16:39:33 +00:00
|
|
|
];
|
|
|
|
|
|
2026-06-26 15:59:40 +00:00
|
|
|
const quoteItems: NavEntry[] = [
|
2026-07-07 15:22:03 +00:00
|
|
|
{ href: "/quotes", label: "Quote List", icon: FileText },
|
|
|
|
|
{ href: "/sprint", label: "Sprint", icon: Zap },
|
|
|
|
|
{ href: "/quotes/approvals", label: "Pending Approvals", icon: CheckCircle },
|
|
|
|
|
{ href: "/quotes/archived", label: "Archived", icon: Archive },
|
feat: add UI components for separator, sheet, sonner, switch, table, tabs, textarea, tooltip
- Introduced a new Separator component for visual separation in UI.
- Added Sheet component for modal-like functionality with triggers and overlays.
- Implemented Toaster component for notifications using Sonner library.
- Created Switch component for toggle functionality.
- Developed Table component with headers, body, footer, and rows for structured data display.
- Added Tabs component for organizing content into tabbed interfaces.
- Implemented Textarea component for multi-line text input.
- Created Tooltip component for displaying additional information on hover.
feat: add PocketBase helpers and types
- Implemented various helper functions for interacting with PocketBase collections (customers, companies, suppliers, quotes, orders).
- Added type definitions for entities such as Customer, Company, Supplier, Quote, Order, and their respective items.
- Included utility functions for generating unique identifiers for quotes, orders, and purchase orders.
- Added functions for calculating totals and formatting currency and dates.
chore: add TypeScript configuration
- Added tsconfig.json for TypeScript support with strict type checking and module resolution.
2026-05-24 14:31:01 +00:00
|
|
|
];
|
2026-06-26 15:59:40 +00:00
|
|
|
|
2026-06-29 11:06:01 +00:00
|
|
|
const orderItems: NavEntry[] = [
|
2026-07-07 15:22:03 +00:00
|
|
|
{ href: "/orders/new", label: "New Order", icon: Plus },
|
|
|
|
|
{ href: "/orders", label: "Order List", icon: ShoppingCart },
|
|
|
|
|
{ href: "/orders/assign", label: "Assign Drivers", icon: Truck },
|
2026-06-29 11:06:01 +00:00
|
|
|
];
|
|
|
|
|
|
2026-06-26 15:59:40 +00:00
|
|
|
const operationsItems: NavEntry[] = [
|
2026-07-07 15:22:03 +00:00
|
|
|
{ href: "/collection-pool", label: "Collection Pool", icon: Package },
|
|
|
|
|
{ href: "/collection-map", label: "Collection Map", icon: MapPin },
|
|
|
|
|
{ href: "/delivery-notes", label: "Delivery Notes", icon: ClipboardList },
|
|
|
|
|
{ href: "/repairs", label: "Repairs", icon: Wrench },
|
2026-06-26 15:59:40 +00:00
|
|
|
];
|
|
|
|
|
|
2026-06-29 11:06:01 +00:00
|
|
|
/* ============================================================================
|
2026-07-07 15:22:03 +00:00
|
|
|
* Active-route resolution
|
|
|
|
|
* The naïve "exact OR starts-with-prefix" rule double-highlights
|
|
|
|
|
* `/orders/new` and `/orders`. We fix it by demanding the item is the
|
|
|
|
|
* most-specific match within its group.
|
2026-06-29 11:06:01 +00:00
|
|
|
* ========================================================================== */
|
2026-07-07 15:22:03 +00:00
|
|
|
function isActive(itemHref: string, siblings: NavEntry[], pathname: string): boolean {
|
2026-06-29 11:06:01 +00:00
|
|
|
if (pathname === itemHref) return true;
|
|
|
|
|
if (!pathname.startsWith(itemHref + "/")) return false;
|
|
|
|
|
return !siblings.some(
|
|
|
|
|
(other) =>
|
|
|
|
|
other.href !== itemHref &&
|
|
|
|
|
other.href.length > itemHref.length &&
|
|
|
|
|
(pathname === other.href || pathname.startsWith(other.href + "/"))
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-26 15:59:40 +00:00
|
|
|
/* ============================================================================
|
2026-07-07 15:22:03 +00:00
|
|
|
* NavSection — collapsible group with a small uppercase label
|
2026-06-26 15:59:40 +00:00
|
|
|
* ========================================================================== */
|
2026-07-07 15:22:03 +00:00
|
|
|
function NavSection({
|
|
|
|
|
label,
|
2026-06-26 15:59:40 +00:00
|
|
|
items,
|
|
|
|
|
pathname,
|
2026-07-07 15:22:03 +00:00
|
|
|
defaultOpen = false,
|
2026-06-26 15:59:40 +00:00
|
|
|
onLinkClick,
|
|
|
|
|
}: {
|
2026-07-07 15:22:03 +00:00
|
|
|
label: string;
|
2026-06-26 15:59:40 +00:00
|
|
|
items: NavEntry[];
|
|
|
|
|
pathname: string;
|
2026-07-07 15:22:03 +00:00
|
|
|
defaultOpen?: boolean;
|
2026-06-26 15:59:40 +00:00
|
|
|
onLinkClick?: () => void;
|
|
|
|
|
}) {
|
2026-07-07 15:22:03 +00:00
|
|
|
const sectionActive = items.some(
|
|
|
|
|
(i) => pathname === i.href || pathname.startsWith(i.href + "/")
|
|
|
|
|
);
|
|
|
|
|
const [open, setOpen] = useState(defaultOpen || sectionActive);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
|
|
|
if (sectionActive) setOpen(true);
|
|
|
|
|
}, [sectionActive]);
|
|
|
|
|
|
2026-06-26 15:59:40 +00:00
|
|
|
return (
|
2026-07-07 15:22:03 +00:00
|
|
|
<div className="space-y-0.5">
|
2026-06-26 15:59:40 +00:00
|
|
|
<button
|
|
|
|
|
type="button"
|
2026-07-07 15:22:03 +00:00
|
|
|
onClick={() => setOpen((o) => !o)}
|
|
|
|
|
className="flex w-full items-center gap-1.5 px-2.5 py-1 text-[10.5px] font-semibold uppercase tracking-widest text-muted-foreground hover:text-foreground transition-colors"
|
2026-06-26 15:59:40 +00:00
|
|
|
>
|
2026-07-07 15:22:03 +00:00
|
|
|
{label}
|
2026-06-26 15:59:40 +00:00
|
|
|
<ChevronDown
|
2026-07-07 15:22:03 +00:00
|
|
|
className={cn(
|
|
|
|
|
"ml-auto h-3 w-3 transition-transform",
|
|
|
|
|
open ? "" : "-rotate-90"
|
|
|
|
|
)}
|
2026-06-26 15:59:40 +00:00
|
|
|
/>
|
|
|
|
|
</button>
|
|
|
|
|
{open && (
|
2026-07-07 15:22:03 +00:00
|
|
|
<div className="space-y-0.5">
|
|
|
|
|
{items.map((item) => (
|
|
|
|
|
<NavLink
|
|
|
|
|
key={item.href}
|
|
|
|
|
item={item}
|
|
|
|
|
active={isActive(item.href, items, pathname)}
|
|
|
|
|
onClick={onLinkClick}
|
|
|
|
|
/>
|
|
|
|
|
))}
|
2026-06-26 15:59:40 +00:00
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-07 15:22:03 +00:00
|
|
|
/* ============================================================================
|
|
|
|
|
* NavLink — single nav row, theme-driven active state
|
|
|
|
|
* ========================================================================== */
|
|
|
|
|
function NavLink({
|
|
|
|
|
item,
|
|
|
|
|
active,
|
|
|
|
|
onClick,
|
|
|
|
|
}: {
|
|
|
|
|
item: NavEntry;
|
|
|
|
|
active: boolean;
|
|
|
|
|
onClick?: () => void;
|
|
|
|
|
}) {
|
|
|
|
|
return (
|
|
|
|
|
<Link
|
|
|
|
|
href={item.href}
|
|
|
|
|
onClick={onClick}
|
|
|
|
|
className={cn(
|
|
|
|
|
"group flex items-center gap-3 rounded-lg px-2.5 py-2 text-sm font-medium transition-colors",
|
|
|
|
|
active
|
|
|
|
|
? "bg-sidebar-accent text-sidebar-accent-foreground"
|
|
|
|
|
: "text-sidebar-foreground/80 hover:bg-sidebar-accent/60 hover:text-sidebar-foreground"
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<item.icon
|
|
|
|
|
className={cn(
|
|
|
|
|
"h-[17px] w-[17px] shrink-0",
|
|
|
|
|
active ? "text-primary" : "text-sidebar-foreground/60 group-hover:text-sidebar-foreground/80"
|
|
|
|
|
)}
|
|
|
|
|
aria-hidden
|
|
|
|
|
/>
|
|
|
|
|
<span className="truncate">{item.label}</span>
|
|
|
|
|
{active && (
|
|
|
|
|
<span className="ml-auto h-1.5 w-1.5 rounded-full bg-primary" aria-hidden />
|
|
|
|
|
)}
|
|
|
|
|
</Link>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-26 15:59:40 +00:00
|
|
|
/* ============================================================================
|
|
|
|
|
* NavContent — the actual sidebar body
|
|
|
|
|
* ========================================================================== */
|
|
|
|
|
function NavContent({ onLinkClick }: { onLinkClick?: () => void }) {
|
feat: add UI components for separator, sheet, sonner, switch, table, tabs, textarea, tooltip
- Introduced a new Separator component for visual separation in UI.
- Added Sheet component for modal-like functionality with triggers and overlays.
- Implemented Toaster component for notifications using Sonner library.
- Created Switch component for toggle functionality.
- Developed Table component with headers, body, footer, and rows for structured data display.
- Added Tabs component for organizing content into tabbed interfaces.
- Implemented Textarea component for multi-line text input.
- Created Tooltip component for displaying additional information on hover.
feat: add PocketBase helpers and types
- Implemented various helper functions for interacting with PocketBase collections (customers, companies, suppliers, quotes, orders).
- Added type definitions for entities such as Customer, Company, Supplier, Quote, Order, and their respective items.
- Included utility functions for generating unique identifiers for quotes, orders, and purchase orders.
- Added functions for calculating totals and formatting currency and dates.
chore: add TypeScript configuration
- Added tsconfig.json for TypeScript support with strict type checking and module resolution.
2026-05-24 14:31:01 +00:00
|
|
|
const pathname = usePathname();
|
|
|
|
|
const { user, logout } = useAuth();
|
|
|
|
|
const { theme, setTheme } = useTheme();
|
Add PocketBase collections, APIs & migration docs
Introduce PocketBase workflow support, migration tooling, server APIs and documentation. Adds a set of PocketBase collection JSONs (order_items, order_items_v2, collection_pool, delivery_notes, delivery_note_items, repairs) and a large import manifest for workflow collections; includes docs describing MCP/API layer, migration audit, order-item schema and rollout plans. Adds server-side agent/MCP endpoints and services (api/mcp, api/v1/orders, collection-pool, order-items status, health) plus helper modules (pocketbase-admin, orders-service, order-item-status, agent-auth) and a migration script to create order_items_v2/collection_pool. UI: new pages for collection-pool, delivery-notes, repairs and several updates to orders/quotes pages, sidebar, tooltip and pb helpers/types. Also updates package.json (migration script and related changes) and global styles. Required env vars and suggested migration command are documented (e.g. NEXT_PUBLIC_POCKETBASE_URL, PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD, ORDER_ITEMS_COLLECTION; run npm run pb:migrate:orders-v2).
2026-05-25 16:39:33 +00:00
|
|
|
|
feat: add UI components for separator, sheet, sonner, switch, table, tabs, textarea, tooltip
- Introduced a new Separator component for visual separation in UI.
- Added Sheet component for modal-like functionality with triggers and overlays.
- Implemented Toaster component for notifications using Sonner library.
- Created Switch component for toggle functionality.
- Developed Table component with headers, body, footer, and rows for structured data display.
- Added Tabs component for organizing content into tabbed interfaces.
- Implemented Textarea component for multi-line text input.
- Created Tooltip component for displaying additional information on hover.
feat: add PocketBase helpers and types
- Implemented various helper functions for interacting with PocketBase collections (customers, companies, suppliers, quotes, orders).
- Added type definitions for entities such as Customer, Company, Supplier, Quote, Order, and their respective items.
- Included utility functions for generating unique identifiers for quotes, orders, and purchase orders.
- Added functions for calculating totals and formatting currency and dates.
chore: add TypeScript configuration
- Added tsconfig.json for TypeScript support with strict type checking and module resolution.
2026-05-24 14:31:01 +00:00
|
|
|
return (
|
2026-07-07 15:22:03 +00:00
|
|
|
<div className="flex h-full flex-col bg-sidebar text-sidebar-foreground">
|
2026-06-26 15:59:40 +00:00
|
|
|
{/* Brand block */}
|
2026-07-07 15:22:03 +00:00
|
|
|
<Link
|
|
|
|
|
href="/dashboard"
|
|
|
|
|
onClick={onLinkClick}
|
|
|
|
|
className="flex items-center gap-3 px-5 pt-6 pb-5"
|
|
|
|
|
>
|
|
|
|
|
<div className="grid size-9 place-items-center rounded-lg bg-primary text-primary-foreground">
|
|
|
|
|
<Package className="h-4.5 w-4.5" />
|
|
|
|
|
</div>
|
|
|
|
|
<div className="leading-tight">
|
|
|
|
|
<div className="text-[15px] font-semibold tracking-tight font-heading-theme">
|
|
|
|
|
WFDASH
|
Add PocketBase collections, APIs & migration docs
Introduce PocketBase workflow support, migration tooling, server APIs and documentation. Adds a set of PocketBase collection JSONs (order_items, order_items_v2, collection_pool, delivery_notes, delivery_note_items, repairs) and a large import manifest for workflow collections; includes docs describing MCP/API layer, migration audit, order-item schema and rollout plans. Adds server-side agent/MCP endpoints and services (api/mcp, api/v1/orders, collection-pool, order-items status, health) plus helper modules (pocketbase-admin, orders-service, order-item-status, agent-auth) and a migration script to create order_items_v2/collection_pool. UI: new pages for collection-pool, delivery-notes, repairs and several updates to orders/quotes pages, sidebar, tooltip and pb helpers/types. Also updates package.json (migration script and related changes) and global styles. Required env vars and suggested migration command are documented (e.g. NEXT_PUBLIC_POCKETBASE_URL, PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD, ORDER_ITEMS_COLLECTION; run npm run pb:migrate:orders-v2).
2026-05-25 16:39:33 +00:00
|
|
|
</div>
|
2026-07-07 15:22:03 +00:00
|
|
|
<div className="text-[11px] text-muted-foreground">
|
|
|
|
|
Westcott Fasteners
|
Add PocketBase collections, APIs & migration docs
Introduce PocketBase workflow support, migration tooling, server APIs and documentation. Adds a set of PocketBase collection JSONs (order_items, order_items_v2, collection_pool, delivery_notes, delivery_note_items, repairs) and a large import manifest for workflow collections; includes docs describing MCP/API layer, migration audit, order-item schema and rollout plans. Adds server-side agent/MCP endpoints and services (api/mcp, api/v1/orders, collection-pool, order-items status, health) plus helper modules (pocketbase-admin, orders-service, order-item-status, agent-auth) and a migration script to create order_items_v2/collection_pool. UI: new pages for collection-pool, delivery-notes, repairs and several updates to orders/quotes pages, sidebar, tooltip and pb helpers/types. Also updates package.json (migration script and related changes) and global styles. Required env vars and suggested migration command are documented (e.g. NEXT_PUBLIC_POCKETBASE_URL, PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD, ORDER_ITEMS_COLLECTION; run npm run pb:migrate:orders-v2).
2026-05-25 16:39:33 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-07-07 15:22:03 +00:00
|
|
|
</Link>
|
|
|
|
|
|
feat: add UI components for separator, sheet, sonner, switch, table, tabs, textarea, tooltip
- Introduced a new Separator component for visual separation in UI.
- Added Sheet component for modal-like functionality with triggers and overlays.
- Implemented Toaster component for notifications using Sonner library.
- Created Switch component for toggle functionality.
- Developed Table component with headers, body, footer, and rows for structured data display.
- Added Tabs component for organizing content into tabbed interfaces.
- Implemented Textarea component for multi-line text input.
- Created Tooltip component for displaying additional information on hover.
feat: add PocketBase helpers and types
- Implemented various helper functions for interacting with PocketBase collections (customers, companies, suppliers, quotes, orders).
- Added type definitions for entities such as Customer, Company, Supplier, Quote, Order, and their respective items.
- Included utility functions for generating unique identifiers for quotes, orders, and purchase orders.
- Added functions for calculating totals and formatting currency and dates.
chore: add TypeScript configuration
- Added tsconfig.json for TypeScript support with strict type checking and module resolution.
2026-05-24 14:31:01 +00:00
|
|
|
<Separator className="mx-3" />
|
2026-06-26 15:59:40 +00:00
|
|
|
|
2026-07-07 15:22:03 +00:00
|
|
|
{/* Nav */}
|
feat: add UI components for separator, sheet, sonner, switch, table, tabs, textarea, tooltip
- Introduced a new Separator component for visual separation in UI.
- Added Sheet component for modal-like functionality with triggers and overlays.
- Implemented Toaster component for notifications using Sonner library.
- Created Switch component for toggle functionality.
- Developed Table component with headers, body, footer, and rows for structured data display.
- Added Tabs component for organizing content into tabbed interfaces.
- Implemented Textarea component for multi-line text input.
- Created Tooltip component for displaying additional information on hover.
feat: add PocketBase helpers and types
- Implemented various helper functions for interacting with PocketBase collections (customers, companies, suppliers, quotes, orders).
- Added type definitions for entities such as Customer, Company, Supplier, Quote, Order, and their respective items.
- Included utility functions for generating unique identifiers for quotes, orders, and purchase orders.
- Added functions for calculating totals and formatting currency and dates.
chore: add TypeScript configuration
- Added tsconfig.json for TypeScript support with strict type checking and module resolution.
2026-05-24 14:31:01 +00:00
|
|
|
<ScrollArea className="flex-1 px-3 py-3">
|
2026-07-07 15:22:03 +00:00
|
|
|
<nav className="space-y-3">
|
|
|
|
|
{/* Dashboard — single, top-level */}
|
|
|
|
|
<NavLink
|
2026-06-26 15:59:40 +00:00
|
|
|
item={dashboardItems[0]}
|
2026-07-07 15:22:03 +00:00
|
|
|
active={isActive(dashboardItems[0].href, dashboardItems, pathname)}
|
Add PocketBase collections, APIs & migration docs
Introduce PocketBase workflow support, migration tooling, server APIs and documentation. Adds a set of PocketBase collection JSONs (order_items, order_items_v2, collection_pool, delivery_notes, delivery_note_items, repairs) and a large import manifest for workflow collections; includes docs describing MCP/API layer, migration audit, order-item schema and rollout plans. Adds server-side agent/MCP endpoints and services (api/mcp, api/v1/orders, collection-pool, order-items status, health) plus helper modules (pocketbase-admin, orders-service, order-item-status, agent-auth) and a migration script to create order_items_v2/collection_pool. UI: new pages for collection-pool, delivery-notes, repairs and several updates to orders/quotes pages, sidebar, tooltip and pb helpers/types. Also updates package.json (migration script and related changes) and global styles. Required env vars and suggested migration command are documented (e.g. NEXT_PUBLIC_POCKETBASE_URL, PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD, ORDER_ITEMS_COLLECTION; run npm run pb:migrate:orders-v2).
2026-05-25 16:39:33 +00:00
|
|
|
onClick={onLinkClick}
|
2026-06-26 15:59:40 +00:00
|
|
|
/>
|
Add PocketBase collections, APIs & migration docs
Introduce PocketBase workflow support, migration tooling, server APIs and documentation. Adds a set of PocketBase collection JSONs (order_items, order_items_v2, collection_pool, delivery_notes, delivery_note_items, repairs) and a large import manifest for workflow collections; includes docs describing MCP/API layer, migration audit, order-item schema and rollout plans. Adds server-side agent/MCP endpoints and services (api/mcp, api/v1/orders, collection-pool, order-items status, health) plus helper modules (pocketbase-admin, orders-service, order-item-status, agent-auth) and a migration script to create order_items_v2/collection_pool. UI: new pages for collection-pool, delivery-notes, repairs and several updates to orders/quotes pages, sidebar, tooltip and pb helpers/types. Also updates package.json (migration script and related changes) and global styles. Required env vars and suggested migration command are documented (e.g. NEXT_PUBLIC_POCKETBASE_URL, PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD, ORDER_ITEMS_COLLECTION; run npm run pb:migrate:orders-v2).
2026-05-25 16:39:33 +00:00
|
|
|
|
2026-07-07 15:22:03 +00:00
|
|
|
<Separator className="mx-1" />
|
|
|
|
|
|
|
|
|
|
<NavSection
|
|
|
|
|
label="Management"
|
2026-06-26 15:59:40 +00:00
|
|
|
items={managementItems}
|
|
|
|
|
pathname={pathname}
|
|
|
|
|
onLinkClick={onLinkClick}
|
|
|
|
|
/>
|
2026-07-07 15:22:03 +00:00
|
|
|
<NavSection
|
|
|
|
|
label="Quotes"
|
2026-06-26 15:59:40 +00:00
|
|
|
items={quoteItems}
|
|
|
|
|
pathname={pathname}
|
|
|
|
|
onLinkClick={onLinkClick}
|
|
|
|
|
/>
|
2026-07-07 15:22:03 +00:00
|
|
|
<NavSection
|
|
|
|
|
label="Orders"
|
2026-06-29 11:06:01 +00:00
|
|
|
items={orderItems}
|
|
|
|
|
pathname={pathname}
|
|
|
|
|
onLinkClick={onLinkClick}
|
|
|
|
|
/>
|
2026-07-07 15:22:03 +00:00
|
|
|
<NavSection
|
|
|
|
|
label="Operations"
|
2026-06-29 11:06:01 +00:00
|
|
|
items={operationsItems}
|
2026-06-26 15:59:40 +00:00
|
|
|
pathname={pathname}
|
|
|
|
|
onLinkClick={onLinkClick}
|
|
|
|
|
/>
|
|
|
|
|
</nav>
|
|
|
|
|
</ScrollArea>
|
|
|
|
|
|
|
|
|
|
<Separator className="mx-3" />
|
|
|
|
|
|
2026-07-07 15:22:03 +00:00
|
|
|
{/* Bottom block */}
|
|
|
|
|
<div className="space-y-1 p-3">
|
2026-06-26 15:59:40 +00:00
|
|
|
<Link
|
|
|
|
|
href="/settings"
|
|
|
|
|
onClick={onLinkClick}
|
|
|
|
|
aria-label="Settings"
|
|
|
|
|
title="Settings"
|
2026-07-07 15:22:03 +00:00
|
|
|
className="flex h-9 items-center gap-3 rounded-lg px-2.5 text-sm text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground"
|
2026-06-26 15:59:40 +00:00
|
|
|
>
|
2026-07-07 15:22:03 +00:00
|
|
|
<SettingsIcon className="h-[17px] w-[17px]" />
|
|
|
|
|
Settings
|
2026-06-26 15:59:40 +00:00
|
|
|
</Link>
|
Add PocketBase collections, APIs & migration docs
Introduce PocketBase workflow support, migration tooling, server APIs and documentation. Adds a set of PocketBase collection JSONs (order_items, order_items_v2, collection_pool, delivery_notes, delivery_note_items, repairs) and a large import manifest for workflow collections; includes docs describing MCP/API layer, migration audit, order-item schema and rollout plans. Adds server-side agent/MCP endpoints and services (api/mcp, api/v1/orders, collection-pool, order-items status, health) plus helper modules (pocketbase-admin, orders-service, order-item-status, agent-auth) and a migration script to create order_items_v2/collection_pool. UI: new pages for collection-pool, delivery-notes, repairs and several updates to orders/quotes pages, sidebar, tooltip and pb helpers/types. Also updates package.json (migration script and related changes) and global styles. Required env vars and suggested migration command are documented (e.g. NEXT_PUBLIC_POCKETBASE_URL, PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD, ORDER_ITEMS_COLLECTION; run npm run pb:migrate:orders-v2).
2026-05-25 16:39:33 +00:00
|
|
|
|
2026-07-07 15:22:03 +00:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
|
|
|
|
|
className="flex h-9 w-full items-center gap-3 rounded-lg px-2.5 text-sm text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground"
|
2026-06-26 15:59:40 +00:00
|
|
|
>
|
|
|
|
|
{theme === "dark" ? (
|
|
|
|
|
<>
|
2026-07-07 15:22:03 +00:00
|
|
|
<Sun className="h-[17px] w-[17px]" />
|
|
|
|
|
Light mode
|
2026-06-26 15:59:40 +00:00
|
|
|
</>
|
|
|
|
|
) : (
|
|
|
|
|
<>
|
2026-07-07 15:22:03 +00:00
|
|
|
<Moon className="h-[17px] w-[17px]" />
|
|
|
|
|
Dark mode
|
2026-06-26 15:59:40 +00:00
|
|
|
</>
|
|
|
|
|
)}
|
2026-07-07 15:22:03 +00:00
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
<Separator className="my-1" />
|
2026-06-26 15:59:40 +00:00
|
|
|
|
|
|
|
|
<div className="flex items-center gap-3 px-2.5 py-2">
|
2026-07-07 15:22:03 +00:00
|
|
|
<Avatar className="h-8 w-8 shrink-0">
|
|
|
|
|
<AvatarFallback className="text-xs font-medium bg-muted text-foreground">
|
2026-06-26 15:59:40 +00:00
|
|
|
{user?.name?.charAt(0)?.toUpperCase() ||
|
|
|
|
|
user?.email?.charAt(0)?.toUpperCase() ||
|
|
|
|
|
"U"}
|
|
|
|
|
</AvatarFallback>
|
|
|
|
|
</Avatar>
|
2026-07-07 15:22:03 +00:00
|
|
|
<div className="min-w-0 flex-1">
|
|
|
|
|
<p className="truncate text-sm font-medium">
|
2026-06-26 15:59:40 +00:00
|
|
|
{user?.name || "User"}
|
|
|
|
|
</p>
|
2026-07-07 15:22:03 +00:00
|
|
|
<p className="truncate text-[11px] text-muted-foreground">
|
2026-06-26 15:59:40 +00:00
|
|
|
{user?.email}
|
|
|
|
|
</p>
|
Add PocketBase collections, APIs & migration docs
Introduce PocketBase workflow support, migration tooling, server APIs and documentation. Adds a set of PocketBase collection JSONs (order_items, order_items_v2, collection_pool, delivery_notes, delivery_note_items, repairs) and a large import manifest for workflow collections; includes docs describing MCP/API layer, migration audit, order-item schema and rollout plans. Adds server-side agent/MCP endpoints and services (api/mcp, api/v1/orders, collection-pool, order-items status, health) plus helper modules (pocketbase-admin, orders-service, order-item-status, agent-auth) and a migration script to create order_items_v2/collection_pool. UI: new pages for collection-pool, delivery-notes, repairs and several updates to orders/quotes pages, sidebar, tooltip and pb helpers/types. Also updates package.json (migration script and related changes) and global styles. Required env vars and suggested migration command are documented (e.g. NEXT_PUBLIC_POCKETBASE_URL, PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD, ORDER_ITEMS_COLLECTION; run npm run pb:migrate:orders-v2).
2026-05-25 16:39:33 +00:00
|
|
|
</div>
|
2026-07-07 15:22:03 +00:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={logout}
|
|
|
|
|
aria-label="Logout"
|
|
|
|
|
title="Logout"
|
|
|
|
|
className="grid size-7 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive"
|
|
|
|
|
>
|
|
|
|
|
<LogOut className="h-[15px] w-[15px]" />
|
|
|
|
|
</button>
|
2026-06-26 15:59:40 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ============================================================================
|
|
|
|
|
* Sidebar — desktop + mobile (Sheet) wrappers
|
|
|
|
|
* ========================================================================== */
|
|
|
|
|
export function Sidebar() {
|
|
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
2026-07-07 15:22:03 +00:00
|
|
|
<aside className="hidden lg:flex lg:w-60 lg:flex-col lg:h-dvh lg:sticky lg:top-0 lg:border-r lg:border-sidebar-border">
|
2026-06-26 15:59:40 +00:00
|
|
|
<NavContent />
|
|
|
|
|
</aside>
|
|
|
|
|
|
2026-07-07 15:22:03 +00:00
|
|
|
<div className="fixed inset-x-0 top-0 z-40 flex h-14 items-center gap-3 border-b bg-background/95 px-4 backdrop-blur-sm lg:hidden">
|
2026-06-26 15:59:40 +00:00
|
|
|
<Sheet open={open} onOpenChange={setOpen}>
|
|
|
|
|
<SheetTrigger
|
|
|
|
|
render={<Button variant="ghost" size="icon" className="h-9 w-9" />}
|
|
|
|
|
>
|
|
|
|
|
<Menu className="h-5 w-5" />
|
|
|
|
|
</SheetTrigger>
|
2026-07-07 15:22:03 +00:00
|
|
|
<SheetContent
|
|
|
|
|
side="left"
|
|
|
|
|
className="w-64 gap-0 border-r border-sidebar-border p-0"
|
|
|
|
|
>
|
2026-06-26 15:59:40 +00:00
|
|
|
<SheetTitle className="sr-only">Navigation</SheetTitle>
|
|
|
|
|
<NavContent onLinkClick={() => setOpen(false)} />
|
|
|
|
|
</SheetContent>
|
|
|
|
|
</Sheet>
|
2026-07-07 15:22:03 +00:00
|
|
|
<div className="text-base font-semibold font-heading-theme">WFDASH</div>
|
2026-06-26 15:59:40 +00:00
|
|
|
</div>
|
|
|
|
|
</>
|
|
|
|
|
);
|
Add PocketBase collections, APIs & migration docs
Introduce PocketBase workflow support, migration tooling, server APIs and documentation. Adds a set of PocketBase collection JSONs (order_items, order_items_v2, collection_pool, delivery_notes, delivery_note_items, repairs) and a large import manifest for workflow collections; includes docs describing MCP/API layer, migration audit, order-item schema and rollout plans. Adds server-side agent/MCP endpoints and services (api/mcp, api/v1/orders, collection-pool, order-items status, health) plus helper modules (pocketbase-admin, orders-service, order-item-status, agent-auth) and a migration script to create order_items_v2/collection_pool. UI: new pages for collection-pool, delivery-notes, repairs and several updates to orders/quotes pages, sidebar, tooltip and pb helpers/types. Also updates package.json (migration script and related changes) and global styles. Required env vars and suggested migration command are documented (e.g. NEXT_PUBLIC_POCKETBASE_URL, PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD, ORDER_ITEMS_COLLECTION; run npm run pb:migrate:orders-v2).
2026-05-25 16:39:33 +00:00
|
|
|
}
|