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:
@@ -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
|
||||
RUN mkdir -p .techradar/src/pages && \
|
||||
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
|
||||
if (typeof window !== 'undefined') {
|
||||
// Remplacer immédiatement le contenu par l'iframe
|
||||
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>';
|
||||
}
|
||||
|
||||
const TeamPage = () => {
|
||||
// Charger directement l'iframe sans redirection ni layout
|
||||
return (
|
||||
<>
|
||||
<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
|
||||
RUN echo "✅ Page team.tsx créée (redirige vers /team.html)"
|
||||
|
||||
|
||||
@@ -1,10 +1,49 @@
|
||||
// Script pour la gestion des pages de stratégie
|
||||
(function() {
|
||||
// PROTECTION : Ne pas s'exécuter sur les pages Next.js (qui ont déjà leur propre gestion)
|
||||
if (document.querySelector('[data-reactroot]') || window.__NEXT_DATA__) {
|
||||
// PROTECTION ABSOLUE : Arrêter immédiatement si on détecte une page équipe
|
||||
// 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');
|
||||
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
|
||||
// Intercepter et ignorer les requêtes webpack hot-update pour éviter les rechargements en boucle
|
||||
@@ -811,12 +850,12 @@ Interface de pilotage pour les responsables sécurité des PME.
|
||||
const path = normalizePath(window.location.pathname);
|
||||
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');
|
||||
else if (hash === '#business' || path === '/business') showPage('business');
|
||||
else if (hash === '#dataviz' || path === '/dataviz') showPage('dataviz');
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user