From d1f1c9a467e232f5c3abac3e6b3a8f25040a8c03 Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Sat, 11 Apr 2026 15:00:58 +0200 Subject: [PATCH] feat: restrict History and Pending Validation tabs to master user --- src/App.tsx | 2 +- src/components/Sidebar.tsx | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 7f2dcb5..eb25ab2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -485,7 +485,7 @@ export default function App() { isSavingAll={isSavingAll} />
- +
{isLoadingDefault ? (
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index f46379d..f3a6b68 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -5,17 +5,22 @@ import { cn } from '../lib/utils'; interface SidebarProps { activeModule: string; setActiveModule: (m: 'descriptions' | 'article_details' | 'matrix' | 'dimensions' | 'pricing' | 'pending_validation' | 'history') => void; + userEmail: string; } -export function Sidebar({ activeModule, setActiveModule }: SidebarProps) { +export function Sidebar({ activeModule, setActiveModule, userEmail }: SidebarProps) { + const isMasterUser = userEmail?.toLowerCase() === 'christian.vidal@craze-group.com'; + const navItems = [ { id: 'matrix', label: 'Matrix', icon: Table }, { id: 'descriptions', label: 'Product Descriptions', icon: FileText }, { id: 'article_details', label: 'Article Details', icon: Package }, { id: 'dimensions', label: 'Dimensions', icon: Box }, { id: 'pricing', label: 'Pricing & Units', icon: DollarSign }, - { id: 'pending_validation', label: 'Pending Validation', icon: Clock }, - { id: 'history', label: 'Change History', icon: History }, + ...(isMasterUser ? [ + { id: 'pending_validation', label: 'Pending Validation', icon: Clock }, + { id: 'history', label: 'Change History', icon: History } + ] : []) ] as const; return (