From fb610b7322baec702b9d886af5872ebd19c6cef0 Mon Sep 17 00:00:00 2001 From: josh-willis-arcadis <168561922+josh-willis-arcadis@users.noreply.github.com> Date: Thu, 22 Aug 2024 14:09:24 -0500 Subject: [PATCH 01/16] feat(advanced-settings-panel): turn off mode if all submode settings are false --- .../form/advanced-settings-panel.tsx | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/components/form/advanced-settings-panel.tsx b/lib/components/form/advanced-settings-panel.tsx index a76b3f85d..ad29c7b94 100644 --- a/lib/components/form/advanced-settings-panel.tsx +++ b/lib/components/form/advanced-settings-panel.tsx @@ -168,13 +168,34 @@ const AdvancedSettingsPanel = ({ ) const processedModeSettings = processSettings(modeSettingDefinitions) + + const checkAllSubsettingsFalse = (modeButton: ModeButtonDefinition) => { + if (modeButton.modeSettings && modeButton.modeSettings.length > 0) { + const transportModeSettings = modeButton.modeSettings.filter( + (setting: ModeSetting) => + // this checks if the setting is a transport mode + (setting.type === 'CHECKBOX' || setting.type === 'SUBMODE') && + setting.addTransportMode + ) + if (transportModeSettings.length === 0) return modeButton + + console.log('transportModeSettings::::::', transportModeSettings) + const allFalse = transportModeSettings.every((setting) => !setting.value) + return { ...modeButton, enabled: modeButton.enabled && !allFalse } + } + + return modeButton + } + const processedModeButtons = modeButtonOptions.map( pipe( addModeButtonIcon(ModeIcon), addSettingsToButton(processedModeSettings), - setModeButtonEnabled(enabledModeButtons) + setModeButtonEnabled(enabledModeButtons), + checkAllSubsettingsFalse ) ) + console.log('processedModeButtons::::::', processedModeButtons) return ( From e593dea94f1c370d551f8f426e186488bbb32a04 Mon Sep 17 00:00:00 2001 From: josh-willis-arcadis <168561922+josh-willis-arcadis@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:05:47 -0500 Subject: [PATCH 02/16] fix(advanced-settings-panel): stop infinite loops on rerender --- .../form/advanced-settings-panel.tsx | 73 +++++++++++++------ 1 file changed, 49 insertions(+), 24 deletions(-) diff --git a/lib/components/form/advanced-settings-panel.tsx b/lib/components/form/advanced-settings-panel.tsx index ad29c7b94..79c4057a5 100644 --- a/lib/components/form/advanced-settings-panel.tsx +++ b/lib/components/form/advanced-settings-panel.tsx @@ -15,7 +15,7 @@ import { ModeSetting, ModeSettingValues } from '@opentripplanner/types' -import React, { RefObject, useContext, useState } from 'react' +import React, { RefObject, useContext, useEffect, useState } from 'react' import styled from 'styled-components' import * as formActions from '../../actions/form' @@ -168,35 +168,59 @@ const AdvancedSettingsPanel = ({ ) const processedModeSettings = processSettings(modeSettingDefinitions) + // console.log('processedModeSettings::::', processedModeSettings) - const checkAllSubsettingsFalse = (modeButton: ModeButtonDefinition) => { - if (modeButton.modeSettings && modeButton.modeSettings.length > 0) { - const transportModeSettings = modeButton.modeSettings.filter( - (setting: ModeSetting) => - // this checks if the setting is a transport mode - (setting.type === 'CHECKBOX' || setting.type === 'SUBMODE') && - setting.addTransportMode - ) - if (transportModeSettings.length === 0) return modeButton - - console.log('transportModeSettings::::::', transportModeSettings) - const allFalse = transportModeSettings.every((setting) => !setting.value) - return { ...modeButton, enabled: modeButton.enabled && !allFalse } - } - - return modeButton - } + const handleModeButtonToggle = setModeButton( + enabledModeButtons, + onSettingsUpdate(setQueryParam) + ) const processedModeButtons = modeButtonOptions.map( pipe( addModeButtonIcon(ModeIcon), addSettingsToButton(processedModeSettings), - setModeButtonEnabled(enabledModeButtons), - checkAllSubsettingsFalse + setModeButtonEnabled(enabledModeButtons) ) ) console.log('processedModeButtons::::::', processedModeButtons) + useEffect(() => { + console.log('processedModeButtons CHANGED!!! ::::::', processedModeButtons) + const checkTransportModeSubsettings = ( + modeButton: ModeButtonDefinition + ) => { + if ( + modeButton.enabled && + modeButton.modeSettings && + modeButton.modeSettings.length > 0 + ) { + const transportModeSettings = modeButton.modeSettings.filter( + (setting: ModeSetting) => + (setting.type === 'CHECKBOX' || setting.type === 'SUBMODE') && + setting.addTransportMode + ) + if (transportModeSettings.length === 0) return modeButton + + const allFalse = transportModeSettings.every( + (setting) => !setting.value + ) + if (allFalse) { + console.log( + 'subsettings are all false!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' + ) + modeButton.enabled = false + handleModeButtonToggle(modeButton.key, false) + return modeButton + } + return { ...modeButton, enabled: modeButton.enabled && !allFalse } + } + + return modeButton + } + + processedModeButtons.map(pipe(checkTransportModeSubsettings)) + }, [processedModeButtons, handleModeButtonToggle]) + return ( @@ -235,10 +259,7 @@ const AdvancedSettingsPanel = ({ label="test" modeButtons={processedModeButtons} onSettingsUpdate={onSettingsUpdate(setQueryParam)} - onToggleModeButton={setModeButton( - enabledModeButtons, - onSettingsUpdate(setQueryParam) - )} + onToggleModeButton={handleModeButtonToggle} /> { + /* console.log( + 'state.otp.modeSettingDefinitions::::', + state.otp.modeSettingDefinitions + ) */ const urlSearchParams = new URLSearchParams(state.router.location.search) const modeSettingValues = generateModeSettingValues( urlSearchParams, From 96d238105fd0db6bbd0ce72f2bc042487797f0d6 Mon Sep 17 00:00:00 2001 From: josh-willis-arcadis <168561922+josh-willis-arcadis@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:50:50 -0500 Subject: [PATCH 03/16] fix(advanced-settings-panel): start trying to use url search params to reset to default values --- .../form/advanced-settings-panel.tsx | 50 +++++++++++++------ 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/lib/components/form/advanced-settings-panel.tsx b/lib/components/form/advanced-settings-panel.tsx index 79c4057a5..4985d8767 100644 --- a/lib/components/form/advanced-settings-panel.tsx +++ b/lib/components/form/advanced-settings-panel.tsx @@ -15,6 +15,7 @@ import { ModeSetting, ModeSettingValues } from '@opentripplanner/types' +import { QueryParamChangeEvent } from '@opentripplanner/trip-form/lib/types' import React, { RefObject, useContext, useEffect, useState } from 'react' import styled from 'styled-components' @@ -118,7 +119,8 @@ const AdvancedSettingsPanel = ({ modeButtonOptions, modeSettingDefinitions, modeSettingValues, - setQueryParam + setQueryParam, + urlSearchParams }: { closeAdvancedSettings: () => void enabledModeButtons: string[] @@ -127,7 +129,8 @@ const AdvancedSettingsPanel = ({ modeSettingDefinitions: ModeSetting[] modeSettingValues: ModeSettingValues onPlanTripClick: () => void - setQueryParam: (evt: any) => void + setQueryParam: (evt: QueryParamChangeEvent) => void + urlSearchParams: URLSearchParams }): JSX.Element => { const [closingBySave, setClosingBySave] = useState(false) const [closingByX, setClosingByX] = useState(false) @@ -189,11 +192,7 @@ const AdvancedSettingsPanel = ({ const checkTransportModeSubsettings = ( modeButton: ModeButtonDefinition ) => { - if ( - modeButton.enabled && - modeButton.modeSettings && - modeButton.modeSettings.length > 0 - ) { + if (modeButton.modeSettings && modeButton.modeSettings.length > 0) { const transportModeSettings = modeButton.modeSettings.filter( (setting: ModeSetting) => (setting.type === 'CHECKBOX' || setting.type === 'SUBMODE') && @@ -204,14 +203,31 @@ const AdvancedSettingsPanel = ({ const allFalse = transportModeSettings.every( (setting) => !setting.value ) - if (allFalse) { + // modeButton is enabled, but all of its subsettings are false + if (allFalse && enabledModeButtons.includes(modeButton.key)) { + console.log('button on -> off') + modeButton.enabled = false console.log( - 'subsettings are all false!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' + 'before delete urlSerchParams::::: ', + urlSearchParams.toString() + ) + urlSearchParams.forEach((value, key) => { + console.log('key:::::::::', key) + if (transportModeSettings.some((setting) => setting.key === key)) { + console.log('deleting key:::::::::', key) + urlSearchParams.delete(key) + } + }) + console.log( + 'after delete urlSerchParams::::: ', + urlSearchParams.toString() ) - modeButton.enabled = false handleModeButtonToggle(modeButton.key, false) + console.log('transportModeSettings:::::::::', transportModeSettings) + return modeButton } + return { ...modeButton, enabled: modeButton.enabled && !allFalse } } @@ -219,7 +235,12 @@ const AdvancedSettingsPanel = ({ } processedModeButtons.map(pipe(checkTransportModeSubsettings)) - }, [processedModeButtons, handleModeButtonToggle]) + }, [ + processedModeButtons, + handleModeButtonToggle, + enabledModeButtons, + urlSearchParams + ]) return ( @@ -284,10 +305,6 @@ const AdvancedSettingsPanel = ({ const queryParamConfig = { modeButtons: DelimitedArrayParam } const mapStateToProps = (state: AppReduxState) => { - /* console.log( - 'state.otp.modeSettingDefinitions::::', - state.otp.modeSettingDefinitions - ) */ const urlSearchParams = new URLSearchParams(state.router.location.search) const modeSettingValues = generateModeSettingValues( urlSearchParams, @@ -305,7 +322,8 @@ const mapStateToProps = (state: AppReduxState) => { [], modeButtonOptions: state.otp.config?.modes?.modeButtons || [], modeSettingDefinitions: state.otp?.modeSettingDefinitions || [], - modeSettingValues + modeSettingValues, + urlSearchParams } } From 2c8b84c0fc0eeb0c45d379662513f320f1d930c0 Mon Sep 17 00:00:00 2001 From: josh-willis-arcadis <168561922+josh-willis-arcadis@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:34:07 -0500 Subject: [PATCH 04/16] feat(form): create deleteQueryParams function --- lib/actions/form.js | 16 ++++++++++++ .../form/advanced-settings-panel.tsx | 25 +++++-------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/lib/actions/form.js b/lib/actions/form.js index bfdc65fe7..4eecdb428 100644 --- a/lib/actions/form.js +++ b/lib/actions/form.js @@ -80,6 +80,22 @@ export function setQueryParam(payload, searchId) { } } +/** + * Deletes the specified query parameter from the current query and updates the + * application state accordingly. + */ +export function deleteQueryParams(params) { + return function (dispatch, getState) { + const state = getState() + const { currentQuery } = state.otp + const newQuery = Object.assign({}, currentQuery) + params.forEach((param) => { + delete newQuery[param] + }) + dispatch(settingQueryParam(newQuery)) + } +} + /** * An action that parses the active URL's query params (or whatever is passed in) * and updates the state with the OTP plan query params. A new search will be diff --git a/lib/components/form/advanced-settings-panel.tsx b/lib/components/form/advanced-settings-panel.tsx index 4985d8767..863aeb3c3 100644 --- a/lib/components/form/advanced-settings-panel.tsx +++ b/lib/components/form/advanced-settings-panel.tsx @@ -114,6 +114,7 @@ const DtSelectorContainer = styled.div` const AdvancedSettingsPanel = ({ closeAdvancedSettings, + deleteQueryParams, enabledModeButtons, innerRef, modeButtonOptions, @@ -123,6 +124,7 @@ const AdvancedSettingsPanel = ({ urlSearchParams }: { closeAdvancedSettings: () => void + deleteQueryParams: (params: string[]) => void enabledModeButtons: string[] innerRef: RefObject modeButtonOptions: ModeButtonDefinition[] @@ -205,25 +207,9 @@ const AdvancedSettingsPanel = ({ ) // modeButton is enabled, but all of its subsettings are false if (allFalse && enabledModeButtons.includes(modeButton.key)) { - console.log('button on -> off') - modeButton.enabled = false - console.log( - 'before delete urlSerchParams::::: ', - urlSearchParams.toString() - ) - urlSearchParams.forEach((value, key) => { - console.log('key:::::::::', key) - if (transportModeSettings.some((setting) => setting.key === key)) { - console.log('deleting key:::::::::', key) - urlSearchParams.delete(key) - } - }) - console.log( - 'after delete urlSerchParams::::: ', - urlSearchParams.toString() - ) + console.log('all keys:::::', Object.keys(transportModeSettings)) + deleteQueryParams(Object.keys(transportModeSettings)) handleModeButtonToggle(modeButton.key, false) - console.log('transportModeSettings:::::::::', transportModeSettings) return modeButton } @@ -239,7 +225,7 @@ const AdvancedSettingsPanel = ({ processedModeButtons, handleModeButtonToggle, enabledModeButtons, - urlSearchParams + deleteQueryParams ]) return ( @@ -328,6 +314,7 @@ const mapStateToProps = (state: AppReduxState) => { } const mapDispatchToProps = { + deleteQueryParams: formActions.deleteQueryParams, setQueryParam: formActions.setQueryParam, updateQueryTimeIfLeavingNow: formActions.updateQueryTimeIfLeavingNow } From 2e43af4267d4fda5a9933c614f88342883963242 Mon Sep 17 00:00:00 2001 From: josh-willis-arcadis <168561922+josh-willis-arcadis@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:43:42 -0500 Subject: [PATCH 05/16] fix(advanced-trip-form): get correct param keys --- lib/components/form/advanced-settings-panel.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/components/form/advanced-settings-panel.tsx b/lib/components/form/advanced-settings-panel.tsx index 863aeb3c3..41382acbb 100644 --- a/lib/components/form/advanced-settings-panel.tsx +++ b/lib/components/form/advanced-settings-panel.tsx @@ -207,8 +207,11 @@ const AdvancedSettingsPanel = ({ ) // modeButton is enabled, but all of its subsettings are false if (allFalse && enabledModeButtons.includes(modeButton.key)) { - console.log('all keys:::::', Object.keys(transportModeSettings)) - deleteQueryParams(Object.keys(transportModeSettings)) + console.log( + 'all keys:::::', + transportModeSettings.map((setting) => setting.key) + ) + deleteQueryParams(transportModeSettings.map((setting) => setting.key)) handleModeButtonToggle(modeButton.key, false) return modeButton From 65f146eabbe09b120610abcf42c6f3b6f88ed329 Mon Sep 17 00:00:00 2001 From: josh-willis-arcadis <168561922+josh-willis-arcadis@users.noreply.github.com> Date: Tue, 3 Sep 2024 15:54:30 -0500 Subject: [PATCH 06/16] fix(util): disable mode button if all subsettings are false and reset values of all subsettings --- lib/actions/form.js | 16 ----- .../form/advanced-settings-panel.tsx | 60 +++--------------- lib/components/form/util.tsx | 61 ++++++++++++++++++- 3 files changed, 69 insertions(+), 68 deletions(-) diff --git a/lib/actions/form.js b/lib/actions/form.js index 4eecdb428..bfdc65fe7 100644 --- a/lib/actions/form.js +++ b/lib/actions/form.js @@ -80,22 +80,6 @@ export function setQueryParam(payload, searchId) { } } -/** - * Deletes the specified query parameter from the current query and updates the - * application state accordingly. - */ -export function deleteQueryParams(params) { - return function (dispatch, getState) { - const state = getState() - const { currentQuery } = state.otp - const newQuery = Object.assign({}, currentQuery) - params.forEach((param) => { - delete newQuery[param] - }) - dispatch(settingQueryParam(newQuery)) - } -} - /** * An action that parses the active URL's query params (or whatever is passed in) * and updates the state with the OTP plan query params. A new search will be diff --git a/lib/components/form/advanced-settings-panel.tsx b/lib/components/form/advanced-settings-panel.tsx index 41382acbb..ab83513be 100644 --- a/lib/components/form/advanced-settings-panel.tsx +++ b/lib/components/form/advanced-settings-panel.tsx @@ -29,6 +29,7 @@ import PageTitle from '../util/page-title' import { addCustomSettingLabels, addModeButtonIcon, + onAdvancedModeSubsettingsUpdate, onSettingsUpdate, pipe, populateSettingWithIcon, @@ -114,7 +115,6 @@ const DtSelectorContainer = styled.div` const AdvancedSettingsPanel = ({ closeAdvancedSettings, - deleteQueryParams, enabledModeButtons, innerRef, modeButtonOptions, @@ -124,7 +124,6 @@ const AdvancedSettingsPanel = ({ urlSearchParams }: { closeAdvancedSettings: () => void - deleteQueryParams: (params: string[]) => void enabledModeButtons: string[] innerRef: RefObject modeButtonOptions: ModeButtonDefinition[] @@ -173,12 +172,6 @@ const AdvancedSettingsPanel = ({ ) const processedModeSettings = processSettings(modeSettingDefinitions) - // console.log('processedModeSettings::::', processedModeSettings) - - const handleModeButtonToggle = setModeButton( - enabledModeButtons, - onSettingsUpdate(setQueryParam) - ) const processedModeButtons = modeButtonOptions.map( pipe( @@ -187,49 +180,11 @@ const AdvancedSettingsPanel = ({ setModeButtonEnabled(enabledModeButtons) ) ) - console.log('processedModeButtons::::::', processedModeButtons) - - useEffect(() => { - console.log('processedModeButtons CHANGED!!! ::::::', processedModeButtons) - const checkTransportModeSubsettings = ( - modeButton: ModeButtonDefinition - ) => { - if (modeButton.modeSettings && modeButton.modeSettings.length > 0) { - const transportModeSettings = modeButton.modeSettings.filter( - (setting: ModeSetting) => - (setting.type === 'CHECKBOX' || setting.type === 'SUBMODE') && - setting.addTransportMode - ) - if (transportModeSettings.length === 0) return modeButton - - const allFalse = transportModeSettings.every( - (setting) => !setting.value - ) - // modeButton is enabled, but all of its subsettings are false - if (allFalse && enabledModeButtons.includes(modeButton.key)) { - console.log( - 'all keys:::::', - transportModeSettings.map((setting) => setting.key) - ) - deleteQueryParams(transportModeSettings.map((setting) => setting.key)) - handleModeButtonToggle(modeButton.key, false) - - return modeButton - } - return { ...modeButton, enabled: modeButton.enabled && !allFalse } - } - - return modeButton - } - - processedModeButtons.map(pipe(checkTransportModeSubsettings)) - }, [ - processedModeButtons, - handleModeButtonToggle, + const handleModeButtonToggle = setModeButton( enabledModeButtons, - deleteQueryParams - ]) + onSettingsUpdate(setQueryParam) + ) return ( @@ -268,7 +223,11 @@ const AdvancedSettingsPanel = ({ fillModeIcons label="test" modeButtons={processedModeButtons} - onSettingsUpdate={onSettingsUpdate(setQueryParam)} + onSettingsUpdate={onAdvancedModeSubsettingsUpdate( + setQueryParam, + processedModeButtons, + handleModeButtonToggle + )} onToggleModeButton={handleModeButtonToggle} /> { } const mapDispatchToProps = { - deleteQueryParams: formActions.deleteQueryParams, setQueryParam: formActions.setQueryParam, updateQueryTimeIfLeavingNow: formActions.updateQueryTimeIfLeavingNow } diff --git a/lib/components/form/util.tsx b/lib/components/form/util.tsx index 23b5ab8fe..9cb6ad1d7 100644 --- a/lib/components/form/util.tsx +++ b/lib/components/form/util.tsx @@ -56,16 +56,75 @@ export const onSettingsUpdate = setQueryParam({ queryParamData: params, ...params }) } +const getModeButtonFromSubmode = ( + key: string, + modeButtons: ModeButtonDefinition[] +): ModeButtonDefinition | undefined => { + return modeButtons.find((button: ModeButtonDefinition) => { + if (button.modeSettings) { + return button.modeSettings.some((setting: ModeSetting) => { + // check if transport mode + if ( + (setting.type === 'CHECKBOX' || setting.type === 'SUBMODE') && + setting.addTransportMode + ) { + return setting.key === key + } + return false + }) + } + return false + }) +} + +export const onAdvancedModeSubsettingsUpdate = + ( + setQueryParam: (evt: any) => void, + processedModeButtons: ModeButtonDefinition[], + handleModeButtonToggle: (buttonId: string, newState: boolean) => void + ) => + (params: any) => { + // check if setting is a transport mode and get the mode button that contains it + const modeButton = getModeButtonFromSubmode( + Object.keys(params)[0], + processedModeButtons + ) + if (modeButton && modeButton.modeSettings && !Object.values(params)[0]) { + const transportModeSettings = modeButton.modeSettings.filter( + (setting: ModeSetting) => + (setting.type === 'CHECKBOX' || setting.type === 'SUBMODE') && + setting.addTransportMode + ) + // if we're disabling a transport mode, we need to check if the mode button needs to be disabled (all of its subsettings are false) + const allFalse = transportModeSettings.every((setting: ModeSetting) => { + if (setting.key === Object.keys(params)[0]) { + return !Object.values(params)[0] + } + return !setting.value + }) + if (allFalse) { + transportModeSettings.forEach((setting) => (params[setting.key] = true)) + handleModeButtonToggle(modeButton.key, false) + } + } + setQueryParam({ queryParamData: params, ...params }) + } + export const setModeButton = (enabledModeButtons: string[], updateHandler: (params: any) => void) => (buttonId: string, newState: boolean) => { + console.log('SET MODE BUTTON IS BEING CALLED. NEW STATE:::: ', newState) let newButtons + if (newState) { + // enable modeButton + // we need to add it to the list of enabled buttons newButtons = [...enabledModeButtons, buttonId] } else { + // disable modeButton + // we need to remove it from the list of enabled buttons newButtons = enabledModeButtons.filter((c) => c !== buttonId) } - // encodeQueryParams serializes the mode buttons for the URL // to get nice looking URL params and consistency updateHandler( From f24376bea7157f9512eda7e3b32bee4c3277e30f Mon Sep 17 00:00:00 2001 From: josh-willis-arcadis <168561922+josh-willis-arcadis@users.noreply.github.com> Date: Mon, 9 Sep 2024 13:21:56 -0500 Subject: [PATCH 07/16] update yarn lock --- yarn.lock | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/yarn.lock b/yarn.lock index 634ff87b2..a9dca0a61 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2416,6 +2416,24 @@ lodash.isequal "^4.5.0" qs "^6.9.1" +"@opentripplanner/core-utils@^11.4.1": + version "11.4.4" + resolved "https://registry.yarnpkg.com/@opentripplanner/core-utils/-/core-utils-11.4.4.tgz#11c1be91a5e90afda4fc265831c761d3e044d933" + integrity sha512-WKhOuG7Q+Yxdm+P5MPmJyXndx+JUtGn44GTeilOnUqDdO8lTLTvqqt0hYeEWjA77jWP0u8tG7fAAsft8IZn2cg== + dependencies: + "@conveyal/lonlat" "^1.4.1" + "@mapbox/polyline" "^1.1.0" + "@opentripplanner/geocoder" "^3.0.2" + "@styled-icons/foundation" "^10.34.0" + "@turf/along" "^6.0.1" + chroma-js "^2.4.2" + date-fns "^2.28.0" + date-fns-tz "^1.2.2" + graphql "^16.6.0" + lodash.clonedeep "^4.5.0" + lodash.isequal "^4.5.0" + qs "^6.9.1" + "@opentripplanner/core-utils@^11.4.3": version "11.4.3" resolved "https://registry.yarnpkg.com/@opentripplanner/core-utils/-/core-utils-11.4.3.tgz#4655f9a3bef1977e53abd81a4a0eae966f977c60" @@ -2465,6 +2483,17 @@ isomorphic-mapzen-search "^1.6.1" lodash.memoize "^4.1.2" +"@opentripplanner/geocoder@^3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@opentripplanner/geocoder/-/geocoder-3.0.2.tgz#2c7618947d1d9b082bd39d037327c9cf23282782" + integrity sha512-pl7tCiodex0hXWKLH3WE+I+HzoSgOOWp9kR3xMcuRiE5g6k2JXNneoD/ZfSS1n6Oorxcjv3U2DbMSXT2j/39dQ== + dependencies: + "@conveyal/geocoder-arcgis-geojson" "^0.0.3" + "@conveyal/lonlat" "^1.4.1" + "@leeoniya/ufuzzy" "^1.0.14" + isomorphic-mapzen-search "^1.6.1" + lodash.memoize "^4.1.2" + "@opentripplanner/humanize-distance@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@opentripplanner/humanize-distance/-/humanize-distance-1.2.0.tgz#71cf5d5d1b756adef15300edbba0995ccd4b35ee" From f452700e9ebf0bbabab8e4800e8a70e891a9498c Mon Sep 17 00:00:00 2001 From: josh-willis-arcadis <168561922+josh-willis-arcadis@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:51:28 -0500 Subject: [PATCH 08/16] feat(advanced-settings-panel): add support for onAllSubmodesDisabled prop --- .../form/advanced-settings-panel.tsx | 12 ++--- lib/components/form/util.tsx | 54 ------------------- 2 files changed, 6 insertions(+), 60 deletions(-) diff --git a/lib/components/form/advanced-settings-panel.tsx b/lib/components/form/advanced-settings-panel.tsx index ab83513be..7f1500f23 100644 --- a/lib/components/form/advanced-settings-panel.tsx +++ b/lib/components/form/advanced-settings-panel.tsx @@ -29,7 +29,6 @@ import PageTitle from '../util/page-title' import { addCustomSettingLabels, addModeButtonIcon, - onAdvancedModeSubsettingsUpdate, onSettingsUpdate, pipe, populateSettingWithIcon, @@ -186,6 +185,10 @@ const AdvancedSettingsPanel = ({ onSettingsUpdate(setQueryParam) ) + const handleAllSubmodesDisabled = (modeButton: ModeButtonDefinition) => { + handleModeButtonToggle(modeButton.key, false) + } + return ( @@ -223,11 +226,8 @@ const AdvancedSettingsPanel = ({ fillModeIcons label="test" modeButtons={processedModeButtons} - onSettingsUpdate={onAdvancedModeSubsettingsUpdate( - setQueryParam, - processedModeButtons, - handleModeButtonToggle - )} + onAllSubmodesDisabled={handleAllSubmodesDisabled} + onSettingsUpdate={onSettingsUpdate(setQueryParam)} onToggleModeButton={handleModeButtonToggle} /> { - return modeButtons.find((button: ModeButtonDefinition) => { - if (button.modeSettings) { - return button.modeSettings.some((setting: ModeSetting) => { - // check if transport mode - if ( - (setting.type === 'CHECKBOX' || setting.type === 'SUBMODE') && - setting.addTransportMode - ) { - return setting.key === key - } - return false - }) - } - return false - }) -} - -export const onAdvancedModeSubsettingsUpdate = - ( - setQueryParam: (evt: any) => void, - processedModeButtons: ModeButtonDefinition[], - handleModeButtonToggle: (buttonId: string, newState: boolean) => void - ) => - (params: any) => { - // check if setting is a transport mode and get the mode button that contains it - const modeButton = getModeButtonFromSubmode( - Object.keys(params)[0], - processedModeButtons - ) - if (modeButton && modeButton.modeSettings && !Object.values(params)[0]) { - const transportModeSettings = modeButton.modeSettings.filter( - (setting: ModeSetting) => - (setting.type === 'CHECKBOX' || setting.type === 'SUBMODE') && - setting.addTransportMode - ) - // if we're disabling a transport mode, we need to check if the mode button needs to be disabled (all of its subsettings are false) - const allFalse = transportModeSettings.every((setting: ModeSetting) => { - if (setting.key === Object.keys(params)[0]) { - return !Object.values(params)[0] - } - return !setting.value - }) - if (allFalse) { - transportModeSettings.forEach((setting) => (params[setting.key] = true)) - handleModeButtonToggle(modeButton.key, false) - } - } - setQueryParam({ queryParamData: params, ...params }) - } - export const setModeButton = (enabledModeButtons: string[], updateHandler: (params: any) => void) => (buttonId: string, newState: boolean) => { From a39f049821640a9641ceb0c8761c420282ab4304 Mon Sep 17 00:00:00 2001 From: josh-willis-arcadis <168561922+josh-willis-arcadis@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:04:51 -0500 Subject: [PATCH 09/16] chore(advanced-settings-panel): remove unused prop --- lib/components/form/advanced-settings-panel.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/components/form/advanced-settings-panel.tsx b/lib/components/form/advanced-settings-panel.tsx index 7f1500f23..c5e99f656 100644 --- a/lib/components/form/advanced-settings-panel.tsx +++ b/lib/components/form/advanced-settings-panel.tsx @@ -119,8 +119,7 @@ const AdvancedSettingsPanel = ({ modeButtonOptions, modeSettingDefinitions, modeSettingValues, - setQueryParam, - urlSearchParams + setQueryParam }: { closeAdvancedSettings: () => void enabledModeButtons: string[] @@ -130,7 +129,6 @@ const AdvancedSettingsPanel = ({ modeSettingValues: ModeSettingValues onPlanTripClick: () => void setQueryParam: (evt: QueryParamChangeEvent) => void - urlSearchParams: URLSearchParams }): JSX.Element => { const [closingBySave, setClosingBySave] = useState(false) const [closingByX, setClosingByX] = useState(false) @@ -270,8 +268,7 @@ const mapStateToProps = (state: AppReduxState) => { [], modeButtonOptions: state.otp.config?.modes?.modeButtons || [], modeSettingDefinitions: state.otp?.modeSettingDefinitions || [], - modeSettingValues, - urlSearchParams + modeSettingValues } } From e0979791623fab83f85123be518416616ec65ba3 Mon Sep 17 00:00:00 2001 From: josh-willis-arcadis <168561922+josh-willis-arcadis@users.noreply.github.com> Date: Wed, 11 Sep 2024 10:02:43 -0500 Subject: [PATCH 10/16] chore(form/util): clean up unnecessary logs and comments --- lib/components/form/util.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/components/form/util.tsx b/lib/components/form/util.tsx index a65c1e721..9dfd6366d 100644 --- a/lib/components/form/util.tsx +++ b/lib/components/form/util.tsx @@ -59,16 +59,10 @@ export const onSettingsUpdate = export const setModeButton = (enabledModeButtons: string[], updateHandler: (params: any) => void) => (buttonId: string, newState: boolean) => { - console.log('SET MODE BUTTON IS BEING CALLED. NEW STATE:::: ', newState) let newButtons - if (newState) { - // enable modeButton - // we need to add it to the list of enabled buttons newButtons = [...enabledModeButtons, buttonId] } else { - // disable modeButton - // we need to remove it from the list of enabled buttons newButtons = enabledModeButtons.filter((c) => c !== buttonId) } // encodeQueryParams serializes the mode buttons for the URL From 8a6bef9d872f91de2e783509e895fd3e0b150857 Mon Sep 17 00:00:00 2001 From: josh-willis-arcadis <168561922+josh-willis-arcadis@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:48:21 -0500 Subject: [PATCH 11/16] fix: address PR feedback --- .../form/advanced-settings-panel.tsx | 3 +- lib/components/form/util.tsx | 34 +++++++++---------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/lib/components/form/advanced-settings-panel.tsx b/lib/components/form/advanced-settings-panel.tsx index c5e99f656..730c53e2f 100644 --- a/lib/components/form/advanced-settings-panel.tsx +++ b/lib/components/form/advanced-settings-panel.tsx @@ -15,7 +15,6 @@ import { ModeSetting, ModeSettingValues } from '@opentripplanner/types' -import { QueryParamChangeEvent } from '@opentripplanner/trip-form/lib/types' import React, { RefObject, useContext, useEffect, useState } from 'react' import styled from 'styled-components' @@ -128,7 +127,7 @@ const AdvancedSettingsPanel = ({ modeSettingDefinitions: ModeSetting[] modeSettingValues: ModeSettingValues onPlanTripClick: () => void - setQueryParam: (evt: QueryParamChangeEvent) => void + setQueryParam: (evt: any) => void }): JSX.Element => { const [closingBySave, setClosingBySave] = useState(false) const [closingByX, setClosingByX] = useState(false) diff --git a/lib/components/form/util.tsx b/lib/components/form/util.tsx index 9dfd6366d..85dd3107d 100644 --- a/lib/components/form/util.tsx +++ b/lib/components/form/util.tsx @@ -5,6 +5,7 @@ import React from 'react' import { getFormattedMode } from '../../util/i18n' import { hasValidLocation } from '../../util/state' +import { QueryParamChangeHandler } from '../util/types' import { RoutingQueryCallResult } from '../../actions/api-constants' import { updateQueryTimeIfLeavingNow } from '../../actions/form' @@ -18,9 +19,9 @@ export const modesQueryParamConfig = { modeButtons: DelimitedArrayParam } export const populateSettingWithIcon = (ModeIcon: React.ComponentType<{ mode?: string; width?: number }>) => // eslint-disable-next-line react/display-name - (msd: ModeSetting): ModeSetting => ({ - ...msd, - icon: + (modeSetting: ModeSetting): ModeSetting => ({ + ...modeSetting, + icon: }) export const addModeButtonIcon = @@ -34,17 +35,17 @@ export const addModeButtonIcon = export const addCustomSettingLabels = (intl: IntlShape) => - (msd: ModeSetting): ModeSetting => { - let modeLabel + (modeSetting: ModeSetting): ModeSetting => { // If we're using route mode overrides, make sure we're using the custom mode name - if (msd.type === 'SUBMODE') { - modeLabel = msd.overrideMode || msd.addTransportMode.mode + if (modeSetting.type === 'SUBMODE') { + const modeLabel = + modeSetting.overrideMode || modeSetting.addTransportMode.mode return { - ...msd, + ...modeSetting, label: getFormattedMode(modeLabel, intl) } } - return msd + return modeSetting } /** @@ -52,19 +53,18 @@ export const addCustomSettingLabels = * @param params Params to store */ export const onSettingsUpdate = - (setQueryParam: (evt: any) => void) => (params: any) => { + (setQueryParam: QueryParamChangeHandler) => + (params: any): void => { setQueryParam({ queryParamData: params, ...params }) } export const setModeButton = (enabledModeButtons: string[], updateHandler: (params: any) => void) => - (buttonId: string, newState: boolean) => { - let newButtons - if (newState) { - newButtons = [...enabledModeButtons, buttonId] - } else { - newButtons = enabledModeButtons.filter((c) => c !== buttonId) - } + (buttonId: string, newState: boolean): void => { + const newButtons = newState + ? [...enabledModeButtons, buttonId] + : enabledModeButtons.filter((c) => c !== buttonId) + // encodeQueryParams serializes the mode buttons for the URL // to get nice looking URL params and consistency updateHandler( From 3f91771db0c58de957908aae08e05d83ea3c974b Mon Sep 17 00:00:00 2001 From: josh-willis-arcadis <168561922+josh-willis-arcadis@users.noreply.github.com> Date: Tue, 8 Oct 2024 12:12:14 -0500 Subject: [PATCH 12/16] chore: update ui package --- package.json | 2 +- yarn.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 7b69da5c0..6c0a5d74e 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "@opentripplanner/transit-vehicle-overlay": "5.0.0", "@opentripplanner/transitive-overlay": "4.0.0", "@opentripplanner/trip-details": "6.0.0", - "@opentripplanner/trip-form": "4.0.0", + "@opentripplanner/trip-form": "4.1.0", "@opentripplanner/trip-viewer-overlay": "3.0.0", "@opentripplanner/vehicle-rental-overlay": "3.0.0", "@styled-icons/fa-regular": "^10.34.0", diff --git a/yarn.lock b/yarn.lock index 1a65ef7a9..81fb842c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2408,7 +2408,7 @@ resolved "https://registry.yarnpkg.com/@opentripplanner/building-blocks/-/building-blocks-2.0.0.tgz#8282c01dff7db5c7e809f6ea91cb52df559a2f9d" integrity sha512-N07rDaZL8fp552eI9/0j1udKjc0uOpvO0Wv1P19Ge0a4roques463MJgWJ026fbopRCi3uwbc/gYTlh4/ske9A== -"@opentripplanner/building-blocks@^1.0.3", "@opentripplanner/building-blocks@^1.2.2": +"@opentripplanner/building-blocks@^1.2.2": version "1.2.3" resolved "https://registry.yarnpkg.com/@opentripplanner/building-blocks/-/building-blocks-1.2.3.tgz#404e8f9038867d66d55f51adf8855b1326c51ed5" integrity sha512-I0AxiZrTZu+e7+av4u0tHW2ijqpxH0AkLHrhf75BHf1Ep2FOGxaul/v+8UT18mNYiM5eHNstOX3XiXaDjtCUaw== @@ -2698,14 +2698,14 @@ flat "^5.0.2" react-animate-height "^3.0.4" -"@opentripplanner/trip-form@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@opentripplanner/trip-form/-/trip-form-4.0.0.tgz#27b36a0504e46cfda1cdf50c971b5cea03de8ae2" - integrity sha512-Cg8SlAVN8M+qoWpz8jAkwuqllIPgrL2PVewTPuDPsIQ8i5B7xo5KKE3TPo7cQUM+jE6WEshpvv0FIdMF+NAlNg== +"@opentripplanner/trip-form@4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@opentripplanner/trip-form/-/trip-form-4.1.0.tgz#83bd7135d1c814f1ea0be4f6896dd2494c9ddba9" + integrity sha512-VOWoyAfnnmwNnsolYLk7vfXRQvF3rj2XW5pXJ+OKwplGTgOhxJGNMKjZxau4legRedauyf0MHBNRpD3M3vsqRg== dependencies: "@floating-ui/react" "^0.19.2" - "@opentripplanner/building-blocks" "^1.0.3" - "@opentripplanner/core-utils" "^11.4.4" + "@opentripplanner/building-blocks" "^2.0.0" + "@opentripplanner/core-utils" "^12.0.0" "@styled-icons/bootstrap" "^10.34.0" "@styled-icons/boxicons-regular" "^10.38.0" "@styled-icons/fa-regular" "^10.37.0" From 6c100ce6684409c08d1d6040708c156bd229ec1d Mon Sep 17 00:00:00 2001 From: Daniel Heppner Date: Tue, 8 Oct 2024 13:46:21 -0700 Subject: [PATCH 13/16] allow multiple transport modes to be specified in a single transportmode --- example-config.yml | 6 +++++- lib/actions/form.js | 2 +- lib/reducers/create-otp-reducer.js | 10 +++++++++- lib/util/config-types.ts | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/example-config.yml b/example-config.yml index 79a242954..d62b241ae 100644 --- a/example-config.yml +++ b/example-config.yml @@ -268,7 +268,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 diff --git a/lib/actions/form.js b/lib/actions/form.js index bfdc65fe7..61ef9b87f 100644 --- a/lib/actions/form.js +++ b/lib/actions/form.js @@ -43,7 +43,7 @@ export function resetForm(full = false) { const options = getTripOptionsFromQuery(defaultQuery) // Default mode is currently WALK,TRANSIT. We need to update this value // here to match the list of modes, otherwise the form will break. - options.mode = ['WALK', ...transitModes.map((m) => m.mode)].join(',') + options.mode = ['WALK', ...transitModes.flatMap((m) => m.mode)].join(',') dispatch(settingQueryParam(options)) } if (full) { diff --git a/lib/reducers/create-otp-reducer.js b/lib/reducers/create-otp-reducer.js index 0bc899936..b84951935 100644 --- a/lib/reducers/create-otp-reducer.js +++ b/lib/reducers/create-otp-reducer.js @@ -135,10 +135,18 @@ export function getInitialState(userDefinedConfig) { const transitModeSettings = config?.modes?.transitModes.map((transitMode) => { const { mode, overrideMode } = transitMode + if (Array.isArray(mode) && !overrideMode) { + console.warn( + `Mode ${mode} is an array, but no overrideMode is specified.` + ) + } const displayedMode = overrideMode || mode + const addTransportModes = Array.isArray(mode) + ? mode.map((m) => ({ mode: m })) + : { mode } return { // This is the mode that gets added to the actual query to OTP - addTransportMode: { mode }, + addTransportMode: addTransportModes, applicableMode: 'TRANSIT', default: true, iconName: displayedMode.toLowerCase(), diff --git a/lib/util/config-types.ts b/lib/util/config-types.ts index 80f9cf10f..e0abbaf11 100644 --- a/lib/util/config-types.ts +++ b/lib/util/config-types.ts @@ -312,7 +312,7 @@ export interface GeocoderConfig extends GeocoderConfigOtpUI { export interface TransitModeConfig { color?: string label?: string - mode: string + mode: string | string[] showWheelchairSetting?: boolean } From 21046bb4a06c97b2ffe95ff1d14ecf7166c7f2df Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Fri, 11 Oct 2024 11:34:48 -0400 Subject: [PATCH 14/16] make use of new stops+stations layer --- lib/components/map/default-map.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/components/map/default-map.tsx b/lib/components/map/default-map.tsx index b2e7b899f..5548f8171 100644 --- a/lib/components/map/default-map.tsx +++ b/lib/components/map/default-map.tsx @@ -158,7 +158,12 @@ class DefaultMap extends Component { // Generate operator logos to pass through OTP tile layer to map-popup getEntityPrefix = (entity) => { - const stopId = entity.gtfsId + // In the case that we are dealing with a station, use the first stop of the station + const firstStopOfStationId = entity.stops + ? JSON.parse(entity.stops)[0] + : false + + const stopId = firstStopOfStationId || entity.gtfsId this.props.findStopTimesForStop({ date: getCurrentDate(), onlyRequestForOperators: true, From 49f2817fa1e703cf291a40b701fedf8f2a40e213 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Fri, 18 Oct 2024 08:11:43 -0400 Subject: [PATCH 15/16] update otp-ui --- package.json | 8 +++--- yarn.lock | 81 +++++++++++++++++++++++++++++++--------------------- 2 files changed, 52 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index a9a43acf2..62073cc3d 100644 --- a/package.json +++ b/package.json @@ -44,17 +44,17 @@ "@floating-ui/react": "^0.19.2", "@opentripplanner/base-map": "4.0.0", "@opentripplanner/building-blocks": "2.0.0", - "@opentripplanner/core-utils": "12.0.0", + "@opentripplanner/core-utils": "12.0.1", "@opentripplanner/endpoints-overlay": "3.0.1", "@opentripplanner/from-to-location-picker": "3.0.0", "@opentripplanner/geocoder": "^3.0.2", "@opentripplanner/humanize-distance": "^1.2.0", - "@opentripplanner/icons": "3.0.0", + "@opentripplanner/icons": "3.0.1", "@opentripplanner/itinerary-body": "6.0.1", "@opentripplanner/location-field": "3.0.0", "@opentripplanner/location-icon": "^1.4.1", "@opentripplanner/map-popup": "5.1.0", - "@opentripplanner/otp2-tile-overlay": "2.1.0", + "@opentripplanner/otp2-tile-overlay": "2.1.1", "@opentripplanner/park-and-ride-overlay": "3.0.0", "@opentripplanner/printable-itinerary": "3.0.0", "@opentripplanner/route-viewer-overlay": "3.0.0", @@ -63,7 +63,7 @@ "@opentripplanner/transit-vehicle-overlay": "5.0.0", "@opentripplanner/transitive-overlay": "4.0.0", "@opentripplanner/trip-details": "6.0.0", - "@opentripplanner/trip-form": "4.0.0", + "@opentripplanner/trip-form": "4.1.0", "@opentripplanner/trip-viewer-overlay": "3.0.0", "@opentripplanner/vehicle-rental-overlay": "3.0.0", "@styled-icons/fa-regular": "^10.34.0", diff --git a/yarn.lock b/yarn.lock index a4f77b0ae..98cb3d267 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2408,15 +2408,15 @@ resolved "https://registry.yarnpkg.com/@opentripplanner/building-blocks/-/building-blocks-2.0.0.tgz#8282c01dff7db5c7e809f6ea91cb52df559a2f9d" integrity sha512-N07rDaZL8fp552eI9/0j1udKjc0uOpvO0Wv1P19Ge0a4roques463MJgWJ026fbopRCi3uwbc/gYTlh4/ske9A== -"@opentripplanner/building-blocks@^1.0.3", "@opentripplanner/building-blocks@^1.2.2": +"@opentripplanner/building-blocks@^1.2.2": version "1.2.3" resolved "https://registry.yarnpkg.com/@opentripplanner/building-blocks/-/building-blocks-1.2.3.tgz#404e8f9038867d66d55f51adf8855b1326c51ed5" integrity sha512-I0AxiZrTZu+e7+av4u0tHW2ijqpxH0AkLHrhf75BHf1Ep2FOGxaul/v+8UT18mNYiM5eHNstOX3XiXaDjtCUaw== -"@opentripplanner/core-utils@12.0.0", "@opentripplanner/core-utils@^12.0.0": - version "12.0.0" - resolved "https://registry.yarnpkg.com/@opentripplanner/core-utils/-/core-utils-12.0.0.tgz#cc40af92620b207f4dce817d08f99def0cdaea7a" - integrity sha512-udLF8XU+k7gxZ+yyyw7ASz6/4D540zYIv8a9GbUL61TF8HmgGhcMk3XOgBnm5jdOukuaNNpOFE4J3oJc5QsSBQ== +"@opentripplanner/core-utils@12.0.1": + version "12.0.1" + resolved "https://registry.yarnpkg.com/@opentripplanner/core-utils/-/core-utils-12.0.1.tgz#2bafb78133393213b4943c76fec5d46436c0fb6d" + integrity sha512-QUTxEcpiOnbqaoiu6RQngTLlQHjSHO4PCMJqR9IRiaei08FnlTx2jgpvIaRla6u7tRNr12YCzptc37+a10ryww== dependencies: "@conveyal/lonlat" "^1.4.1" "@mapbox/polyline" "^1.1.0" @@ -2449,6 +2449,24 @@ lodash.isequal "^4.5.0" qs "^6.9.1" +"@opentripplanner/core-utils@^12.0.0": + version "12.0.0" + resolved "https://registry.yarnpkg.com/@opentripplanner/core-utils/-/core-utils-12.0.0.tgz#cc40af92620b207f4dce817d08f99def0cdaea7a" + integrity sha512-udLF8XU+k7gxZ+yyyw7ASz6/4D540zYIv8a9GbUL61TF8HmgGhcMk3XOgBnm5jdOukuaNNpOFE4J3oJc5QsSBQ== + dependencies: + "@conveyal/lonlat" "^1.4.1" + "@mapbox/polyline" "^1.1.0" + "@opentripplanner/geocoder" "^3.0.2" + "@styled-icons/foundation" "^10.34.0" + "@turf/along" "^6.0.1" + chroma-js "^2.4.2" + date-fns "^2.28.0" + date-fns-tz "^1.2.2" + graphql "^16.6.0" + lodash.clonedeep "^4.5.0" + lodash.isequal "^4.5.0" + qs "^6.9.1" + "@opentripplanner/endpoints-overlay@3.0.1": version "3.0.1" resolved "https://registry.yarnpkg.com/@opentripplanner/endpoints-overlay/-/endpoints-overlay-3.0.1.tgz#b6b8e2f08ae41fbaad475fc0f0fe3e72d7d36463" @@ -2493,12 +2511,12 @@ resolved "https://registry.yarnpkg.com/@opentripplanner/humanize-distance/-/humanize-distance-1.2.0.tgz#71cf5d5d1b756adef15300edbba0995ccd4b35ee" integrity sha512-x0QRXMDhypFeazZ6r6vzrdU8vhiV56nZ/WX6zUbxpgp6T9Oclw0gwR2Zdw6DZiiFpSYVNeVNxVzZwsu6NRGjcA== -"@opentripplanner/icons@3.0.0", "@opentripplanner/icons@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@opentripplanner/icons/-/icons-3.0.0.tgz#f7293fd4dd2625eace3a4c82ecd573d6000d85d3" - integrity sha512-naSCdCsPwSyEiP7Vf6oN6dpgwpFIkeQFXfTJG7lp1Dg9emLTAYzRx/f+45e9Bh0zP0aA4DsN4VgHBQllyu82qQ== +"@opentripplanner/icons@3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@opentripplanner/icons/-/icons-3.0.1.tgz#62cf5ffd9ad42c5ba2ac64cf91e9f10c8300ff1e" + integrity sha512-pu96GWVR2ef6aMPPJRjdzHkIVlENGa3LRlqNaW3PEZQLjycsCsT1ZpJ6+zKwVfZsgoMl1L8mx2qjLO4RUZzGAA== dependencies: - "@opentripplanner/core-utils" "^11.4.4" + "@opentripplanner/core-utils" "^12.0.0" prop-types "^15.7.2" "@opentripplanner/icons@^2.0.12": @@ -2509,6 +2527,14 @@ "@opentripplanner/core-utils" "^11.4.4" prop-types "^15.7.2" +"@opentripplanner/icons@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@opentripplanner/icons/-/icons-3.0.0.tgz#f7293fd4dd2625eace3a4c82ecd573d6000d85d3" + integrity sha512-naSCdCsPwSyEiP7Vf6oN6dpgwpFIkeQFXfTJG7lp1Dg9emLTAYzRx/f+45e9Bh0zP0aA4DsN4VgHBQllyu82qQ== + dependencies: + "@opentripplanner/core-utils" "^11.4.4" + prop-types "^15.7.2" + "@opentripplanner/itinerary-body@6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/@opentripplanner/itinerary-body/-/itinerary-body-6.0.1.tgz#74139536b34083af5b324fb94e69be267ea6bbeb" @@ -2566,7 +2592,7 @@ "@styled-icons/fa-regular" "^10.34.0" "@styled-icons/fa-solid" "^10.34.0" -"@opentripplanner/map-popup@5.1.0": +"@opentripplanner/map-popup@5.1.0", "@opentripplanner/map-popup@^v5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@opentripplanner/map-popup/-/map-popup-5.1.0.tgz#cf6374bf7b69af69c026ec414a84719078c56e9e" integrity sha512-EShoMyFZa7Zb2ZZrJhEsJfuCAvs2jfQe5QstU+AEk5Jm1zc8LzU6PsXmizQ/RMVi6zIYLhlBoZ3u458tTA3VQA== @@ -2588,23 +2614,12 @@ "@opentripplanner/from-to-location-picker" "^2.1.14" flat "^5.0.2" -"@opentripplanner/map-popup@^v3.2.0-alpha.1": - version "3.2.0-alpha.1" - resolved "https://registry.yarnpkg.com/@opentripplanner/map-popup/-/map-popup-3.2.0-alpha.1.tgz#dcad38c103500f7c5ad3c632398204849ed5885e" - integrity sha512-Z0RsyC7wkYU/aOLYQFsJI5tBhzooEE/sQZROX2WODkDWAv4Qfj95ppS8pvNkpoZ0N4fioFcj5aM2VGXVMSy0EA== - dependencies: - "@opentripplanner/base-map" "^3.2.2" - "@opentripplanner/building-blocks" "^1.2.2" - "@opentripplanner/core-utils" "^11.4.4" - "@opentripplanner/from-to-location-picker" "^2.1.14" - flat "^5.0.2" - -"@opentripplanner/otp2-tile-overlay@2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@opentripplanner/otp2-tile-overlay/-/otp2-tile-overlay-2.1.0.tgz#745cb6c80dbde767a0b5ac7b0b866193a18ec984" - integrity sha512-gkKS5OT/Ayc/987vcdSkFcGSH/YyvEBN9bZFWBHKRN5nbRykBRZu2GNFVfN5ITLoshrFw+YasIk9omfTKVJtRg== +"@opentripplanner/otp2-tile-overlay@2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@opentripplanner/otp2-tile-overlay/-/otp2-tile-overlay-2.1.1.tgz#3bd2f26caa01181eb4ca90bbd05ce784f9b05a7a" + integrity sha512-dAU8wd82ySTCHzc1uMbvN5k4WLAtK7AXY56rm6KZdnV3G2UQIFVcaatLj4bpTqS9j90trWnCIvRNm6FKo41f/w== dependencies: - "@opentripplanner/map-popup" "^v3.2.0-alpha.1" + "@opentripplanner/map-popup" "^v5.1.0" "@opentripplanner/park-and-ride-overlay@3.0.0": version "3.0.0" @@ -2698,14 +2713,14 @@ flat "^5.0.2" react-animate-height "^3.0.4" -"@opentripplanner/trip-form@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@opentripplanner/trip-form/-/trip-form-4.0.0.tgz#27b36a0504e46cfda1cdf50c971b5cea03de8ae2" - integrity sha512-Cg8SlAVN8M+qoWpz8jAkwuqllIPgrL2PVewTPuDPsIQ8i5B7xo5KKE3TPo7cQUM+jE6WEshpvv0FIdMF+NAlNg== +"@opentripplanner/trip-form@4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@opentripplanner/trip-form/-/trip-form-4.1.0.tgz#83bd7135d1c814f1ea0be4f6896dd2494c9ddba9" + integrity sha512-VOWoyAfnnmwNnsolYLk7vfXRQvF3rj2XW5pXJ+OKwplGTgOhxJGNMKjZxau4legRedauyf0MHBNRpD3M3vsqRg== dependencies: "@floating-ui/react" "^0.19.2" - "@opentripplanner/building-blocks" "^1.0.3" - "@opentripplanner/core-utils" "^11.4.4" + "@opentripplanner/building-blocks" "^2.0.0" + "@opentripplanner/core-utils" "^12.0.0" "@styled-icons/bootstrap" "^10.34.0" "@styled-icons/boxicons-regular" "^10.38.0" "@styled-icons/fa-regular" "^10.37.0" From 38de6c2de6e892109d691b164a91b363a2a44ae0 Mon Sep 17 00:00:00 2001 From: josh-willis-arcadis <168561922+josh-willis-arcadis@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:40:08 -0500 Subject: [PATCH 16/16] refactor(advanced-settings-panel): remove new line to clean up git blame --- lib/components/form/advanced-settings-panel.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/components/form/advanced-settings-panel.tsx b/lib/components/form/advanced-settings-panel.tsx index d3cd25c3d..d39e03ec9 100644 --- a/lib/components/form/advanced-settings-panel.tsx +++ b/lib/components/form/advanced-settings-panel.tsx @@ -169,7 +169,6 @@ const AdvancedSettingsPanel = ({ ) const processedModeSettings = processSettings(modeSettingDefinitions) - const processedModeButtons = modeButtonOptions.map( pipe( addModeButtonIcon(ModeIcon),