Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"Associated routes cotations": "Cotations des itinéraires associés au point de passage",
"Association": "Camptocamp Association",
"Associations history": "Historique des associations",
"At least one access point in the route do not have a public transport stop within 5km.": "Au moins un point d'accès du topo ne dispose pas d'arrêt de transport en commun à moins de 5km.",
"Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.": "Attribution — Vous devez créditer l'Œuvre, intégrer un lien vers la licence et indiquer si des modifications ont été effectuées à l'Oeuvre. ",
"Avalanche bulletins": "Bulletins d'avalanche",
"Avalanche risk": "Risque d'avalanche",
Expand Down Expand Up @@ -376,6 +377,7 @@
},
"Invalid value": "Valeur invalide",
"Issue report": "Signalement d'un problème",
"It seems your trip can not be completed on the selected date and time": "Il semblerait que votre trajet ne puisse être réalisé à la date et aux horaires indiqués",
"Join us": "Adhérer",
"Know more about SERAC": "En savoir plus sur SERAC",
"Large group = 5 people and more": "Grand groupe = 5 personnes et plus",
Expand Down Expand Up @@ -761,6 +763,7 @@
"Warning: This action cannot be undone!": "Attention : cette action est irréversible !",
"Waypoint's main properties": "Principales données du point de passage",
"Waypoint's textual description": "Descriptions textuelles du point de passage",
"We did not find any public transport stop point in a 5 km foot range from any route access point.": "Nous n'avons pas trouvé d'arrêt de transport en commun à moins de 5km à pied de l'un des points d'accès à l'itinéraire.",
"We sent you an email, please click on the link to reset password.": "Vous allez bientôt recevoir un email. Veuillez cliquer sur le lien qu'il contient pour réinitialiser votre mot de passe.",
"Weather & conditions": "Météo & conditions",
"Weather forecast (meteoblue)": "Prévisions météo (meteoblue)",
Expand Down
1 change: 0 additions & 1 deletion src/views/document/WaypointView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
<markdown-section :document="document" :field="fields.external_resources" />
<div style="clear: both" />
</div>
<transports-box :document="[document]" />

<routes-box v-if="!isDraftView && document.waypoint_type !== 'climbing_indoor'" :document="document" />
<recent-outings-box v-if="!isDraftView" :document="document" />
Expand Down
22 changes: 16 additions & 6 deletions src/views/document/utils/boxes/NearbyStopsSection.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="public-transports-section">
<div class="public-transports-section" :class="{ 'public-transports-section-not-served': !showAccessibilityInfo }">
<div v-if="showAccessibilityInfo" class="public-transports-result">
<div class="stop-cards" ref="stopCardContainer">
<div
Expand Down Expand Up @@ -44,7 +44,7 @@
<div class="missing-transports-warning-text">
<strong>{{ $gettext('This route is partially accessible by public transport.') }}</strong>
<p>
{{ $gettext("At least one access point in the route don't have a public transport stop within 5km.") }}
{{ $gettext('At least one access point in the route do not have a public transport stop within 5km.') }}
</p>
</div>
</div>
Expand All @@ -56,13 +56,15 @@
<strong>{{ $gettext('Unfortunately, this route may not be deserved by public transport') }}</strong>
<p>
{{
$gettext("We didn't find any public transport stop point in a 5 km foot range from any route access point.")
$gettext(
'We did not find any public transport stop point in a 5 km foot range from any route access point.'
)
}}
</p>
</div>
</div>

