diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml
index 15dffceb6..79874aecd 100644
--- a/.github/workflows/node-ci.yml
+++ b/.github/workflows/node-ci.yml
@@ -32,6 +32,8 @@ jobs:
run: yarn lint-all || true
- name: Run type check
run: yarn typecheck
+ - name: Check i18n messages (en-US and fr)
+ run: yarn check:i18n-en-fr
- name: Run tests
run: yarn unit
- name: Build example project
diff --git a/.github/workflows/percy.yml b/.github/workflows/percy.yml
index 5dc6abc37..ffde64290 100644
--- a/.github/workflows/percy.yml
+++ b/.github/workflows/percy.yml
@@ -8,31 +8,7 @@ on:
pull_request:
jobs:
- run-pixel-tests-with-otp1-real-server:
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2
- with:
- # This allows us to work with the repository during the lint step
- fetch-depth: 2
- - name: Use Node.js 16.x
- uses: actions/setup-node@v1
- with:
- node-version: 16.x
- - name: Install npm packages using cache
- uses: bahmutov/npm-install@v1
- - name: Download OTP1 config file
- run: curl $PERCY_OTP1_CONFIG_URL --output /tmp/otp1config.yml
- env:
- PERCY_OTP1_CONFIG_URL: ${{ secrets.PERCY_OTP1_CONFIG_URL_METRO }}
- - name: Take Percy Snapshots
- # Move everything from latest commit back to staged
- run: npx percy exec -- npx jest percy/percy.test.js --force-exit
- env:
- PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
- PERCY_OTP_CONFIG_OVERRIDE: /tmp/otp1config.yml
- run-pixel-tests-with-otp2-real-server:
+ run-pixel-tests-with-otp2-real-server-mobile:
runs-on: ubuntu-latest
steps:
@@ -49,7 +25,7 @@ jobs:
- name: Download OTP2 config file
run: curl $PERCY_OTP2_CONFIG_URL --output /tmp/otp2config.yml
env:
- PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_OTP2_CONFIG_URL_METRO }}
+ PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_OTP2_CONFIG_URL_METRO_MODE_SELECTOR }}
- name: Take Percy Snapshots
# Move everything from latest commit back to staged
run: npx percy exec -- npx jest percy/percy.test.js --force-exit
@@ -74,7 +50,7 @@ jobs:
- name: Download OTP2 config file
run: curl $PERCY_OTP2_CONFIG_URL --output /tmp/otp2config.yml
env:
- PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_OTP2_CONFIG_URL_METRO }}
+ PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_OTP2_CONFIG_URL_METRO_MODE_SELECTOR }}
- name: Take Percy Snapshots
# Move everything from latest commit back to staged
run: npx percy exec -- npx jest percy/percy.test.js --force-exit
diff --git a/README.md b/README.md
index 1ab2e1878..ff8e2054d 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,9 @@
+[![Join the chat at https://gitter.im/opentripplanner/otp-react-redux](https://badges.gitter.im/repo.png)](https://gitter.im/opentripplanner/otp-react-redux)
+[![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)
+
A library for writing modern [OpenTripPlanner](http://www.opentripplanner.org/)-compatible multimodal journey planning applications using [React]() and [Redux]().
## Running the Example
@@ -119,6 +122,6 @@ If changes to a specific language file is needed but not enabled in Weblate, ple
## Library Documentation
-More coming soon...
+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.
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.
diff --git a/__tests__/actions/__snapshots__/api.js.snap b/__tests__/actions/__snapshots__/api.js.snap
index c8b742c84..1082730fd 100644
--- a/__tests__/actions/__snapshots__/api.js.snap
+++ b/__tests__/actions/__snapshots__/api.js.snap
@@ -5,62 +5,9 @@ Array [
Array [
[Function],
],
- Array [
- Object {
- "payload": Object {
- "activeItinerary": 0,
- "pending": 1,
- "routingType": "ITINERARY",
- "searchId": "abcd1234",
- "updateSearchInReducer": false,
- },
- "type": "ROUTING_REQUEST",
- },
- ],
- Array [
- [Function],
- ],
- Array [
- Object {
- "payload": Object {
- "requestId": "abcd1237",
- "response": Object {
- "fake": "response",
- },
- "searchId": "abcd1234",
- },
- "type": "ROUTING_RESPONSE",
- },
- ],
- Array [
- [Function],
- ],
- Array [
- Object {
- "payload": Object {
- "activeItinerary": 0,
- "pending": 1,
- "routingType": "ITINERARY",
- "searchId": "abcd1236",
- "updateSearchInReducer": false,
- },
- "type": "ROUTING_REQUEST",
- },
- ],
Array [
[Function],
],
- Array [
- Object {
- "payload": Object {
- "error": [Error: Received error from server],
- "requestId": "abcd1238",
- "searchId": "abcd1236",
- "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",
- },
- "type": "ROUTING_ERROR",
- },
- ],
]
`;
@@ -69,34 +16,5 @@ Array [
Array [
[Function],
],
- Array [
- Object {
- "payload": Object {
- "activeItinerary": 0,
- "pending": 1,
- "routingType": "ITINERARY",
- "searchId": "abcd1234",
- "updateSearchInReducer": false,
- },
- "type": "ROUTING_REQUEST",
- },
- ],
- Array [
- [Function],
- ],
- Array [
- Object {
- "payload": Object {
- "requestId": "abcd1235",
- "response": Object {
- "fake": "response",
- },
- "searchId": "abcd1234",
- },
- "type": "ROUTING_RESPONSE",
- },
- ],
]
`;
-
-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"`;
diff --git a/__tests__/actions/form.ts b/__tests__/actions/form.ts
new file mode 100644
index 000000000..8140c437e
--- /dev/null
+++ b/__tests__/actions/form.ts
@@ -0,0 +1,25 @@
+import '../test-utils/mock-window-url'
+import { checkShouldReplanTrip } from '../../lib/actions/form'
+
+describe('actions > form', () => {
+ describe('checkShouldReplanTrip', () => {
+ it('should not replan trip on mobile (with default autoPlan settings) if both locations change from null', () => {
+ const autoPlan = {
+ default: 'ONE_LOCATION_CHANGED',
+ mobile: 'BOTH_LOCATIONS_CHANGED'
+ }
+ const oldQuery = {
+ from: null,
+ to: null
+ }
+ const newQuery = {
+ from: { name: 'From place' },
+ to: { name: 'To place' }
+ }
+ expect(
+ checkShouldReplanTrip(autoPlan, true, oldQuery, newQuery)
+ .shouldReplanTrip
+ ).toBe(null)
+ })
+ })
+})
diff --git a/__tests__/components/__snapshots__/date-time-options.js.snap b/__tests__/components/__snapshots__/date-time-options.js.snap
index 620284217..b6c3fb84f 100644
--- a/__tests__/components/__snapshots__/date-time-options.js.snap
+++ b/__tests__/components/__snapshots__/date-time-options.js.snap
@@ -90,10 +90,10 @@ exports[`components > form > call-taker > date time options should correctly han
"lineHeight": ".8em",
"marginLeft": "3px",
"padding": "0px",
- "width": "50px",
+ "width": "65px",
}
}
- value="12a"
+ value="12:00 AM"
/>
form > call-taker > date time options should correctly han
"lineHeight": ".8em",
"marginLeft": "3px",
"padding": "0px",
- "width": "50px",
+ "width": "65px",
}
}
- value="12p"
+ value="12:00 PM"
/>
form > call-taker > date time options should correctly han
"lineHeight": ".8em",
"marginLeft": "3px",
"padding": "0px",
- "width": "50px",
+ "width": "65px",
}
}
- value="133"
+ value="1:03 PM"
/>
form > call-taker > date time options should correctly han
"lineHeight": ".8em",
"marginLeft": "3px",
"padding": "0px",
- "width": "50px",
+ "width": "65px",
}
}
- value="133p"
+ value="1:33 PM"
/>
form > call-taker > date time options should correctly han
"lineHeight": ".8em",
"marginLeft": "3px",
"padding": "0px",
- "width": "50px",
+ "width": "65px",
}
}
- value="135p"
+ value="1:35 PM"
/>
form > call-taker > date time options should correctly han
"lineHeight": ".8em",
"marginLeft": "3px",
"padding": "0px",
- "width": "50px",
+ "width": "65px",
}
}
- value="1335"
+ value="1:35 PM"
/>
form > call-taker > date time options should render 1`] =
"lineHeight": ".8em",
"marginLeft": "3px",
"padding": "0px",
- "width": "50px",
+ "width": "65px",
}
}
- value="12:34"
+ value="12:34 PM"
/>
viewers > stop viewer should render countdown times after
>
viewers > stop viewer should render countdown times after
iconViewBox="0 0 448 512"
>
viewers > stop viewer should render countdown times after
>