Skip to content

Commit

Permalink
Merge branch 'dev' into pass-render-other-first
Browse files Browse the repository at this point in the history
  • Loading branch information
amy-corson-ibigroup committed Nov 20, 2024
2 parents c512398 + 3749ee6 commit a995658
Show file tree
Hide file tree
Showing 96 changed files with 10,830 additions and 7,416 deletions.
6,676 changes: 5,593 additions & 1,083 deletions __tests__/components/viewers/__snapshots__/nearby-view.js.snap

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ exports[`components > viewers > stop viewer should render with initial stop id a
>
<Styled(styled.span)>
<span
className="sc-jifHHV sc-hkwmXC frJUIW gWGcte"
className="sc-hkwmXC sc-bSFUlv eFsrhn gAUjbw"
>
<ArrowLeft>
<StyledIconBase
Expand Down Expand Up @@ -267,11 +267,11 @@ exports[`components > viewers > stop viewer should render with initial stop id a
</div>
<styled.div>
<div
className="sc-hJxDiT dbjOgr"
className="sc-cuWdqJ jtAZHv"
>
<styled.div>
<div
className="sc-jlIlqL sdJoA"
className="sc-iWRHom bUIXtU"
>
<h1>
<FormattedMessage
Expand Down
2 changes: 2 additions & 0 deletions __tests__/test-utils/mock-data/fileMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const mockImg = ''
export default mockImg
2 changes: 1 addition & 1 deletion a11y/a11y.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ beforeAll(async () => {
})
// Web security is disabled to allow requests to the mock OTP server
browser = await puppeteer.launch({
args: ['--disable-web-security']
args: ['--disable-web-security', '--no-sandbox']
})
})

