Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hopelink preview #223

Draft
wants to merge 99 commits into
base: ibi-dev-2.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
50cef84
Add excalidraw SVG diagrams of timetable snapshots
abyrd Jun 28, 2024
1d323c4
update some javadoc about Vias
abyrd Jun 28, 2024
bbe4e55
explain that new diagram is detail of old one
abyrd Jun 28, 2024
92b015a
Split excalidraw file and derived SVGs
abyrd Jul 25, 2024
c04cf3a
Merge branch 'dev-2.x' into abyrd/rt-snapshot-docs
abyrd Jul 25, 2024
a5291ee
maintain svg fragment relative widths
abyrd Jul 25, 2024
0b4cc7b
adjust title and relative svg width
abyrd Jul 25, 2024
05dd9ad
add explanatory text between snapshot diagrams
abyrd Jul 25, 2024
39d9e0b
regenerate excalidraw and svg to fix arrows
abyrd Jul 25, 2024
457f00c
Update src/main/java/org/opentripplanner/transit/model/timetable/Stop…
abyrd Jul 25, 2024
0b0f20f
consolidate domain javadoc on interface method
abyrd Jul 25, 2024
5c2ec08
revise updater package.md in response to PR review
abyrd Jul 25, 2024
f180441
fix import and javadoc method reference
abyrd Jul 25, 2024
649a79c
update arrows in diagrams and related text
abyrd Aug 2, 2024
c4da8a9
apply javadoc change from review
abyrd Aug 2, 2024
11e8997
touch up diagram 5, set font to sans serif
abyrd Aug 2, 2024
5b71ff1
Update indexes in timetable snapshot
vpaturet Aug 9, 2024
db7ccb4
Apply review suggestions
vpaturet Aug 15, 2024
c1c809c
Rename boolean fields in record
vpaturet Aug 15, 2024
0caf435
Apply review suggestion
vpaturet Aug 16, 2024
1a5c1d5
Fix TransitService.getAllXXX methods
vpaturet Aug 16, 2024
e176b0b
Fix indexing of pattern by stop
vpaturet Aug 20, 2024
49f29b4
Update GTFS unit tests
vpaturet Aug 20, 2024
9baf38b
Ensure null-safe lookup on immutable map
vpaturet Aug 20, 2024
f34b32d
Use CollectionsView in DefaultTransitService
vpaturet Aug 21, 2024
c0c88ff
Remove redundant null-check
vpaturet Aug 27, 2024
dd2aadc
Add Javadoc for Trip
vpaturet Aug 27, 2024
e693e50
Introduce RealtimeUpdateContext
vpaturet Aug 23, 2024
089fbbb
Open graphQL route query in graphiQL
a-limyr Aug 30, 2024
f4df207
Take into account pass-through for mismatch check
leonardehrenfried Sep 2, 2024
1f8cea0
Add tests
leonardehrenfried Sep 2, 2024
1551ea4
Update documentation
leonardehrenfried Sep 2, 2024
365cb25
rename field to match interface accessor method
abyrd Sep 3, 2024
58451ac
Merge branch 'dev-2.x' into abyrd/rt-snapshot-docs
abyrd Sep 3, 2024
e6b774e
remove javadoc - field name matches accessor name
abyrd Sep 3, 2024
1b10ead
Upgrade OBA, remove camsys-apps.com from Maven repos
leonardehrenfried Sep 4, 2024
c7c3fa0
Rename TripTimeShort to TripTimeOnDate in method and class names
vpaturet Sep 4, 2024
945f0e8
fix(deps): update dependency com.graphql-java:graphql-java to v22.3
renovate[bot] Sep 5, 2024
dae1122
Apply review suggestions
vpaturet Sep 5, 2024
95415dc
Merge pull request #6037 from leonardehrenfried/netex-pass-through-st…
leonardehrenfried Sep 5, 2024
8a4be11
Add changelog entry for #6037 [ci skip]
Sep 5, 2024
1e9a775
Add special handling for short flex and long transit
leonardehrenfried Sep 5, 2024
c6ec2d7
Skip test
leonardehrenfried Sep 5, 2024
2fdace7
Update version
leonardehrenfried Sep 6, 2024
8cedc68
Improve reporting about ambiguous OSM levels and layers
vesameskanen Sep 6, 2024
f454be5
Introduce enum for arrive by/depart at
leonardehrenfried Sep 6, 2024
34c2601
Re-enable test
leonardehrenfried Sep 6, 2024
8a96f3a
Fix arrive by snapshot test
leonardehrenfried Sep 6, 2024
8cedfc9
Add tests
leonardehrenfried Sep 6, 2024
bf6792c
fix(deps): update dependency com.google.cloud:libraries-bom to v26.45.0
renovate[bot] Sep 7, 2024
dc3bba8
Add chat threads to documentation [ci skip]
leonardehrenfried Sep 9, 2024
be98e56
Merge pull request #5936 from opentripplanner/abyrd/rt-snapshot-docs
abyrd Sep 9, 2024
8612fbc
Add changelog entry for #5936 [ci skip]
Sep 9, 2024
7fc64e7
Open graphQL trip. quay and line query in graphiQL
a-limyr Sep 9, 2024
06ad9a6
Merge pull request #6041 from leonardehrenfried/oba-camsys
leonardehrenfried Sep 9, 2024
db031aa
Add changelog entry for #6041 [ci skip]
Sep 9, 2024
0acd126
Fix for links
a-limyr Sep 9, 2024
d46b612
Formatting
a-limyr Sep 9, 2024
6e9daaf
Merge pull request #6044 from opentripplanner/renovate/com.graphql-ja…
leonardehrenfried Sep 9, 2024
809290f
Apply review suggestions
vpaturet Sep 9, 2024
9143c55
chore(deps): update micrometer.version to v1.13.4
renovate[bot] Sep 9, 2024
3b9f3a2
Merge pull request #6049 from HSLdevcom/fix-floornumber-report
vesameskanen Sep 10, 2024
cd1f13c
Add changelog entry for #6049 [ci skip]
Sep 10, 2024
0789d24
Update src/main/java/org/opentripplanner/updater/trip/TimetableSnapsh…
vpaturet Sep 10, 2024
2881c2b
Refactoring based on feedback + made Authority clickable as well
a-limyr Sep 10, 2024
f68ea6e
Update client/src/components/SearchBar/GraphiQLRouteButton.tsx
a-limyr Sep 10, 2024
5ba8d94
Merge pull request #6029 from entur/introduce_real_time_update_context
t2gran Sep 10, 2024
f579cbe
Fix merge conflict
vpaturet Sep 10, 2024
c21826b
Merge branch 'dev-2.x' into update_indexes_in_timetable_snapshot
vpaturet Sep 10, 2024
ccc5ec6
Remove SearchDirection enum
leonardehrenfried Sep 10, 2024
c141a7c
Merge pull request #6053 from entur/debug-graphiql-interaction
leonardehrenfried Sep 11, 2024
4e93e9b
Add changelog entry for #6053 [ci skip]
Sep 11, 2024
e962bc7
Upgrade debug client to version 2024/09/2024-09-11T13:13
Sep 11, 2024
04a9eed
Merge pull request #6007 from entur/update_indexes_in_timetable_snapshot
vpaturet Sep 11, 2024
f53aa81
Add changelog entry for #6007 [ci skip]
Sep 11, 2024
c00ea1e
Merge pull request #6042 from entur/rename_trip_time_short
vpaturet Sep 11, 2024
e55b7cc
Add Iceland to the list of deployments
t2gran Sep 11, 2024
b0e6747
Merge pull request #6051 from opentripplanner/renovate/micrometer.ver…
leonardehrenfried Sep 12, 2024
eccee39
Merge pull request #6052 from opentripplanner/renovate/com.google.clo…
leonardehrenfried Sep 12, 2024
b40ea4b
Fix incorrect flex safe duration offset
leonardehrenfried Sep 12, 2024
048a219
Bump serialization version id for #5936 (Manually)
t2gran Sep 12, 2024
e9f847d
Merge pull request #6022 from entur/add_javadoc_for_trip
vpaturet Sep 12, 2024
00f12c6
Add changelog entry for #6022 [ci skip]
Sep 12, 2024
7e8229e
Merge pull request #6057 from opentripplanner/add-iceland-to-deployments
leonardehrenfried Sep 13, 2024
c19cef5
Add changelog entry for #6057 [ci skip]
Sep 13, 2024
dc4cdb8
Use correct HEAD request when fetching HTTP headers
leonardehrenfried Sep 13, 2024
60d98e4
Remove check for content
leonardehrenfried Sep 13, 2024
db590e5
Merge pull request #6063 from leonardehrenfried/fix-headers
leonardehrenfried Sep 16, 2024
069ddda
Add changelog entry for #6063 [ci skip]
Sep 16, 2024
8bdf6bc
Update src/main/java/org/opentripplanner/routing/algorithm/filterchai…
leonardehrenfried Sep 16, 2024
6a06341
Convert line comments to Javadoc
leonardehrenfried Sep 16, 2024
7e2a181
Improve Javadoc
leonardehrenfried Sep 16, 2024
1af7cd3
Merge remote-tracking branch 'upstream/dev-2.x' into arrive-by-filtering
leonardehrenfried Sep 16, 2024
43a136e
Merge pull request #6059 from ibi-group/fix-flex-safe-duration
leonardehrenfried Sep 16, 2024
ea461af
Add changelog entry for #6059 [ci skip]
Sep 16, 2024
c1ef7ae
Merge remote-tracking branch 'upstream/dev-2.x' into arrive-by-filtering
leonardehrenfried Sep 16, 2024
c61bdc5
Update Javadoc
leonardehrenfried Sep 16, 2024
279e269
Merge remote-tracking branch 'upstream/dev-2.x' into hopelink-preview
leonardehrenfried Sep 17, 2024
b382717
Merge branch 'arrive-by-filtering' into hopelink-preview
leonardehrenfried Sep 17, 2024
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
2 changes: 1 addition & 1 deletion client/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VITE_API_URL=/otp/transmodel/v3
VITE_DEBUG_STYLE_URL=/otp/routers/default/inspector/vectortile/style.json

