Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b299745
feat(gtfs.yml and validation.js): Updated GTFS Spec for stops.txt and…
May 6, 2021
976b5c7
style(validation.js): removed space
May 6, 2021
b1341cf
refactor(validation.js): SOrted typing issues and removed some code
May 10, 2021
8a9c383
improvement(gtfs.yml, end-to-end.js, index.js,validation.js): WIP: Va…
May 11, 2021
baaba8b
improvement(gtfs.yml): Added continuous_pickup and drop off fields to…
May 11, 2021
acd651a
feat(gtfs.yml): Added fields to feed_info.txt
May 11, 2021
93b1f53
improvement(OatternStopCard.js lib/gtfs/util/index.js lib/types/index…
Jun 1, 2021
5397f4a
refactor(patternStopCard.js): Refactored code from github feedback
Jun 1, 2021
ad6bfe6
refactor(end-to-end.js map.js index.js): Fix errors
Jun 2, 2021
6a9e2ed
refactor(PatternStopCard.js): Refactored based on PR Feedback.
Jun 7, 2021
b30a941
refactor(PatternStopCard.js): REfactor
Jun 8, 2021
c4cf115
refactor(PatternStopCard.js): Refactored drop down select method
Jun 9, 2021
36a759d
refactor(PatternStopCard.js): Fix lint errors
Jun 9, 2021
79073f7
refactor(PatternStopCard.js validation.js): Refactor the form control…
Jun 28, 2021
094efc7
refactor(validation.js PatternStopCard.js): Fix flow issues
Jun 28, 2021
7717c28
fix(PatternStopCard.js): Fix flow issue
Jun 28, 2021
f1cb21e
refactor(validation.js): add validationIssue method
landonreed Jul 1, 2021
ff05ac7
refactor(validation): fix stop name message
landonreed Jul 1, 2021
5d17fbb
refactor(validation): fix bad invocation of validationIssue
landonreed Jul 1, 2021
c728b3d
Merge pull request #690 from ibi-group/gtfs-spec-changes-ltr
Jul 2, 2021
212cf37
refactor(PatternStopCard.js): Changed a method name and added a delet…
Jul 2, 2021
3b97719
refactor(PatternStopCard.js): Changed method name
Jul 2, 2021
826088d
Merge branch 'gtfs-spec-changes' of https://github.com/ibi-group/data…
Jul 2, 2021
4039af7
fix(PatternSTopCard.js): Fixed prop bug
Jul 2, 2021
0255029
fix(PatternStopCard.js): Attempt to fix flow error
Jul 3, 2021
ae5eaae
fix(PatternStopCard.js): Attempt to fix flow issue again
Jul 3, 2021
cb588be
fix(PatternStopCard.js): Attempt to fox flow issue 3
Jul 3, 2021
a95a02c
refactor(PatternStopCard): Separate props for <PickupDropoffSelect>
binh-dam-ibigroup Jul 6, 2021
5696ff1
refactor(editor/util/validation): Add emptyFieldValidationIssue.
binh-dam-ibigroup Jul 6, 2021
2eda50c
Merge pull request #691 from ibi-group/gtfs-spec-changes-qbd
Jul 7, 2021
e692199
refactor(PatternStopCard.js validation.js): Refactor
Jul 7, 2021
f567077
refactor(validation): reuse validation method for 'empty' method
landonreed Jul 7, 2021
589b6c6
fix(validation.js): Remove ES lint waiver
Jul 7, 2021
ef69da3
fix(editor/util/validation): Fix stop name validation.
binh-dam-ibigroup Jul 19, 2021
00ea4d4
style(editor/util/validation): Reformat stop_name validation condition
binh-dam-ibigroup Jul 20, 2021
e180c43
Merge branch 'dev' into gtfs-spec-changes
landonreed Sep 2, 2021
1c5fd78
Merge branch 'dev' into gtfs-spec-changes
binh-dam-ibigroup Sep 16, 2021
59d429a
refactor(PatternStopCard): Clone before updating pickup/dropoff stop …
binh-dam-ibigroup Sep 21, 2021
548fb24
fix(saveEntity, saveTripsForCalendar): Resolve missing defaults with …
philip-cline Sep 22, 2021
c48bb18
refactor(fetchBaseGtfs, saveTripsForCalendar): Fix fetch of new spec …
philip-cline Sep 22, 2021
cda4f65
refactor(saveTripsForCalendar): Fix missing tripCopy ref
philip-cline Sep 22, 2021
be6b088
Merge pull request #720 from ibi-group/resolve-missing-defaults
miles-grant-ibigroup Sep 23, 2021
a5f9c88
Merge branch 'dev' into gtfs-spec-changes
miles-grant-ibigroup Sep 23, 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
64 changes: 60 additions & 4 deletions gtfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
inputType: LANGUAGE
columnWidth: 12
helpContent: "The feed_lang field contains a IETF BCP 47 language code specifying the default language used for the text in this feed. This setting helps GTFS consumers choose capitalization rules and other language-specific settings for the feed. For an introduction to IETF BCP 47, please refer to http://www.rfc-editor.org/rfc/bcp/bcp47.txt and http://www.w3.org/International/articles/language-tags/."
- name: "default_lang"
required: false
inputType: LANGUAGE
columnWidth: 12
helpContent: "Defines the language used when the data consumer doesn’t know the language of the rider. It's often defined as en, English."
- name: "feed_start_date"
required: false
inputType: DATE
Expand Down Expand Up @@ -67,6 +72,16 @@
inputType: TEXT
columnWidth: 12
helpContent: "The feed publisher can specify a string here that indicates the current version of their GTFS feed. GTFS-consuming applications can display this value to help feed publishers determine whether the latest version of their feed has been incorporated."
- name: "feed_contact_email"
required: false
inputType: EMAIL
columnWidth: 12
helpContent: "Email address for communication regarding the GTFS dataset and data publishing practices."
- name: "feed_contact_url"
required: false
inputType: URL
columnWidth: 12
helpContent: "URL for contact information, a web-form, support desk, or other tools for communication regarding the GTFS dataset and data publishing practices."

- id: agency
name: agency.txt
Expand Down Expand Up @@ -139,7 +154,7 @@
columnWidth: 6
helpContent: "The stop_code field contains short text or a number that uniquely identifies the stop for passengers. Stop codes are often used in phone-based transit information systems or printed on stop signage to make it easier for riders to get a stop schedule or real-time arrival information for a particular stop."
- name: "stop_name"
required: true
required: false
inputType: TEXT
bulkEditEnabled: true
columnWidth: 12
Expand All @@ -151,12 +166,12 @@
columnWidth: 12
helpContent: "The stop_desc field contains a description of a stop. Please provide useful, quality information. Do not simply duplicate the name of the stop."
- name: "stop_lat"
required: true
required: false
inputType: LATITUDE
columnWidth: 6
helpContent: "The stop_lat field contains the latitude of a stop or station. The field value must be a valid WGS 84 latitude."
- name: "stop_lon"
required: true
required: false
inputType: LONGITUDE
columnWidth: 6
helpContent: "The stop_lon field contains the longitude of a stop or station. The field value must be a valid WGS 84 longitude value from -180 to 180."
Expand All @@ -180,8 +195,19 @@
text: Stop (0)
- value: '1'
text: Station (1)
columnWidth: 12
- value: '2'
text: Entrance/Exit (2)
- value: '3'
text: Generic Node (3)
- value: '4'
text: Boarding Area (4)
columnWidth: 7
helpContent: "The location_type field identifies whether this stop ID represents a stop or station. If no location type is specified, or the location_type is blank, stop IDs are treated as stops. Stations may have different properties from stops when they are represented on a map or used in trip planning."
- name: "platform_code"
required: false
inputType: TEXT
columnWidth: 5
helpContent: "Platform identifier for a platform stop (a stop belonging to a station). This should be just the platform identifier (eg. G or 3)."
- name: "parent_station"
required: false
inputType: GTFS_STOP
Expand Down Expand Up @@ -297,6 +323,36 @@
inputType: POSITIVE_INT
columnWidth: 6
helpContent: The route_sort_order field can be used to order the routes in a way which is ideal for presentation to customers. It must be a non-negative integer. Routes with smaller route_sort_order values should be displayed before routes with larger route_sort_order values.
- name: continuous_pickup
required: false
inputType: DROPDOWN
bulkEditEnabled: true
options:
- value: 0
text: Continuous stopping pickup (0)
- value: 1
text: No continuous stopping pickup (1)
- value: 2
text: Must phone an agency to arrange continuous stopping pickup (2)
- value: 3
text: Must coordinate with a driver to arrange continuous stopping pickup (3)
columnWidth: 12
helpContent: Indicates whether a rider can board the transit vehicle anywhere along the vehicle’s travel path.
- name: continuous_drop_off
required: false
inputType: DROPDOWN
bulkEditEnabled: true
options:
- value: 0
text: Continuous stopping drop-off (0)
- value: 1
text: No continuous stopping drop-off (1)
- value: 2
text: Must phone an agency to arrange continuous stopping drop-off (2)
- value: 3
text: Must coordinate with a driver to arrange continuous stopping drop-off (3)
columnWidth: 12
helpContent: Indicates whether a rider can alight from the transit vehicle at any point along the vehicle’s travel path.
- name: route_url
required: false
inputType: URL
Expand Down
23 changes: 17 additions & 6 deletions lib/editor/actions/active.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import {createAction, type ActionType} from 'redux-actions'

import {createVoidPayloadAction, secureFetch} from '../../common/actions'
import {ENTITY} from '../constants'
import {newGtfsEntity, fetchBaseGtfs} from './editor'
import {fetchFeedSourceAndProject} from '../../manager/actions/feeds'
import {fetchGTFSEntities} from '../../manager/actions/versions'
import {saveTripPattern} from './tripPattern'
import {
getEditorNamespace,
getTableById,
Expand All @@ -18,10 +16,12 @@ import {
subSubComponentList
} from '../util/gtfs'
import {getMapFromGtfsStrategy, entityIsNew} from '../util/objects'

import type {Entity, Feed} from '../../types'
import type {dispatchFn, getStateFn, AppState} from '../../types/reducers'

import {saveTripPattern} from './tripPattern'
import {newGtfsEntity, fetchBaseGtfs} from './editor'

export const clearGtfsContent = createVoidPayloadAction('CLEAR_GTFSEDITOR_CONTENT')
const receivedNewEntity = createAction(
'RECEIVE_NEW_ENTITY',
Expand Down Expand Up @@ -331,14 +331,25 @@ export function saveEntity (
return
}
dispatch(savingActiveGtfsEntity())
const notNew = !entityIsNew(entity)
// Add default vals for component
const defaults = {}
if (component === 'route') {
defaults.continuous_pickup = 1 // Default value for no continuous pickup
defaults.continuous_drop_off = 1 // Default value for no continuous drop off
} else if (component === 'feedinfo') {
defaults.default_lang = ''
defaults.feed_contact_url = ''
defaults.feed_contact_email = ''
}
const entityWithDefaults = {...defaults, ...(entity: any)} // add defaults, if any.
const notNew = !entityIsNew(entityWithDefaults)
const method = notNew ? 'put' : 'post'
const idParam = notNew ? `/${entity.id || ''}` : ''
const idParam = notNew ? `/${entityWithDefaults.id || ''}` : ''
const {sessionId} = getState().editor.data.lock
const route = component === 'fare' ? 'fareattribute' : component
const url = `/api/editor/secure/${route}${idParam}?feedId=${feedId}&sessionId=${sessionId || ''}`
const mappingStrategy = getMapFromGtfsStrategy(component)
const data = mappingStrategy(entity)
const data = mappingStrategy(entityWithDefaults)
return dispatch(secureFetch(url, method, data))
.then(res => res.json())
.then(savedEntity => {
Expand Down
3 changes: 3 additions & 0 deletions lib/editor/actions/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@ export function fetchBaseGtfs ({
feed_version
default_route_color
default_route_type
default_lang
feed_contact_url
feed_contact_email
}
agency (limit: -1) {
id
Expand Down
15 changes: 12 additions & 3 deletions lib/editor/actions/trip.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// @flow

import clone from 'lodash/cloneDeep'
import {createAction, type ActionType} from 'redux-actions'

import {snakeCaseKeys} from '../../common/util/map-keys'
import {createVoidPayloadAction, fetchGraphQL, secureFetch} from '../../common/actions'
import {setErrorMessage} from '../../manager/actions/status'
import {entityIsNew} from '../util/objects'
import {getEditorNamespace} from '../util/gtfs'

import type {Pattern, TimetableColumn, Trip} from '../../types'
import type {dispatchFn, getStateFn, TripCounts} from '../../types/reducers'

Expand Down Expand Up @@ -159,11 +158,21 @@ export function saveTripsForCalendar (
trips = trips.map(snakeCaseKeys)
return Promise.all(trips.filter(t => t).map((trip, index) => {
const tripExists = !entityIsNew(trip) && trip.id !== null
const tripCopy: any = clone((trip: any))
// Add default value to continuous pickup if not provided
// Editing continuous pickup/drop off is not currently supported in the schedule editor
const defaults = {
continuous_pickup: 1,
continuous_drop_off: 1
}
tripCopy.stop_times = tripCopy.stop_times.map((stopTime, index) => {
return {...defaults, ...(stopTime: any)}
})
const method = tripExists ? 'put' : 'post'
const url = tripExists && trip.id
? `/api/editor/secure/trip/${trip.id}?feedId=${feedId}&sessionId=${sessionId}`
: `/api/editor/secure/trip?feedId=${feedId}&sessionId=${sessionId}`
return dispatch(secureFetch(url, method, trip))
return dispatch(secureFetch(url, method, tripCopy))
.then(res => res.json())
.catch(err => {
console.warn(err)
Expand Down
Loading