forked from opentripplanner/OpenTripPlanner
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/dev-2.x' into arrive-by-filtering
- Loading branch information
Showing
109 changed files
with
25,843 additions
and
758 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=/otp/transmodel/v3 | ||
VITE_DEBUG_STYLE_URL=/otp/routers/default/inspector/vectortile/style.json | ||
|
||
VITE_GRAPHIQL_URL=/graphiql?flavor=transmodel |
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,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 |
25 changes: 25 additions & 0 deletions
25
client/src/components/ItineraryList/ItineraryGraphiQLAuthorityLink.tsx
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,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
18
client/src/components/ItineraryList/ItineraryGraphiQLLineLink.tsx
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,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
25
client/src/components/ItineraryList/ItineraryGraphiQLQuayLink.tsx
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,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> | ||
); | ||
} |
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
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; |
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
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); |
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,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); |
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,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); |
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,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); |
Oops, something went wrong.