VITE_GRAPHIQL_URL=/graphiql?flavor=transmodel
3 changes: 2 additions & 1 deletion client/.env.development
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
VITE_API_URL=http://localhost:8080/otp/transmodel/v3
VITE_DEBUG_STYLE_URL=http://localhost:8080/otp/routers/default/inspector/vectortile/style.json
VITE_DEBUG_STYLE_URL=http://localhost:8080/otp/routers/default/inspector/vectortile/style.json
VITE_GRAPHIQL_URL=http://localhost:8080/graphiql?flavor=transmodel
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { authorityQueryAsString } from '../../static/query/authorityQuery.tsx';
import { Maybe } from '../../gql/graphql.ts';
const graphiQLUrl = import.meta.env.VITE_GRAPHIQL_URL;

export function ItineraryGraphiQLAuthorityLink({
legId,
legName,
}: {
legId: string | undefined;
legName: Maybe<string> | undefined;
}) {
const queryID = { id: legId };
const formattedQuery = encodeURIComponent(authorityQueryAsString);
const formattedQueryID = encodeURIComponent(JSON.stringify(queryID));

return (
<a
href={graphiQLUrl + '&query=' + formattedQuery + '&variables=' + formattedQueryID}
target={'_blank'}
rel={'noreferrer'}
>
{legName}
</a>
);
}
18 changes: 18 additions & 0 deletions client/src/components/ItineraryList/ItineraryGraphiQLLineLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { lineQueryAsString } from '../../static/query/lineQuery.tsx';
const graphiQLUrl = import.meta.env.VITE_GRAPHIQL_URL;

