Skip to content

Commit 4dae31a

Browse files
use new GtfsLocation where previously GtfsLocationGroup was used
1 parent ee6429c commit 4dae31a

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

lib/editor/actions/location.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { receivedNewEntity, savedGtfsEntity } from './active'
1010

1111
export function saveLocationGroup (
1212
feedId: ?string,
13-
locationGroup: GtfsLocationGroup,
13+
locationGroup: GtfsLocation,
1414
refetch: ?boolean = true
1515
) {
1616
return function (dispatch: dispatchFn, getState: getStateFn) {

lib/editor/components/pattern/EditShapePanel.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
getPatternDistance,
2222
isValidStopControlPoint
2323
} from '../../util/map'
24-
import type {ControlPoint, LatLng, Pattern, GtfsStop, GtfsLocation, GtfsLocationGroup} from '../../../types'
24+
import type {ControlPoint, LatLng, Pattern, GtfsStop, GtfsLocation} from '../../../types'
2525
import type {EditSettingsUndoState} from '../../../types/reducers'
2626

2727
import EditSettings from './EditSettings'
@@ -30,7 +30,7 @@ type Props = {
3030
activePattern: Pattern,
3131
controlPoints: Array<ControlPoint>,
3232
editSettings: EditSettingsUndoState,
33-
locationGroups: Array<GtfsLocationGroup>,
33+
locationGroups: Array<GtfsLocation>,
3434
locations: Array<GtfsLocation>,
3535
patternSegment: number,
3636
resetActiveGtfsEntity: typeof activeActions.resetActiveGtfsEntity,

lib/editor/selectors/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ function addPatternStopsToShapePoints (
432432
patternStops: Array<PatternStop>,
433433
activePatternStops: Array<GtfsStop>,
434434
activePatternLocations: Array<GtfsLocation>,
435-
activePatternLocationGroups: Array<GtfsLocationGroup>,
435+
activePatternLocationGroups: Array<GtfsLocation>,
436436
projectStops: boolean = false,
437437
totalShapePointsDistTraveled: number
438438
): {patternSegments: Array<Coordinates>, shapePoints: Array<ShapePoint>} {

lib/editor/util/map.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import type {
2525
GeoJsonLinestring,
2626
GeoJsonPoint,
2727
GtfsLocation,
28-
GtfsLocationGroup,
2928
GtfsStop,
3029
LatLng,
3130
Pattern,
@@ -875,7 +874,7 @@ export function straightLineDistancesBetweenStopAnchors (
875874
export function generateControlPointsFromPatternStops (
876875
patternStops: Array<PatternStop>,
877876
stops: Array<GtfsStop>,
878-
locationGroups: Array<GtfsLocationGroup>,
877+
locationGroups: Array<GtfsLocation>,
879878
locations: Array<GtfsLocation>
880879
): any { // FIXME: fix flow return type
881880
const controlPoints = []
@@ -915,7 +914,7 @@ export function generateControlPointsFromPatternStops (
915914
}
916915
}
917916
918-
export function stopToPoint (stop: GtfsStop | GtfsLocation | GtfsLocationGroup) {
917+
export function stopToPoint (stop: GtfsStop | GtfsLocation) {
919918
if (!stop.stop_lon || !stop.stop_lat) {
920919
console.error('Serious issue: stopToPoint called without a point! Using 0, 0 coordinates. This is a very bad thing')
921920
return point([0, 0])

lib/types/index.js

+7
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,13 @@ export type GtfsLocation = {|
824824
zone_id?: string
825825
|}
826826

827+
// export type GtfsLocationGroup = {
828+
// id: number,
829+
// location_group_id: string,
830+
// location_group_name: ?string,
831+
// stop_id: ?string[]
832+
// }
833+
827834
export type StopWithFeed = GtfsStop & {child_stops?: Array<GtfsStop>, feed: Feed}
828835

829836
export type LatLng = {

0 commit comments

Comments
 (0)