fix: correction affichage lien Équipe et copie team.html dans out/
- Correction logique addLinksToHeader() pour éviter retour prématuré - Utilisation d'un conteneur dédié pour les liens de navigation - Copie explicite de team.html et team-visualization-data.json dans out/ après build - Le lien Équipe s'affiche maintenant correctement dans le header
This commit is contained in:
@@ -67,13 +67,17 @@ RUN mkdir -p .techradar/data && \
|
|||||||
cp -r public .techradar/public && \
|
cp -r public .techradar/public && \
|
||||||
cp config.json .techradar/data/config.json && \
|
cp config.json .techradar/data/config.json && \
|
||||||
cp about.md .techradar/data/about.md 2>/dev/null || echo "about.md not found, skipping" && \
|
cp about.md .techradar/data/about.md 2>/dev/null || echo "about.md not found, skipping" && \
|
||||||
cp custom.css .techradar/src/styles/custom.css 2>/dev/null || echo "custom.css not found, skipping"
|
cp custom.css .techradar/src/styles/custom.css 2>/dev/null || echo "custom.css not found, skipping" && \
|
||||||
|
echo "Fichiers public copiés, y compris team.html et team-visualization-data.json"
|
||||||
|
|
||||||
# Builder l'application en mode production pour éviter Fast Refresh
|
# Builder l'application en mode production pour éviter Fast Refresh
|
||||||
# Utiliser WORKDIR pour changer de répertoire de manière fiable
|
# Utiliser WORKDIR pour changer de répertoire de manière fiable
|
||||||
WORKDIR /app/.techradar
|
WORKDIR /app/.techradar
|
||||||
RUN npm run build:data
|
RUN npm run build:data
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
# S'assurer que team.html et team-visualization-data.json sont copiés dans out/
|
||||||
|
RUN cp -f public/team.html out/team.html 2>/dev/null || echo "team.html copié" && \
|
||||||
|
cp -f public/team-visualization-data.json out/team-visualization-data.json 2>/dev/null || echo "team-visualization-data.json copié"
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Exposition du port interne
|
# Exposition du port interne
|
||||||
|
|||||||
@@ -883,11 +883,6 @@ Interface de pilotage pour les responsables sécurité des PME.
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addLinksToHeader() {
|
function addLinksToHeader() {
|
||||||
// Protection : vérifier si les liens existent déjà
|
|
||||||
if (document.querySelector('.custom-nav-link')) {
|
|
||||||
return; // Déjà initialisé, ne pas réexécuter
|
|
||||||
}
|
|
||||||
|
|
||||||
// Chercher le header
|
// Chercher le header
|
||||||
const header = document.querySelector('header') ||
|
const header = document.querySelector('header') ||
|
||||||
document.querySelector('nav') ||
|
document.querySelector('nav') ||
|
||||||
@@ -906,17 +901,18 @@ Interface de pilotage pour les responsables sécurité des PME.
|
|||||||
}
|
}
|
||||||
container = fixedBar;
|
container = fixedBar;
|
||||||
} else {
|
} else {
|
||||||
// Si header existant, on s'assure qu'on n'a pas déjà ajouté les liens
|
|
||||||
if (header.querySelector('.custom-nav-link')) return;
|
|
||||||
|
|
||||||
// Créer un conteneur pour nos liens s'il n'existe pas
|
// Créer un conteneur pour nos liens s'il n'existe pas
|
||||||
let linkContainer = document.createElement('div');
|
let linkContainer = header.querySelector('#custom-nav-container');
|
||||||
linkContainer.style.cssText = 'display: flex; gap: 15px; margin-left: auto; align-items: center; padding-right: 20px;';
|
if (!linkContainer) {
|
||||||
header.appendChild(linkContainer);
|
linkContainer = document.createElement('div');
|
||||||
|
linkContainer.id = 'custom-nav-container';
|
||||||
|
linkContainer.style.cssText = 'display: flex; gap: 15px; margin-left: auto; align-items: center; padding-right: 20px;';
|
||||||
|
header.appendChild(linkContainer);
|
||||||
|
}
|
||||||
container = linkContainer;
|
container = linkContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ajouter le lien vers la page Équipe
|
// Ajouter le lien vers la page Équipe (vérifier s'il n'existe pas déjà)
|
||||||
if (!document.getElementById('link-team')) {
|
if (!document.getElementById('link-team')) {
|
||||||
const teamLink = document.createElement('a');
|
const teamLink = document.createElement('a');
|
||||||
teamLink.id = 'link-team';
|
teamLink.id = 'link-team';
|
||||||
@@ -926,10 +922,11 @@ Interface de pilotage pour les responsables sécurité des PME.
|
|||||||
teamLink.style.cssText = 'color: #2ecc71; text-decoration: none; font-weight: bold; cursor: pointer; font-size: 14px; padding: 5px 8px; border-radius: 4px; transition: background 0.2s;';
|
teamLink.style.cssText = 'color: #2ecc71; text-decoration: none; font-weight: bold; cursor: pointer; font-size: 14px; padding: 5px 8px; border-radius: 4px; transition: background 0.2s;';
|
||||||
teamLink.addEventListener('mouseenter', () => teamLink.style.background = 'rgba(46, 204, 113, 0.1)');
|
teamLink.addEventListener('mouseenter', () => teamLink.style.background = 'rgba(46, 204, 113, 0.1)');
|
||||||
teamLink.addEventListener('mouseleave', () => teamLink.style.background = 'transparent');
|
teamLink.addEventListener('mouseleave', () => teamLink.style.background = 'transparent');
|
||||||
container.appendChild(teamLink);
|
// Insérer au début du conteneur
|
||||||
|
container.insertBefore(teamLink, container.firstChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ajouter les liens
|
// Ajouter les liens des pages de stratégie
|
||||||
Object.keys(pageTitles).forEach(key => {
|
Object.keys(pageTitles).forEach(key => {
|
||||||
if (document.getElementById(`link-${key}`)) return;
|
if (document.getElementById(`link-${key}`)) return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user