mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
feat: implement production router with mobile/desktop support and add sidebar navigation component
This commit is contained in:
1 parent
ea8aed7e01
commit
4318bb3b5c
4 files changed
+4
-29
No files matched your search
@@ -26,7 +26,6 @@ import SavTickets from "@/pages/SavTickets";
|
||||
import Avoirs from "@/pages/Avoirs";
|
||||
import WeatherSettings from "@/pages/WeatherSettings";
|
||||
import Analytics from "@/pages/Analytics";
|
||||
import SalesAnalysisPage from "@/pages/SalesAnalysisPage";
|
||||
import PaymentSchedulePage from "@/pages/PaymentSchedulePage";
|
||||
import Layout from "@/components/Layout";
|
||||
|
||||
@@ -125,7 +124,6 @@ function RouterProduction() {
|
||||
<Route path="/sav" component={MobileSavPage} />
|
||||
<Route path="/avoirs" component={MobileAvoirsPage} />
|
||||
<Route path="/analytics" component={Analytics} />
|
||||
<Route path="/sales-analysis" component={SalesAnalysisPage} />
|
||||
<Route path="/payment-schedule" component={PaymentSchedulePage} />
|
||||
|
||||
{/* Redirection /auth vers dashboard */}
|
||||
|
||||
@@ -35,7 +35,6 @@ import {
|
||||
FileUp,
|
||||
Send,
|
||||
Receipt,
|
||||
TrendingUp,
|
||||
CreditCard
|
||||
} from "lucide-react";
|
||||
|
||||
@@ -290,12 +289,6 @@ export default function Sidebar() {
|
||||
icon: BarChart3,
|
||||
roles: ["admin", "directeur", "manager"]
|
||||
},
|
||||
{
|
||||
path: "/sales-analysis",
|
||||
label: "Analyse Vente",
|
||||
icon: TrendingUp,
|
||||
roles: ["admin", "directeur"]
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -198,7 +198,8 @@ export default function Dashboard() {
|
||||
queryKey: ['/api/ad-campaigns', 'upcoming'],
|
||||
queryFn: async () => {
|
||||
// Essayer d'abord 2024, puis 2025 pour avoir toutes les publicités
|
||||
const years = [2024, 2025];
|
||||
const currentYear = new Date().getFullYear();
|
||||
const years = [currentYear - 1, currentYear, currentYear + 1];
|
||||
let allPublicities: PublicityWithRelations[] = [];
|
||||
|
||||
for (const year of years) {
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
Cloud,
|
||||
Send,
|
||||
Code,
|
||||
TrendingUp
|
||||
} from "lucide-react";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
@@ -22,7 +21,6 @@ import DatabaseDebug from "./DatabaseDebug";
|
||||
import WeatherSettings from "./WeatherSettings";
|
||||
import WebhookBAPConfig from "./WebhookBAPConfig";
|
||||
import SQLExecutor from "./SQLExecutor";
|
||||
import SalesAnalysisConfig from "./SalesAnalysisConfig";
|
||||
|
||||
export default function Utilities() {
|
||||
const { user } = useAuthUnified();
|
||||
@@ -43,10 +41,8 @@ export default function Utilities() {
|
||||
const canManageWeather = user?.role === 'admin';
|
||||
const canManageWebhookBAP = user?.role === 'admin';
|
||||
const canExecuteSQL = user?.role === 'admin';
|
||||
const canManageSalesAnalysis = user?.role === 'admin' || user?.role === 'directeur';
|
||||
|
||||
// Si l'utilisateur n'a aucune permission, afficher le message d'accès refusé
|
||||
if (!canManageBackups && !canManageNocoDB && !canDebugDatabase && !canManageWeather && !canManageWebhookBAP && !canExecuteSQL && !canManageSalesAnalysis) {
|
||||
if (!canManageBackups && !canManageNocoDB && !canDebugDatabase && !canManageWeather && !canManageWebhookBAP && !canExecuteSQL) {
|
||||
return (
|
||||
<div className="flex-1 flex items-center justify-center">
|
||||
<Card className="w-96">
|
||||
@@ -82,7 +78,7 @@ export default function Utilities() {
|
||||
{/* Content avec onglets */}
|
||||
<div className="flex-1 p-6 overflow-hidden">
|
||||
<Tabs value={activeTab} onValueChange={setActiveTab} className="h-full flex flex-col">
|
||||
<TabsList className="grid w-full grid-cols-7 mb-6">
|
||||
<TabsList className="grid w-full grid-cols-6 mb-6">
|
||||
{canManageBackups && (
|
||||
<TabsTrigger value="backups" className="flex items-center gap-2">
|
||||
<Database className="w-4 h-4" />
|
||||
@@ -119,12 +115,6 @@ export default function Utilities() {
|
||||
Exécution SQL
|
||||
</TabsTrigger>
|
||||
)}
|
||||
{canManageSalesAnalysis && (
|
||||
<TabsTrigger value="salesanalysis" className="flex items-center gap-2">
|
||||
<TrendingUp className="w-4 h-4" />
|
||||
Analyse Vente
|
||||
</TabsTrigger>
|
||||
)}
|
||||
</TabsList>
|
||||
|
||||
{/* Contenu des onglets */}
|
||||
@@ -176,13 +166,6 @@ export default function Utilities() {
|
||||
</TabsContent>
|
||||
)}
|
||||
|
||||
{canManageSalesAnalysis && (
|
||||
<TabsContent value="salesanalysis" className="flex-1 overflow-hidden">
|
||||
<div className="h-full bg-gray-50 -m-6 p-6">
|
||||
<SalesAnalysisConfig />
|
||||
</div>
|
||||
</TabsContent>
|
||||
)}
|
||||
</Tabs>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user