From ff77ee977d0d53d086bd7706e8e3b098c9069712 Mon Sep 17 00:00:00 2001 From: Olivier Date: Fri, 3 Jul 2026 20:44:32 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20pour=20nouveau=20connect?= =?UTF-8?q?=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/Dashboard.jsx | 12 ++++++++++++ frontend/src/pages/DepotsRetraits.jsx | 12 ++++++++++++ frontend/src/pages/Investissements.jsx | 12 ++++++++++++ frontend/src/pages/Plateformes.jsx | 19 ++++++++++++++++++- frontend/src/pages/Remboursements.jsx | 12 ++++++++++++ frontend/src/pages/TaxReport.jsx | 26 +++++++++++++++++++++----- 6 files changed, 87 insertions(+), 6 deletions(-) diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx index 19c959d..86cc9df 100644 --- a/frontend/src/pages/Dashboard.jsx +++ b/frontend/src/pages/Dashboard.jsx @@ -483,6 +483,18 @@ export default function Dashboard() { ); + if (platLoaded && data.portfolio.nb_projets === 0) return ( + <> +

Tableau de bord

+ + + ); const { cash, cashByPlatform, portfolio, interets, interetsParAnnee } = data; const viewTitle = activeView === 'all' diff --git a/frontend/src/pages/DepotsRetraits.jsx b/frontend/src/pages/DepotsRetraits.jsx index 9f87b19..ebb48cc 100644 --- a/frontend/src/pages/DepotsRetraits.jsx +++ b/frontend/src/pages/DepotsRetraits.jsx @@ -889,6 +889,18 @@ export default function DepotsRetraits() { ); + if (!loading && !modalOpen && allRows.length === 0) return ( + <> +

Dépôts / Retraits

+ + + ); return ( <>
diff --git a/frontend/src/pages/Investissements.jsx b/frontend/src/pages/Investissements.jsx index dd52008..37d93b1 100644 --- a/frontend/src/pages/Investissements.jsx +++ b/frontend/src/pages/Investissements.jsx @@ -779,6 +779,18 @@ export default function Investissements() { ); + if (!loading && !modalOpen && allRows.length === 0) return ( + <> +

Investissements

+ + + ); return ( <>
diff --git a/frontend/src/pages/Plateformes.jsx b/frontend/src/pages/Plateformes.jsx index 079cadd..abc159e 100644 --- a/frontend/src/pages/Plateformes.jsx +++ b/frontend/src/pages/Plateformes.jsx @@ -597,7 +597,7 @@ export default function Plateformes() { const netMode = displayMode === 'net'; const prevYearLabel = selectedYear ? Number(selectedYear) - 1 : new Date().getFullYear() - 1; - if (!loading && platOptions.length === 0) { + if (!loading && plats.length === 0) { return ( <>
@@ -608,6 +608,23 @@ export default function Plateformes() { ); } + if (!loading && platOptions.length === 0) { + return ( + <> +
+

Plateformes

+
+ + + ); + } + return ( <>
diff --git a/frontend/src/pages/Remboursements.jsx b/frontend/src/pages/Remboursements.jsx index 95b2bb1..87f9aab 100644 --- a/frontend/src/pages/Remboursements.jsx +++ b/frontend/src/pages/Remboursements.jsx @@ -768,6 +768,18 @@ export default function Remboursements() { ); + if (platLoaded && !loading && !modalOpen && allRows.length === 0) return ( + <> +

Remboursements

+ + + ); return ( <>
diff --git a/frontend/src/pages/TaxReport.jsx b/frontend/src/pages/TaxReport.jsx index 4cede2d..c36d085 100644 --- a/frontend/src/pages/TaxReport.jsx +++ b/frontend/src/pages/TaxReport.jsx @@ -156,6 +156,12 @@ export default function TaxReport() { const [activeTab, setActiveTab] = useState('2042'); const [detailExpanded, setDetailExpanded] = useState(false); const [cerfaExpanded, setCerfaExpanded] = useState(false); + const [hasPlateformes, setHasPlateformes] = useState(true); // true par défaut pour éviter un flash du mauvais message + + /* ── Plateformes configurées ? (pour distinguer "pas de plateforme" de "pas encore de données") ── */ + useEffect(() => { + api.get('/plateformes').then(p => setHasPlateformes((p || []).length > 0)).catch(() => {}); + }, []); /* ── Chargement des années disponibles ── */ useEffect(() => { @@ -253,11 +259,21 @@ export default function TaxReport() { if (!loading && data && availableYears.length === 0) return ( <>

Fiscalité

- + {hasPlateformes ? ( + + ) : ( + + )} ); return (