Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
9a77687
Merge pull request #192 from opentripplanner/dev
evansiroky Jul 9, 2020
879b481
Merge commit 'd9ed60dd03ae5ab61fa71706f557a462d89cf79c'
evansiroky Jul 9, 2020
1d5f599
Merge pull request #198 from opentripplanner/dev
landonreed Jul 10, 2020
96c689d
Merge pull request #204 from opentripplanner/dev
evansiroky Aug 5, 2020
72875cb
Merge branch 'dev' into commtrans-accessibility-release
binh-dam-ibigroup Aug 20, 2020
f6994a9
Merge pull request #213 from opentripplanner/commtrans-accessibility-…
landonreed Aug 20, 2020
a3b6d0f
Merge pull request #215 from opentripplanner/dev
landonreed Aug 21, 2020
6f7aebe
Merge pull request #225 from opentripplanner/dev
binh-dam-ibigroup Sep 8, 2020
704f312
Merge pull request #235 from opentripplanner/dev
landonreed Sep 23, 2020
23ddcc1
Merge pull request #240 from opentripplanner/dev
evansiroky Oct 1, 2020
797dae8
Merge pull request #249 from opentripplanner/dev
evansiroky Oct 7, 2020
4930580
Merge pull request #252 from opentripplanner/dev
landonreed Oct 8, 2020
7fbcb6a
Merge pull request #261 from opentripplanner/dev
landonreed Oct 21, 2020
097f809
Merge pull request #264 from opentripplanner/dev
landonreed Oct 22, 2020
7c3db35
Merge pull request #267 from opentripplanner/dev
binh-dam-ibigroup Oct 30, 2020
7562e69
Merge pull request #273 from opentripplanner/dev
landonreed Nov 9, 2020
dec2bb7
Merge pull request #277 from opentripplanner/dev
binh-dam-ibigroup Jan 5, 2021
3bdc600
Merge pull request #299 from opentripplanner/dev
landonreed Jan 5, 2021
0a3887d
Merge pull request #302 from opentripplanner/dev
evansiroky Jan 8, 2021
56e4243
Merge pull request #307 from opentripplanner/dev
landonreed Jan 14, 2021
bf20282
Merge pull request #318 from opentripplanner/dev
landonreed Jan 25, 2021
f4b3a25
Merge pull request #351 from opentripplanner/dev
evansiroky Apr 13, 2021
3d4386f
Merge pull request #367 from opentripplanner/dev
binh-dam-ibigroup May 19, 2021
bbfec9f
Merge pull request #402 from opentripplanner/dev
binh-dam-ibigroup Jul 7, 2021
c12097b
Merge pull request #405 from opentripplanner/dev
landonreed Jul 7, 2021
ce9d5bf
Merge pull request #410 from opentripplanner/dev
evansiroky Jul 9, 2021
3f5a2a5
Merge pull request #416 from opentripplanner/dev
evansiroky Jul 15, 2021
4cf9c0e
Merge pull request #420 from opentripplanner/dev
landonreed Jul 22, 2021
4e8dfae
Merge pull request #432 from opentripplanner/dev
landonreed Aug 18, 2021
36328f5
Merge pull request #437 from opentripplanner/dev
landonreed Aug 19, 2021
c37ac4d
Merge pull request #439 from opentripplanner/dev
landonreed Aug 23, 2021
629d885
refactor: move to craco, support build
miles-grant-ibigroup Sep 2, 2021
f4f930b
chore: attempt to get tests working
miles-grant-ibigroup Sep 2, 2021
803e77d
chore: attempt to repair a11y tests
miles-grant-ibigroup Sep 2, 2021
a622227
test: fix a11y tests
miles-grant-ibigroup Sep 7, 2021
c05b6f6
refactor: update husky hook
miles-grant-ibigroup Sep 7, 2021
7a3832d
test: bump node version to 16
miles-grant-ibigroup Sep 7, 2021
35464d9
test: fix tests for craco (improve api.js null checks)
miles-grant-ibigroup Sep 7, 2021
2b73cbb
chore: update temporary transit-vehicle-overlay import
miles-grant-ibigroup Sep 7, 2021
3db4a98
chore: update lockfile
miles-grant-ibigroup Sep 7, 2021
b37c86e
refactor: fix pdfkit through webpack
miles-grant-ibigroup Sep 7, 2021
1d881bd
Merge pull request #451 from opentripplanner/dev
landonreed Sep 8, 2021
39c27a0
chore: migrate from temporary otp-ui packages
miles-grant-ibigroup Sep 14, 2021
085363d
chore: only lint staged files
miles-grant-ibigroup Sep 14, 2021
de0754a
Merge branch 'dev' into migrate-to-craco
miles-grant-ibigroup Sep 14, 2021
a7b6899
ci: allow lint staged to work by first moving latest commit back to s…
miles-grant-ibigroup Sep 14, 2021
c38be2f
chore: fetch git history
miles-grant-ibigroup Sep 14, 2021
cbbf70b
ci: increase clone depth
miles-grant-ibigroup Sep 14, 2021
2dd9c19
ci: reduce fetch depth
miles-grant-ibigroup Sep 14, 2021
1e28a59
feat: add typescript support
miles-grant-ibigroup Sep 15, 2021
2439727
refactor: integrate trimet-mod-otp
miles-grant-ibigroup Sep 20, 2021
5ebde60
Merge branch 'dev' into migrate-to-craco
miles-grant-ibigroup Sep 22, 2021
160d310
refactor: adjustments for trimet-mod-otp styling
miles-grant-ibigroup Sep 22, 2021
ffcc40e
refactor: fix build by downgrading mini-css-extract-plugin
miles-grant-ibigroup Sep 22, 2021
bd8581c
refactor: adjust to trimet-mod-otp changes
miles-grant-ibigroup Sep 22, 2021
61e803e
refactor: replace ts-loader with babel-loader
miles-grant-ibigroup Sep 22, 2021
21a7409
refactor: add example.js features to app.js and main.js
miles-grant-ibigroup Sep 24, 2021
71b0ad5
chore: improve source map quality
miles-grant-ibigroup Sep 27, 2021
5052ddd
chore: enable webpack module reloading
miles-grant-ibigroup Sep 27, 2021
4140b44
chore: support react 17 fast refresh
miles-grant-ibigroup Sep 27, 2021
cb78f51
refactor(route-viewer): trimet-mod-otp integration fixes
miles-grant-ibigroup Sep 27, 2021
fdedb44
chore: downgrade to react 16.14, fixing enzyme tests
miles-grant-ibigroup Sep 27, 2021
921b5e5
refactor(route-details-viewer): another attempt of tmo-agnostic styling
miles-grant-ibigroup Sep 27, 2021
16fe92d
fix(bounds-updating-overlay): fix map not appearing on desktop
miles-grant-ibigroup Oct 1, 2021
2852a39
refactor(bounds-updating-overlay): format file
miles-grant-ibigroup Oct 1, 2021
bdd68ef
Merge branch 'make-location-field-updates-configurable' into migrate-…
miles-grant-ibigroup Oct 5, 2021
4ce8b62
refactor(bounds-updating-overlay): support config with no initZoom
miles-grant-ibigroup Oct 5, 2021
4753fe5
Merge pull request #463 from opentripplanner/dev
binh-dam-ibigroup Oct 5, 2021
198c0d1
feat(example-config): remove period
miles-grant-ibigroup Oct 5, 2021
aae17e0
Merge pull request #464 from opentripplanner/force-master-package
binh-dam-ibigroup Oct 5, 2021
19ea126
Merge pull request #466 from opentripplanner/dev
binh-dam-ibigroup Oct 5, 2021
c356d92
Merge branch 'dev' into migrate-to-craco
miles-grant-ibigroup Oct 6, 2021
5025772
test: fix a11y tests
miles-grant-ibigroup Oct 7, 2021
672e7d9
chore: remove files required by mastarm
miles-grant-ibigroup Oct 7, 2021
ad00144
refactor: add typescript types
miles-grant-ibigroup Oct 8, 2021
1641915
refactor: update readme
miles-grant-ibigroup Oct 8, 2021
254b57d
docs: readme corrections
miles-grant-ibigroup Oct 8, 2021
7a43e90
refactor: cleanup craco config
miles-grant-ibigroup Oct 8, 2021
dea0560
refactor(craco.config): only conditionally load hot-loader
miles-grant-ibigroup Oct 8, 2021
d940b1f
Merge branch 'dev' into migrate-to-craco
miles-grant-ibigroup Oct 19, 2021
0ad0768
test: update snapshots
miles-grant-ibigroup Oct 19, 2021
152adb0
refactor: fix merged commits to work with typescript
miles-grant-ibigroup Oct 19, 2021
3e9fdab
refactor(actions/api): fix enhanced stop viewer bugs
miles-grant-ibigroup Oct 19, 2021
a818bc5
Merge branch 'dev' into migrate-to-craco
miles-grant-ibigroup Oct 21, 2021
e2ddaec
Merge pull request #475 from opentripplanner/dev
miles-grant-ibigroup Oct 21, 2021
f22c5a3
refactor: account for latest dev changes
miles-grant-ibigroup Oct 21, 2021
472c4c7
Merge branch 'master' into migrate-to-craco
miles-grant-ibigroup Oct 22, 2021
b09e836
refactor: add typescript where linter requires
miles-grant-ibigroup Oct 22, 2021
c814707
chore(deps): upgrade location field to use fixed version
miles-grant-ibigroup Oct 22, 2021
08738e8
improvement(app-menu): repair app menu regression
miles-grant-ibigroup Oct 22, 2021
ca73711
refactor: address pr feedback
miles-grant-ibigroup Oct 25, 2021
71d0123
ci: experiment with lint-all reporting
miles-grant-ibigroup Oct 25, 2021
f1b7199
ci: correctl allow lint-all to fail
miles-grant-ibigroup Oct 25, 2021
f73f4ac
ci: improve lint all code message
miles-grant-ibigroup Oct 25, 2021
77b62dc
Merge branch 'support-gtfs-flex' into migrate-to-craco
miles-grant-ibigroup Oct 26, 2021
326c2cb
improvement(craco config): support webfonts in build
miles-grant-ibigroup Oct 26, 2021
65d22e3
Merge branch 'support-gtfs-flex' into migrate-to-craco
miles-grant-ibigroup Oct 26, 2021
b81dad0
refactor: typescript files as requested by linter
miles-grant-ibigroup Oct 26, 2021
44d053c
refactor: disable eslint on files which will require large typescript…
miles-grant-ibigroup Oct 26, 2021
1a22028
refactor(craco.config): vastly reduce built bundle size
miles-grant-ibigroup Oct 27, 2021
1582c98
refactor(connected-transit-vehicle-overlay): add missing react import
miles-grant-ibigroup Oct 28, 2021
461936f
refactor(eslintrc): have auto sort keys fix match non-auto one
miles-grant-ibigroup Oct 28, 2021
2af87d5
chore(app): lint file
miles-grant-ibigroup Oct 28, 2021
b02144c
refactor(app): apply suggestions from pr review
miles-grant-ibigroup Oct 28, 2021
1d9b8c8
refactor: address pr feedback
miles-grant-ibigroup Oct 28, 2021
93d62e8
chore(deps): more specifically define react version
miles-grant-ibigroup Nov 1, 2021
42af060
Merge branch 'dev' into migrate-to-craco
miles-grant-ibigroup Nov 4, 2021
6c7fb3d
chore: resolve merge conflict
miles-grant-ibigroup Nov 4, 2021
17ea526
refactor(tabbed-itineraries): meet linter demands
miles-grant-ibigroup Nov 4, 2021
dc02e88
Merge branch 'dev' into migrate-to-craco
miles-grant-ibigroup Nov 5, 2021
6d82322
fix(default-itinerary): don't shrink flexIndicator
miles-grant-ibigroup Nov 9, 2021
23ad70b
Merge branch 'dev' into migrate-to-craco
miles-grant-ibigroup Nov 12, 2021
02b779a
Merge branch 'dev' into migrate-to-craco
miles-grant-ibigroup Nov 19, 2021
1b11bd4
Merge branch 'dev' into migrate-to-craco
miles-grant-ibigroup Nov 23, 2021
ca2cebb
Merge branch 'dev' into migrate-to-craco
miles-grant-ibigroup Nov 29, 2021
fe0ce41
chore: add react import where missing
miles-grant-ibigroup Nov 29, 2021
537589c
refactor(formatted-mode): remove typescript to work with documentatio…
miles-grant-ibigroup Nov 29, 2021
243d455
refactor: disable eslint on difficult-to-type files
miles-grant-ibigroup Nov 29, 2021
a31ea9c
refactor(formatted-realtime-status-label): add typescript
miles-grant-ibigroup Nov 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"plugins": ["babel-plugin-add-module-exports", "babel-plugin-lodash"],
"presets": [
"@babel/preset-env",
"@babel/preset-typescript",
"@babel/preset-react"
],
"env": {
"development": {
"plugins": ["react-refresh/babel"]
},
"test": {
"presets": [["@babel/preset-env", { "targets": { "node": "current" } }]]
}
}
}
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PORT=9966
125 changes: 125 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
module.exports = {
extends: [
'standard',
'standard-jsx',
'react-app',
'plugin:@typescript-eslint/recommended',
'plugin:typescript-sort-keys/recommended',
'plugin:react/recommended',
'plugin:jest/recommended',
'plugin:jsx-a11y/strict',
'plugin:prettier/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
'sort-keys-fix',
'import',
'jest',
'jsx-a11y',
'react',
'sort-destructure-keys',
'sort-imports-es6-autofix',
'typescript-sort-keys'
],
rules: {
'@typescript-eslint/member-delimiter-style': [
'off',
{
multiline: {
delimiter: 'none',
requireLast: false
},
singleline: {
delimiter: 'comma',
requireLast: false
}
}
],
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/no-var-requires': 0,
complexity: ['warn', 12],
'import/order': [
'warn',
{
'newlines-between': 'always'
}
],
'jsx-a11y/label-has-for': [
2,
{
allowChildren: false,
components: ['Label'],
required: {
every: ['id']
}
}
],
// from docs: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md#how-to-use
// it must be disabled to work correctly
'no-use-before-define': 'off',
'object-curly-spacing': 0,
'prefer-const': [
'warn',
{
destructuring: 'all',
ignoreReadBeforeAssign: false
}
],
'prettier/prettier': [
'error',
{
semi: false,
singleQuote: true,
trailingComma: 'none'
}
],
quotes: [2, 'single', { avoidEscape: true }],
'react/jsx-handler-names': 'off',
'react/jsx-sort-props': [
'error',
{
ignoreCase: true
}
],
'sort-destructure-keys/sort-destructure-keys': [
'error',
{
caseSensitive: false
}
],
'sort-imports-es6-autofix/sort-imports-es6': [
2,
{
ignoreCase: true,
ignoreMemberSort: false
}
],
'sort-keys': [
'error',
'asc',
{
caseSensitive: false
}
],
'sort-keys-fix/sort-keys-fix': [
'warn',
'asc',
{
caseSensitive: false
}
],
'sort-vars': [
'error',
{
ignoreCase: true
}
]
},
settings: {
react: {
version: '999.999.999'
}
}
}
14 changes: 11 additions & 3 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,24 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
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: 14.x
node-version: 16.x
- name: Install npm packages using cache
uses: bahmutov/npm-install@v1
- name: Copy example config
run: cp example-config.yml config.yml
- name: Lint code
run: yarn lint
# Move everything from latest commit back to staged
run: git reset --soft HEAD^ && yarn lint
# For our info, lint all files but don't mark them as failure
# TODO: remove this once project is typescripted
- name: Lint all code (ignoring errors)
run: yarn lint-all || true
- name: Lint docs
run: yarn lint-docs
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
yarn lint-staged
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,29 @@ An example of an OTP-RR application is included in the repository. The example p

