@digitransit-component/digitransit-component-autosuggest 9.0.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.development.cjs +12 -2
- package/lib/index.js +11 -1
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -5533,6 +5533,15 @@ function hasFavourites(searchContext) {
|
|
|
5533
5533
|
if (favouriteLocations?.length > 0) {
|
|
5534
5534
|
return true;
|
|
5535
5535
|
}
|
|
5536
|
+
|
|
5537
|
+
// Prefer the backend-validated signal when available: a stop/station/
|
|
5538
|
+
// bikeStation favourite may look locally available (e.g. a citybike
|
|
5539
|
+
// network whose season config is stale) while no longer being served by
|
|
5540
|
+
// OTP at all, which would otherwise offer a "favourites" suggestion that
|
|
5541
|
+
// opens to an empty list.
|
|
5542
|
+
if (typeof searchContext.getHasOtpLocationFavourites === 'function') {
|
|
5543
|
+
return !!searchContext.getHasOtpLocationFavourites(searchContext.context);
|
|
5544
|
+
}
|
|
5536
5545
|
const favouriteVehicleRentalStations = searchContext.getFavouriteVehicleRentalStations(searchContext.context);
|
|
5537
5546
|
if (favouriteVehicleRentalStations?.length > 0) {
|
|
5538
5547
|
return true;
|
|
@@ -6391,7 +6400,7 @@ function getSuggestionContent(item, lng, t) {
|
|
|
6391
6400
|
let [name, label] = getNameLabel(item.properties, true);
|
|
6392
6401
|
let suggestionType;
|
|
6393
6402
|
if (item.properties.layer.toLowerCase().includes('bikerental') || item.properties.layer.toLowerCase().includes('bikestation')) {
|
|
6394
|
-
suggestionType = t('
|
|
6403
|
+
suggestionType = t('bikerentalstation', {
|
|
6395
6404
|
lng
|
|
6396
6405
|
});
|
|
6397
6406
|
const stopCode = item.properties.labelId;
|
|
@@ -7301,6 +7310,7 @@ const getNewTargets = ({
|
|
|
7301
7310
|
* getFavouriteRoutesQuery: () => ({}), // Function that returns query for fetching favourite routes.
|
|
7302
7311
|
* getFavouriteVehicleRentalStations: () => ({}), // Function that returns favourite bike rental station.
|
|
7303
7312
|
* getFavouriteVehicleRentalStationsQuery: () => ({}), // Function that returns query for fetching favourite bike rental stations.
|
|
7313
|
+
* getHasOtpLocationFavourites: () => ({}), // Optional. Function that returns whether any OTP-backed favourite is currently available.
|
|
7304
7314
|
* startLocationWatch: () => ({}), // Function that locates users geolocation.
|
|
7305
7315
|
* saveSearch: () => ({}), // Function that saves search to old searches store.
|
|
7306
7316
|
* clearOldSearches: () => ({}), // Function that clears old searches store.
|