Skip to content

Commit

Permalink
Merge pull request #952 from opentripplanner/dev
Browse files Browse the repository at this point in the history
Release: July 24, 2023
  • Loading branch information
amy-corson-ibigroup authored Jul 31, 2023
2 parents 2fd726a + 4686537 commit fbe413d
Show file tree
Hide file tree
Showing 136 changed files with 4,738 additions and 3,289 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 3 additions & 27 deletions .github/workflows/percy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

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

[![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
Expand Down Expand Up @@ -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.
82 changes: 0 additions & 82 deletions __tests__/actions/__snapshots__/api.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
],
]
`;

Expand All @@ -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"`;
25 changes: 25 additions & 0 deletions __tests__/actions/form.ts
Original file line number Diff line number Diff line change
@@ -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)
})
})
})
28 changes: 14 additions & 14 deletions __tests__/components/__snapshots__/date-time-options.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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"
/>
</OverlayTrigger>
<input
Expand Down Expand Up @@ -207,10 +207,10 @@ exports[`components > 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"
/>
</OverlayTrigger>
<input
Expand Down Expand Up @@ -324,10 +324,10 @@ exports[`components > 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"
/>
</OverlayTrigger>
<input
Expand Down Expand Up @@ -441,10 +441,10 @@ exports[`components > 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"
/>
</OverlayTrigger>
<input
Expand Down Expand Up @@ -558,10 +558,10 @@ exports[`components > 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"
/>
</OverlayTrigger>
<input
Expand Down Expand Up @@ -675,10 +675,10 @@ exports[`components > 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"
/>
</OverlayTrigger>
<input
Expand Down Expand Up @@ -792,10 +792,10 @@ exports[`components > 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"
/>
</OverlayTrigger>
<input
Expand Down
Loading

0 comments on commit fbe413d

Please sign in to comment.