To run, first clone the repo and install [yarn](https://yarnpkg.com/) if needed.

Copy `example-config.yml` to `config.yml`. Update `config.yml` with the needed API keys, and optionally, the OTP endpoint and initial map origin. (The default values are for a test server for Portland, OR.).
Update `example-config.yml` with the needed API keys, and optionally, the OTP endpoint and initial map origin. (The default values are for a test server for Portland, OR.).

Install the dependencies and start a local instance using the following script:

```bash
yarn start
```

Should you want to maintain multiple configuration files, OTP-RR can be made to use a custom config file by using environment variables. Other environment variables also exist. `CUSTOM_CSS` can be used to point to a css file to inject, and `JS_CONFIG` can be used to point to a `config.js` file to override the one shipped with OTP-RR.

```bash
yarn start --env.YAML_CONFIG=/absolute/path/to/config.yml
```

## Deploying the UI

1. Build the js/css bundle by running `yarn build`. The build will appear in the `dist/` directory).
2. Modify the `index.html` to point to `dist/index.js` (instead of `example.js`).
3. Upload the following files to wherever you're deploying the UI:
- `index.html` (modified to point to `dist/index.js`)
- `example.css`
- `dist/`
- `index.js`
- `index.js.map`
- `index.css`
- `index.css.map`

