mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-23 15:08:22 +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 Avoirs from "@/pages/Avoirs";
|
||||||
import WeatherSettings from "@/pages/WeatherSettings";
|
import WeatherSettings from "@/pages/WeatherSettings";
|
||||||
import Analytics from "@/pages/Analytics";
|
import Analytics from "@/pages/Analytics";
|
||||||
import SalesAnalysisPage from "@/pages/SalesAnalysisPage";
|
|
||||||
import PaymentSchedulePage from "@/pages/PaymentSchedulePage";
|
import PaymentSchedulePage from "@/pages/PaymentSchedulePage";
|
||||||
import Layout from "@/components/Layout";
|
import Layout from "@/components/Layout";
|
||||||
|
|
||||||
@@ -125,7 +124,6 @@ function RouterProduction() {
|
|||||||
<Route path="/sav" component={MobileSavPage} />
|
<Route path="/sav" component={MobileSavPage} />
|
||||||
<Route path="/avoirs" component={MobileAvoirsPage} />
|
<Route path="/avoirs" component={MobileAvoirsPage} />
|
||||||
<Route path="/analytics" component={Analytics} />
|
<Route path="/analytics" component={Analytics} />
|
||||||
<Route path="/sales-analysis" component={SalesAnalysisPage} />
|
|
||||||
<Route path="/payment-schedule" component={PaymentSchedulePage} />
|
<Route path="/payment-schedule" component={PaymentSchedulePage} />
|
||||||
|
|
||||||
{/* Redirection /auth vers dashboard */}
|
{/* Redirection /auth vers dashboard */}
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import {
|
|||||||
FileUp,
|
FileUp,
|
||||||
Send,
|
Send,
|
||||||
Receipt,
|
Receipt,
|
||||||
TrendingUp,
|
|
||||||
CreditCard
|
CreditCard
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
|
|
||||||
@@ -290,12 +289,6 @@ export default function Sidebar() {
|
|||||||
icon: BarChart3,
|
icon: BarChart3,
|
||||||
roles: ["admin", "directeur", "manager"]
|
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'],
|
queryKey: ['/api/ad-campaigns', 'upcoming'],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
// Essayer d'abord 2024, puis 2025 pour avoir toutes les publicités
|
// 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[] = [];
|
let allPublicities: PublicityWithRelations[] = [];
|
||||||
|
|
||||||
for (const year of years) {
|
for (const year of years) {
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import {
|
|||||||
Cloud,
|
Cloud,
|
||||||
Send,
|
Send,
|
||||||
Code,
|
Code,
|
||||||
TrendingUp
|
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||||
@@ -22,7 +21,6 @@ import DatabaseDebug from "./DatabaseDebug";
|
|||||||
import WeatherSettings from "./WeatherSettings";
|
import WeatherSettings from "./WeatherSettings";
|
||||||
import WebhookBAPConfig from "./WebhookBAPConfig";
|
import WebhookBAPConfig from "./WebhookBAPConfig";
|
||||||
import SQLExecutor from "./SQLExecutor";
|
import SQLExecutor from "./SQLExecutor";
|
||||||
import SalesAnalysisConfig from "./SalesAnalysisConfig";
|
|
||||||
|
|
||||||
export default function Utilities() {
|
export default function Utilities() {
|
||||||
const { user } = useAuthUnified();
|
const { user } = useAuthUnified();
|
||||||
@@ -43,10 +41,8 @@ export default function Utilities() {
|
|||||||
const canManageWeather = user?.role === 'admin';
|
const canManageWeather = user?.role === 'admin';
|
||||||
const canManageWebhookBAP = user?.role === 'admin';
|
const canManageWebhookBAP = user?.role === 'admin';
|
||||||
const canExecuteSQL = 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é
|
// 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 (
|
return (
|
||||||
<div className="flex-1 flex items-center justify-center">
|
<div className="flex-1 flex items-center justify-center">
|
||||||
<Card className="w-96">
|
<Card className="w-96">
|
||||||
@@ -82,7 +78,7 @@ export default function Utilities() {
|
|||||||
{/* Content avec onglets */}
|
{/* Content avec onglets */}
|
||||||
<div className="flex-1 p-6 overflow-hidden">
|
<div className="flex-1 p-6 overflow-hidden">
|
||||||
<Tabs value={activeTab} onValueChange={setActiveTab} className="h-full flex flex-col">
|
<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 && (
|
{canManageBackups && (
|
||||||
<TabsTrigger value="backups" className="flex items-center gap-2">
|
<TabsTrigger value="backups" className="flex items-center gap-2">
|
||||||
<Database className="w-4 h-4" />
|
<Database className="w-4 h-4" />
|
||||||
@@ -119,12 +115,6 @@ export default function Utilities() {
|
|||||||
Exécution SQL
|
Exécution SQL
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
)}
|
)}
|
||||||
{canManageSalesAnalysis && (
|
|
||||||
<TabsTrigger value="salesanalysis" className="flex items-center gap-2">
|
|
||||||
<TrendingUp className="w-4 h-4" />
|
|
||||||
Analyse Vente
|
|
||||||
</TabsTrigger>
|
|
||||||
)}
|
|
||||||
</TabsList>
|
</TabsList>
|
||||||
|
|
||||||
{/* Contenu des onglets */}
|
{/* Contenu des onglets */}
|
||||||
@@ -176,13 +166,6 @@ export default function Utilities() {
|
|||||||
</TabsContent>
|
</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>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user