<div class="public-transports-map">
<div class="public-transports-map" v-if="showAccessibilityInfo">
<map-view
ref="mapView"
:documents="filteredDocuments"
Expand Down Expand Up @@ -180,6 +182,9 @@
},
deep: true,
},
showAccessibilityInfo(newVal) {
this.$emit('accessibility-info-changed', newVal);
},
},
methods: {
/** Fetch access waypoints */
Expand Down Expand Up @@ -213,7 +218,7 @@
this.createStopDocuments();
})
.catch((error) => {
console.error('Error retrieving data :', error);

Check warning on line 221 in src/views/document/utils/boxes/NearbyStopsSection.vue

View workflow job for this annotation

GitHub Actions / build (lts/*)

Unexpected console statement
this.missingTransportForWaypoint = true;

documents.forEach((doc) => {
Expand Down Expand Up @@ -512,10 +517,10 @@
padding: 20px;
border: 1px solid lightgray;
border-radius: 4px;
margin-top: 20px;
gap: 30px;
align-items: center;
height: fit-content;
width: 100%;

.public-transports-no-result-bus {
margin-left: 20px;
Expand All @@ -525,6 +530,11 @@
}
}

.public-transports-section-not-served {
height: auto;
margin-top: 0;
}

@media only screen and (max-width: 600px) {
.public-transports-section {
display: inline !important;
Expand All @@ -534,7 +544,7 @@
}
.public-transports-map {
height: 275px !important;
width: 319px !important;
width: auto !important;
margin-left: auto;
margin-right: auto;
}
Expand Down
83 changes: 28 additions & 55 deletions src/views/document/utils/boxes/PlanATripSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
<div class="no-itineraries-text">
<div class="no-itineraries-found">{{ $gettext('No public transport found') }}</div>
<div class="no-itineraries-detail">
{{ $gettext("It seems your trip can't be completed on the selected date and and time") }}
{{ $gettext('It seems your trip can not be completed on the selected date and time') }}
</div>
</div>
</div>
Expand Down Expand Up @@ -495,8 +495,6 @@ export default {
isUpdating: false,
missingDepartureAddress: false,
missingDestinationAddress: false,
limitTransfers: false,
maxTransfers: 0,
},

// Data for return journey
Expand All @@ -518,8 +516,6 @@ export default {
isUpdating: false,
missingDepartureAddress: false,
missingDestinationAddress: false,
limitTransfers: false,
maxTransfers: 0,
},

userService: new UserProfileService(c2c),
Expand All @@ -530,6 +526,8 @@ export default {
reachableWaypoints: [],
loadingReachable: false,
searchTimeout: null,
limitTransfers: false,
maxTransfers: 0,
};
},

Expand Down Expand Up @@ -751,24 +749,6 @@ export default {
},
},

limitTransfers: {
get() {
return this.currentData.limitTransfers;
},
set(value) {
this.currentData.limitTransfers = value;
},
},

maxTransfers: {
get() {
return this.limitTransfers ? this.currentData.maxTransfers : null;
},
set(value) {
this.currentData.maxTransfers = value;
},
},

canAccessReturnTab() {
return this.outboundData.journeys.length > 0;
},
Expand Down Expand Up @@ -946,11 +926,13 @@ export default {
adjustedDateTime.setTime(originalDateTime.getTime() - 15 * 60 * 1000);
}

const dateTimeFormat =
adjustedDateTime.toISOString().slice(0, 10).replace(/-/g, '') +
'T' +
adjustedDateTime.toTimeString().slice(0, 5).replace(':', '') +
'00';
const year = adjustedDateTime.getFullYear();
const month = String(adjustedDateTime.getMonth() + 1).padStart(2, '0');
const day = String(adjustedDateTime.getDate()).padStart(2, '0');
const hours = String(adjustedDateTime.getHours()).padStart(2, '0');
const minutes = String(adjustedDateTime.getMinutes()).padStart(2, '0');

const dateTimeFormat = `${year}${month}${day}T${hours}${minutes}00`;
const dateTimeRepresents = this.timePreference === 'arrive-before' ? 'arrival' : 'departure';

try {
Expand Down Expand Up @@ -980,13 +962,7 @@ export default {
});

if (filteredJourneys.length === 0) {
if (this.activeTab === 'return') {
await this.fetchExtendedTimeframeJourney(fromCoords, toCoords, dateTimeFormat, dateTimeRepresents);
return;
}

this.noResult = true;
this.journeys = [];
await this.fetchExtendedTimeframeJourney(fromCoords, toCoords, dateTimeFormat, dateTimeRepresents);
return;
}

Expand All @@ -999,24 +975,11 @@ export default {
await this.determineReturnWaypoint();
}
} else {
if (this.activeTab === 'return') {
await this.fetchExtendedTimeframeJourney(fromCoords, toCoords, dateTimeFormat, dateTimeRepresents);
return;
}

this.noResult = true;
this.journeys = [];
await this.fetchExtendedTimeframeJourney(fromCoords, toCoords, dateTimeFormat, dateTimeRepresents);
}
} catch (error) {
console.error('Error retrieving routes:', error);

if (this.activeTab === 'return') {
await this.fetchExtendedTimeframeJourney(fromCoords, toCoords, dateTimeFormat, dateTimeRepresents);
return;
}

this.noResult = true;
this.journeys = [];
await this.fetchExtendedTimeframeJourney(fromCoords, toCoords, dateTimeFormat, dateTimeRepresents);
} finally {
this.isUpdating = false;
}
Expand Down Expand Up @@ -1064,6 +1027,10 @@ export default {
this.journeys = [bestLastJourney];
this.noResult = true;
this.selectedRouteJourney = bestLastJourney;
if (this.activeTab === 'outbound') {
this.calculateReturnParameters();
await this.determineReturnWaypoint();
}
this.showTimeButton = true;

this.$emit('calculate-route', {
Expand Down Expand Up @@ -1434,7 +1401,6 @@ export default {
if (!this.outboundData.journeys || this.outboundData.journeys.length === 0) {
return;
}

const outboundJourney = this.outboundData.journeys[0];
const arrivalTime = outboundJourney.arrival_date_time;

Expand Down Expand Up @@ -1624,7 +1590,7 @@ export default {
if (this.document.durations.length === 1 && this.document.durations[0] === '10+') {
return '10+ ' + this.$gettext('Day(s)').toLowerCase();
}
// Priority to the calculated duration if the minimum duration is exactly 1 day

const shouldUseCalculated =
this.document.durations?.length &&
Math.min(...this.document.durations) === 1 &&
Expand All @@ -1638,8 +1604,14 @@ export default {

if (durationInDays < 1) {
const hours = durationInDays * 24;
const hoursInt = Math.floor(hours);
const minutes = Math.round((hours - hoursInt) * 60);
let hoursInt = Math.floor(hours);
let minutes = Math.round((hours - hoursInt) * 60);

if (minutes === 60) {
hoursInt += 1;
minutes = 0;
}

return `${hoursInt}h${minutes.toString().padStart(2, '0')}`;
}

Expand Down Expand Up @@ -2256,6 +2228,7 @@ export default {
.journey-steps {
display: flex;
margin-top: 8px;
flex-wrap: wrap;

.step-wrapper {
display: flex;
Expand Down Expand Up @@ -2347,7 +2320,7 @@ export default {

.plan-trip-map {
height: 275px !important;
width: 319px !important;
width: auto !important;
margin-left: auto;
margin-right: auto;
}
Expand Down
Loading
Loading