Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e0c2f63
[refactor] use of reusable input address
Jun 2, 2026
619725e
[feat] make transport box and its related section available for waypo…
Jun 2, 2026
05163dd
[feat] show plan a trip section only for routes and access waypoints
Jun 2, 2026
9cd6095
[design] use 100% width on mobile for address fields
Jun 2, 2026
08429f9
[refactor] show return trip only for routes
Jun 5, 2026
11aff25
[refactor] use of document mixin instead of document props
Jun 5, 2026
3b4f7f6
[design] fix css with input address
Jun 5, 2026
a5c4d0d
[feat] missing transport information for waypoint instead of a warning
Jun 23, 2026
4785d88
[feat] show transport box for allowed waypoint types
Jun 23, 2026
6175815
[refactor] move all plan a trip utils functions in a utils file
Jun 23, 2026
70ce6be
[refactor] extract results from main component
Jun 25, 2026
dc0b468
[fix] fixed missing transport box for waypoint of type access
Jun 25, 2026
91cdc79
[refactor] extract form from main component
Jun 25, 2026
8655fd0
[feat] added a swap addresses button for documents that don't have th…
Jun 25, 2026
fe83cfd
[feat] new error message when navitia api returns 500
Jun 26, 2026
5a4abc3
[to remove] add a negative value for testing
Jun 26, 2026
f3feb36
[fix] fix departure date time value
Jun 29, 2026
0f9d6ec
[fix] handle journeys error properly
Jul 1, 2026
06d6acf
[fix] fix merge, remove test case
Jul 3, 2026
d66b100
[refactor] Use section.duration instead of recomputing it
Jul 3, 2026
7bdb168
[fix] Default accessWaypoints to []
Jul 3, 2026
0bc9d9c
[fix] Guard the fallback before cloning
Jul 3, 2026
b5b3b74
[fix] Return-trip "To" address placeholder is copy-pasted from the ou…
Jul 3, 2026
44ffd6d
[fix] Incorrect alt text on transport icon.
Jul 3, 2026
3f07b34
[fix] Hardcoded, non-translated fallback strings.
Jul 3, 2026
b1edf0a
[fix] Typo: "occured" → "occurred".
Jul 3, 2026
6f2198e
[fix] Extended-timeframe fallback fires for every error, including no…
Jul 3, 2026
86e93cf
[fix] Potential crash: accessPoints can be undefined, and reachabilit…
Jul 3, 2026
5906337
[fix] Default the filtered waypoints to an empty array.
Jul 3, 2026
730320a
[fix] fixed a bug where switching tab was not setting address properl…
Jul 3, 2026
e5ff119
[fix] Side effect (map recenter) scheduled from inside a computed pro…
Jul 6, 2026
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
36 changes: 36 additions & 0 deletions src/assets/img/boxes/navitia_api_error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/components/generics/inputs/InputAddress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@

