RELEASE V5.5.0 : Voici les modifications apportées :
-> Implémentation des afficheurs "Sécurité"; "Informations" et "Correspondances" pour les afficheurs AFL FONCTIONNALITÉS EN COURS DE DÉVELOPPEMENT : -> REFONTE DU DESIGN DES AFFICHEURS CLASSIQUES
This commit is contained in:
1 parent
1c83953552
commit
4f3a34b101
24 files changed
+3517
-412
No files matched your search
@@ -887,7 +887,7 @@ export default function EVAArrivees() {
|
||||
}
|
||||
};
|
||||
});
|
||||
setHoraires(formatted.slice(0, 10));
|
||||
setHoraires(formatted);
|
||||
setAllHoraires(formatted);
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -1032,21 +1032,55 @@ export default function EVAArrivees() {
|
||||
const tomorrowStr = localDateStr(tomorrow);
|
||||
|
||||
const circulatesOn = (h, d) => {
|
||||
const targetDateStr = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
||||
const customDaysRaw = h.jours_personnalises;
|
||||
if (!customDaysRaw) return false;
|
||||
let customDays = [];
|
||||
if (Array.isArray(customDaysRaw)) {
|
||||
customDays = customDaysRaw;
|
||||
} else if (typeof customDaysRaw === 'string') {
|
||||
try { customDays = JSON.parse(customDaysRaw); } catch (e) { return false; }
|
||||
}
|
||||
if (Array.isArray(customDays)) {
|
||||
const match = customDays.find(item => item.date === targetDateStr);
|
||||
if (match) return Boolean(match.circule);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
if (!h || !d) return false;
|
||||
const pad = (n) => String(n).padStart(2, '0');
|
||||
const targetDateHyphen = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
||||
const targetDateCompact = `${d.getFullYear()}${pad(d.getMonth() + 1)}${pad(d.getDate())}`;
|
||||
const targetDay = d.getDay();
|
||||
|
||||
if (Array.isArray(h.dates) && h.dates.length > 0) {
|
||||
return h.dates.includes(targetDateCompact) || h.dates.includes(targetDateHyphen);
|
||||
}
|
||||
|
||||
const customDaysRaw = h.jours_personnalises;
|
||||
if (customDaysRaw) {
|
||||
let customDays = [];
|
||||
if (Array.isArray(customDaysRaw)) {
|
||||
customDays = customDaysRaw;
|
||||
} else if (typeof customDaysRaw === 'string') {
|
||||
try { customDays = JSON.parse(customDaysRaw); } catch (e) {}
|
||||
}
|
||||
if (Array.isArray(customDays) && customDays.length > 0) {
|
||||
const match = customDays.find(item => item.date === targetDateHyphen || item.date === targetDateCompact);
|
||||
if (match) return Boolean(match.circule);
|
||||
}
|
||||
}
|
||||
|
||||
const dayNames = ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'];
|
||||
const colName = `circule_${dayNames[targetDay]}`;
|
||||
if (typeof h[colName] !== 'undefined' && h[colName] !== null) {
|
||||
const db = h.date_debut ? String(h.date_debut).slice(0, 10) : null;
|
||||
const df = h.date_fin ? String(h.date_fin).slice(0, 10) : null;
|
||||
if (db && targetDateHyphen < db) return false;
|
||||
if (df && targetDateHyphen > df) return false;
|
||||
return Boolean(h[colName]);
|
||||
}
|
||||
|
||||
if (Array.isArray(h.days) && h.days.length > 0) {
|
||||
if (!h.days.includes(targetDay)) return false;
|
||||
if (h.start && targetDateCompact < String(h.start).replace(/-/g, '')) return false;
|
||||
if (h.end && targetDateCompact > String(h.end).replace(/-/g, '')) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
const singleDate = h.date_depart || h.date || h.service_date;
|
||||
if (singleDate) {
|
||||
const sStr = String(singleDate).slice(0, 10);
|
||||
return sStr === targetDateHyphen || sStr.replace(/-/g, '') === targetDateCompact;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
const travauxList = travauxData || [];
|
||||
const travauxSubstList = travauxSubstData || [];
|
||||
@@ -1149,6 +1183,10 @@ export default function EVAArrivees() {
|
||||
let serviceDateStr;
|
||||
if (todayCandidates && todayCandidates.length > 0) {
|
||||
finalList = todayCandidates.slice().sort((a, b) => (a._depHM || 99999) - (b._depHM || 99999));
|
||||
if (finalList.length <= 5 && tomorrowCandidates && tomorrowCandidates.length > 0) {
|
||||
const sortedTomorrow = tomorrowCandidates.slice().sort((a,b)=> (a._arrHM||99999)-(b._arrHM||99999));
|
||||
finalList = [...finalList, ...sortedTomorrow];
|
||||
}
|
||||
serviceDateStr = todayStr;
|
||||
} else {
|
||||
finalList = (tomorrowCandidates || []).slice().sort((a, b) => (a._depHM || 99999) - (b._depHM || 99999));
|
||||
@@ -1314,28 +1352,10 @@ export default function EVAArrivees() {
|
||||
''
|
||||
).toString().trim();
|
||||
|
||||
const isCG = rawPlatform.toUpperCase() === 'CG' ||
|
||||
rawPlatform.toUpperCase().includes('CG') ||
|
||||
String(horaire.quai || '').toUpperCase().includes('CG') ||
|
||||
String(horaire.quai_reel || '').toUpperCase().includes('CG') ||
|
||||
String(horaire.quai_prevu || '').toUpperCase().includes('CG') ||
|
||||
String(horaire.platform || '').toUpperCase().includes('CG');
|
||||
const isSub = (travauxSubstitutions || []).some(ts => String(ts.horaire_id) === String(horaire.id) || String(ts.horaire_id) === String(horaire.numero_train) || String(ts.horaire_id) === String(horaire.numero));
|
||||
const isCarTER = (op === 'CAR TER' || op === 'AUTOCAR');
|
||||
|
||||
const isCarTER = isCG ||
|
||||
op.includes('CAR') ||
|
||||
op.includes('AUTOCAR') ||
|
||||
op.includes('BUS') ||
|
||||
String(horaire.mode || '').toUpperCase().includes('BUS') ||
|
||||
String(horaire.mode || '').toUpperCase().includes('CAR') ||
|
||||
String(horaire.mode_transport || '').toUpperCase().includes('CAR') ||
|
||||
String(horaire.mode_transport || '').toUpperCase().includes('BUS') ||
|
||||
String(horaire.type_train || '').toUpperCase().includes('CAR') ||
|
||||
String(horaire.type_train || '').toUpperCase().includes('BUS') ||
|
||||
String(horaire.libelle_type_train || '').toUpperCase().includes('CAR') ||
|
||||
String(horaire.libelle_type_train || '').toUpperCase().includes('BUS') ||
|
||||
(travauxSubstitutions || []).some(ts => String(ts.horaire_id) === String(horaire.id) || String(ts.horaire_id) === String(horaire.numero_train) || String(ts.horaire_id) === String(horaire.numero));
|
||||
|
||||
const time = horaire._displayTime || formatTimeWithColon(horaire.heure_arrivee || horaire.time || horaire.heure || '');
|
||||
let time = horaire._displayTime || formatTimeWithColon(horaire.heure_arrivee || horaire.time || horaire.heure || '');
|
||||
const origin = horaire.gare_depart_nom || horaire.gare_depart || 'Origine inconnue';
|
||||
|
||||
const stationId = horaire.gare_depart_id || horaire.gare_id || horaire.origin_id || (gareIdParam || null);
|
||||
@@ -1409,11 +1429,11 @@ export default function EVAArrivees() {
|
||||
|
||||
{/* SECTION DROITE : MODE / VOIE & BLOC OPERATEUR/NUMERO */}
|
||||
<div className="eva-arr-col-right">
|
||||
{isCarTER ? (
|
||||
{isSub || isCarTER ? (
|
||||
<div className="eva-arr-bus-box">
|
||||
<EVABusIcon className="eva-arr-bus-icon" />
|
||||
</div>
|
||||
) : (rawPlatform && !isCG) ? (
|
||||
) : (rawPlatform && !isSuppressed) ? (
|
||||
<div className="eva-arr-voie-box">
|
||||
<span className="eva-arr-voie-label">Voie</span>
|
||||
<span className="eva-arr-voie-val">{rawPlatform}</span>
|
||||
|
||||
@@ -880,7 +880,7 @@ export default function EVADeparts() {
|
||||
causeDetails: t.cause_retard || null
|
||||
}
|
||||
}));
|
||||
setHoraires(formatted.slice(0, 10));
|
||||
setHoraires(formatted);
|
||||
setAllHoraires(formatted);
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -1045,21 +1045,55 @@ export default function EVADeparts() {
|
||||
const tomorrowStr = localDateStr(tomorrow);
|
||||
|
||||
const circulatesOn = (h, d) => {
|
||||
const targetDateStr = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
||||
const customDaysRaw = h.jours_personnalises;
|
||||
if (!customDaysRaw) return false;
|
||||
let customDays = [];
|
||||
if (Array.isArray(customDaysRaw)) {
|
||||
customDays = customDaysRaw;
|
||||
} else if (typeof customDaysRaw === 'string') {
|
||||
try { customDays = JSON.parse(customDaysRaw); } catch (e) { return false; }
|
||||
}
|
||||
if (Array.isArray(customDays)) {
|
||||
const match = customDays.find(item => item.date === targetDateStr);
|
||||
if (match) return Boolean(match.circule);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
if (!h || !d) return false;
|
||||
const pad = (n) => String(n).padStart(2, '0');
|
||||
const targetDateHyphen = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
||||
const targetDateCompact = `${d.getFullYear()}${pad(d.getMonth() + 1)}${pad(d.getDate())}`;
|
||||
const targetDay = d.getDay();
|
||||
|
||||
if (Array.isArray(h.dates) && h.dates.length > 0) {
|
||||
return h.dates.includes(targetDateCompact) || h.dates.includes(targetDateHyphen);
|
||||
}
|
||||
|
||||
const customDaysRaw = h.jours_personnalises;
|
||||
if (customDaysRaw) {
|
||||
let customDays = [];
|
||||
if (Array.isArray(customDaysRaw)) {
|
||||
customDays = customDaysRaw;
|
||||
} else if (typeof customDaysRaw === 'string') {
|
||||
try { customDays = JSON.parse(customDaysRaw); } catch (e) {}
|
||||
}
|
||||
if (Array.isArray(customDays) && customDays.length > 0) {
|
||||
const match = customDays.find(item => item.date === targetDateHyphen || item.date === targetDateCompact);
|
||||
if (match) return Boolean(match.circule);
|
||||
}
|
||||
}
|
||||
|
||||
const dayNames = ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'];
|
||||
const colName = `circule_${dayNames[targetDay]}`;
|
||||
if (typeof h[colName] !== 'undefined' && h[colName] !== null) {
|
||||
const db = h.date_debut ? String(h.date_debut).slice(0, 10) : null;
|
||||
const df = h.date_fin ? String(h.date_fin).slice(0, 10) : null;
|
||||
if (db && targetDateHyphen < db) return false;
|
||||
if (df && targetDateHyphen > df) return false;
|
||||
return Boolean(h[colName]);
|
||||
}
|
||||
|
||||
if (Array.isArray(h.days) && h.days.length > 0) {
|
||||
if (!h.days.includes(targetDay)) return false;
|
||||
if (h.start && targetDateCompact < String(h.start).replace(/-/g, '')) return false;
|
||||
if (h.end && targetDateCompact > String(h.end).replace(/-/g, '')) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
const singleDate = h.date_depart || h.date || h.service_date;
|
||||
if (singleDate) {
|
||||
const sStr = String(singleDate).slice(0, 10);
|
||||
return sStr === targetDateHyphen || sStr.replace(/-/g, '') === targetDateCompact;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
const travauxList = travauxData || [];
|
||||
const travauxSubstList = travauxSubstData || [];
|
||||
@@ -1162,6 +1196,10 @@ export default function EVADeparts() {
|
||||
let serviceDateStr;
|
||||
if (todayCandidates && todayCandidates.length > 0) {
|
||||
finalList = todayCandidates.slice().sort((a, b) => (a._depHM || 99999) - (b._depHM || 99999));
|
||||
if (finalList.length <= 5 && tomorrowCandidates && tomorrowCandidates.length > 0) {
|
||||
const sortedTomorrow = tomorrowCandidates.slice().sort((a,b)=> (a._depHM||99999)-(b._depHM||99999));
|
||||
finalList = [...finalList, ...sortedTomorrow];
|
||||
}
|
||||
serviceDateStr = todayStr;
|
||||
} else {
|
||||
finalList = (tomorrowCandidates || []).slice().sort((a, b) => (a._depHM || 99999) - (b._depHM || 99999));
|
||||
@@ -1313,7 +1351,6 @@ export default function EVADeparts() {
|
||||
const horaire = h || {};
|
||||
const op = (horaire.type_train || horaire.op || horaire.type || 'TER').toUpperCase();
|
||||
const number = horaire.numero_train || horaire.number || horaire.numero || '';
|
||||
|
||||
const rawPlatform = (
|
||||
horaire._displayPlatform ||
|
||||
horaire.quai_reel ||
|
||||
@@ -1325,28 +1362,10 @@ export default function EVADeparts() {
|
||||
''
|
||||
).toString().trim();
|
||||
|
||||
const isCG = rawPlatform.toUpperCase() === 'CG' ||
|
||||
rawPlatform.toUpperCase().includes('CG') ||
|
||||
String(horaire.quai || '').toUpperCase().includes('CG') ||
|
||||
String(horaire.quai_reel || '').toUpperCase().includes('CG') ||
|
||||
String(horaire.quai_prevu || '').toUpperCase().includes('CG') ||
|
||||
String(horaire.platform || '').toUpperCase().includes('CG');
|
||||
const isSub = (travauxSubstitutions || []).some(ts => String(ts.horaire_id) === String(horaire.id) || String(ts.horaire_id) === String(horaire.numero_train) || String(ts.horaire_id) === String(horaire.numero));
|
||||
const isCarTER = (op === 'CAR TER' || op === 'AUTOCAR');
|
||||
|
||||
const isCarTER = isCG ||
|
||||
op.includes('CAR') ||
|
||||
op.includes('AUTOCAR') ||
|
||||
op.includes('BUS') ||
|
||||
String(horaire.mode || '').toUpperCase().includes('BUS') ||
|
||||
String(horaire.mode || '').toUpperCase().includes('CAR') ||
|
||||
String(horaire.mode_transport || '').toUpperCase().includes('CAR') ||
|
||||
String(horaire.mode_transport || '').toUpperCase().includes('BUS') ||
|
||||
String(horaire.type_train || '').toUpperCase().includes('CAR') ||
|
||||
String(horaire.type_train || '').toUpperCase().includes('BUS') ||
|
||||
String(horaire.libelle_type_train || '').toUpperCase().includes('CAR') ||
|
||||
String(horaire.libelle_type_train || '').toUpperCase().includes('BUS') ||
|
||||
(travauxSubstitutions || []).some(ts => String(ts.horaire_id) === String(horaire.id) || String(ts.horaire_id) === String(horaire.numero_train) || String(ts.horaire_id) === String(horaire.numero));
|
||||
|
||||
const time = horaire._displayTime || formatTimeWithColon(horaire.heure_depart || horaire.time || horaire.heure || '');
|
||||
let time = horaire._displayTime || formatTimeWithColon(horaire.heure_depart || horaire.time || horaire.heure || '');
|
||||
const destination = horaire.gare_arrivee_nom || horaire.gare_arrivee || 'Destination inconnue';
|
||||
|
||||
const stationId = horaire.gare_depart_id || horaire.gare_id || horaire.origin_id || (gareIdParam || null);
|
||||
@@ -1424,11 +1443,11 @@ export default function EVADeparts() {
|
||||
|
||||
{/* SECTION DROITE : MODE / VOIE & BLOC OPERATEUR/NUMERO */}
|
||||
<div className="eva-dep-col-right">
|
||||
{isCarTER ? (
|
||||
{isSub || isCarTER ? (
|
||||
<div className="eva-dep-bus-box">
|
||||
<EVABusIcon className="eva-dep-bus-icon" />
|
||||
</div>
|
||||
) : (rawPlatform && !isCG) ? (
|
||||
) : (rawPlatform && !isSuppressed) ? (
|
||||
<div className="eva-dep-voie-box">
|
||||
<span className="eva-dep-voie-label">Voie</span>
|
||||
<span className="eva-dep-voie-val">{rawPlatform}</span>
|
||||
|
||||
Reference in new issue
Block a user