export function ItineraryGraphiQLLineLink({ legId, legName }: { legId: string; legName: string }) {
const queryID = { id: legId };
const formattedQuery = encodeURIComponent(lineQueryAsString);
const formattedQueryID = encodeURIComponent(JSON.stringify(queryID));

return (
<a
href={graphiQLUrl + '&query=' + formattedQuery + '&variables=' + formattedQueryID}
target={'_blank'}
rel={'noreferrer'}
>
{legName}
</a>
);
}
25 changes: 25 additions & 0 deletions client/src/components/ItineraryList/ItineraryGraphiQLQuayLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { quayQueryAsString } from '../../static/query/quayQuery.tsx';
import { Maybe } from '../../gql/graphql.ts';
const graphiQLUrl = import.meta.env.VITE_GRAPHIQL_URL;

export function ItineraryGraphiQLQuayLink({
legId,
legName,
}: {
legId: string | undefined;
legName: Maybe<string> | undefined;
}) {
const queryID = { id: legId };
const formattedQuery = encodeURIComponent(quayQueryAsString);
const formattedQueryID = encodeURIComponent(JSON.stringify(queryID));

return (
<a
href={graphiQLUrl + '&query=' + formattedQuery + '&variables=' + formattedQueryID}
target={'_blank'}
rel={'noreferrer'}
>
{legName}
</a>
);
}
16 changes: 10 additions & 6 deletions client/src/components/ItineraryList/ItineraryLegDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { LegTime } from './LegTime.tsx';
import { formatDistance } from '../../util/formatDistance.ts';
import { formatDuration } from '../../util/formatDuration.ts';
import { InterchangeInfo } from './InterchangeInfo.tsx';
import { ItineraryGraphiQLLineLink } from './ItineraryGraphiQLLineLink.tsx';
import { ItineraryGraphiQLQuayLink } from './ItineraryGraphiQLQuayLink.tsx';
import { ItineraryGraphiQLAuthorityLink } from './ItineraryGraphiQLAuthorityLink.tsx';