this.selectAddress(data.features?.[0] ?? this.buildFeatureFromCoords([lon, lat]));
} catch (error) {
console.warn('Error during reverse geolocation:', error);

Check warning on line 139 in src/components/generics/inputs/InputAddress.vue

View workflow job for this annotation

GitHub Actions / build (lts/*)

Unexpected console statement
this.selectAddress(this.buildFeatureFromCoords([lon, lat]));
}
},
Expand All @@ -159,7 +159,7 @@
await this.reverseGeocode(coords[0], coords[1]);
},
(error) => {
console.warn('Geolocation error:', error);

Check warning on line 162 in src/components/generics/inputs/InputAddress.vue

View workflow job for this annotation

GitHub Actions / build (lts/*)

Unexpected console statement
toast({
message: this.$gettext('Unable to get your current location.'),
type: 'is-warning',
Expand All @@ -186,7 +186,7 @@
this.localData.coordinates = [lon, lat];
await this.reverseGeocode(lon, lat);
} catch (error) {
console.warn('Error loading user location:', error);

Check warning on line 189 in src/components/generics/inputs/InputAddress.vue

View workflow job for this annotation

GitHub Actions / build (lts/*)

Unexpected console statement
}
},

Expand All @@ -209,7 +209,7 @@
this.localData.addressPropositions = response.data.features.slice(0, 6) || [];
this.localData.showAddressPropositions = this.localData.addressPropositions?.length > 0;
} catch (error) {
console.warn('Error searching for addresses:', error);

Check warning on line 212 in src/components/generics/inputs/InputAddress.vue

View workflow job for this annotation

GitHub Actions / build (lts/*)

Unexpected console statement
this.localData.addressPropositions = [];
}
}, 600);
Expand All @@ -224,8 +224,9 @@

/** Takes selected address proposition */
selectAddress(proposition) {
this.localData.selectedAddress = proposition;
this.localData.address = this.formatProposition(proposition);
this.localData.selectedAddress = proposition;
this.localData.selectedAddress.address = this.localData.address;
this.localData.coordinates = proposition.geometry.coordinates;
this.localData.showAddressPropositions = false;
},
Expand Down
112 changes: 112 additions & 0 deletions src/js/plan-a-trip-utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
export default {
/** Format time for displaying : YYYYMMDDTHHMMSS -> HH:MM */
formatTime(dateTimeString) {
if (!dateTimeString) return '';
return dateTimeString.substring(9, 11) + ':' + dateTimeString.substring(11, 13);
},

/** Format duration for displaying : h / min */
formatDuration(seconds) {
if (!seconds && seconds !== 0) return '';
const hours = Math.floor(seconds / 3600);
const minutes = Math.floor((seconds % 3600) / 60);

if (hours > 0) {
return `${hours} h ${minutes > 0 ? minutes + ' min' : ''}`;
}
return `${minutes} min`;
},

/** Gets icons according to the nature of the transport */
getTransportIcon(section) {
if (!section.display_informations) return '';

const mode = section.display_informations.commercial_mode?.toLowerCase() || '';
if (mode.includes('bus')) return 'bus';
if (mode.includes('tram')) return 'tram';
if (mode.includes('métro') || mode.includes('metro')) return 'tram';
if (mode.includes('train')) return 'train';
if (mode.includes('car')) return 'bus';

return 'bus';
},

/** Manage different spellings of transports */
getTransportClass(section) {
if (!section.display_informations) return '';

const mode = section.display_informations.commercial_mode?.toLowerCase() || '';

if (mode.includes('bus')) return 'bus';
if (mode.includes('tram')) return 'tram';
if (mode.includes('métro') || mode.includes('metro')) return 'tram';
if (mode.includes('train')) return 'train';
if (mode.includes('car')) return 'bus';

return 'bus';
},

/** Method to calculate distance in meters */
getDistance(section) {
if (section.distance) {
return Math.round(section.distance);
}
return section.path && section.path.length > 0
? Math.round(section.path.reduce((acc, step) => acc + (step.length || 0), 0))
: 0;
},

/** Method to get accessibility icons */
getAccessibilityIcon(section) {
if (!section.display_informations || !section.display_informations.equipments) {
return {
bike: false,
wheelchair: false,
};
}

return {
bike: section.display_informations.equipments.includes('has_bike_accepted'),
wheelchair: section.display_informations.equipments.includes('has_wheelchair'),
};
},

/** Each route follows the same sequence of colors */
getRouteColor(section) {
if (section.mode === 'walking') return '00008B';
if (section.type === 'public_transport' || section.type === 'on_demand_transport') {
const color = section.display_informations?.color;
return color === 'FFFFFF' ? '808080' : color || '808080';
}
return '808080';
},

/** Creates the class based on color */
getTransportColorClass(section) {
if (section.display_informations?.color) {
return 'transport-color-' + section.display_informations.color.replace('#', '');
}
return 'transport-color-default';
},

/** Formats the journey time in minutes and hours */
formatJourneyDuration(seconds) {
if (!seconds && seconds !== 0) return '';

const hours = Math.floor(seconds / 3600);
const minutes = Math.floor((seconds % 3600) / 60);

if (hours > 0) {
return `${hours}h${minutes.toString().padStart(2, '0')}`;
}
return `${minutes} min`;
},

/** Get section duration directly when available, fallback to 0 */
calculateSectionDuration(section) {
if (section.duration !== undefined && section.duration !== null) {
return section.duration;
}
return 0;
},
};
Loading
Loading