forked from opentripplanner/OpenTripPlanner
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev-2.x' into gql-mode-weight
- Loading branch information
Showing
151 changed files
with
3,582 additions
and
1,535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.