Skip to content

Commit fbe413d

Browse files
Merge pull request #952 from opentripplanner/dev
Release: July 24, 2023
2 parents 2fd726a + 4686537 commit fbe413d

File tree

136 files changed

+4738
-3289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+4738
-3289
lines changed

.github/workflows/node-ci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
run: yarn lint-all || true
3333
- name: Run type check
3434
run: yarn typecheck
35+
- name: Check i18n messages (en-US and fr)
36+
run: yarn check:i18n-en-fr
3537
- name: Run tests
3638
run: yarn unit
3739
- name: Build example project

.github/workflows/percy.yml

+3-27
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,7 @@ on:
88
pull_request:
99

1010
jobs:
11-
run-pixel-tests-with-otp1-real-server:
12-
runs-on: ubuntu-latest
13-
14-
steps:
15-
- uses: actions/checkout@v2
16-
with:
17-
# This allows us to work with the repository during the lint step
18-
fetch-depth: 2
19-
- name: Use Node.js 16.x
20-
uses: actions/setup-node@v1
21-
with:
22-
node-version: 16.x
23-
- name: Install npm packages using cache
24-
uses: bahmutov/npm-install@v1
25-
- name: Download OTP1 config file
26-
run: curl $PERCY_OTP1_CONFIG_URL --output /tmp/otp1config.yml
27-
env:
28-
PERCY_OTP1_CONFIG_URL: ${{ secrets.PERCY_OTP1_CONFIG_URL_METRO }}
29-
- name: Take Percy Snapshots
30-
# Move everything from latest commit back to staged
31-
run: npx percy exec -- npx jest percy/percy.test.js --force-exit
32-
env:
33-
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
34-
PERCY_OTP_CONFIG_OVERRIDE: /tmp/otp1config.yml
35-
run-pixel-tests-with-otp2-real-server:
11+
run-pixel-tests-with-otp2-real-server-mobile:
3612
runs-on: ubuntu-latest
3713

3814
steps:
@@ -49,7 +25,7 @@ jobs:
4925
- name: Download OTP2 config file
5026
run: curl $PERCY_OTP2_CONFIG_URL --output /tmp/otp2config.yml
5127
env:
52-
PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_OTP2_CONFIG_URL_METRO }}
28+
PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_OTP2_CONFIG_URL_METRO_MODE_SELECTOR }}
5329
- name: Take Percy Snapshots
5430
# Move everything from latest commit back to staged
5531
run: npx percy exec -- npx jest percy/percy.test.js --force-exit
@@ -74,7 +50,7 @@ jobs:
7450
- name: Download OTP2 config file
7551
run: curl $PERCY_OTP2_CONFIG_URL --output /tmp/otp2config.yml
7652
env:
77-
PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_OTP2_CONFIG_URL_METRO }}
53+
PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_OTP2_CONFIG_URL_METRO_MODE_SELECTOR }}
7854
- name: Take Percy Snapshots
7955
# Move everything from latest commit back to staged
8056
run: npx percy exec -- npx jest percy/percy.test.js --force-exit

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
<img src="https://github.com/opentripplanner/otp-react-redux/raw/master/otprr.png" width="500" />
44

