Skip to content

Commit

Permalink
use new GtfsLocation where previously GtfsLocationGroup was used
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Jan 3, 2025
1 parent ee6429c commit 4dae31a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/editor/actions/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { receivedNewEntity, savedGtfsEntity } from './active'

export function saveLocationGroup (
feedId: ?string,
locationGroup: GtfsLocationGroup,
locationGroup: GtfsLocation,
refetch: ?boolean = true
) {
return function (dispatch: dispatchFn, getState: getStateFn) {
Expand Down
4 changes: 2 additions & 2 deletions lib/editor/components/pattern/EditShapePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
getPatternDistance,
isValidStopControlPoint
} from '../../util/map'
import type {ControlPoint, LatLng, Pattern, GtfsStop, GtfsLocation, GtfsLocationGroup} from '../../../types'
import type {ControlPoint, LatLng, Pattern, GtfsStop, GtfsLocation} from '../../../types'
import type {EditSettingsUndoState} from '../../../types/reducers'

import EditSettings from './EditSettings'
Expand All @@ -30,7 +30,7 @@ type Props = {
activePattern: Pattern,
controlPoints: Array<ControlPoint>,
editSettings: EditSettingsUndoState,
locationGroups: Array<GtfsLocationGroup>,
locationGroups: Array<GtfsLocation>,
locations: Array<GtfsLocation>,
patternSegment: number,
resetActiveGtfsEntity: typeof activeActions.resetActiveGtfsEntity,
Expand Down
2 changes: 1 addition & 1 deletion lib/editor/selectors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ function addPatternStopsToShapePoints (
patternStops: Array<PatternStop>,
activePatternStops: Array<GtfsStop>,
activePatternLocations: Array<GtfsLocation>,
activePatternLocationGroups: Array<GtfsLocationGroup>,
activePatternLocationGroups: Array<GtfsLocation>,
projectStops: boolean = false,
totalShapePointsDistTraveled: number
): {patternSegments: Array<Coordinates>, shapePoints: Array<ShapePoint>} {
Expand Down
5 changes: 2 additions & 3 deletions lib/editor/util/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import type {
GeoJsonLinestring,
GeoJsonPoint,
GtfsLocation,
GtfsLocationGroup,
GtfsStop,
LatLng,
Pattern,
Expand Down Expand Up @@ -875,7 +874,7 @@ export function straightLineDistancesBetweenStopAnchors (
export function generateControlPointsFromPatternStops (
patternStops: Array<PatternStop>,
stops: Array<GtfsStop>,
locationGroups: Array<GtfsLocationGroup>,
locationGroups: Array<GtfsLocation>,
locations: Array<GtfsLocation>
): any { // FIXME: fix flow return type
const controlPoints = []
Expand Down Expand Up @@ -915,7 +914,7 @@ export function generateControlPointsFromPatternStops (
}
}
export function stopToPoint (stop: GtfsStop | GtfsLocation | GtfsLocationGroup) {
export function stopToPoint (stop: GtfsStop | GtfsLocation) {
if (!stop.stop_lon || !stop.stop_lat) {
console.error('Serious issue: stopToPoint called without a point! Using 0, 0 coordinates. This is a very bad thing')
return point([0, 0])
Expand Down
7 changes: 7 additions & 0 deletions lib/types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,13 @@ export type GtfsLocation = {|
zone_id?: string
|}

// export type GtfsLocationGroup = {
// id: number,
// location_group_id: string,
// location_group_name: ?string,
// stop_id: ?string[]
// }

export type StopWithFeed = GtfsStop & {child_stops?: Array<GtfsStop>, feed: Feed}

export type LatLng = {
Expand Down

0 comments on commit 4dae31a

Please sign in to comment.