Expand Down
28 changes: 27 additions & 1 deletion craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ module.exports = {
findBackwardsCompatibleEnvVar('JS_CONFIG')
backwardsCompatibleEnv.HTML_FILE =
findBackwardsCompatibleEnvVar('HTML_FILE')
backwardsCompatibleEnv.PLAN_QUERY_RESOURCE_URI =
findBackwardsCompatibleEnvVar('PLAN_QUERY_RESOURCE_URI')
backwardsCompatibleEnv.CUSTOM_CSS =
findBackwardsCompatibleEnvVar('CUSTOM_CSS')

Expand All @@ -65,6 +67,13 @@ module.exports = {
}
addBeforeLoader(webpackConfig, loaderByName('file-loader'), yamlLoader)

// Support import of raw GraphQL files
const graphqlLoader = {
loader: ['raw-loader'],
test: /\.graphql$/
}
addBeforeLoader(webpackConfig, loaderByName('file-loader'), graphqlLoader)

// Support webfonts (for font awesome)
const webfontLoader = {
loader: ['url-loader'],
Expand All @@ -82,7 +91,7 @@ module.exports = {
loader.exclude = /node_modules/
})

// Gather the CSS, HTML, YAML, and JS override files.
// Gather the CSS, HTML, YAML, GraphQL, and JS override files.
const CUSTOM_CSS =
(process.env && process.env.CUSTOM_CSS) ||
backwardsCompatibleEnv.CUSTOM_CSS ||
Expand All @@ -91,6 +100,22 @@ module.exports = {
(process.env && process.env.HTML_FILE) ||
backwardsCompatibleEnv.HTML_FILE ||
'lib/index.tpl.html'
// resolve the custom GraphQL file. If it is present, copy the file to a
// temporary folder within this project so that it can be bundled and loaded at runtime.
let customPlanGraphQLFile = './planQuery.graphql'
const PLAN_QUERY_RESOURCE_URI =
(process.env && process.env.PLAN_QUERY_RESOURCE_URI) ||
backwardsCompatibleEnv.PLAN_QUERY_RESOURCE_URI ||
'node_modules/@opentripplanner/core-utils/src/planQuery.graphql'
if (PLAN_QUERY_RESOURCE_URI) {
const splitPath = PLAN_QUERY_RESOURCE_URI.split(path.sep)
customPlanGraphQLFile = `../tmp/${splitPath[splitPath.length - 1]}`
// copy location is relative to root, while js file for app is relative to lib
fs.copySync(
PLAN_QUERY_RESOURCE_URI,
`./tmp/${splitPath[splitPath.length - 1]}`
)
}
const YAML_CONFIG =
(process.env && process.env.YAML_CONFIG) ||
backwardsCompatibleEnv.YAML_CONFIG ||
Expand Down Expand Up @@ -143,6 +168,7 @@ module.exports = {
new webpack.DefinePlugin({
CSS: JSON.stringify(CUSTOM_CSS),
JS_CONFIG: JSON.stringify(customJsFile),
PLAN_QUERY_RESOURCE: JSON.stringify(customPlanGraphQLFile),
// Optionally override the default config files with some other
// files.
YAML_CONFIG: JSON.stringify(YAML_CONFIG)
Expand Down
22 changes: 21 additions & 1 deletion example-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ persistence:
# iconUrl: ''
# href: ''

### These settings are only used for the field trip features.
dateTime:
timeFormat: h:mm a
dateFormat: MM/dd/yyyy

map:
initLat: 45.52
initLon: -122.682
Expand Down Expand Up @@ -266,7 +271,11 @@ modes:
iconName: wheelchair
type: CHECKBOX # Possible options: CHECKBOX, SUBMODE, SLIDER, DROPDOWN
transitModes:
- mode: BUS
# Mode can be a string or an array of strings.
- mode: ["TROLLEYBUS", "BUS"]
# When mode is an array an overrideMode must be provided.
# This specifies the displayed mode used for icon and URL param.
overrideMode: BUS
label: Bus
# A mode color can be added, used throughout the application,
# most notably in the enhanced stop viewer bubble
Expand Down Expand Up @@ -414,6 +423,8 @@ itinerary:
displayA11yError: false
# Whether to display itinerary info in the side of the preview or next to the departure times
showInlineItinerarySummary: false
# Whether to sync the sort type with the depart/arrive time in the date/time modal
syncSortWithDepartArrive: true
# The sort option to use by default
# Available sort options: 'BEST', 'DURATION', 'ARRIVALTIME', 'WALKTIME', 'COST', 'DEPARTURETIME'
# defaultSort: "BEST" # Default
Expand All @@ -429,6 +440,11 @@ itinerary:
# - 'DEPARTURETIME'
# In the batch itinerary UI, this setting will always show both departure/arrival times
alwaysShowBothTimes: false
advancedSettingsPanel:
# Show button in advanced panel that allows users to save and return
saveAndReturnButton: true
# Prevent users from selecting a single day for saving trips.
disableSingleItineraryDays: false

# The transitOperators key is a list of transit operators that can be used to
# order transit agencies when sorting by route. Also, this can optionally
Expand Down Expand Up @@ -664,6 +680,8 @@ itinerary:
# maxRealtimeVehicleAge: 60
# # Interval for refreshing vehicle positions
# vehiclePositionRefreshSeconds: 30 # defaults to 30 seconds.
# # Enable this to restrict listing to routes active within the last to next Sunday
# onlyShowCurrentServiceWeek: true

# API key to make Mapillary API calls. These are used to show street imagery.
# Mapillary calls these "Client Tokens". They can be created at https://www.mapillary.com/dashboard/developers
Expand All @@ -680,6 +698,8 @@ itinerary:
# sessionTimeoutSeconds: 180

# nearbyView:
### Setting to use arrival time instead of departure time in the nearby view.
# useArrivalTime: true
### Setting to hide stops with no depatures in the nearby view.
# hideEmptyStops: true
### What radius should the nearby query get results within? (in meters)
Expand Down
36 changes: 30 additions & 6 deletions i18n/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,11 @@ common:
submitting: Submitting…
"yes": "Yes"
itineraryDescriptions:
calories: "{calories, number} Cal"
fareUnknown: No fare information
noItineraryToDisplay: No itinerary to display.
relativeCo2: |
{co2} {isMore, select, true {more} other {less} } CO₂ than driving alone
timeStartEnd: "{start} – {end}"
transfers: "{transfers, plural, =0 {} one {# transfer} other {# transfers}}"
linkOpensNewWindow: (Opens new window)
modes:
bicycle_rent: Bikeshare
Expand Down Expand Up @@ -154,7 +152,6 @@ common:
enterStartLocation: Enter start location or {mapAction} on map…
tap: tap
time:
departureArrivalTimes: "{startTime, time, short}—{endTime, time, short}"
duration:
aFewSeconds: a few seconds
nDays: "{days, plural, =1 {one day} other {# days}}"
Expand Down Expand Up @@ -196,8 +193,15 @@ components:
BatchRoutingPanel:
shortTitle: Plan Trip
BatchSearchScreen:
advancedHeader: Advanced Preferences
header: Plan Your Trip
modeOptions: Mode Options
modeSelectorLabel: Select a travel mode
moreOptions: More options
saveAndReturn: Save and return
saved: Saved
submodeSelectorLabel: Select travel modes and submodes
tripOptions: Trip Options
BatchSettings:
destination: destination
invalidModeSelection: >-
Expand All @@ -215,6 +219,20 @@ components:
advancedOptions: Advanced options
groupSize: "Group size:"
intermediateDestination: Enter intermediate destination
CompanionsPane:
addNewCompanion: Add a new travel companion
companionAlreadyAdded: You already have a companion with email {email}
companionExplanation: >
Invite an exiting G-MAP user to be a travel companion by entering their
email. When they accept, their status will change to "verified", and you
can share your trip status and plan trips based on one another's mobility
profile.
confirmDeleteCompanion: Do you want to delete companion {email}?
currentCompanionsLabel: "Current travel companions:"
deleteCompanion: Delete {email}
noCompanions: You do not have any existing travel companions.
submitNewCompanion: Send invitation
title: Travel companions
DateTimeOptions:
arriveBy: Arrive by
departAt: Depart at
Expand Down Expand Up @@ -262,7 +280,6 @@ components:
ariaLabel: Form navigation
ItinerarySummary:
itineraryDetails: Itinerary details
minMaxFare: "{minTotalFare} - {maxTotalFare}"
LocationSearch:
enterLocation: Enter location
setDestination: Set Destination
Expand Down Expand Up @@ -357,6 +374,7 @@ components:
distanceAway: "{localizedDistanceString} away"
error: An error occurred loading nearby amenities.
header: Nearby View
headsign: "{destination}"
nearbyListIntro: List of {count} nearby entities.
nothingNearby: There are no places nearby.
spacesAvailable: "{spacesAvailable} empty spaces available"
Expand Down Expand Up @@ -417,7 +435,6 @@ components:
changeNumber: Change number
invalidCode: Please enter 6 digits for the validation code.
invalidPhone: Please enter a valid phone number.
pending: Pending
phoneNumberSubmitted: Phone number {phoneNumber} was successfully submitted.
phoneNumberVerified: Phone number {phoneNumber} was successfully verified.
placeholder: Enter your phone number
Expand All @@ -433,7 +450,6 @@ components:
Please check the SMS messaging app on your mobile phone for a text message
with a verification code, and enter the code below (code expires after 10
minutes).
verified: Verified
verify: Verify
verifySms: >-
Please complete the verification process in order to set up SMS
Expand Down Expand Up @@ -511,6 +527,7 @@ components:
deleteSavedTrip: Delete saved trip
editSavedTrip: Edit saved trip
saveNewTrip: Save new trip
travelCompanions: Travel companions
tripInformation: Trip information
tripNotFound: Trip not found
tripNotFoundDescription: Sorry, the requested trip was not found.
Expand All @@ -526,6 +543,7 @@ components:
SavedTripScreen:
itineraryLoaded: Itinerary loaded
itineraryLoading: Loading itinerary
selectAtLeastOneDay: Please select at least one day to monitor.
tooManyTrips: >
You already have reached the maximum of five saved trips. Please remove
unused trips from your saved trips, and try again.
Expand All @@ -543,6 +561,10 @@ components:
usingRealtimeInfo: This trip uses real-time traffic and delay information
StackedPaneDisplay:
savePreferences: Save preferences
StatusBadge:
invalid: Invalid
pending: Pending
verified: Verified
StopScheduleTable:
block: Block
departure: Departure
Expand Down Expand Up @@ -623,6 +645,8 @@ components:
oneHour: 1 hour
realtimeAlertFlagged: There is a realtime alert flagged on my journey
timeBefore: "{time} before"
TripPreviewLayout:
previewTrip: Preview Trip
TripStatus:
alerts: "{alerts, plural, one {# alert!} other {# alerts!}}"
deleteTrip: Delete Trip
Expand Down
6 changes: 4 additions & 2 deletions i18n/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ components:
changeNumber: Cambiar número de teléfono
invalidCode: Introduzca 6 dígitos para el código de validación.
invalidPhone: Por favor, introduzca un número de teléfono válido.
pending: Pendiente
phoneNumberSubmitted: El número de teléfono {phoneNumber} se ha enviado correctamente.
phoneNumberVerified: El número de teléfono {phoneNumber} se ha verificado correctamente.
placeholder: Introduzca su número de teléfono
Expand All @@ -448,7 +447,6 @@ components:
teléfono móvil si hay un mensaje de texto con un código de verificación, e
introduzca el código que aparece a continuación. El código caduca a los 10
minutos.
verified: Verificado
verify: Verificar
verifySms: >-
Por favor, complete el proceso de verificación para configurar las
Expand Down Expand Up @@ -561,6 +559,10 @@ components:
usingRealtimeInfo: Este viaje utiliza información de tráfico y retrasos en tiempo real
StackedPaneDisplay:
savePreferences: Guardar preferencias
StatusBadge:
invalid: Inválido
pending: Pendiente
verified: Verificado
StopScheduleTable:
block: Bloquear
departure: Salida
Expand Down
Loading

0 comments on commit a995658

Please sign in to comment.