Skip to content
Merged
Show file tree
Hide file tree
Changes from 36 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
151 changes: 143 additions & 8 deletions lib/editor/components/pattern/PatternStopCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
import Icon from '@conveyal/woonerf/components/icon'
import React, {Component} from 'react'
import { DragSource, DropTarget } from 'react-dnd'
import { Row, Col, Collapse, FormGroup, ControlLabel, Checkbox } from 'react-bootstrap'
import {
Checkbox,
Col,
Collapse,
ControlLabel,
FormControl,
FormGroup,
Row
} from 'react-bootstrap'

import * as activeActions from '../../actions/active'
import * as stopStrategiesActions from '../../actions/map/stopStrategies'
Expand Down Expand Up @@ -42,6 +50,79 @@ type Props = {
updatePatternStops: typeof tripPatternActions.updatePatternStops
}

type PickupDropoffSelectProps = {
activePattern: Pattern,
controlLabel: string,
onChange: (evt: SyntheticInputEvent<HTMLInputElement>) => void,
selectType: string,
shouldHaveDisabledOption: boolean,
title: string,
value: string | number
}

type State = {
initialDwellTime: number,
initialTravelTime: number,
update: boolean
}

const pickupDropoffOptions = [
{
value: 0,
text: 'Available (0)'
},
{
value: 1,
text: 'Not available (1)'
},
{
value: 2,
text: 'Must phone agency to arrange (2)'
},
{
value: 3,
text: 'Must coordinate with driver to arrange (3)'
}
]

/** renders the form control drop downs for dropOff/Pick up and also continuous */
const PickupDropoffSelect = (props: PickupDropoffSelectProps) => {
const {
activePattern,
controlLabel,
onChange,
selectType,
shouldHaveDisabledOption,
title,
value
} = props
const hasShapeId = activePattern.shapeId === null
return (
<FormGroup
bsSize='small'
controlId={selectType}
>
<ControlLabel
className='small'
title={title}
>
{controlLabel}
</ControlLabel>
<FormControl
componentClass='select'
disabled={shouldHaveDisabledOption && hasShapeId}
onChange={onChange}
placeholder='select'
value={value}
>
{pickupDropoffOptions.map(o => (
<option key={o.value} value={o.value}>{o.text}</option>
))}
</FormControl>
</FormGroup>
)
}

const cardSource = {
beginDrag (props: Props) {
return {
Expand Down Expand Up @@ -174,12 +255,6 @@ class PatternStopCard extends Component<Props> {
}
}

type State = {
initialDwellTime: number,
initialTravelTime: number,
update: boolean
}

class PatternStopContents extends Component<Props, State> {
componentWillMount () {
this.setState({
Expand Down Expand Up @@ -246,12 +321,23 @@ class PatternStopContents extends Component<Props, State> {
updatePatternStops(activePattern, patternStops)
}

_onPickupOrDropOffChange = (evt: SyntheticInputEvent<HTMLInputElement>) => {
const selectedOptionValue: number = parseInt(evt.target.value, 10)
const {activePattern, index, updatePatternStops} = this.props
const patternStops = [...activePattern.patternStops]

patternStops[index][evt.target.id] = selectedOptionValue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the patternStops variable is a shallow clone of activePattern.patternStops, the original objects are still used. Therefore, this overwrites existing data. The patternStop at the particular index should also be cloned to avoid this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patternStop at the particular index should also be cloned to avoid this.

This part of the comment still hasn't been addressed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 59d429a.

this.setState({update: true})
updatePatternStops(activePattern, patternStops)
}

render () {
const {active, patternEdited, patternStop} = this.props
const {active, activePattern, patternEdited, patternStop} = this.props
// This component has a special shouldComponentUpdate to ensure that state
// is not overwritten with new props, so use state.update to check edited
// state.
const isEdited = patternEdited || this.state.update

let innerDiv
if (active) {
innerDiv = <div>
Expand Down Expand Up @@ -301,6 +387,55 @@ class PatternStopContents extends Component<Props, State> {
</FormGroup>
</Col>
</Row>
{/* Pickup and drop off type selectors */}
<Row>
<Col xs={6}>
<PickupDropoffSelect
activePattern={activePattern}
controlLabel='Pickup'
onChange={this._onPickupOrDropOffChange}
selectType='pickupType'
shouldHaveDisabledOption={false}
title='Define the pickup method/availability at this stop.'
value={patternStop.pickupType || ''}
/>
</Col>
<Col xs={6}>
<PickupDropoffSelect
activePattern={activePattern}
controlLabel='Drop-off'
onChange={this._onPickupOrDropOffChange}
selectType='dropOffType'
shouldHaveDisabledOption={false}
title='Define the dropff method/availability at this stop.'
value={patternStop.dropOffType || ''}
/>
</Col>
</Row>
<Row>
<Col xs={6}>
<PickupDropoffSelect
activePattern={activePattern}
controlLabel='Continuous pickup'
onChange={this._onPickupOrDropOffChange}
selectType='continuousPickup'
shouldHaveDisabledOption
title='Indicates whether a rider can board the transit vehicle anywhere along the vehicle’s travel path.'
value={patternStop.continuousPickup || ''}
/>
</Col>
<Col xs={6}>
<PickupDropoffSelect
activePattern={activePattern}
controlLabel='Continuous drop-off'
onChange={this._onPickupOrDropOffChange}
selectType='continuousDropOff'
shouldHaveDisabledOption
title='Indicates whether a rider can alight from the transit vehicle at any point along the vehicle’s travel path.'
value={patternStop.continuousDropOff || ''}
/>
</Col>
</Row>
<NormalizeStopTimesTip />
</div>
}
Expand Down
2 changes: 2 additions & 0 deletions lib/editor/util/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,8 @@ export function stopToPatternStop (
id: generateUID(),
stopSequence,
stopId: stop.stop_id,
continuousDropOff: 1,
continuousPickup: 1,
defaultDwellTime: 0,
defaultTravelTime: 0,
dropOffType: 0,
Expand Down
Loading