export function ItineraryLegDetails({ leg, isLast }: { leg: Leg; isLast: boolean }) {
return (
Expand All @@ -17,19 +20,20 @@ export function ItineraryLegDetails({ leg, isLast }: { leg: Leg; isLast: boolean
<b>{leg.mode}</b>{' '}
{leg.line && (
<>
<u>
{leg.line.publicCode} {leg.toEstimatedCall?.destinationDisplay?.frontText}
</u>
, {leg.authority?.name}
<ItineraryGraphiQLLineLink
legId={leg.line?.id}
legName={leg.line.publicCode + ' ' + leg.toEstimatedCall?.destinationDisplay?.frontText}
/>
, <ItineraryGraphiQLAuthorityLink legId={leg.authority?.id} legName={leg.authority?.name} />
</>
)}{' '}
{leg.mode !== Mode.Foot && (
<>
<br />
<u title={leg.fromPlace.quay?.id}>{leg.fromPlace.name}</u> →{' '}
<ItineraryGraphiQLQuayLink legId={leg.fromPlace.quay?.id} legName={leg.fromPlace.name} /> →{' '}
</>
)}{' '}
{!isLast && <u title={leg.toPlace.quay?.id}>{leg.toPlace.name}</u>}
{!isLast && <ItineraryGraphiQLQuayLink legId={leg.toPlace.quay?.id} legName={leg.toPlace.name} />}
</div>
</div>
);
Expand Down
18 changes: 18 additions & 0 deletions client/src/components/SearchBar/GraphiQLRouteButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Button } from 'react-bootstrap';
import { TripQueryVariables } from '../../gql/graphql.ts';
import { queryAsString } from '../../static/query/tripQuery.tsx';
const graphiQLUrl = import.meta.env.VITE_GRAPHIQL_URL;

function GraphiQLRouteButton({ tripQueryVariables }: { tripQueryVariables: TripQueryVariables }) {
const formattedVariables = encodeURIComponent(JSON.stringify(tripQueryVariables));
const formattedQuery = encodeURIComponent(queryAsString);

return (
<div className="search-bar-route-button-wrapper">
<Button href={graphiQLUrl + '&query=' + formattedQuery + '&variables=' + formattedVariables} target={'_blank'}>
GraphiQL
</Button>
</div>
);
}
export default GraphiQLRouteButton;
2 changes: 2 additions & 0 deletions client/src/components/SearchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Navbar from 'react-bootstrap/Navbar';
import { ServerInfoTooltip } from './ServerInfoTooltip.tsx';
import { useRef, useState } from 'react';
import logo from '../../static/img/otp-logo.svg';
import GraphiQLRouteButton from './GraphiQLRouteButton.tsx';

type SearchBarProps = {
onRoute: () => void;
Expand Down Expand Up @@ -61,6 +62,7 @@ export function SearchBar({ onRoute, tripQueryVariables, setTripQueryVariables,
Route
</Button>
</div>
<GraphiQLRouteButton tripQueryVariables={tripQueryVariables}></GraphiQLRouteButton>
</div>
);
}
87 changes: 1 addition & 86 deletions client/src/hooks/useTripQuery.ts
Original file line number Diff line number Diff line change
@@ -1,96 +1,12 @@
import { useCallback, useEffect, useState } from 'react';
import { graphql } from '../gql';
import { request } from 'graphql-request'; // eslint-disable-line import/no-unresolved
import { QueryType, TripQueryVariables } from '../gql/graphql.ts';
import { getApiUrl } from '../util/getApiUrl.ts';
import { query } from '../static/query/tripQuery.tsx';

/**
General purpose trip query document for debugging trip searches
TODO: should live in a separate file, and split into fragments for readability
*/
const query = graphql(`
query trip(
$from: Location!
$to: Location!
$arriveBy: Boolean
$dateTime: DateTime
$numTripPatterns: Int
$searchWindow: Int
$modes: Modes
$itineraryFiltersDebug: ItineraryFilterDebugProfile
$pageCursor: String
) {
trip(
from: $from
to: $to
arriveBy: $arriveBy
dateTime: $dateTime
numTripPatterns: $numTripPatterns
searchWindow: $searchWindow
modes: $modes
itineraryFilters: { debug: $itineraryFiltersDebug }
pageCursor: $pageCursor
) {
previousPageCursor
nextPageCursor
tripPatterns {
aimedStartTime
aimedEndTime
expectedEndTime
expectedStartTime
duration
distance
legs {
id
mode
aimedStartTime
aimedEndTime
expectedEndTime
expectedStartTime
realtime
distance
duration
fromPlace {
name
quay {
id
}
}
toPlace {
name
quay {
id
}
}
toEstimatedCall {
destinationDisplay {
frontText
}
}
line {
publicCode
name
}
authority {
name
}
pointsOnLink {
points
}
interchangeTo {
staySeated
}
interchangeFrom {
staySeated
}
}
systemNotices {
tag
}
}
}
}
`);

type TripQueryHook = (
variables?: TripQueryVariables,
Expand Down Expand Up @@ -126,6 +42,5 @@ export const useTripQuery: TripQueryHook = (variables) => {
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [variables?.from, variables?.to]);

return [data, loading, callback];
};
13 changes: 13 additions & 0 deletions client/src/static/query/authorityQuery.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { graphql } from '../../gql';
import { print } from 'graphql/index';

export const query = graphql(`
query authority($id: String!) {
authority(id: $id) {
name
id
}
}
`);

export const authorityQueryAsString = print(query);
13 changes: 13 additions & 0 deletions client/src/static/query/lineQuery.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { graphql } from '../../gql';
import { print } from 'graphql/index';

export const query = graphql(`
query line($id: ID!) {
line(id: $id) {
name
publicCode
}
}
`);

export const lineQueryAsString = print(query);
15 changes: 15 additions & 0 deletions client/src/static/query/quayQuery.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { graphql } from '../../gql';
import { print } from 'graphql/index';

export const query = graphql(`
query quay($id: String!) {
quay(id: $id) {
stopPlace {
id
name
}
}
}
`);

export const quayQueryAsString = print(query);
90 changes: 90 additions & 0 deletions client/src/static/query/tripQuery.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import { graphql } from '../../gql';
import { print } from 'graphql/index';

export const query = graphql(`
query trip(
$from: Location!
$to: Location!
$arriveBy: Boolean
$dateTime: DateTime
$numTripPatterns: Int
$searchWindow: Int
$modes: Modes
$itineraryFiltersDebug: ItineraryFilterDebugProfile
$pageCursor: String
) {
trip(
from: $from
to: $to
arriveBy: $arriveBy
dateTime: $dateTime
numTripPatterns: $numTripPatterns
searchWindow: $searchWindow
modes: $modes
itineraryFilters: { debug: $itineraryFiltersDebug }
pageCursor: $pageCursor
) {
previousPageCursor
nextPageCursor
tripPatterns {
aimedStartTime
aimedEndTime
expectedEndTime
expectedStartTime
duration
distance
legs {
id
mode
aimedStartTime
aimedEndTime
expectedEndTime
expectedStartTime
realtime
distance
duration
fromPlace {
name
quay {
id
}
}
toPlace {
name
quay {
id
}
}
toEstimatedCall {
destinationDisplay {
frontText
}
}
line {
publicCode
name
id
}
authority {
name
id
}
pointsOnLink {
points
}
interchangeTo {
staySeated
}
interchangeFrom {
staySeated
}
}
systemNotices {
tag
}
}
}
}
`);

export const queryAsString = print(query);
Loading
Loading