V2.0.1 : VOICI LES MODIFICATIONS MAJEURS APPRTÉES DANS CETTE VERSION :
-> REFONTE DU DESIGN DES AFFICHEURS CLASSIQUES (GÉNÉRAL + QUAIS) -> IMPLÉMENTATION DU DESIGN AFL : GÉNÉRAL ET QUAIS -> CHOIX DE LA SÉLECTION DES TYPES D'AFFICHEURS (GÉNÉRAL / QUAIS) UNE FOIS LE TYPE D'AFFICHEUR SÉLECTIONNÉS
This commit is contained in:
1 parent
71822823f2
commit
19868a451f
16 files changed
+156
-48
No files matched your search
@@ -5,6 +5,7 @@ import Logo from '../../../components/Logo';
|
||||
import MarqueeText from '../../../components/MarqueeText';
|
||||
import useAnnonceSonoreRealtime from '../../../hooks/useAnnonceSonoreRealtime';
|
||||
import useAutoAnnonce from '../../../hooks/useAutoAnnonce';
|
||||
import { fetchAllRows } from '../../../lib/fetchAllRows';
|
||||
|
||||
// Helper utilitaire : format HHhMM sans secondes (ex: 06h44)
|
||||
const formatTimeNoSeconds = (v) => {
|
||||
@@ -625,9 +626,7 @@ export default function ClassiquesArrivees(){
|
||||
setError(null);
|
||||
try {
|
||||
const [{ data: horairesData, error: hError }, { data: perturbData, error: pError }, { data: travauxData, error: tError }] = await Promise.all([
|
||||
// DEBUG: récupérer explicitement l'id et toutes les colonnes pour s'assurer que l'identifiant
|
||||
// `id` est bien présent et peut être mis en correspondance avec `horaire_id` dans perturbations
|
||||
supabase.from('horaires').select('id, *'),
|
||||
fetchAllRows(supabase.from('horaires').select('*')),
|
||||
supabase.from('perturbations').select('*'),
|
||||
supabase.from('travaux').select('*')
|
||||
]);
|
||||
@@ -649,14 +648,13 @@ export default function ClassiquesArrivees(){
|
||||
// conserver la liste complète telle que renvoyée par la BDD (avant filtrage par gare)
|
||||
let parsedHoraires = (horairesData || []).map(h => h || {});
|
||||
|
||||
// Certains champs (comme stops) peuvent arriver en tant que chaîne JSON depuis la BDD;
|
||||
// essayer de parser pour garantir que stops est un tableau utilisable.
|
||||
// Parser gares_desservies si c'est une chaîne JSON
|
||||
parsedHoraires = parsedHoraires.map(h => {
|
||||
try {
|
||||
if (h && typeof h.stops === 'string') {
|
||||
const parsed = JSON.parse(h.stops);
|
||||
if (h && typeof h.gares_desservies === 'string') {
|
||||
const parsed = JSON.parse(h.gares_desservies);
|
||||
if (Array.isArray(parsed)) {
|
||||
return { ...h, stops: parsed };
|
||||
return { ...h, gares_desservies: parsed };
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
Reference in new issue
Block a user