From 48ec25d7bae419901eee144e386639e447241a88 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Wed, 14 Aug 2024 16:30:38 +0200 Subject: [PATCH 01/17] hide plan button when field trip is active --- lib/components/app/call-taker-panel.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/components/app/call-taker-panel.js b/lib/components/app/call-taker-panel.js index 61fc68105..360103fa0 100644 --- a/lib/components/app/call-taker-panel.js +++ b/lib/components/app/call-taker-panel.js @@ -153,10 +153,12 @@ class CallTakerPanel extends Component { } } + // eslint-disable-next-line complexity render() { const { activeSearch, currentQuery, + fieldTripVisible, groupSize, intl, mainPanelContent, @@ -267,15 +269,17 @@ class CallTakerPanel extends Component { />
- + {!fieldTripVisible && ( + + )}
{groupSize !== null && maxGroupSize && ( From 2eddfde6a4ce1bc748b629d54ce063006d7136c8 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Wed, 14 Aug 2024 16:30:56 +0200 Subject: [PATCH 02/17] ask before wiping away user from/to updates --- lib/actions/field-trip.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/actions/field-trip.js b/lib/actions/field-trip.js index 9c2b771dd..c9f085e52 100644 --- a/lib/actions/field-trip.js +++ b/lib/actions/field-trip.js @@ -494,7 +494,7 @@ export function saveRequestTripItineraries(request, outbound, intl) { */ function prepareQueryParams(request, outbound) { return async function (dispatch, getState) { - const { config } = getState().otp + const { config, currentQuery } = getState().otp const { modules, transitOperators } = config const fieldTripOptions = modules?.find((m) => m.id === 'ft')?.options @@ -533,7 +533,11 @@ function prepareQueryParams(request, outbound) { agencies: bannedAgencies } } - const locations = await planParamsToQueryAsync(locationsToGeocode, config) + const hasExistingLocations = currentQuery.from || currentQuery.to + const locations = + !hasExistingLocations || window.confirm('Overwrite existing locations?') + ? await planParamsToQueryAsync(locationsToGeocode, config) + : { from: currentQuery.from, to: currentQuery.to } return dispatch(setQueryParam({ ...locations, ...queryParams })) } } From 8e9ad51bb15d346b7833a23bee956963d0826c4f Mon Sep 17 00:00:00 2001 From: Daniel Heppner Date: Wed, 21 Aug 2024 15:32:04 -0700 Subject: [PATCH 03/17] i18n: remove extra dollar signs from trip start time --- i18n/en-US.yml | 4 ++-- i18n/es.yml | 6 ++---- i18n/fr.yml | 4 ++-- i18n/ko.yml | 4 ++-- i18n/ru.yml | 4 ++-- i18n/tl.yml | 4 ++-- i18n/vi.yml | 4 ++-- i18n/zh_Hans.yml | 4 ++-- i18n/zh_Hant.yml | 4 ++-- 9 files changed, 18 insertions(+), 20 deletions(-) diff --git a/i18n/en-US.yml b/i18n/en-US.yml index bc9e6e513..04717ba5e 100644 --- a/i18n/en-US.yml +++ b/i18n/en-US.yml @@ -674,8 +674,8 @@ components: tripBegins: >- Trip is due to begin at {tripStart, time, short}. (Realtime monitoring will begin at {monitoringStart, time, short}.) - tripStartIsDelayed: Trip start time is delayed ${duration}! - tripStartIsEarly: Trip start time is happening ${duration} earlier than expected! + tripStartIsDelayed: Trip start time is delayed {duration}! + tripStartIsEarly: Trip start time is happening {duration} earlier than expected! tripStartsSoonNoUpdates: Trip is starting soon (no realtime updates available). tripStartsSoonOnTime: Trip is starting soon and is about on time. TripSummary: diff --git a/i18n/es.yml b/i18n/es.yml index 930a2bd9d..2a25daa1a 100644 --- a/i18n/es.yml +++ b/i18n/es.yml @@ -693,10 +693,8 @@ components: tripBegins: >- El viaje debe comenzar a las {tripStart, time, short}. (El seguimiento en tiempo real comenzará a las {monitoringStart, time, short}.) - tripStartIsDelayed: ¡La hora de inicio del viaje se retrasa ${duration}! - tripStartIsEarly: >- - ¡La hora de inicio del viaje se produce ${duration} antes de lo - previsto! + tripStartIsDelayed: ¡La hora de inicio del viaje se retrasa {duration}! + tripStartIsEarly: ¡La hora de inicio del viaje se produce {duration} antes de lo previsto! tripStartsSoonNoUpdates: >- El viaje comienza pronto (no hay actualizaciones disponibles en tiempo real). diff --git a/i18n/fr.yml b/i18n/fr.yml index 4ec02b1e4..b38066665 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -708,8 +708,8 @@ components: tripBegins: >- Départ prévu à {tripStart, time, short}. (Le suivi en temps réel débutera à {monitoringStart, time, short}.) - tripStartIsDelayed: Départ retardé de ${duration}. - tripStartIsEarly: Départ avancé de ${duration} ! + tripStartIsDelayed: Départ retardé de {duration}. + tripStartIsEarly: Départ avancé de {duration} ! tripStartsSoonNoUpdates: Départ proche (pas de données en temps réel). tripStartsSoonOnTime: Départ proche et prévu à l'heure. TripSummary: diff --git a/i18n/ko.yml b/i18n/ko.yml index e83ad24a5..e333e7e62 100644 --- a/i18n/ko.yml +++ b/i18n/ko.yml @@ -582,8 +582,8 @@ components: tripBegins: >- 트립이 {tripStart, time, short}에 시작될 것으로 예정되어 있습니다. (실시간 모니터링은 {monitoringStart, time, short}에 시작됩니다.) - tripStartIsDelayed: 트립 시작 시간이 ${duration} 지연됩니다! - tripStartIsEarly: 트립이 예상보다 ${duration} 일찍 시작됩니다! + tripStartIsDelayed: 트립 시작 시간이 {duration} 지연됩니다! + tripStartIsEarly: 트립이 예상보다 {duration} 일찍 시작됩니다! tripStartsSoonNoUpdates: 트립이 곧 시작됩니다 (실시간 업데이트를 사용할 수 없습니다). tripStartsSoonOnTime: 트립은 곧 정시에 시작됩니다. TripSummary: diff --git a/i18n/ru.yml b/i18n/ru.yml index 6fefb7846..b7a2eedd4 100644 --- a/i18n/ru.yml +++ b/i18n/ru.yml @@ -642,8 +642,8 @@ components: tripBegins: >- Поездка должна начаться в {tripStart, time, short}. (Отслеживание в реальном времени запустится в {monitoringStart, time, short}.) - tripStartIsDelayed: Начало поездки откладывается на ${duration}! - tripStartIsEarly: Начало поездки произойдет на ${duration} раньше ожидаемого! + tripStartIsDelayed: Начало поездки откладывается на {duration}! + tripStartIsEarly: Начало поездки произойдет на {duration} раньше ожидаемого! tripStartsSoonNoUpdates: Поездка скоро начнется (обновления в реальном времени недоступны). tripStartsSoonOnTime: Поездка скоро начнется. Без задержек. TripSummary: diff --git a/i18n/tl.yml b/i18n/tl.yml index 363b5d212..d1e65084a 100644 --- a/i18n/tl.yml +++ b/i18n/tl.yml @@ -658,8 +658,8 @@ components: tripBegins: >- Magsisimula ang biyahe nang {tripStart, time, short}. (Magsisimula ang realtime na pagsubaybay nang {monitoringStart, time, short}.) - tripStartIsDelayed: Naantala ang oras ng pagsisimula ng biyahe nang ${duration}! - tripStartIsEarly: Nagsisimula na ang biyahe ${duration} na mas maaga kaysa sa inaasahan! + tripStartIsDelayed: Naantala ang oras ng pagsisimula ng biyahe nang {duration}! + tripStartIsEarly: Nagsisimula na ang biyahe {duration} na mas maaga kaysa sa inaasahan! tripStartsSoonNoUpdates: >- Malapit nang magsimula ang biyahe (walang realtime na update na available). diff --git a/i18n/vi.yml b/i18n/vi.yml index 28e814180..719ee0898 100644 --- a/i18n/vi.yml +++ b/i18n/vi.yml @@ -647,9 +647,9 @@ components: tripBegins: >- Chuyến đi sẽ bắt đầu lúc {tripStart, time, short}. (Việc theo dõi thời gian thực sẽ bắt đầu lúc {monitoringStart, time, short}.) - tripStartIsDelayed: Thời gian bắt đầu chuyến đi bị trì hoãn ${duration}! + tripStartIsDelayed: Thời gian bắt đầu chuyến đi bị trì hoãn {duration}! tripStartIsEarly: >- - Thời gian bắt đầu chuyến đi đang diễn ra sớm hơn ${duration} so với dự + Thời gian bắt đầu chuyến đi đang diễn ra sớm hơn {duration} so với dự kiến! tripStartsSoonNoUpdates: Chuyến đi đang bắt đầu sớm (không có cập nhật về thời gian thực). tripStartsSoonOnTime: Chuyến đi đang bắt đầu sớm và sắp đúng giờ. diff --git a/i18n/zh_Hans.yml b/i18n/zh_Hans.yml index e065ded22..47464fc2c 100644 --- a/i18n/zh_Hans.yml +++ b/i18n/zh_Hans.yml @@ -579,8 +579,8 @@ components: tripBegins: >- 您的行程将于 {tripStart, time, short} 开始. (实时跟踪将于{monitoringStart, time, short}开始.) - tripStartIsDelayed: 行程开始时间延迟 ${duration}! - tripStartIsEarly: 开始时间比预期早 ${duration}! + tripStartIsDelayed: 行程开始时间延迟 {duration}! + tripStartIsEarly: 开始时间比预期早 {duration}! tripStartsSoonNoUpdates: 行程即将开始 (没有实时更新). tripStartsSoonOnTime: 行程即将开始而且大约是准时的. TripSummary: diff --git a/i18n/zh_Hant.yml b/i18n/zh_Hant.yml index eb4307f2d..e625d04c7 100644 --- a/i18n/zh_Hant.yml +++ b/i18n/zh_Hant.yml @@ -566,8 +566,8 @@ components: tripBegins: >- 行程預計在{tripStart, time, short}開始。(即時監控將在{monitoringStart, time, short}開始。) - tripStartIsDelayed: 行程開始時間延誤${duration}! - tripStartIsEarly: 行程開始時間比預期提早${duration}! + tripStartIsDelayed: 行程開始時間延誤{duration}! + tripStartIsEarly: 行程開始時間比預期提早{duration}! tripStartsSoonNoUpdates: 行程即將開始 (沒有可用的即時更新)。 tripStartsSoonOnTime: 行程即將開始且大約準時。 TripSummary: From 5ca534baa1bd43b0837decd3d8e9897bc216237d Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Fri, 23 Aug 2024 12:06:33 -0400 Subject: [PATCH 04/17] fix field trip company filling --- lib/components/narrative/default/itinerary-summary.js | 4 +++- lib/components/narrative/default/itinerary.css | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/components/narrative/default/itinerary-summary.js b/lib/components/narrative/default/itinerary-summary.js index 94fdade6f..5ff8dcc8f 100644 --- a/lib/components/narrative/default/itinerary-summary.js +++ b/lib/components/narrative/default/itinerary-summary.js @@ -118,7 +118,9 @@ export default class ItinerarySummary extends Component { } blocks.push( .header .title > .summary > .mode-block { height: 18px; width: 18px; +} +.otp + .option.default-itin + > .header + .title + > .summary + > .mode-block.non-company { color: #eee; fill: #eee; } From 1d759e7931e94e7e56c759a00e0f5fa5ed0d4dae Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Fri, 23 Aug 2024 12:20:44 -0400 Subject: [PATCH 05/17] show walk icon when showing walk time --- lib/components/narrative/default/default-itinerary.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/components/narrative/default/default-itinerary.js b/lib/components/narrative/default/default-itinerary.js index 77d9f6f8a..48f31aec6 100644 --- a/lib/components/narrative/default/default-itinerary.js +++ b/lib/components/narrative/default/default-itinerary.js @@ -166,7 +166,7 @@ const ITINERARY_ATTRIBUTES = [ includeSeconds={false} /> - + ) From 12d9b841a1d2c193eff2a07c9bf9642e886f1a38 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Mon, 26 Aug 2024 11:09:27 -0400 Subject: [PATCH 06/17] add new `alwaysShowBothTimes` option for batch ui --- example-config.yml | 2 ++ i18n/en-US.yml | 1 + i18n/fr.yml | 1 + .../narrative/default/default-itinerary.js | 14 ++++++++++++++ lib/util/config-types.ts | 1 + 5 files changed, 19 insertions(+) diff --git a/example-config.yml b/example-config.yml index 77caef21f..d132b835e 100644 --- a/example-config.yml +++ b/example-config.yml @@ -424,6 +424,8 @@ itinerary: # - 'WALKTIME' # - 'COST' # - 'DEPARTURETIME' + # In the batch itinerary UI, this setting will always show both departure/arrival times + alwaysShowBothTimes: 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 diff --git a/i18n/en-US.yml b/i18n/en-US.yml index bc9e6e513..ac3b70560 100644 --- a/i18n/en-US.yml +++ b/i18n/en-US.yml @@ -114,6 +114,7 @@ common: 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: diff --git a/i18n/fr.yml b/i18n/fr.yml index 4ec02b1e4..b73d85402 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -123,6 +123,7 @@ common: noItineraryToDisplay: Aucun trajet à afficher. relativeCo2: | {co2} de CO₂ en {isMore, select, true {plus} other {moins} } qu'en voiture + timeStartEnd: "{start} – {end}" transfers: >- {transfers, plural, =0 {} one {# correspondance} other {# correspondances}} diff --git a/lib/components/narrative/default/default-itinerary.js b/lib/components/narrative/default/default-itinerary.js index 77d9f6f8a..0edc73fb5 100644 --- a/lib/components/narrative/default/default-itinerary.js +++ b/lib/components/narrative/default/default-itinerary.js @@ -95,6 +95,17 @@ const ITINERARY_ATTRIBUTES = [ id: 'arrivalTime', order: 1, render: (itinerary, options) => { + if (options.alwaysShowBothTimes) { + return ( + , + start: + }} + /> + ) + } if (options.selection === 'ARRIVALTIME') { return } @@ -250,6 +261,7 @@ class DefaultItinerary extends NarrativeItinerary { render() { const { accessibilityScoreGradationMap, + alwaysShowBothTimes, co2Config, configCosts, defaultFareType, @@ -287,6 +299,7 @@ class DefaultItinerary extends NarrativeItinerary { } const itineraryAttributeOptions = { + alwaysShowBothTimes, co2Config, configCosts, LegIcon @@ -402,6 +415,7 @@ const mapStateToProps = (state, ownProps) => { return { accessibilityScoreGradationMap: state.otp.config.accessibilityScore?.gradationMap, + alwaysShowBothTimes: state.otp.config.itinerary?.alwaysShowBothTimes, co2Config: state.otp.config.co2, configCosts: state.otp.config.itinerary?.costs, defaultFareType: state.otp.config.itinerary?.defaultFareType || { diff --git a/lib/util/config-types.ts b/lib/util/config-types.ts index 3995d0ba8..18e27ca37 100644 --- a/lib/util/config-types.ts +++ b/lib/util/config-types.ts @@ -263,6 +263,7 @@ export interface ItineraryCostWeights { export interface ItineraryConfig { allowUserAlertCollapsing?: boolean + alwaysShowBothTimes?: boolean costs?: ItineraryCostConfig customBatchUiBackground?: boolean defaultFareType?: FareProductSelector From 6cf5a6c3bf9575a8b0912ee9422c851f5f13eec6 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Mon, 26 Aug 2024 11:16:28 -0400 Subject: [PATCH 07/17] add dividing calltaker line --- lib/components/admin/query-record.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/components/admin/query-record.js b/lib/components/admin/query-record.js index c061af31a..9d825c987 100644 --- a/lib/components/admin/query-record.js +++ b/lib/components/admin/query-record.js @@ -42,6 +42,7 @@ class QueryRecordLayout extends Component { {params.from.name} to {params.to.name} at {time} +
) } From 2b91ff45c745dac465a961048b80facab6af74fd Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Mon, 26 Aug 2024 11:20:07 -0400 Subject: [PATCH 08/17] fix mailables window height --- lib/components/admin/mailables-window.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/components/admin/mailables-window.js b/lib/components/admin/mailables-window.js index 585515d36..509b6c87b 100644 --- a/lib/components/admin/mailables-window.js +++ b/lib/components/admin/mailables-window.js @@ -157,7 +157,7 @@ class MailablesWindow extends Component { Mailables } - height="300px" + height="400px" onClickClose={toggleMailables} scroll={false} style={{ width: '600px' }} From 6154a4a2392758dc6bcc7019b7155baa8431c7cb Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Mon, 26 Aug 2024 15:02:02 -0500 Subject: [PATCH 09/17] fix(user): Filter out empty queries by mode --- lib/actions/user.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/actions/user.js b/lib/actions/user.js index 17b63d1f7..887fe4e44 100644 --- a/lib/actions/user.js +++ b/lib/actions/user.js @@ -219,7 +219,9 @@ export function fetchTripRequests() { const convertedTrips = trips.data .map(convertRequestToSearch(config)) .filter( - (tripReq) => !isEmpty(tripReq.query) || !!tripReq.otp2QueryParams + (tripReq) => + (!isEmpty(tripReq.query) || !!tripReq.otp2QueryParams) && + tripReq.query.modes ) .reduce(removeDuplicateRequests, []) From 121a00b979c20d22b6dc6d8cf3885cbd6c5126b4 Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:25:02 -0500 Subject: [PATCH 10/17] fix from and to place data to eliminate bracket --- lib/actions/user.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/actions/user.js b/lib/actions/user.js index 887fe4e44..c06108aae 100644 --- a/lib/actions/user.js +++ b/lib/actions/user.js @@ -159,6 +159,11 @@ function convertRequestToSearch(config) { return function (tripRequest) { const { dateCreated, id, otp2QueryParams = {} } = tripRequest const { host, path } = config.api + otp2QueryParams.fromPlace = + otp2QueryParams.fromPlace?.replaceAll('}', '') || null + otp2QueryParams.toPlace = + otp2QueryParams.toPlace?.replaceAll('}', '') || null + console.log(otp2QueryParams) return { canDelete: false, id, From 3b5cfd97214cfa98d1b7feee4511a822c6d7a32c Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Tue, 27 Aug 2024 10:05:03 -0500 Subject: [PATCH 11/17] Revert "fix from and to place data to eliminate bracket" This reverts commit 121a00b979c20d22b6dc6d8cf3885cbd6c5126b4. --- lib/actions/user.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/actions/user.js b/lib/actions/user.js index c06108aae..887fe4e44 100644 --- a/lib/actions/user.js +++ b/lib/actions/user.js @@ -159,11 +159,6 @@ function convertRequestToSearch(config) { return function (tripRequest) { const { dateCreated, id, otp2QueryParams = {} } = tripRequest const { host, path } = config.api - otp2QueryParams.fromPlace = - otp2QueryParams.fromPlace?.replaceAll('}', '') || null - otp2QueryParams.toPlace = - otp2QueryParams.toPlace?.replaceAll('}', '') || null - console.log(otp2QueryParams) return { canDelete: false, id, From 1cd723df05f6293dafc82e2b5577ea52ba749047 Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Thu, 29 Aug 2024 15:23:14 -0500 Subject: [PATCH 12/17] fix(nearby-view): Pass starting config lat lon to nearby --- lib/components/viewers/nearby/nearby-view.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/components/viewers/nearby/nearby-view.tsx b/lib/components/viewers/nearby/nearby-view.tsx index 9f4b24310..64470a0e4 100644 --- a/lib/components/viewers/nearby/nearby-view.tsx +++ b/lib/components/viewers/nearby/nearby-view.tsx @@ -34,6 +34,7 @@ type CurrentPosition = { coords?: { latitude: number; longitude: number } } type Props = { currentPosition?: CurrentPosition + defaultLatLon: LatLonObj displayedCoords?: LatLonObj entityId?: string fetchNearby: (latLon: LatLonObj, radius?: number) => void @@ -73,7 +74,8 @@ const getNearbyItem = (place: any) => { function getNearbyCoordsFromUrlOrLocationOrMapCenter( coordsFromUrl?: LatLonObj, currentPosition?: CurrentPosition, - map?: MapRef + map?: MapRef, + defaultLatLon?: LatLonObj ): LatLonObj | null { if (coordsFromUrl) { return coordsFromUrl @@ -92,11 +94,15 @@ function getNearbyCoordsFromUrlOrLocationOrMapCenter( if (mapCoords) { return mapCoords } + if (defaultLatLon) { + return defaultLatLon + } return null } function NearbyView({ currentPosition, + defaultLatLon, displayedCoords, entityId, fetchNearby, @@ -119,7 +125,8 @@ function NearbyView({ getNearbyCoordsFromUrlOrLocationOrMapCenter( nearbyViewCoords, currentPosition, - map + map, + defaultLatLon ), [nearbyViewCoords, currentPosition, map] ) @@ -283,12 +290,15 @@ function NearbyView({ const mapStateToProps = (state: AppReduxState) => { const { config, location, transitIndex, ui } = state.otp + const { initLat, initLon } = state.otp.config.map const { nearbyViewCoords } = ui const { nearby } = transitIndex const { entityId } = state.router.location.query const { currentPosition } = location + const defaultLatLon = { lat: initLat || 0, lon: initLon || 0 } return { currentPosition, + defaultLatLon, displayedCoords: nearby?.coords, entityId: entityId && decodeURIComponent(entityId), homeTimezone: config.homeTimezone, From 1e1f9fcde12ba69eff03b1cbf2055fa276b9fc1b Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Thu, 29 Aug 2024 15:44:33 -0500 Subject: [PATCH 13/17] Account for empty map config --- lib/components/viewers/nearby/nearby-view.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/components/viewers/nearby/nearby-view.tsx b/lib/components/viewers/nearby/nearby-view.tsx index 64470a0e4..1fffdffdd 100644 --- a/lib/components/viewers/nearby/nearby-view.tsx +++ b/lib/components/viewers/nearby/nearby-view.tsx @@ -290,12 +290,12 @@ function NearbyView({ const mapStateToProps = (state: AppReduxState) => { const { config, location, transitIndex, ui } = state.otp - const { initLat, initLon } = state.otp.config.map + const { map } = state.otp.config const { nearbyViewCoords } = ui const { nearby } = transitIndex const { entityId } = state.router.location.query const { currentPosition } = location - const defaultLatLon = { lat: initLat || 0, lon: initLon || 0 } + const defaultLatLon = { lat: map?.initLat || 0, lon: map?.initLon || 0 } return { currentPosition, defaultLatLon, From 53a7cb35ff24b0982c02459defd488ed11e49179 Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Thu, 29 Aug 2024 16:49:50 -0500 Subject: [PATCH 14/17] fix typing & tests --- .../components/viewers/__snapshots__/nearby-view.js.snap | 2 ++ lib/components/viewers/nearby/nearby-view.tsx | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/__tests__/components/viewers/__snapshots__/nearby-view.js.snap b/__tests__/components/viewers/__snapshots__/nearby-view.js.snap index b20164dd6..48064f0f4 100644 --- a/__tests__/components/viewers/__snapshots__/nearby-view.js.snap +++ b/__tests__/components/viewers/__snapshots__/nearby-view.js.snap @@ -31,6 +31,7 @@ exports[`components > viewers > nearby view renders nothing on a blank page 1`] "fetching": false, } } + defaultLatLon={null} fetchNearby={[Function]} homeTimezone="America/Los_Angeles" nearby={Array []} @@ -146,6 +147,7 @@ exports[`components > viewers > nearby view renders proper scooter dates 1`] = ` "fetching": false, } } + defaultLatLon={null} fetchNearby={[Function]} homeTimezone="America/Los_Angeles" nearby={ diff --git a/lib/components/viewers/nearby/nearby-view.tsx b/lib/components/viewers/nearby/nearby-view.tsx index 1fffdffdd..653f3716a 100644 --- a/lib/components/viewers/nearby/nearby-view.tsx +++ b/lib/components/viewers/nearby/nearby-view.tsx @@ -34,7 +34,7 @@ type CurrentPosition = { coords?: { latitude: number; longitude: number } } type Props = { currentPosition?: CurrentPosition - defaultLatLon: LatLonObj + defaultLatLon: LatLonObj | null displayedCoords?: LatLonObj entityId?: string fetchNearby: (latLon: LatLonObj, radius?: number) => void @@ -75,7 +75,7 @@ function getNearbyCoordsFromUrlOrLocationOrMapCenter( coordsFromUrl?: LatLonObj, currentPosition?: CurrentPosition, map?: MapRef, - defaultLatLon?: LatLonObj + defaultLatLon?: LatLonObj | null ): LatLonObj | null { if (coordsFromUrl) { return coordsFromUrl @@ -295,7 +295,8 @@ const mapStateToProps = (state: AppReduxState) => { const { nearby } = transitIndex const { entityId } = state.router.location.query const { currentPosition } = location - const defaultLatLon = { lat: map?.initLat || 0, lon: map?.initLon || 0 } + const defaultLatLon = + map?.initLat && map?.initLon ? { lat: map.initLat, lon: map.initLon } : null return { currentPosition, defaultLatLon, From bfd9de188a6fd05b55819d85c286999ef0e5f686 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:38:06 +0000 Subject: [PATCH 15/17] chore(deps): bump dset from 3.1.3 to 3.1.4 Bumps [dset](https://github.com/lukeed/dset) from 3.1.3 to 3.1.4. - [Release notes](https://github.com/lukeed/dset/releases) - [Commits](https://github.com/lukeed/dset/compare/v3.1.3...v3.1.4) --- updated-dependencies: - dependency-name: dset dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 652b8cc0a..272d4c50c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7337,9 +7337,9 @@ dotenv@8.2.0: integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw== dset@^3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.3.tgz#c194147f159841148e8e34ca41f638556d9542d2" - integrity sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ== + version "3.1.4" + resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.4.tgz#f8eaf5f023f068a036d08cd07dc9ffb7d0065248" + integrity sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA== duplexer2@~0.1.0, duplexer2@~0.1.4: version "0.1.4" From d5cb624d99301fa88035a0104348938fd7c76b38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:44:56 +0000 Subject: [PATCH 16/17] chore(deps-dev): bump express from 4.19.2 to 4.20.0 Bumps [express](https://github.com/expressjs/express) from 4.19.2 to 4.20.0. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.19.2...4.20.0) --- updated-dependencies: - dependency-name: express dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 89 +++++++++++++++++++++++++++++++++++----------------- 2 files changed, 61 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 109ae8d1f..8c3c622fd 100644 --- a/package.json +++ b/package.json @@ -181,7 +181,7 @@ "eslint-plugin-sort-keys-fix": "^1.1.1", "eslint-plugin-typescript-sort-keys": "^1.8.0", "execa": "^5.1.1", - "express": "^4.19.2", + "express": "^4.20.0", "har-express": "^1.1.0", "husky": "^6.0.0", "jest-transform-stub": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index 272d4c50c..0951bfcae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5163,10 +5163,10 @@ bn.js@^5.0.0, bn.js@^5.2.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -body-parser@1.20.2: - version "1.20.2" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" - integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== +body-parser@1.20.3: + version "1.20.3" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.3.tgz#1953431221c6fb5cd63c4b36d53fab0928e548c6" + integrity sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g== dependencies: bytes "3.1.2" content-type "~1.0.5" @@ -5176,7 +5176,7 @@ body-parser@1.20.2: http-errors "2.0.0" iconv-lite "0.4.24" on-finished "2.4.1" - qs "6.11.0" + qs "6.13.0" raw-body "2.5.2" type-is "~1.6.18" unpipe "1.0.0" @@ -7449,6 +7449,11 @@ encodeurl@~1.0.2: resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= +encodeurl@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58" + integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== + encoding@^0.1.11, encoding@^0.1.12: version "0.1.13" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" @@ -8298,37 +8303,37 @@ expect@^27.1.0: jest-message-util "^27.1.0" jest-regex-util "^27.0.6" -express@^4.17.1, express@^4.19.2: - version "4.19.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.19.2.tgz#e25437827a3aa7f2a827bc8171bbbb664a356465" - integrity sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q== +express@^4.17.1, express@^4.20.0: + version "4.20.0" + resolved "https://registry.yarnpkg.com/express/-/express-4.20.0.tgz#f1d08e591fcec770c07be4767af8eb9bcfd67c48" + integrity sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.2" + body-parser "1.20.3" content-disposition "0.5.4" content-type "~1.0.4" cookie "0.6.0" cookie-signature "1.0.6" debug "2.6.9" depd "2.0.0" - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" etag "~1.8.1" finalhandler "1.2.0" fresh "0.5.2" http-errors "2.0.0" - merge-descriptors "1.0.1" + merge-descriptors "1.0.3" methods "~1.1.2" on-finished "2.4.1" parseurl "~1.3.3" - path-to-regexp "0.1.7" + path-to-regexp "0.1.10" proxy-addr "~2.0.7" qs "6.11.0" range-parser "~1.2.1" safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" + send "0.19.0" + serve-static "1.16.0" setprototypeof "1.2.0" statuses "2.0.1" type-is "~1.6.18" @@ -12394,10 +12399,10 @@ meow@^8.0.0: type-fest "^0.18.0" yargs-parser "^20.2.3" -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= +merge-descriptors@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.3.tgz#d80319a65f3c7935351e5cfdac8f9318504dbed5" + integrity sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ== merge-source-map@1.0.4: version "1.0.4" @@ -13765,10 +13770,10 @@ path-parse@^1.0.6, path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= +path-to-regexp@0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" + integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== path-to-regexp@2.2.1: version "2.2.1" @@ -14946,13 +14951,20 @@ qrcode-terminal@^0.12.0: resolved "https://registry.yarnpkg.com/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz#bb5b699ef7f9f0505092a3748be4464fe71b5819" integrity sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ== -qs@6.11.0, qs@^6.10.3, qs@^6.3.0, qs@^6.5.1, qs@^6.9.1: +qs@6.11.0: version "6.11.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== dependencies: side-channel "^1.0.4" +qs@6.13.0, qs@^6.10.3, qs@^6.3.0, qs@^6.5.1, qs@^6.9.1: + version "6.13.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906" + integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg== + dependencies: + side-channel "^1.0.6" + qs@~6.5.2: version "6.5.3" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" @@ -16428,6 +16440,25 @@ send@0.18.0: range-parser "~1.2.1" statuses "2.0.1" +send@0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8" + integrity sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw== + dependencies: + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "2.0.0" + mime "1.6.0" + ms "2.1.3" + on-finished "2.4.1" + range-parser "~1.2.1" + statuses "2.0.1" + serialize-javascript@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" @@ -16474,10 +16505,10 @@ serve-index@^1.9.1: mime-types "~2.1.17" parseurl "~1.3.2" -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== +serve-static@1.16.0: + version "1.16.0" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.16.0.tgz#2bf4ed49f8af311b519c46f272bf6ac3baf38a92" + integrity sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA== dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" @@ -16602,7 +16633,7 @@ shellwords@^0.1.1: resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== -side-channel@^1.0.4: +side-channel@^1.0.4, side-channel@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== From 915f147d60df16d690a153f6571fb4ea08b26968 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:55:14 +0000 Subject: [PATCH 17/17] chore(deps): bump elliptic from 6.5.4 to 6.5.7 Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.4 to 6.5.7. - [Commits](https://github.com/indutny/elliptic/compare/v6.5.4...v6.5.7) --- updated-dependencies: - dependency-name: elliptic dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0951bfcae..44a964276 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7397,9 +7397,9 @@ electron-to-chromium@^1.3.564, electron-to-chromium@^1.3.811: integrity sha512-bpLc4QU4B8PYmdO4MSu2ZBTMD8lAaEXRS43C09lB31BvYwuk9UxgBRXbY5OJBw7VuMGcg2MZG5FyTaP9u4PQnw== elliptic@^6.5.3, elliptic@^6.5.4: - version "6.5.4" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + version "6.5.7" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.7.tgz#8ec4da2cb2939926a1b9a73619d768207e647c8b" + integrity sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q== dependencies: bn.js "^4.11.9" brorand "^1.1.0"