Note: only contents produced during build in the `dist/` directory are likely to change over time (the `index.html` and `example.css` files contain minimal code), so subsequent deployments will typically only need to replace the `dist/` contents.
Build the js/css bundle by running `yarn build`. The build will appear in the `dist/` directory).

The same environment variables which affect the behavior of `yarn start` also affect `yarn build`. Running the following command builds OTP-RR with customized js and css:

```bash
yarn build --env.JS_CONFIG=my-custom-js.js env.CUSTOM_CSS=my-custom-css.css
```

## Library Documentation

Expand Down
4 changes: 2 additions & 2 deletions __tests__/actions/__snapshots__/api.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Array [
Array [
Object {
"payload": Object {
"error": [TypeError: Cannot read property 'trackRecent' of undefined],
"error": [TypeError: Cannot read properties of undefined (reading 'trackRecent')],
"requestId": "abcd1239",
"searchId": "abcd1234",
"url": "http://mock-host.com:80/api/plan?fromPlace=Origin%20%2812%2C34%29%3A%3A12%2C34&toPlace=Destination%20%2834%2C12%29%3A%3A34%2C12&mode=WALK%2CTRANSIT&ignoreRealtimeUpdates=false&batchId=abcd1234",
Expand Down Expand Up @@ -110,7 +110,7 @@ Array [
Array [
Object {
"payload": Object {
"error": [TypeError: Cannot read property 'trackRecent' of undefined],
"error": [TypeError: Cannot read properties of undefined (reading 'trackRecent')],
"requestId": "abcd1236",
"searchId": "abcd1234",
"url": "http://mock-host.com:80/api/plan?fromPlace=Origin%20%2812%2C34%29%3A%3A12%2C34&toPlace=Destination%20%2834%2C12%29%3A%3A34%2C12&mode=WALK%2CTRANSIT&ignoreRealtimeUpdates=false&batchId=abcd1234",
Expand Down
Loading