5+
[![Join the chat at https://gitter.im/opentripplanner/otp-react-redux](https://badges.gitter.im/repo.png)](https://gitter.im/opentripplanner/otp-react-redux)
6+
[![Build process badge](https://img.shields.io/github/actions/workflow/status/opentripplanner/otp-react-redux/node-ci.yml)](https://github.com/opentripplanner/otp-react-redux/actions/workflows/node-ci.yml)
7+
58
A library for writing modern [OpenTripPlanner](http://www.opentripplanner.org/)-compatible multimodal journey planning applications using [React]() and [Redux]().
69

710
## Running the Example
@@ -119,6 +122,6 @@ If changes to a specific language file is needed but not enabled in Weblate, ple
119122

120123
## Library Documentation
121124

122-
More coming soon...
125+
You can chat with the main OTP-RR developers in our [Gitter chat](https://gitter.im/opentripplanner/otp-react-redux). Support is not guaranteed, but we may be able to answer questions and assist people wishing to make contributions.
123126

124127
As of version 2.0, otp-react-redux utilizes React's context API in a number of components. This changed the way that some components receive props such that they will not work properly unless wrapped with the context provider used in the `ResponsiveWebapp` component.

__tests__/actions/__snapshots__/api.js.snap

-82
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,9 @@ Array [
55
Array [
66
[Function],
77
],
8-
Array [
9-
Object {
10-
"payload": Object {
11-
"activeItinerary": 0,
12-
"pending": 1,
13-
"routingType": "ITINERARY",
14-
"searchId": "abcd1234",
15-
"updateSearchInReducer": false,
16-
},
17-
"type": "ROUTING_REQUEST",
18-
},
19-
],
20-
Array [
21-
[Function],
22-
],
23-
Array [
24-
Object {
25-
"payload": Object {
26-
"requestId": "abcd1237",
27-
"response": Object {
28-
"fake": "response",
29-
},
30-
"searchId": "abcd1234",
31-
},
32-
"type": "ROUTING_RESPONSE",
33-
},
34-
],
35-
Array [
36-
[Function],
37-
],
38-
Array [
39-
Object {
40-
"payload": Object {
41-
"activeItinerary": 0,
42-
"pending": 1,
43-
"routingType": "ITINERARY",
44-
"searchId": "abcd1236",
45-
"updateSearchInReducer": false,
46-
},
47-
"type": "ROUTING_REQUEST",
48-
},
49-
],
508
Array [
519
[Function],
5210
],
53-
Array [
54-
Object {
55-
"payload": Object {
56-
"error": [Error: Received error from server],
57-
"requestId": "abcd1238",
58-
"searchId": "abcd1236",
59-
"url": "http://mock-host.com:80/api/plan?fromPlace=%2812%2C34%29%3A%3A12%2C34&toPlace=%2834%2C12%29%3A%3A34%2C12&mode=WALK%2CTRANSIT&ignoreRealtimeUpdates=false&batchId=abcd1236",
60-
},
61-
"type": "ROUTING_ERROR",
62-
},
63-
],
6411
]
6512
`;
6613

@@ -69,34 +16,5 @@ Array [
6916
Array [
7017
[Function],
7118
],
72-
Array [
73-
Object {
74-
"payload": Object {
75-
"activeItinerary": 0,
76-
"pending": 1,
77-
"routingType": "ITINERARY",
78-
"searchId": "abcd1234",
79-
"updateSearchInReducer": false,
80-
},
81-
"type": "ROUTING_REQUEST",
82-
},
83-
],
84-
Array [
85-
[Function],
86-
],
87-
Array [
88-
Object {
89-
"payload": Object {
90-
"requestId": "abcd1235",
91-
"response": Object {
92-
"fake": "response",
93-
},
94-
"searchId": "abcd1234",
95-
},
96-
"type": "ROUTING_RESPONSE",
97-
},
98-
],
9919
]
10020
`;
101-
102-
exports[`actions > api routingQuery should make a query to OTP: OTP Query Path 1`] = `"/api/plan?fromPlace=%2812%2C34%29%3A%3A12%2C34&toPlace=%2834%2C12%29%3A%3A34%2C12&mode=WALK%2CTRANSIT&ignoreRealtimeUpdates=false&batchId=abcd1234"`;

__tests__/actions/form.ts

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import '../test-utils/mock-window-url'
2+
import { checkShouldReplanTrip } from '../../lib/actions/form'
3+
4+
describe('actions > form', () => {
5+
describe('checkShouldReplanTrip', () => {
6+
it('should not replan trip on mobile (with default autoPlan settings) if both locations change from null', () => {
7+
const autoPlan = {
8+
default: 'ONE_LOCATION_CHANGED',
9+
mobile: 'BOTH_LOCATIONS_CHANGED'
10+
}
11+
const oldQuery = {
12+
from: null,
13+
to: null
14+
}
15+
const newQuery = {
16+
from: { name: 'From place' },
17+
to: { name: 'To place' }
18+
}
19+
expect(
20+
checkShouldReplanTrip(autoPlan, true, oldQuery, newQuery)
21+
.shouldReplanTrip
22+
).toBe(null)
23+
})
24+
})
25+
})

__tests__/components/__snapshots__/date-time-options.js.snap

+14-14
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ exports[`components > form > call-taker > date time options should correctly han
9090
"lineHeight": ".8em",
9191
"marginLeft": "3px",
9292
"padding": "0px",
93-
"width": "50px",
93+
"width": "65px",
9494
}
9595
}
96-
value="12a"
96+
value="12:00 AM"
9797
/>
9898
</OverlayTrigger>
9999
<input
@@ -207,10 +207,10 @@ exports[`components > form > call-taker > date time options should correctly han
207207
"lineHeight": ".8em",
208208
"marginLeft": "3px",
209209
"padding": "0px",
210-
"width": "50px",
210+
"width": "65px",
211211
}
212212
}
213-
value="12p"
213+
value="12:00 PM"
214214
/>
215215
</OverlayTrigger>
216216
<input
@@ -324,10 +324,10 @@ exports[`components > form > call-taker > date time options should correctly han
324324
"lineHeight": ".8em",
325325
"marginLeft": "3px",
326326
"padding": "0px",
327-
"width": "50px",
327+
"width": "65px",
328328
}
329329
}
330-
value="133"
330+
value="1:03 PM"
331331
/>
332332
</OverlayTrigger>
333333
<input
@@ -441,10 +441,10 @@ exports[`components > form > call-taker > date time options should correctly han
441441
"lineHeight": ".8em",
442442
"marginLeft": "3px",
443443
"padding": "0px",
444-
"width": "50px",
444+
"width": "65px",
445445
}
446446
}
447-
value="133p"
447+
value="1:33 PM"
448448
/>
449449
</OverlayTrigger>
450450
<input
@@ -558,10 +558,10 @@ exports[`components > form > call-taker > date time options should correctly han
558558
"lineHeight": ".8em",
559559
"marginLeft": "3px",
560560
"padding": "0px",
561-
"width": "50px",
561+
"width": "65px",
562562
}
563563
}
564-
value="135p"
564+
value="1:35 PM"
565565
/>
566566
</OverlayTrigger>
567567
<input
@@ -675,10 +675,10 @@ exports[`components > form > call-taker > date time options should correctly han
675675
"lineHeight": ".8em",
676676
"marginLeft": "3px",
677677
"padding": "0px",
678-
"width": "50px",
678+
"width": "65px",
679679
}
680680
}
681-
value="1335"
681+
value="1:35 PM"
682682
/>
683683
</OverlayTrigger>
684684
<input
@@ -792,10 +792,10 @@ exports[`components > form > call-taker > date time options should render 1`] =
792792
"lineHeight": ".8em",
793793
"marginLeft": "3px",
794794
"padding": "0px",
795-
"width": "50px",
795+
"width": "65px",
796796
}
797797
}
798-
value="12:34"
798+
value="12:34 PM"
799799
/>
800800
</OverlayTrigger>
801801
<input

0 commit comments

Comments
 (0)