fix: page team.tsx ultra-simplifiée + protection absolue script JS

- Page Next.js simplifiée au maximum pour éviter erreurs compilation
- Remplacement immédiat du body par l'iframe côté client
- Protection absolue dans strategie-script.js contre les pages équipe
- Script bloqué complètement sur toute URL contenant /team

Ces changements devraient définitivement résoudre :
- Les deux liens équipe (1 seul lien Next.js)
- L'affichage radar au lieu des visualisations équipe
This commit is contained in:
syoul
2025-12-09 12:41:14 +01:00
parent 52ff55a291
commit 2ab2e1f261
2 changed files with 51 additions and 57 deletions

View File

@@ -98,60 +98,15 @@ RUN echo "📊 Comptage des fichiers .md dans .techradar/data/radar" && \
# La page Next.js pour le routing, le HTML statique pour garantir l'affichage # La page Next.js pour le routing, le HTML statique pour garantir l'affichage
RUN mkdir -p .techradar/src/pages && \ RUN mkdir -p .techradar/src/pages && \
cat > .techradar/src/pages/team.tsx << 'EOF' cat > .techradar/src/pages/team.tsx << 'EOF'
import Head from "next/head"; export default function TeamPage() {
// Version ultra-simple pour éviter les erreurs de compilation
const TeamPage = () => { if (typeof window !== 'undefined') {
// Charger directement l'iframe sans redirection ni layout // Remplacer immédiatement le contenu par l'iframe
return ( document.body.innerHTML = '<iframe src="/team.html" style="width:100vw;height:100vh;border:none;margin:0;padding:0;position:fixed;top:0;left:0;z-index:9999;"></iframe>';
<>
<Head>
<title>Équipe & Technologies - Laplank</title>
<style dangerouslySetInnerHTML={{__html: `
html, body {
margin: 0 !important;
padding: 0 !important;
width: 100% !important;
height: 100% !important;
overflow: hidden !important;
} }
#__next {
width: 100% !important;
height: 100% !important;
margin: 0 !important;
padding: 0 !important;
}
`}} />
</Head>
<div style={{
width: '100vw',
height: '100vh',
margin: 0,
padding: 0,
overflow: 'hidden',
position: 'fixed',
top: 0,
left: 0,
zIndex: 9999,
background: '#1a4d3a'
}}>
<iframe
src="/team.html"
style={{
width: '100%',
height: '100%',
border: 'none',
margin: 0,
padding: 0,
display: 'block'
}}
title="Équipe & Technologies"
/>
</div>
</>
);
};
export default TeamPage; return null; // Ne rien rendre côté serveur
}
EOF EOF
RUN echo "✅ Page team.tsx créée (redirige vers /team.html)" RUN echo "✅ Page team.tsx créée (redirige vers /team.html)"

View File

@@ -1,11 +1,50 @@
// Script pour la gestion des pages de stratégie // Script pour la gestion des pages de stratégie
(function() { (function() {
// PROTECTION : Ne pas s'exécuter sur les pages Next.js (qui ont déjà leur propre gestion) // PROTECTION ABSOLUE : Arrêter immédiatement si on détecte une page équipe
if (document.querySelector('[data-reactroot]') || window.__NEXT_DATA__) { // Cette vérification doit être la PREMIÈRE chose exécutée
var isTeamPage = window.location.pathname === '/team' ||
window.location.pathname === '/team/' ||
window.location.pathname.startsWith('/team/') ||
window.location.href.includes('/team');
if (isTeamPage) {
console.log('🚫 Script stratégie BLOQUÉ sur page équipe - arrêt immédiat');
return;
}
// Marquer qu'on n'est pas sur une page équipe
window.__notTeamPage = true;
// PROTECTION : Ne pas interférer avec les pages Next.js
function shouldSkipExecution() {
// Vérifier les indicateurs Next.js présents dès le chargement
if (document.querySelector('[data-reactroot]') ||
window.__NEXT_DATA__ ||
window.next ||
document.querySelector('#__next') ||
document.querySelector('[data-react-helmet]')) {
return true;
}
return false;
}
// Vérifier immédiatement
if (shouldSkipExecution()) {
console.log('🚫 Script stratégie désactivé sur page Next.js'); console.log('🚫 Script stratégie désactivé sur page Next.js');
return; return;
} }
// Différer la vérification au cas où Next.js se charge après
setTimeout(function() {
if (shouldSkipExecution()) {
console.log('🚫 Script stratégie désactivé après délai (page Next.js détectée)');
// Arrêter toute exécution en cours
if (window.initStrategyTimeout) clearTimeout(window.initStrategyTimeout);
return;
}
}, 100);
// Protection contre Fast Refresh : ignorer les tentatives de hot-reload // Protection contre Fast Refresh : ignorer les tentatives de hot-reload
// Intercepter et ignorer les requêtes webpack hot-update pour éviter les rechargements en boucle // Intercepter et ignorer les requêtes webpack hot-update pour éviter les rechargements en boucle
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
@@ -811,12 +850,12 @@ Interface de pilotage pour les responsables sécurité des PME.
const path = normalizePath(window.location.pathname); const path = normalizePath(window.location.pathname);
const hash = window.location.hash; const hash = window.location.hash;
// Détection simple - SANS /team car Next.js gère cette route // IMPORTANT : Ne jamais gérer /team dans ce script - Next.js s'en charge exclusivement
// Détection simple pour les pages HTML pures uniquement
if (hash === '#strategie' || path === '/strategie') showPage('strategie'); if (hash === '#strategie' || path === '/strategie') showPage('strategie');
else if (hash === '#business' || path === '/business') showPage('business'); else if (hash === '#business' || path === '/business') showPage('business');
else if (hash === '#dataviz' || path === '/dataviz') showPage('dataviz'); else if (hash === '#dataviz' || path === '/dataviz') showPage('dataviz');
else if (hash === '#dataviz-details' || path === '/dataviz-details') showPage('dataviz-details'); else if (hash === '#dataviz-details' || path === '/dataviz-details') showPage('dataviz-details');
// /team est maintenant géré par Next.js, pas par ce script
} }
// Vérifier la route /team IMMÉDIATEMENT au chargement du script (avant Next.js) // Vérifier la route /team IMMÉDIATEMENT au chargement du script (avant Next.js)