Skip to content

Commit

Permalink
Merge branch 'v3' into waltti
Browse files Browse the repository at this point in the history
  • Loading branch information
vesameskanen committed Nov 12, 2024
2 parents a29880e + 33a12de commit 7a0e048
Show file tree
Hide file tree
Showing 160 changed files with 4,793 additions and 41,577 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
'import/no-extraneous-dependencies': 'off',
'import/no-named-default': 'off',
'import/extensions': 'off',
'import/prefer-default-export': 'off',
// react
'react/button-has-type': 'warn',
'react/destructuring-assignment': 'off',
Expand Down
1 change: 0 additions & 1 deletion app/action/FutureRoutesActions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/prefer-default-export
export function saveFutureRoute(actionContext, futureRoute) {
actionContext.dispatch('saveFutureRoute', futureRoute);
}
1 change: 0 additions & 1 deletion app/action/SearchActions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable import/prefer-default-export
export function saveSearch(actionContext, endpoint) {
actionContext.dispatch('SaveSearch', endpoint);
}
Expand Down
1 change: 0 additions & 1 deletion app/action/SearchSettingsActions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/prefer-default-export
export function saveRoutingSettings(actionContext, settings) {
actionContext.dispatch('saveRoutingSettings', settings);
}
2 changes: 0 additions & 2 deletions app/action/userPreferencesActions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable import/prefer-default-export */

export function setLanguage(actionContext, language) {
actionContext.dispatch('SetLanguage', language);
}
3 changes: 1 addition & 2 deletions app/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ async function init() {
ttl: 60 * 60 * 1000,
}),
urlMiddleware({
url: () =>
Promise.resolve(`${config.URL.OTP}index/graphql${queryParameters}`),
url: () => Promise.resolve(`${config.URL.OTP}gtfs/v1${queryParameters}`),
}),
errorMiddleware(),
retryMiddleware({
Expand Down
7 changes: 6 additions & 1 deletion app/component/EmbeddedSearchGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ import { isBrowser } from '../util/browser';

const LocationSearch = withSearchContext(DTAutosuggest, true);

const locationSearchTargets = ['Locations', 'CurrentPosition', 'Stops'];
const locationSearchTargets = [
'Locations',
'CurrentPosition',
'Stations',
'Stops',
];
const sources = ['Favourite', 'History', 'Datasource'];

const languages = [
Expand Down
2 changes: 1 addition & 1 deletion app/component/FavouritesContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ class FavouritesContainer extends React.Component {
const isLoading =
this.props.favouriteStatus === FavouriteStore.STATUS_FETCHING_OR_UPDATING;
const { requireLoggedIn, isLoggedIn } = this.props;
const targets = ['Locations', 'CurrentPosition', 'MapPosition'];
const targets = ['Locations', 'Stations', 'CurrentPosition', 'MapPosition'];
const { fontWeights } = this.context.config;
const favouritePlaces = this.props.favourites.filter(
item => item.type === 'place',
Expand Down
11 changes: 10 additions & 1 deletion app/component/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ IconBadge.asString = (badgeFill, badgeText, badgeTextFill) => {

function Icon({
backgroundShape,
backgroundColor,
badgeFill,
badgeText,
badgeTextFill,
Expand Down Expand Up @@ -88,7 +89,13 @@ function Icon({
aria-label={ariaLabel}
>
{backgroundShape === 'circle' && (
<circle className="icon-circle" cx="20" cy="20" fill="white" r="20" />
<circle
className="icon-circle"
cx="20"
cy="20"
fill={backgroundColor}
r="20"
/>
)}
{!dataURI && <use xlinkHref={`#${img}`} />}
{dataURI && (
Expand All @@ -106,6 +113,7 @@ function Icon({

Icon.propTypes = {
backgroundShape: PropTypes.oneOf(['circle']),
backgroundColor: PropTypes.string,
badgeFill: PropTypes.string,
badgeText: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
badgeTextFill: PropTypes.string,
Expand All @@ -123,6 +131,7 @@ Icon.propTypes = {

Icon.defaultProps = {
backgroundShape: undefined,
backgroundColor: 'white',
badgeFill: undefined,
badgeText: undefined,
badgeTextFill: undefined,
Expand Down
30 changes: 20 additions & 10 deletions app/component/IndexPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,21 +299,31 @@ class IndexPage extends React.Component {
const origin = this.pendingOrigin || this.props.origin;
const destination = this.pendingDestination || this.props.destination;
const sources = ['Favourite', 'History', 'Datasource'];
const stopAndRouteSearchTargets = ['Stops', 'Routes'];
const locationSearchTargets = [
const stopAndRouteSearchTargets = ['Stations', 'Stops', 'Routes'];
let locationSearchTargets = [
'Locations',
'CurrentPosition',
'FutureRoutes',
'Stops',
];

if (useCitybikes(config.vehicleRental?.networks, config)) {
stopAndRouteSearchTargets.push('VehicleRentalStations');
locationSearchTargets.push('VehicleRentalStations');
}
if (config.includeParkAndRideSuggestions) {
stopAndRouteSearchTargets.push('ParkingAreas');
locationSearchTargets.push('ParkingAreas');
if (config.locationSearchTargetsFromOTP) {
// configurable setup
locationSearchTargets = [
...locationSearchTargets,
...config.locationSearchTargetsFromOTP,
];
} else {
// default setup
locationSearchTargets.push('Stations');
locationSearchTargets.push('Stops');
if (useCitybikes(config.vehicleRental?.networks, config)) {
stopAndRouteSearchTargets.push('VehicleRentalStations');
locationSearchTargets.push('VehicleRentalStations');
}
if (config.includeParkAndRideSuggestions) {
stopAndRouteSearchTargets.push('ParkingAreas');
locationSearchTargets.push('ParkingAreas');
}
}
const locationSearchTargetsMobile = [
...locationSearchTargets,
Expand Down
Loading

0 comments on commit 7a0e048

Please sign in to comment.