-
Notifications
You must be signed in to change notification settings - Fork 58
GTFS FLEX Support (trip planner only) #470
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
4a12934
fix(connected-route-viewer-overlay): don't crash on viewing route wit…
miles-grant-ibigroup 4220102
refactor(connected-park-and-ride-overlay): avoid crash on empty Park …
miles-grant-ibigroup d1d8528
feature(default-itinerary): add flex itinerary notice
miles-grant-ibigroup 7a3293e
refactor(tabbed-itineraries): show flex status
miles-grant-ibigroup fd44b48
refactor(tabbed-itineraries): move to a11y compliant red
miles-grant-ibigroup 2d68378
refactor(tabbed-itineraries): move to a11y compliant red
miles-grant-ibigroup 2a700d5
refactor(tabbed-itineraries): update to match mockups
miles-grant-ibigroup 23087cd
improvement(default-itinerary): add dynamic flex notice
miles-grant-ibigroup 26b4e9c
refactor(flex-indicator): internationalize messages
miles-grant-ibigroup 70e83a7
chore(i18n/en-US): add flex strings
miles-grant-ibigroup 98a7a4c
Merge branch 'dev' into support-gtfs-flex
miles-grant-ibigroup 99be28a
refactor(flex-indicator): set variable names to match logic
miles-grant-ibigroup 19f53db
refactor(connected-park-and-ride-overlay): make overlay more robust t…
miles-grant-ibigroup eeec5c8
refactor(example-config): add flex strings
miles-grant-ibigroup f37cce2
improvement(flex-indicator): support scrolling environments
miles-grant-ibigroup 391bfe1
improvement(flex-indicator): support shrinking flex indicator
miles-grant-ibigroup 42103cd
feat(actions/api): route only flex requests to otp2 server
miles-grant-ibigroup a0ce199
improvement(flex-indicator): display flex phone number from bookingInfo
miles-grant-ibigroup e550df2
refactor: adjust to latest core-utils changes
miles-grant-ibigroup 51cd157
Merge branch 'dev' into support-gtfs-flex
miles-grant-ibigroup 61d4a11
refactor(default-itinerary): don't crash on missing bookingInfo
miles-grant-ibigroup be71977
fix(default-itinerary): show detailsHint at correct spot
miles-grant-ibigroup 690dadd
fix(default-itinerary): don't shrink flexIndicator
miles-grant-ibigroup 28debeb
improvement(actions/api): re-attempt failed calls with otp2 instance …
miles-grant-ibigroup 0ae72fb
Merge branch 'otp-1-and-2-in-parallel' into support-gtfs-flex
miles-grant-ibigroup fa1112d
chore(deps): update otp-ui
miles-grant-ibigroup e40c5ae
Merge branch 'dev' into support-gtfs-flex
miles-grant-ibigroup 2a1e3db
chore(i18n): Match PR changes to PR file.
binh-dam-ibigroup debeffc
chore(i18n): Add with-constraint comment to call ahead msg.
binh-dam-ibigroup d755e4f
refactor(default-itinerary): address pr feedback
miles-grant-ibigroup 838eb0b
Merge branch 'support-gtfs-flex' of github.com:opentripplanner/otp-re…
miles-grant-ibigroup File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,99 @@ | ||
| // Craco will require this. FIXME: remove line once migrated to craco | ||
| // eslint-disable-next-line no-unused-vars | ||
| import { barberPole } from '@opentripplanner/itinerary-body/lib/otp-react-redux/line-column-content' | ||
| import { FormattedMessage } from 'react-intl' | ||
| import React from 'react' | ||
| import styled from 'styled-components' | ||
| import tinycolor from 'tinycolor2' | ||
|
|
||
| import Icon from '../../util/icon' | ||
|
|
||
| export const FLEX_COLOR = '#FA6400' | ||
| const FLEX_COLOR_LIGHT = tinycolor(FLEX_COLOR).lighten(40).toHexString() | ||
|
|
||
| const FlexNotice = ({ faKey, showText, text }) => ( | ||
| <> | ||
| <Icon name={faKey} /> | ||
| {showText && <p>{text}</p>} | ||
| </> | ||
| ) | ||
|
|
||
| const FlexIndicatorWrapper = styled.div` | ||
| background: ${FLEX_COLOR_LIGHT}; | ||
| border-bottom-right-radius: 8px; | ||
| border-top-right-radius: 8px; | ||
| color: ${FLEX_COLOR}; | ||
| display: grid; | ||
| grid-template-columns: 1fr 2fr 3fr 2fr; | ||
| grid-template-rows: 1fr 2fr; | ||
| grid-column-gap: ${(props) => (props.shrink ? '8px' : 'inherit')}; | ||
| height: ${(props) => (props.shrink ? '40px' : '80px')}; | ||
| margin-right: 1em; | ||
| max-width: ${(props) => (props.shrink ? '60px' : '190px')}; | ||
| padding-right: 0.25em; | ||
| padding-top: 0.25em; | ||
|
|
||
| /* "Flex Service" text */ | ||
| h4 { | ||
| grid-column: 3 / span 2; | ||
| grid-row: 1; | ||
| margin: 0; | ||
| padding-top: 2px; | ||
| text-align: left; | ||
| } | ||
|
|
||
| /* Icon (phone or hand) */ | ||
| span { | ||
| font-size: 32px; | ||
| grid-column: 2; | ||
| grid-row: 2; | ||
| height: 100%; | ||
| width: 100%; | ||
| } | ||
|
|
||
| /* Description text */ | ||
| p { | ||
| font-size: 13px; | ||
| grid-column: 3 / span 2; | ||
| grid-row: 2; | ||
| text-overflow: ellipsis; | ||
| overflow-y: hidden; | ||
| } | ||
|
|
||
| /* Barber pole at left */ | ||
| &::before { | ||
| background: ${barberPole(FLEX_COLOR)}; | ||
| content: ''; | ||
| display: block; | ||
| grid-row: 1 / span 2; | ||
| height: inherit; | ||
| margin-top: -0.25em; | ||
| position: relative; | ||
| width: 20px; | ||
| } | ||
| ` | ||
|
|
||
| export const FlexIndicator = ({ isCallAhead, isContinuousDropoff, phoneNumber, shrink }) => ( | ||
| <FlexIndicatorWrapper shrink={shrink}> | ||
| {!shrink && ( | ||
| <h4> | ||
| <FormattedMessage id='config.flex.flex-service' /> | ||
| </h4> | ||
| )} | ||
| {isCallAhead && ( | ||
| <FlexNotice | ||
| faKey='phone' | ||
| showText={!shrink} | ||
| text={<FormattedMessage id='config.flex.call-ahead' values={{ phoneNumber }} />} | ||
| /> | ||
| )} | ||
| {/* Only show continuous dropoff message if call ahead message isn't shown */} | ||
| {isContinuousDropoff && !isCallAhead && ( | ||
| <FlexNotice | ||
| faKey='hand-paper-o' | ||
| showText={!shrink} | ||
| text={<FormattedMessage id='config.flex.continuous-dropoff' />} | ||
| /> | ||
| )} | ||
| </FlexIndicatorWrapper> | ||
| ) |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.