Skip to content

Commit

Permalink
Merge branch 'dev-2.x' into gmap-mobility-profile
Browse files Browse the repository at this point in the history
  • Loading branch information
binh-dam-ibigroup committed Dec 28, 2023
2 parents 922bac7 + 3c93bb0 commit 077aa0e
Show file tree
Hide file tree
Showing 81 changed files with 1,586 additions and 756 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Any message posted there will be seen by most of the contributors, some of whom
time. It will also create a record of the discussion that will be useful to the larger community and
often leads to issues being discussed at the twice-weekly development meetings.

## Developer meetings

OTP development meetings usually occur twice a week. These meetings are open to anyone who wants to
join, even if you simply want to observe the process or ask a few questions. The most effective way
to advance pull requests and collaborate is to participate directly in these meetings. The meeting
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Leg } from '../../gql/graphql.ts';
import { useHeaderLegContentStyleCalculations } from './useHeaderLegContentStyleCalculations.ts';
const modeIcons = import.meta.glob('../../static/img/mode/*.png', { as: 'url', eager: true });

function getModeIconUrl(leg: Leg) {
return modeIcons[`../../static/img/mode/${leg.mode.toLowerCase()}.png`];
}

export function ItineraryHeaderLegContent({
leg,
Expand All @@ -22,6 +27,8 @@ export function ItineraryHeaderLegContent({
pxSpan,
);

const legIconImageUrl = getModeIconUrl(leg);

return (
<div
className="itinerary-header-leg-wrapper"
Expand All @@ -36,8 +43,8 @@ export function ItineraryHeaderLegContent({
className="itinerary-header-leg-icon"
style={{
background: legTextColor,
maskImage: `url(/debug-client-preview/img/mode/${leg.mode.toLowerCase()}.png)`,
WebkitMaskImage: `url(/debug-client-preview/img/mode/${leg.mode.toLowerCase()}.png)`,
maskImage: `url(${legIconImageUrl})`,
WebkitMaskImage: `url(${legIconImageUrl})`,
}}
></div>
{showPublicCode && <span className="itinerary-header-leg-public-code">{leg.line?.publicCode}</span>}
Expand Down
6 changes: 4 additions & 2 deletions client-next/src/components/MapView/NavigationMarkers.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { TripQueryVariables } from '../../gql/graphql.ts';
import { Marker } from 'react-map-gl';
import markerFlagStart from '../../static/img/marker-flag-start-shadowed.png';
import markerFlagEnd from '../../static/img/marker-flag-end-shadowed.png';

export function NavigationMarkers({
tripQueryVariables,
Expand Down Expand Up @@ -27,7 +29,7 @@ export function NavigationMarkers({
}}
anchor="bottom-right"
>
<img alt="" src="/debug-client-preview/img/marker-flag-start-shadowed.png" height={48} width={49} />
<img alt="" src={markerFlagStart} height={48} width={49} />
</Marker>
)}
{tripQueryVariables.to.coordinates && (
Expand All @@ -45,7 +47,7 @@ export function NavigationMarkers({
}}
anchor="bottom-right"
>
<img alt="" src="/debug-client-preview/img/marker-flag-end-shadowed.png" height={48} width={49} />
<img alt="" src={markerFlagEnd} height={48} width={49} />
</Marker>
)}
</>
Expand Down
10 changes: 2 additions & 8 deletions client-next/src/components/SearchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ItineraryFilterDebugSelect } from './ItineraryFilterDebugSelect.tsx';
import Navbar from 'react-bootstrap/Navbar';
import { ServerInfoTooltip } from './ServerInfoTooltip.tsx';
import { useRef, useState } from 'react';
import logo from '../../static/img/otp-logo.svg';

type SearchBarProps = {
onRoute: () => void;
Expand All @@ -31,14 +32,7 @@ export function SearchBar({ onRoute, tripQueryVariables, setTripQueryVariables,
<div className="search-bar top-content">
<Navbar.Brand onClick={() => setShowServerInfo((v) => !v)}>
<div style={{ position: 'relative' }} ref={target}>
<img
alt=""
src="/debug-client-preview/img/otp-logo.svg"
width="30"
height="30"
className="d-inline-block align-top"
/>{' '}
OTP Debug Client
<img alt="" src={logo} width="30" height="30" className="d-inline-block align-top" /> OTP Debug Client
{showServerInfo && <ServerInfoTooltip serverInfo={serverInfo} target={target} />}
</div>
</Navbar.Brand>
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 4 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle
- Improve paging - avoid duplicates and missed itineraries when paging [#5551](https://github.com/opentripplanner/OpenTripPlanner/pull/5551)
- Create own parking preferences for bike and car in the internal model [#5521](https://github.com/opentripplanner/OpenTripPlanner/pull/5521)
- Make Transmodel GraphQl API an official OTP API [#5573](https://github.com/opentripplanner/OpenTripPlanner/pull/5573)
- Add option to include stations in `nearest` search [#5390](https://github.com/opentripplanner/OpenTripPlanner/pull/5390)
- GTFS Flex spec update: separate columns for `location_id`, `location_group_id` [#5564](https://github.com/opentripplanner/OpenTripPlanner/pull/5564)
- Report NO_TRANSIT_CONNECTION when search-window is set. [#5570](https://github.com/opentripplanner/OpenTripPlanner/pull/5570)
- Transit priority - part 3 [#5583](https://github.com/opentripplanner/OpenTripPlanner/pull/5583)
[](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE)

## 2.4.0 (2023-09-13)
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<lucene.version>9.8.0</lucene.version>
<slf4j.version>2.0.9</slf4j.version>
<netex-java-model.version>2.0.15</netex-java-model.version>
<siri-java-model.version>1.25</siri-java-model.version>
<siri-java-model.version>1.26</siri-java-model.version>
<jaxb-runtime.version>4.0.4</jaxb-runtime.version>
<!-- Other properties -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -142,7 +142,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.12.0</version>
<configuration>
<!-- Target Java version -->
<release>21</release>
Expand Down Expand Up @@ -853,7 +853,7 @@
<dependency>
<groupId>org.onebusaway</groupId>
<artifactId>onebusaway-gtfs</artifactId>
<version>1.4.9</version>
<version>1.4.10</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
Expand Down
19 changes: 14 additions & 5 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,24 @@
"com.microsoft.azure:azure-servicebus",
"com.azure.resourcemanager:azure-resourcemanager-servicebus",
"com.azure:azure-core",
"com.azure:azure-messaging-servicebus"
"com.azure:azure-messaging-servicebus",
"io.netty:netty-bom"
],
"enabled": false
},
{
"matchFiles": ["client-next/package.json"],
"enabled": false
},
// gbfs-java-model patch releases are automatic dependency upgrades so we automerge
{
"matchPackageNames": [
"org.entur.gbfs:gbfs-java-model"
],
"matchUpdateTypes": ["patch"],
"schedule": "on the 18th day of the month",
"automerge": true
},
{
// https://github.com/graphql-java-kickstart/renovate-config/blob/main/default.json
"description": "GraphQL Java (ignoring snapshot builds)",
Expand All @@ -53,8 +63,7 @@
"@graphql-codegen/java-resolvers",
"graphql",
"io.micrometer:micrometer-registry-prometheus",
"io.micrometer:micrometer-registry-influx",
"org.entur.gbfs:gbfs-java-model"
"io.micrometer:micrometer-registry-influx"
],
// we don't use the 'monthly' preset because that only fires on the first day of the month
// when there might already other PRs open
Expand All @@ -64,7 +73,6 @@
"description": "in order to keep review burden low, don't update these quite so frequently",
"matchPackagePrefixes": [
"org.apache.lucene:",
"io.netty:"
],
"extends": [
"schedule:quarterly"
Expand Down Expand Up @@ -97,7 +105,8 @@
"io.github.git-commit-id:git-commit-id-maven-plugin",
"com.hubspot.maven.plugins:prettier-maven-plugin",
"com.google.cloud.tools:jib-maven-plugin",
"org.apache.maven.plugins:maven-shade-plugin"
"org.apache.maven.plugins:maven-shade-plugin",
"org.apache.maven.plugins:maven-compiler-plugin"
],
"matchPackagePrefixes": [
"org.junit.jupiter:",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public static PlaceType toModel(GraphQLFilterPlaceType type) {
case CAR_PARK -> PlaceType.CAR_PARK;
case DEPARTURE_ROW -> PlaceType.PATTERN_AT_STOP;
case STOP -> PlaceType.STOP;
case STATION -> PlaceType.STATION;
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation;
import org.opentripplanner.service.vehiclerental.model.VehicleRentalVehicle;
import org.opentripplanner.transit.model.site.RegularStop;
import org.opentripplanner.transit.model.site.Station;

public class PlaceInterfaceTypeResolver implements TypeResolver {

Expand Down Expand Up @@ -45,7 +46,7 @@ public GraphQLObjectType getType(TypeResolutionEnvironment environment) {
if (o instanceof PatternAtStop) {
return schema.getObjectType("DepartureRow");
}
if (o instanceof RegularStop) {
if (o instanceof RegularStop || o instanceof Station) {
return schema.getObjectType("Stop");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.locationtech.jts.geom.Coordinate;
Expand Down Expand Up @@ -75,6 +77,10 @@ public class QueryTypeImpl implements GraphQLDataFetchers.GraphQLQueryType {
DataImportIssueStore.NOOP
);

private final List<PlaceType> DEFAULT_PLACE_TYPES = List.copyOf(
EnumSet.complementOf(EnumSet.of(PlaceType.STATION))
);

@Override
public DataFetcher<Iterable<Agency>> agencies() {
return environment -> getTransitService(environment).getAgencies();
Expand Down Expand Up @@ -276,6 +282,7 @@ public DataFetcher<Trip> fuzzyTrip() {
public DataFetcher<Connection<PlaceAtDistance>> nearest() {
return environment -> {
List<FeedScopedId> filterByStops = null;
List<FeedScopedId> filterByStations = null;
List<FeedScopedId> filterByRoutes = null;
List<String> filterByBikeRentalStations = null;
// TODO implement
Expand All @@ -293,6 +300,10 @@ public DataFetcher<Connection<PlaceAtDistance>> nearest() {
filterByIds.getGraphQLStops() != null
? filterByIds.getGraphQLStops().stream().map(FeedScopedId::parse).toList()
: null;
filterByStations =
filterByIds.getGraphQLStations() != null
? filterByIds.getGraphQLStations().stream().map(FeedScopedId::parse).toList()
: null;
filterByRoutes =
filterByIds.getGraphQLRoutes() != null
? filterByIds.getGraphQLRoutes().stream().map(FeedScopedId::parse).toList()
Expand All @@ -318,7 +329,7 @@ public DataFetcher<Connection<PlaceAtDistance>> nearest() {
: null;
List<PlaceType> filterByPlaceTypes = args.getGraphQLFilterByPlaceTypes() != null
? args.getGraphQLFilterByPlaceTypes().stream().map(GraphQLUtils::toModel).toList()
: null;
: DEFAULT_PLACE_TYPES;

List<PlaceAtDistance> places;
try {
Expand All @@ -333,6 +344,7 @@ public DataFetcher<Connection<PlaceAtDistance>> nearest() {
filterByModes,
filterByPlaceTypes,
filterByStops,
filterByStations,
filterByRoutes,
filterByBikeRentalStations,
getTransitService(environment)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ public enum GraphQLFilterPlaceType {
BIKE_PARK,
CAR_PARK,
DEPARTURE_ROW,
STATION,
STOP,
VEHICLE_RENT,
}
Expand Down Expand Up @@ -372,6 +373,7 @@ public static class GraphQLInputFiltersInput {
private List<String> bikeRentalStations;
private List<String> carParks;
private List<String> routes;
private List<String> stations;
private List<String> stops;

public GraphQLInputFiltersInput(Map<String, Object> args) {
Expand All @@ -380,6 +382,7 @@ public GraphQLInputFiltersInput(Map<String, Object> args) {
this.bikeRentalStations = (List<String>) args.get("bikeRentalStations");
this.carParks = (List<String>) args.get("carParks");
this.routes = (List<String>) args.get("routes");
this.stations = (List<String>) args.get("stations");
this.stops = (List<String>) args.get("stops");
}
}
Expand All @@ -400,6 +403,10 @@ public List<String> getGraphQLRoutes() {
return this.routes;
}

public List<String> getGraphQLStations() {
return this.stations;
}

public List<String> getGraphQLStops() {
return this.stops;
}
Expand All @@ -420,6 +427,10 @@ public void setGraphQLRoutes(List<String> routes) {
this.routes = routes;
}

public void setGraphQLStations(List<String> stations) {
this.stations = stations;
}

public void setGraphQLStops(List<String> stops) {
this.stops = stops;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,7 @@ private GraphQLSchema create() {
.argument(relay.getConnectionFieldArguments())
.dataFetcher(environment -> {
List<FeedScopedId> filterByStops = null;
List<FeedScopedId> filterByStations = null;
List<FeedScopedId> filterByRoutes = null;
List<String> filterByBikeRentalStations = null;
List<String> filterByBikeParks = null;
Expand Down Expand Up @@ -949,6 +950,7 @@ private GraphQLSchema create() {
filterByTransportModes,
filterByPlaceTypes,
filterByStops,
filterByStations,
filterByRoutes,
filterByBikeRentalStations,
GqlUtil.getTransitService(environment)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public class EnumTypes {
.value(
"noTransitConnectionInSearchWindow",
RoutingErrorCode.NO_TRANSIT_CONNECTION_IN_SEARCH_WINDOW,
"Transit connection was found, but it was outside the search window, see metadata for the next search window"
"A transit connection was found, but it was outside the search window. Use paging to navigate to a result."
)
.value(
"outsideBounds",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,18 @@ public static GraphQLObjectType create(
.dataFetcher(env -> itinerary(env).getGeneralizedCost())
.build()
)
.field(
GraphQLFieldDefinition
.newFieldDefinition()
.name("generalizedCost2")
.description(
"A second cost or weight of the itinerary. Some use-cases like pass-through " +
"and transit-priority-groups use a second cost during routing. This is used for debugging."
)
.type(Scalars.GraphQLInt)
.dataFetcher(env -> itinerary(env).getGeneralizedCost2().orElse(null))
.build()
)
.field(
GraphQLFieldDefinition
.newFieldDefinition()
Expand Down
Loading

0 comments on commit 077aa0e

Please sign in to comment.