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

Upstream merge 2024-09-30 #227

Merged
merged 96 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
5e18c0a
GTFS graphql API supports querying itinerary leg status
vesameskanen Sep 2, 2024
021e07c
Catch non-transit legs properly
vesameskanen Sep 5, 2024
01b460d
Add type resolver for Leg
vesameskanen Sep 5, 2024
2182066
Fix formatting
vesameskanen Sep 5, 2024
7e2033f
Do not encode null reference as 'null' string
vesameskanen Sep 6, 2024
6b92741
More accurate docs about leg query
vesameskanen Sep 6, 2024
e489f05
Add leg id to plan query test
vesameskanen Sep 6, 2024
6bd5d04
Use self-documenting value for non-transit leg ids
vesameskanen Sep 9, 2024
a998e52
Add more docs about leg re-fetching into gtfs graphql schema
vesameskanen Sep 9, 2024
cf37e89
Support querying leg's realTimeState in GTFS graphql api
vesameskanen Sep 11, 2024
cd54cbe
Query realtimeState in extended plan test
vesameskanen Sep 11, 2024
4025d5b
Revert LegReferenceSerializer changes
vesameskanen Sep 13, 2024
b206ce1
Generate unique id for non-transit legs
vesameskanen Sep 13, 2024
15f1f34
Restore LegReferenceSerializer null test
vesameskanen Sep 13, 2024
20f855a
Update plan-extended expoctations to use unique leg ids
vesameskanen Sep 13, 2024
f7fc002
Introduce timetable builder
vpaturet Jul 22, 2024
307a745
refactor: Encapsulate ordering trip-times in Timetable
t2gran Aug 22, 2024
2b6c7f0
refactor: Replace 'Timetable.of(tt)' with 'tt.copyOf()'
t2gran Aug 22, 2024
cc692c6
Fix unit test (the timetable is now sorted)
vpaturet Aug 26, 2024
15833df
Remove redundant timetable sorting in TransitLayerMapper
vpaturet Aug 26, 2024
4b6a019
Code clean-up
vpaturet Aug 27, 2024
16c8264
Ensure stable TripPattern creation order
vpaturet Sep 16, 2024
c3553d5
Code clean-up
vpaturet Sep 16, 2024
1139e19
Remove GTFS flex stop areas
leonardehrenfried Sep 18, 2024
1468498
Fix remaining mentions of /docs
leonardehrenfried Sep 18, 2024
3fe0161
fix /docs/user mentions
JustCris654 Sep 18, 2024
3fe686b
fix docs mentions in function comments
JustCris654 Sep 18, 2024
882730a
fix documentation bash command doc folder
JustCris654 Sep 18, 2024
f09d3be
Merge remote-tracking branch 'otp_master/dev-2.x' into fix-docs
JustCris654 Sep 19, 2024
1cff559
Update dependency org.apache.httpcomponents.client5:httpclient5 to v5.4
renovate[bot] Sep 19, 2024
c61819a
Return transit model timezone in server info
leonardehrenfried Sep 19, 2024
d6f1b80
Use react to fetch time zone
leonardehrenfried Sep 20, 2024
719dde7
Use polyfill, combine datetime into a single input
leonardehrenfried Sep 23, 2024
e75409d
Simplify time zone display
leonardehrenfried Sep 23, 2024
db17fab
Store time zone in context
leonardehrenfried Sep 23, 2024
b55ecd7
Remove memo of time
leonardehrenfried Sep 23, 2024
eda11ec
Use configuration value for URL
leonardehrenfried Sep 23, 2024
9b3c4d5
Revert "Generate unique id for non-transit legs"
vesameskanen Sep 24, 2024
14fd13e
Remove node interface from LegType and add leg query
vesameskanen Sep 24, 2024
207cd5d
Merge remote-tracking branch 'otp/dev-2.x' into gfts-leg-node-refetch
vesameskanen Sep 24, 2024
71a6315
Update auto generated files
vesameskanen Sep 24, 2024
cd660b2
Fix schema formatting
vesameskanen Sep 24, 2024
97d2180
Fix leg id access
vesameskanen Sep 24, 2024
208c8ad
Add comment
leonardehrenfried Sep 24, 2024
c09387b
Fix linting issues
leonardehrenfried Sep 24, 2024
795cb52
DocsTestConstants test check both user and templates directories
JustCris654 Sep 24, 2024
1bc92c3
fix typo
JustCris654 Sep 24, 2024
0be72d3
Add internal time zone to Transmodel GraphQL API
leonardehrenfried Sep 24, 2024
e9c029f
Update schema docs
leonardehrenfried Sep 24, 2024
b75c047
Remove leg resolver from node type
vesameskanen Sep 24, 2024
769bb50
Remove unused env variables
leonardehrenfried Sep 24, 2024
1a43221
Use ID parameter type for leg query
vesameskanen Sep 24, 2024
e577006
Update schema docs
leonardehrenfried Sep 24, 2024
b5d7e13
Update schema docs
leonardehrenfried Sep 24, 2024
7080ebb
Update src/main/java/org/opentripplanner/apis/transmodel/model/framew…
t2gran Sep 24, 2024
60b7383
Update src/main/resources/org/opentripplanner/apis/transmodel/schema.…
t2gran Sep 24, 2024
f70cfd4
Merge pull request #6087 from leonardehrenfried/time-zone-2
leonardehrenfried Sep 24, 2024
9c10a0e
Upgrade debug client to version 2024/09/2024-09-24T12:05
Sep 24, 2024
1c858c8
Merge pull request #6075 from JustCris654/fix-docs
habrahamsson-skanetrafiken Sep 24, 2024
0a95a2d
fix(orca-fares): remove fare attributes with no rules
daniel-heppner-ibigroup Sep 25, 2024
fb4eef5
Apply review suggestions
vpaturet Sep 20, 2024
7ed6c52
Merge branch 'dev-2.x' into make_timetable_immutable
vpaturet Sep 25, 2024
e15c3d0
Fix merge conflicts
vpaturet Sep 25, 2024
c93fc7c
Merge pull request #6079 from opentripplanner/renovate/org.apache.htt…
leonardehrenfried Sep 25, 2024
58b382f
Update src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls
vesameskanen Sep 26, 2024
f6a8d8f
Suggested review changes
vesameskanen Sep 26, 2024
71caaa5
Merge remote-tracking branch 'origin/gfts-leg-node-refetch' into gfts…
vesameskanen Sep 26, 2024
cd5277e
Merge pull request #6017 from entur/make_timetable_immutable
vpaturet Sep 26, 2024
5ef129a
Make search bar more compact
leonardehrenfried Sep 25, 2024
ef4a6c3
Added wheelchair accessible checkbox parameter
a-limyr Sep 26, 2024
8549ccc
Make pagin buttons smaller
leonardehrenfried Sep 26, 2024
31577c9
Move styling into CSS
leonardehrenfried Sep 26, 2024
feedefe
add tests for FareRuleSet
daniel-heppner-ibigroup Sep 26, 2024
ba100e8
Use string type instead of relay ID type for transit leg identification
vesameskanen Sep 27, 2024
45d6f98
Update src/main/java/org/opentripplanner/apis/gtfs/datafetchers/LegIm…
vesameskanen Sep 27, 2024
857b815
Update src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls
vesameskanen Sep 27, 2024
2cfbd7b
Merge pull request #6045 from HSLdevcom/gfts-leg-node-refetch
vesameskanen Sep 27, 2024
69a5ff1
Add changelog entry for #6045 [ci skip]
Sep 27, 2024
25194e2
Changed label from text to icon
a-limyr Sep 27, 2024
d792ef6
Merge pull request #6074 from leonardehrenfried/flex-stop-areas
leonardehrenfried Sep 27, 2024
8cf6db5
Add changelog entry for #6074 [ci skip]
Sep 27, 2024
364cf4f
add Javadoc
daniel-heppner-ibigroup Sep 27, 2024
54223b1
replace new hashset with set.of()
daniel-heppner-ibigroup Sep 27, 2024
450a8ad
Merge remote-tracking branch 'upstream/dev-2.x' into upstream-merge-2…
leonardehrenfried Sep 30, 2024
f6ec36d
Re-enable Seattle smoke tests
leonardehrenfried Sep 30, 2024
f285066
Merge pull request #6090 from entur/debug-ui-wheelchair-accessible
leonardehrenfried Sep 30, 2024
4637e26
Merge remote-tracking branch 'upstream/dev-2.x' into route-button
leonardehrenfried Sep 30, 2024
f584dbd
Upgrade debug client to version 2024/09/2024-09-30T08:24
Sep 30, 2024
a1bcecf
Fix typo
leonardehrenfried Sep 30, 2024
3a7a984
Rename icon
leonardehrenfried Sep 30, 2024
94943d5
Change breakpoint to 1895px
leonardehrenfried Sep 30, 2024
0be4f9f
Add hint to button
leonardehrenfried Sep 30, 2024
2fe2b37
Merge pull request #6089 from ibi-group/orca-remove-ruleless-attributes
leonardehrenfried Sep 30, 2024
a891ef6
Merge pull request #6091 from leonardehrenfried/route-button
leonardehrenfried Sep 30, 2024
b174c25
Upgrade debug client to version 2024/09/2024-09-30T09:03
Sep 30, 2024
00fdbff
Merge remote-tracking branch 'upstream/dev-2.x' into upstream-merge-2…
leonardehrenfried Sep 30, 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
4 changes: 2 additions & 2 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
strategy:
matrix:
locations:
#- name: seattle
# sleep: 30
- name: seattle
sleep: 30
- name: atlanta
sleep: 15
- name: houston
Expand Down
2 changes: 1 addition & 1 deletion client/.env.development
Original file line number Diff line number Diff line change
@@ -1,3 +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_GRAPHIQL_URL=http://localhost:8080/graphiql?flavor=transmodel
VITE_GRAPHIQL_URL=http://localhost:8080/graphiql?flavor=transmodel
18 changes: 18 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"dependencies": {
"@googlemaps/polyline-codec": "1.0.28",
"@js-temporal/polyfill": "0.4.4",
"bootstrap": "5.3.3",
"graphql": "16.9.0",
"graphql-request": "7.1.0",
Expand Down
13 changes: 8 additions & 5 deletions client/src/components/ItineraryList/ItineraryHeaderContent.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { TripPattern } from '../../gql/graphql.ts';
import { TIME_BOX_WIDTH, useHeaderContentStyleCalculations } from './useHeaderContentStyleCalculations.ts';
import { ItineraryHeaderLegContent } from './ItineraryHeaderLegContent.tsx';
import { useMemo } from 'react';
import { useContext, useMemo } from 'react';
import { formatTime } from '../../util/formatTime.ts';
import { TimeZoneContext } from '../../hooks/TimeZoneContext.ts';

export function ItineraryHeaderContent({
tripPattern,
Expand All @@ -24,14 +25,16 @@ export function ItineraryHeaderContent({
latestEndTime,
);

const timeZone = useContext(TimeZoneContext);

const formattedStartTime = useMemo(
() => formatTime(tripPattern.expectedStartTime, 'short'),
[tripPattern.expectedStartTime],
() => formatTime(tripPattern.expectedStartTime, timeZone, 'short'),
[tripPattern.expectedStartTime, timeZone],
);

const formattedEndTime = useMemo(
() => formatTime(tripPattern.expectedEndTime, 'short'),
[tripPattern.expectedEndTime],
() => formatTime(tripPattern.expectedEndTime, timeZone, 'short'),
[tripPattern.expectedEndTime, timeZone],
);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { ItineraryHeaderContent } from './ItineraryHeaderContent.tsx';
import { useEarliestAndLatestTimes } from './useEarliestAndLatestTimes.ts';
import { ItineraryDetails } from './ItineraryDetails.tsx';
import { ItineraryPaginationControl } from './ItineraryPaginationControl.tsx';
import { useContext } from 'react';
import { TimeZoneContext } from '../../hooks/TimeZoneContext.ts';

export function ItineraryListContainer({
tripQueryResult,
Expand All @@ -21,6 +23,7 @@ export function ItineraryListContainer({
}) {
const [earliestStartTime, latestEndTime] = useEarliestAndLatestTimes(tripQueryResult);
const { containerRef, containerWidth } = useContainerWidth();
const timeZone = useContext(TimeZoneContext);

return (
<section className="itinerary-list-container below-content" ref={containerRef}>
Expand Down Expand Up @@ -56,6 +59,9 @@ export function ItineraryListContainer({
</Accordion.Item>
))}
</Accordion>
<div className="time-zone-info">
All times in <code>{timeZone}</code>
</div>
</section>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export function ItineraryPaginationControl({
return (
<div style={{ display: 'flex', justifyContent: 'space-evenly', margin: '1rem 0 ' }}>
<Button
variant="outline-primary"
size="sm"
disabled={!previousPageCursor || loading}
onClick={() => {
previousPageCursor && onPagination(previousPageCursor);
Expand All @@ -22,6 +24,8 @@ export function ItineraryPaginationControl({
Previous page
</Button>{' '}
<Button
variant="outline-primary"
size="sm"
disabled={!nextPageCursor || loading}
onClick={() => {
nextPageCursor && onPagination(nextPageCursor);
Expand Down
9 changes: 6 additions & 3 deletions client/src/components/ItineraryList/LegTime.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { formatTime } from '../../util/formatTime.ts';
import { useContext } from 'react';
import { TimeZoneContext } from '../../hooks/TimeZoneContext.ts';

export function LegTime({
aimedTime,
Expand All @@ -9,18 +11,19 @@ export function LegTime({
expectedTime: string;
hasRealtime: boolean;
}) {
const timeZone = useContext(TimeZoneContext);
return aimedTime !== expectedTime ? (
<>
<span title={expectedTime} style={{ color: 'red' }}>
{formatTime(expectedTime, 'short')}
{formatTime(expectedTime, timeZone, 'short')}
</span>
<span title={aimedTime} style={{ textDecoration: 'line-through' }}>
{formatTime(aimedTime, 'short')}
{formatTime(aimedTime, timeZone, 'short')}
</span>
</>
) : (
<span title={expectedTime}>
{formatTime(expectedTime, 'short')}
{formatTime(expectedTime, timeZone, 'short')}
{hasRealtime && <span> (on time)</span>}
</span>
);
Expand Down
40 changes: 0 additions & 40 deletions client/src/components/SearchBar/DateInputField.tsx

This file was deleted.

42 changes: 42 additions & 0 deletions client/src/components/SearchBar/DateTimeInputField.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Form } from 'react-bootstrap';
import { TripQueryVariables } from '../../gql/graphql.ts';
import { ChangeEvent, useCallback, useContext } from 'react';
import { Temporal } from '@js-temporal/polyfill';
import { TimeZoneContext } from '../../hooks/TimeZoneContext.ts';

export function DateTimeInputField({
tripQueryVariables,
setTripQueryVariables,
}: {
tripQueryVariables: TripQueryVariables;
setTripQueryVariables: (tripQueryVariables: TripQueryVariables) => void;
}) {
const timeZone = useContext(TimeZoneContext);
const current = Temporal.Instant.from(tripQueryVariables.dateTime)
.toZonedDateTimeISO(timeZone)
.toPlainDateTime()
.toString({ smallestUnit: 'minute', calendarName: 'never' });

const onChange = useCallback(
(event: ChangeEvent<HTMLInputElement>) => {
const dateTime = Temporal.PlainDateTime.from(event.target.value)
.toZonedDateTime(timeZone)
.toString({ calendarName: 'never', timeZoneName: 'never' });

setTripQueryVariables({
...tripQueryVariables,
dateTime: dateTime,
});
},
[tripQueryVariables, setTripQueryVariables, timeZone],
);

return (
<Form.Group>
<Form.Label column="sm" htmlFor="timePicker" title={'Time zone: ' + timeZone}>
Time
</Form.Label>
<Form.Control type="datetime-local" id="timePicker" size="sm" onChange={onChange} value={current} />
</Form.Group>
);
}
17 changes: 12 additions & 5 deletions client/src/components/SearchBar/GraphiQLRouteButton.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
import { Button } from 'react-bootstrap';
import { TripQueryVariables } from '../../gql/graphql.ts';
import { queryAsString } from '../../static/query/tripQuery.tsx';
import graphqlIcon from '../../static/img/graphql-solid.svg';

const graphiQLUrl = import.meta.env.VITE_GRAPHIQL_URL;

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

const hint = 'Open in GraphiQL';

return (
<div className="search-bar-route-button-wrapper">
<Button href={graphiQLUrl + '&query=' + formattedQuery + '&variables=' + formattedVariables} target={'_blank'}>
GraphiQL
</Button>
</div>
<Button
title={hint}
href={graphiQLUrl + '&query=' + formattedQuery + '&variables=' + formattedVariables}
target={'_blank'}
>
<img alt={hint} title={hint} src={graphqlIcon} width="20" height="20" className="d-inline-block align-middle" />
</Button>
);
}

export default GraphiQLRouteButton;
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ export function ItineraryFilterDebugSelect({
return (
<Form.Group>
<Form.Label column="sm" htmlFor="itineraryDebugFilterSelect">
Itinerary filter debug
Filter debug
</Form.Label>
<Form.Select
id="itineraryDebugFilterSelect"
size="sm"
className="input-medium"
onChange={(e) => {
setTripQueryVariables({
...tripQueryVariables,
Expand Down
1 change: 1 addition & 0 deletions client/src/components/SearchBar/LocationInputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export function LocationInputField({ location, id, label }: { location: Location
id={id}
size="sm"
placeholder="[Click in map]"
className="input-medium"
// Intentionally empty for now, but needed because of
// https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable
onChange={() => {}}
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/SearchBar/NumTripPatternsInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ export function NumTripPatternsInput({
return (
<Form.Group>
<Form.Label column="sm" htmlFor="numTripPatternsInput">
Number of trip patterns
Num. results
</Form.Label>
<Form.Control
type="number"
id="numTripPatternsInput"
size="sm"
placeholder="12"
min={1}
className="input-small"
value={tripQueryVariables.numTripPatterns || ''}
onChange={(event) =>
setTripQueryVariables({
Expand Down
34 changes: 20 additions & 14 deletions client/src/components/SearchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Button, Spinner } from 'react-bootstrap';
import { Button, ButtonGroup, Spinner } from 'react-bootstrap';
import { ServerInfo, TripQueryVariables } from '../../gql/graphql.ts';
import { LocationInputField } from './LocationInputField.tsx';
import { DepartureArrivalSelect } from './DepartureArrivalSelect.tsx';
import { TimeInputField } from './TimeInputField.tsx';
import { DateInputField } from './DateInputField.tsx';
import { DateTimeInputField } from './DateTimeInputField.tsx';
import { SearchWindowInput } from './SearchWindowInput.tsx';
import { AccessSelect } from './AccessSelect.tsx';
import { EgressSelect } from './EgressSelect.tsx';
Expand All @@ -16,6 +15,7 @@ import { ServerInfoTooltip } from './ServerInfoTooltip.tsx';
import { useRef, useState } from 'react';
import logo from '../../static/img/otp-logo.svg';
import GraphiQLRouteButton from './GraphiQLRouteButton.tsx';
import WheelchairAccessibleCheckBox from './WheelchairAccessibleCheckBox.tsx';

type SearchBarProps = {
onRoute: () => void;
Expand All @@ -40,8 +40,7 @@ export function SearchBar({ onRoute, tripQueryVariables, setTripQueryVariables,
<LocationInputField location={tripQueryVariables.from} label="From" id="fromInputField" />
<LocationInputField location={tripQueryVariables.to} label="To" id="toInputField" />
<DepartureArrivalSelect tripQueryVariables={tripQueryVariables} setTripQueryVariables={setTripQueryVariables} />
<TimeInputField tripQueryVariables={tripQueryVariables} setTripQueryVariables={setTripQueryVariables} />
<DateInputField tripQueryVariables={tripQueryVariables} setTripQueryVariables={setTripQueryVariables} />
<DateTimeInputField tripQueryVariables={tripQueryVariables} setTripQueryVariables={setTripQueryVariables} />
<NumTripPatternsInput tripQueryVariables={tripQueryVariables} setTripQueryVariables={setTripQueryVariables} />
<SearchWindowInput tripQueryVariables={tripQueryVariables} setTripQueryVariables={setTripQueryVariables} />
<AccessSelect tripQueryVariables={tripQueryVariables} setTripQueryVariables={setTripQueryVariables} />
Expand All @@ -52,17 +51,24 @@ export function SearchBar({ onRoute, tripQueryVariables, setTripQueryVariables,
tripQueryVariables={tripQueryVariables}
setTripQueryVariables={setTripQueryVariables}
/>
<WheelchairAccessibleCheckBox
tripQueryVariables={tripQueryVariables}
setTripQueryVariables={setTripQueryVariables}
/>

<div className="search-bar-route-button-wrapper">
<Button variant="primary" onClick={() => onRoute()} disabled={loading}>
{loading && (
<>
<Spinner as="span" animation="border" size="sm" role="status" aria-hidden="true" />{' '}
</>
)}
Route
</Button>
<ButtonGroup>
<Button variant="primary" onClick={() => onRoute()} disabled={loading}>
{loading && (
<>
<Spinner as="span" animation="border" size="sm" role="status" aria-hidden="true" />{' '}
</>
)}
Route
</Button>
<GraphiQLRouteButton tripQueryVariables={tripQueryVariables}></GraphiQLRouteButton>
</ButtonGroup>
</div>
<GraphiQLRouteButton tripQueryVariables={tripQueryVariables}></GraphiQLRouteButton>
</div>
);
}
1 change: 1 addition & 0 deletions client/src/components/SearchBar/SearchWindowInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function SearchWindowInput({
size="sm"
placeholder="(in minutes)"
min={1}
className="input-small"
value={tripQueryVariables.searchWindow || ''}
onChange={(event) =>
setTripQueryVariables({
Expand Down
Loading
Loading