Skip to content

Commit 71398a4

Browse files
Merge pull request #462 from opentripplanner/make-location-field-updates-configurable
Make location field updates configurable
2 parents 60078f5 + dc16ef2 commit 71398a4

File tree

9 files changed

+91
-17
lines changed

9 files changed

+91
-17
lines changed

Diff for: .github/workflows/node-ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v2
15-
- name: Use Node.js 12.x
15+
- name: Use Node.js 14.x
1616
uses: actions/setup-node@v1
1717
with:
18-
node-version: 12.x
18+
node-version: 14.x
1919
- name: Install npm packages using cache
2020
uses: bahmutov/npm-install@v1
2121
- name: Copy example config

Diff for: example-config.yml

+3
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ geocoder:
145145
# This base URL is required as the libraries will default to using now-defunct
146146
# mapzen urls
147147
baseUrl: https://geocoder.example.com/pelias/v1
148+
# This allows the location field dropdown headers to be colored based on Pelias layer
149+
#resultsColors:
150+
# stops: "#007fae"
148151

149152
# example config for an ArcGIS geocoder
150153
# (https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm)

Diff for: lib/components/app/default-main-panel.js

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class DefaultMainPanel extends Component {
2626
<div style={{
2727
bottom: showPlanTripButton ? 55 : 0,
2828
left: 0,
29-
overflow: 'auto',
3029
paddingBottom: 15,
3130
position: 'absolute',
3231
right: 0,

Diff for: lib/components/form/connect-location-field.js

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default function connectLocationField (StyledLocationField, options = {})
2626
const stateToProps = {
2727
currentPosition,
2828
geocoderConfig: config.geocoder,
29+
layerColorMap: config.geocoder?.resultsColors || {},
2930
nearbyStops,
3031
sessionSearches,
3132
showUserSettings: getShowUserSettings(state),

Diff for: lib/components/form/default-search-form.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default class DefaultSearchForm extends Component {
2929

3030
return (
3131
<div>
32-
<div className='locations'>
32+
<div className='locations' style={{marginTop: '5px'}}>
3333
<LocationField
3434
inputPlaceholder={`Enter start location or ${actionText} on map...`}
3535
locationType='from'

Diff for: lib/components/viewers/route-details.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class RouteDetails extends Component {
142142
}}
143143
/>}
144144
{url && (
145-
<a href={url} target='_blank'>
145+
<a href={url} style={{whiteSpace: 'nowrap'}} target='_blank'>
146146
<Icon type='link' />
147147
<FormattedMessage id='components.RouteDetails.moreDetails' />
148148
</a>
@@ -163,7 +163,7 @@ class RouteDetails extends Component {
163163
onChange={this._headSignButtonClicked}
164164
value={viewedRoute?.patternId}
165165
>
166-
{!viewedRoute?.patternId && <option>{intl.formatMessage({id: 'components.RouteDetails.selectADirection'})}</option>}
166+
{!viewedRoute?.patternId && <option value=''>{intl.formatMessage({id: 'components.RouteDetails.selectADirection'})}</option>}
167167
{headsigns.map((h) => (
168168
<option
169169
key={h.id}

Diff for: lib/index.css

+6
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,9 @@ button.step {
197197
overflow: hidden;
198198
text-overflow: ellipsis;
199199
}
200+
201+
.map-container .leaflet-top {
202+
/* we need to override this z-index so that the +/- map controls appear below
203+
the geocoder search results */
204+
z-index: 999;
205+
}

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
"@opentripplanner/core-utils": "^3.2.3",
3838
"@opentripplanner/endpoints-overlay": "^1.2.0",
3939
"@opentripplanner/from-to-location-picker": "^1.2.1",
40-
"@opentripplanner/geocoder": "^1.1.0",
40+
"@opentripplanner/geocoder": "^1.1.1",
4141
"@opentripplanner/humanize-distance": "^1.1.0",
4242
"@opentripplanner/icons": "^1.1.0",
4343
"@opentripplanner/itinerary-body": "^2.3.1",
44-
"@opentripplanner/location-field": "^1.3.0",
44+
"@opentripplanner/location-field": "^1.6.1",
4545
"@opentripplanner/location-icon": "^1.3.0",
4646
"@opentripplanner/park-and-ride-overlay": "^1.2.0",
4747
"@opentripplanner/printable-itinerary": "^1.2.0",

Diff for: yarn.lock

+74-9
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,13 @@
10711071
dependencies:
10721072
regenerator-runtime "^0.13.4"
10731073

1074+
"@babel/runtime@^7.14.0":
1075+
version "7.15.4"
1076+
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a"
1077+
integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==
1078+
dependencies:
1079+
regenerator-runtime "^0.13.4"
1080+
10741081
"@babel/template@^7.10.4", "@babel/template@^7.12.7", "@babel/template@^7.4.0":
10751082
version "7.12.7"
10761083
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.7.tgz#c817233696018e39fbb6c491d2fb684e05ed43bc"
@@ -1125,6 +1132,11 @@
11251132
resolved "https://registry.yarnpkg.com/@conveyal/lonlat/-/lonlat-1.4.0.tgz#18a5c1349078a779e710d24af11bc02b24127ba0"
11261133
integrity sha512-ag1FcRuwRGAZgeZ4e3sUq+gblf1Pgma2c9SaIVXluIrgsZ9Lrq7xhCbV0ErN8chyg/OCOoG8m/l3mgzbycQCnQ==
11271134

1135+
"@conveyal/lonlat@^1.4.1":
1136+
version "1.4.1"
1137+
resolved "https://registry.yarnpkg.com/@conveyal/lonlat/-/lonlat-1.4.1.tgz#9970f33a2dc810ac08e89c844901405f18da478b"
1138+
integrity sha512-Z4W1NmvDsnkylhPMDWCk7kLaAjRtA9BVixASFxDPVkQwAiceOxaLEo4UVbZys4jNFzdtbcZ1UVPr6SQHBmEsrA==
1139+
11281140
"@csstools/convert-colors@^1.4.0":
11291141
version "1.4.0"
11301142
resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7"
@@ -1166,7 +1178,7 @@
11661178
resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.8.0.tgz#bbbff68978fefdbe68ccb533bc8cbe1d1afb5413"
11671179
integrity sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==
11681180

1169-
"@emotion/is-prop-valid@^0.8.6", "@emotion/is-prop-valid@^0.8.8":
1181+
"@emotion/is-prop-valid@^0.8.6", "@emotion/is-prop-valid@^0.8.7", "@emotion/is-prop-valid@^0.8.8":
11701182
version "0.8.8"
11711183
resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz#db28b1c4368a259b60a97311d6a952d4fd01ac1a"
11721184
integrity sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==
@@ -1575,6 +1587,23 @@
15751587
prop-types "^15.7.2"
15761588
qs "^6.9.1"
15771589

1590+
"@opentripplanner/core-utils@^4.1.0":
1591+
version "4.1.0"
1592+
resolved "https://registry.yarnpkg.com/@opentripplanner/core-utils/-/core-utils-4.1.0.tgz#fd1f879de0366e9b1ac1d4af9450df4296338711"
1593+
integrity sha512-SGsazdapV7zUxaLg8AM3TgLGqlLHc34qhAoI/6Z3fjFFlbOb5+vFefltFSnKvOh0IYx/33gRJZ35FTcmCSZqkQ==
1594+
dependencies:
1595+
"@mapbox/polyline" "^1.1.0"
1596+
"@opentripplanner/geocoder" "^1.0.2"
1597+
"@turf/along" "^6.0.1"
1598+
bowser "^2.7.0"
1599+
date-fns "^2.23.0"
1600+
date-fns-tz "^1.1.4"
1601+
lodash.clonedeep "^4.5.0"
1602+
lodash.isequal "^4.5.0"
1603+
moment "^2.24.0"
1604+
prop-types "^15.7.2"
1605+
qs "^6.9.1"
1606+
15781607
"@opentripplanner/endpoints-overlay@^1.2.0":
15791608
version "1.2.0"
15801609
resolved "https://registry.yarnpkg.com/@opentripplanner/endpoints-overlay/-/endpoints-overlay-1.2.0.tgz#d8bcf347d82b1566352c4c2bc52f4f389bf72f6b"
@@ -1604,6 +1633,16 @@
16041633
isomorphic-mapzen-search "^1.5.1"
16051634
lodash.memoize "^4.1.2"
16061635

1636+
"@opentripplanner/geocoder@^1.1.1":
1637+
version "1.1.1"
1638+
resolved "https://registry.yarnpkg.com/@opentripplanner/geocoder/-/geocoder-1.1.1.tgz#a449ad868a01d9e35291e52f68946929469c065a"
1639+
integrity sha512-XejHs5KvYcZOnv/oh8QrF4JU43Fne803HjWx0o0a7OfxqvWj9Xh7ioKktKz7HMXmtI9nSMWWXpeqLW6tTp9K9w==
1640+
dependencies:
1641+
"@conveyal/geocoder-arcgis-geojson" "^0.0.2"
1642+
"@conveyal/lonlat" "^1.4.1"
1643+
isomorphic-mapzen-search "^1.5.1"
1644+
lodash.memoize "^4.1.2"
1645+
16071646
"@opentripplanner/humanize-distance@^1.1.0":
16081647
version "1.1.0"
16091648
resolved "https://registry.yarnpkg.com/@opentripplanner/humanize-distance/-/humanize-distance-1.1.0.tgz#aa5ecdd70f33cfbdd214c76da4ba799a8ab473a5"
@@ -1632,17 +1671,17 @@
16321671
react-resize-detector "^4.2.1"
16331672
velocity-react "^1.4.3"
16341673

1635-
"@opentripplanner/location-field@^1.3.0":
1636-
version "1.3.0"
1637-
resolved "https://registry.yarnpkg.com/@opentripplanner/location-field/-/location-field-1.3.0.tgz#18c31edfe03d8483e0663cbfa6ced5349b809aa7"
1638-
integrity sha512-j9TvSOfB9EAiRHIy6lR43qnPqQQqlnqO1WjibBhThUkgkxL/NOy688hAJuUyna+PXE/m3SJKgNlVdkyDzyJ9HQ==
1674+
"@opentripplanner/location-field@^1.6.1":
1675+
version "1.6.1"
1676+
resolved "https://registry.yarnpkg.com/@opentripplanner/location-field/-/location-field-1.6.1.tgz#2a439d4c87f1ee2e914fb628ab919eda32498b58"
1677+
integrity sha512-5RPn1j8o7ACWhJ9v/X9G/NZoORqEq91xplE8y0LGz6dLRhnRjY2brhqIz4DtzKyWM3siMJS51dsxOUWhkJDMDA==
16391678
dependencies:
1640-
"@opentripplanner/core-utils" "^3.0.4"
1641-
"@opentripplanner/geocoder" "^1.0.2"
1679+
"@opentripplanner/core-utils" "^4.1.0"
1680+
"@opentripplanner/geocoder" "^1.1.0"
16421681
"@opentripplanner/humanize-distance" "^1.1.0"
1643-
"@opentripplanner/location-icon" "^1.0.1"
1682+
"@opentripplanner/location-icon" "^1.3.0"
1683+
"@styled-icons/fa-solid" "^10.34.0"
16441684
prop-types "^15.7.2"
1645-
styled-icons "^9.1.0"
16461685
throttle-debounce "^2.1.0"
16471686

16481687
"@opentripplanner/location-icon@^1.0.1", "@opentripplanner/location-icon@^1.3.0":
@@ -1968,6 +2007,14 @@
19682007
"@styled-icons/styled-icon" "^9.4.1"
19692008
tslib "^1.9.3"
19702009

2010+
"@styled-icons/fa-solid@^10.34.0":
2011+
version "10.34.0"
2012+
resolved "https://registry.yarnpkg.com/@styled-icons/fa-solid/-/fa-solid-10.34.0.tgz#315a6f6f25d38202d3387928191731e4c7a3bb18"
2013+
integrity sha512-PnJMUPcbuPA7gswxl9FKd725qaqP5VSbmX7rk+ZZ7ivdA6Dbi1VoKYXqAc62OEisGDhzn5g56KbBvE14W1n7vw==
2014+
dependencies:
2015+
"@babel/runtime" "^7.14.0"
2016+
"@styled-icons/styled-icon" "^10.6.3"
2017+
19712018
"@styled-icons/fa-solid@^9.4.1":
19722019
version "9.4.1"
19732020
resolved "https://registry.yarnpkg.com/@styled-icons/fa-solid/-/fa-solid-9.4.1.tgz#d30de755f8fee6e932032e97fa592cb1eaa21d8e"
@@ -2056,6 +2103,14 @@
20562103
"@styled-icons/styled-icon" "^9.4.1"
20572104
tslib "^1.9.3"
20582105

2106+
"@styled-icons/styled-icon@^10.6.3":
2107+
version "10.6.3"
2108+
resolved "https://registry.yarnpkg.com/@styled-icons/styled-icon/-/styled-icon-10.6.3.tgz#eae0e5e18fd601ac47e821bb9c2e099810e86403"
2109+
integrity sha512-/A95L3peioLoWFiy+/eKRhoQ9r/oRrN/qzbSX4hXU1nGP2rUXcX3LWUhoBNAOp9Rw38ucc/4ralY427UUNtcGQ==
2110+
dependencies:
2111+
"@babel/runtime" "^7.10.5"
2112+
"@emotion/is-prop-valid" "^0.8.7"
2113+
20592114
"@styled-icons/styled-icon@^9.4.1":
20602115
version "9.4.1"
20612116
resolved "https://registry.yarnpkg.com/@styled-icons/styled-icon/-/styled-icon-9.4.1.tgz#9dc236c85afd89edc2bc7265ec7858cbc35d4234"
@@ -6028,6 +6083,16 @@ data-urls@^1.0.0:
60286083
whatwg-mimetype "^2.2.0"
60296084
whatwg-url "^7.0.0"
60306085

6086+
date-fns-tz@^1.1.4:
6087+
version "1.1.6"
6088+
resolved "https://registry.yarnpkg.com/date-fns-tz/-/date-fns-tz-1.1.6.tgz#93cbf354e2aeb2cd312ffa32e462c1943cf20a8e"
6089+
integrity sha512-nyy+URfFI3KUY7udEJozcoftju+KduaqkVfwyTIE0traBiVye09QnyWKLZK7drRr5h9B7sPJITmQnS3U6YOdQg==
6090+
6091+
date-fns@^2.23.0:
6092+
version "2.24.0"
6093+
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.24.0.tgz#7d86dc0d93c87b76b63d213b4413337cfd1c105d"
6094+
integrity sha512-6ujwvwgPID6zbI0o7UbURi2vlLDR9uP26+tW6Lg+Ji3w7dd0i3DOcjcClLjLPranT60SSEFBwdSyYwn/ZkPIuw==
6095+
60316096
date-now@^0.1.4:
60326097
version "0.1.4"
60336098
resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"

0 commit comments

Comments
 (0)