Skip to content

Commit b2db337

Browse files
authored
Merge pull request #604 from ibi-group/dev
Release
2 parents 10c5627 + 71eb526 commit b2db337

Some content is hidden

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

42 files changed

+1603
-773
lines changed

__tests__/end-to-end.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ describe('end-to-end', () => {
885885
await click('[data-test-id="confirm-create-user-button"]')
886886

887887
// wait for user to be saved
888-
await wait(2000, 'for user to be created')
888+
await wait(30000, 'for user to be created')
889889

890890
// filter users
891891
await filterUsers(testUserSlug)
@@ -2471,6 +2471,11 @@ describe('end-to-end', () => {
24712471
await page.keyboard.press('Tab')
24722472
await page.keyboard.press('Enter')
24732473

2474+
// trip short name
2475+
await page.keyboard.type('test-trip-short-name')
2476+
await page.keyboard.press('Tab')
2477+
await page.keyboard.press('Enter')
2478+
24742479
// Laurel Dr arrival
24752480
await page.keyboard.type('1234')
24762481
await page.keyboard.press('Tab')

__tests__/test-utils/mock-data/manager.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ export const mockFeedWithVersion = {
139139
retrievalMethod: 'MANUALLY_UPLOADED',
140140
s3Url: null,
141141
snapshotVersion: null,
142+
transformRules: [],
142143
url: 'http://mdtrip.org/googletransit/AnnapolisTransit/google_transit.zip',
143144
user: null
144145
}
@@ -160,6 +161,7 @@ export const mockFeedWithoutVersion = {
160161
retrievalMethod: 'FETCHED_AUTOMATICALLY',
161162
s3Url: null,
162163
snapshotVersion: null,
164+
transformRules: [],
163165
url: null,
164166
user: null
165167
}
605 KB
Loading
524 KB
Loading

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# IBI Transit Data Tools
1+
# IBI Transit Data Tools (TRANSIT-data-tools)
22

33
The IBI Transit Data Tools suite provides web-based tools for creating, managing, evaluating, and publishing transit data, specifically data stored in the General Transit Feed Specification (GTFS) format.
44

docs/user/managing-projects-feeds.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,35 @@ Feed Versions are created from the main Feed Source profile page. There are thre
5252

5353
3. **Import From the GTFS Editor**: Select "From snapshot" from the `+ Create new version` dropdown. The list of snapshots should now be visible showing any available snapshots of the feed in the Editor. Select the desired snapshot by clicking the "Publish" button to publish the snapshot as a new version.
5454

55+
4. **Service Period Merge** (certain Data Tools configurations only): If a Feed Source has two or more Feed Versions, a new Feed Version can be created by merging two versions representing a transit agency's service over different time periods. While viewing a particular Feed Version, click `Merge with version` (underneath the map view) to select which past version you would like to merge with.
56+
57+
5. **Regional Merge**: For Projects that contain multiple Feed Sources across a region, it can be useful to merge multiple transit agencies together into a combined GTFS feed for the entire region. While viewing a Project's list of Feed Sources, click `Actions > Merge all` to produce a combined GTFS file for all Feed Sources.
58+
5559
**Note:** when uploading or fetching a feed, and the file being uploaded or fetched is not different from the latest version, no new Feed Version will be created.
5660

57-
## Loading Feed Versions into Editor
61+
## Feed Transformations
62+
63+
Data Tools now supports **Feed Transformations**, which can apply a set of changes automatically to each new GTFS feed loaded into the system. This is especially helpful for applying repeatable changes to or inserting supplementary files into GTFS feeds that need to be enhanced. It provides a critical stopgap to improve GTFS coming out of systems that cannot be modified (e.g., scheduling software that has a rigid export format). The different transformation types currently supported are:
64+
65+
1. **Replace File From Version** - any file in an incoming GTFS (e.g., feed_info.txt) can be overwritten or inserted with a file extracted from a previously loaded feed version.
66+
67+
2. **Replace File From String** - any file in an incoming GTFS (e.g., feed_info.txt) can be overwritten or inserted with user-defined CSV data.
68+
69+
### Configuring Feed Transformations
70+
71+
Follow the steps below to configure Feed Transformations for an existing Feed Source:
72+
73+
1. Select a Feed Source and click `Settings > Feed Transformations`.
74+
2. From here, click `Add transformation` to begin creating a new set of rules for incoming GTFS feeds. Your first ruleset will automatically apply to GTFS that is fetched automatically *and* manually uploaded, but this can be changed for each ruleset to apply to any of the retrieval methods listed in [Creating Feed Versions](#creating-feed-versions).
75+
3. Click `Add step to transformation` to select a transformation type and fill in the required fields for each type. Multiple transformations can be specified and each will be applied to the incoming GTFS file in the order that they are defined.
76+
77+
![screenshot](../img/configure-feed-transformations.png)
78+
79+
### Viewing the Feed Transformation Summary
80+
81+
Once the Feed Transformations have all been configured, you can import a new GTFS file using one of the retrieval methods you have specified for your ruleset. Once the GTFS file has been processed, a summary of the transformations is available by hovering over the wrench icon that is visible in the Feed Version panel.
5882

83+
![screenshot](../img/feed-transformation-summary.png)
5984

6085

6186
## Viewing and Managing Feed Versions

gtfs.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,28 @@
629629
inputType: DROPDOWN
630630
bulkEditEnabled: true
631631
options:
632-
- value: 'USD'
633-
- value: 'EUR'
634-
- value: 'GBP'
632+
- value: USD
633+
text: US dollar (USD)
634+
- value: AUD
635+
text: Australian dollar (AUD)
636+
- value: CAD
637+
text: Canadian dollar (CAD)
638+
- value: CHF
639+
text: Swiss franc (CHF)
640+
- value: CNH
641+
text: Chinese renminbi (CNH)
642+
- value: EUR
643+
text: Euro (EUR)
644+
- value: GBP
645+
text: Pound sterling (GBP)
646+
- value: JPY
647+
text: Japanese yen (JPY)
648+
- value: MXN
649+
text: Mexican peso (MXN)
650+
- value: NZD
651+
text: New Zealand dollar (NZD)
652+
- value: SEK
653+
text: Swedish krona (SEK)
635654
columnWidth: 12
636655
helpContent: "The currency_type field defines the currency used to pay the fare. Please use the ISO 4217 alphabetical currency codes which can be found at the following URL:http://en.wikipedia.org/wiki/ISO_4217."
637656
- name: "payment_method"
@@ -776,6 +795,7 @@
776795

777796
- id: scheduleexception
778797
name: (none)
798+
datatools: true
779799
helpContent: Conveyal-specific table for classifying schedule exceptions.
780800
fields:
781801
- name: name

i18n/english.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,23 @@ components:
228228
upload: Upload
229229
versions: Versions
230230
viewPublic: View public page
231+
FeedTransformationDescriptions:
232+
general:
233+
fileDefined: below text
234+
filePlaceholder: '[choose file]'
235+
tablePlaceholder: '[choose table]'
236+
table: table
237+
version: version
238+
versionPlaceholder: '[choose version]'
239+
DeleteRecordsTransformation:
240+
label: Delete records from %tablePlaceholder%
241+
name: Delete records transformation
242+
ReplaceFileFromStringTransformation:
243+
label: Replace %tablePlaceholder% from %filePlaceholder%
244+
name: Replace file from string transformation
245+
ReplaceFileFromVersionTransformation:
246+
label: Replace %tablePlaceholder% from %versionPlaceholder%
247+
name: Replace file from version transformation
231248
FeedVersionNavigator:
232249
confirmDelete: Are you sure you want to delete this version? This cannot be undone.
233250
confirmLoad: 'This will override all active GTFS Editor data for this Feed Source with the data from this version. If there is unsaved work in the Editor you want to keep, you must snapshot the current Editor data first. Are you sure you want to continue?'

lib/common/actions/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function createVoidPayloadAction (type: string) {
1111
return () => ({ type })
1212
}
1313

14-
export function secureFetch (url: string, method: string = 'get', payload: any, raw: boolean = false, isJSON: boolean = true, actionOnFail: any): any {
14+
export function secureFetch (url: string, method: string = 'get', payload?: any, raw: boolean = false, isJSON: boolean = true, actionOnFail?: string): any {
1515
return function (dispatch: dispatchFn, getState: getStateFn) {
1616
function consoleError (message) {
1717
console.error(`Error making ${method} request to ${url}: `, message)
@@ -95,7 +95,7 @@ export function fetchGraphQL ({
9595
}: {
9696
errorMessage?: string,
9797
query: string,
98-
variables: any
98+
variables?: {[key: string]: string | number | Array<string>}
9999
}): any {
100100
return function (dispatch: dispatchFn, getState: getStateFn) {
101101
const body = {

lib/common/components/JobMonitor.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {Link} from 'react-router'
77

88
import {removeRetiredJob} from '../../manager/actions/status'
99
import SidebarPopover from './SidebarPopover'
10+
import {getConfigProperty} from '../util/config'
1011

1112
import type {ServerJob} from '../../types'
1213
import type {JobStatusState} from '../../types/reducers'
@@ -136,6 +137,7 @@ class RetiredJob extends Component<{
136137
render () {
137138
const {job} = this.props
138139
const path = this._getPathToObject()
140+
const supportEmail = getConfigProperty('application.support_email')
139141
return (
140142
<li className='job-container'>
141143
<div style={{ float: 'left' }}>
@@ -189,12 +191,15 @@ class RetiredJob extends Component<{
189191
<Icon type='bug' /> Oh no! Looks like an error has occurred.
190192
</span>
191193
}>
192-
<p>
193-
To submit an error report email a screenshot of your browser
194-
window, the following text (current URL and error details),
195-
and a detailed description of the steps you followed
196-
to <a href='mailto:[email protected]'>[email protected]</a>.
197-
</p>
194+
{supportEmail
195+
? <p>
196+
To submit an error report email a screenshot of your browser
197+
window, the following text (current URL and error details),
198+
and a detailed description of the steps you followed
199+
to <a href={`mailto:${supportEmail}`}>{supportEmail}</a>.
200+
</p>
201+
: null
202+
}
198203
<p>{window.location.href}</p>
199204
<span style={{whiteSpace: 'pre', fontSize: 'xx-small'}}>
200205
{job.status.exceptionDetails}

0 commit comments

Comments
 (0)