Skip to content

Commit 6236f13

Browse files
author
Rob Gregg
committed
fix(EditorInput.js gtfs.yml): Added missing GTFS Extended Route Types
Added the route types to the GTFS.yml file and then added logic to display the route_type field in an optgroup #645
1 parent cd45247 commit 6236f13

File tree

2 files changed

+164
-1
lines changed

2 files changed

+164
-1
lines changed

gtfs.yml

+150
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,156 @@
290290
text: Gondola
291291
- value: 7
292292
text: Funicular
293+
- value: 100
294+
text: Railway Service
295+
- value: 100
296+
text: Railway Service
297+
- value: 101
298+
text: High Speed Rail Service
299+
- value: 102
300+
text: Long Distance Trains
301+
- value: 103
302+
text: Inter Regional Rail Service
303+
- value: 104
304+
text: Car Transport Rail Service
305+
- value: 105
306+
text: Sleeper Rail Service
307+
- value: 106
308+
text: Regional Rail Service
309+
- value: 107
310+
text: Tourist Railway Service
311+
- value: 108
312+
text: Rail Shuttle (Within Complex)
313+
- value: 109
314+
text: Suburban Railway
315+
- value: 110
316+
text: Replacement Rail Service
317+
- value: 111
318+
text: Special Rail Service
319+
- value: 112
320+
text: Lorry Transport Rail Service
321+
- value: 113
322+
text: All Rail Services
323+
- value: 114
324+
text: Cross-Country Rail Service
325+
- value: 115
326+
text: Vehicle Transport Rail Service
327+
- value: 116
328+
text: Rack and Pinion Railway
329+
- value: 117
330+
text: Additional Rail Service
331+
- value: 200
332+
text: Coach Service
333+
- value: 201
334+
text: International Coach Service
335+
- value: 202
336+
text: National Coach Service
337+
- value: 203
338+
text: Shuttle Coach Service
339+
- value: 204
340+
text: Regional Coach Service
341+
- value: 205
342+
text: Special Coach Service
343+
- value: 206
344+
text: Sightseeing Coach Service
345+
- value: 207
346+
text: Tourist Coach Service
347+
- value: 208
348+
text: Commuter Coach Service
349+
- value: 209
350+
text: All Coach Services
351+
- value: 400
352+
text: Urban Railway Service
353+
- value: 401
354+
text: Metro Service
355+
- value: 402
356+
text: Underground Service
357+
- value: 403
358+
text: Urban Railway Service
359+
- value: 404
360+
text: All Urban Railway Services
361+
- value: 405
362+
text: Monorail
363+
- value: 700
364+
text: Bus Service
365+
- value: 701
366+
text: Regional Bus Service
367+
- value: 702
368+
text: Express Bus Service
369+
- value: 703
370+
text: Stopping Bus Service
371+
- value: 704
372+
text: Local Bus Service
373+
- value: 705
374+
text: Night Bus Service
375+
- value: 706
376+
text: Post Bus Service
377+
- value: 707
378+
text: Special Needs Bus
379+
- value: 708
380+
text: Mobility Bus Service
381+
- value: 709
382+
text: Mobility Bus for Registered Disabled
383+
- value: 710
384+
text: Sightseeing Bus
385+
- value: 711
386+
text: Shuttle Bus
387+
- value: 712
388+
text: School Bus
389+
- value: 713
390+
text: School and Public Service Bus
391+
- value: 714
392+
text: Rail Replacement Bus Service
393+
- value: 715
394+
text: Demand and Response Bus Service
395+
- value: 716
396+
text: All Bus Services
397+
- value: 800
398+
text: Trolleybus Service
399+
- value: 900
400+
text: Tram Service
401+
- value: 901
402+
text: City Tram Service
403+
- value: 902
404+
text: Local Tram Service
405+
- value: 903
406+
text: Regional Tram Service
407+
- value: 904
408+
text: Sightseeing Tram Service
409+
- value: 905
410+
text: Shuttle Tram Service
411+
- value: 906
412+
text: All Tram Services
413+
- value: 1000
414+
text: Water Transport Service
415+
- value: 1100
416+
text: Air Service
417+
- value: 1200
418+
text: Ferry Service
419+
- value: 1300
420+
text: Aerial Lift Service
421+
- value: 1400
422+
text: Funicular Service
423+
- value: 1500
424+
text: Taxi Service
425+
- value: 1501
426+
text: Communal Taxi Service
427+
- value: 1502
428+
text: Water Taxi Service
429+
- value: 1503
430+
text: Rail Taxi Service
431+
- value: 1504
432+
text: Bike Taxi Service
433+
- value: 1505
434+
text: Licensed Taxi Service
435+
- value: 1506
436+
text: Private Hire Service Vehicle
437+
- value: 1507
438+
text: All Taxi Services
439+
- value: 1700
440+
text: Miscellaneous Service
441+
- value: 1702
442+
text: Horse-drawn Carriage
293443
columnWidth: 6
294444
helpContent: The route_type field describes the type of transportation used on a route. Valid values for this field are...
295445
- name: route_sort_order

lib/editor/components/EditorInput.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ export default class EditorInput extends Component<Props> {
300300
</span>
301301
)
302302
case 'DROPDOWN':
303+
const standard = 'Standard'
304+
const extended = 'Extended'
303305
return (
304306
<FormGroup
305307
{...formProps}
@@ -314,7 +316,18 @@ export default class EditorInput extends Component<Props> {
314316
? <option disabled value=''>{field.required ? '-- select an option --' : '(optional)' }</option>
315317
: null
316318
}
317-
{field.options && field.options.map(o => (<option value={o.value} key={o.value}>{o.text || o.value}</option>))}
319+
{field.name === 'route_type' &&
320+
<optgroup label={standard}>
321+
{field.options.slice(0, 7).map(o => (
322+
<option value={o.value} key={o.value}>{o.text} ({o.value})</option>))}
323+
</optgroup>}
324+
{field.name === 'route_type' &&
325+
<optgroup label={extended}>
326+
{field.options.slice(8).map(o => (
327+
<option value={o.value} key={o.value}>{o.text} ({o.value})</option>))}
328+
</optgroup>}
329+
)}
330+
{field.name !== 'route_type' && field.options && field.options.map(o => (<option value={o.value} key={o.value}>{o.text || o.value}</option>))}}
318331
</FormControl>
319332
</FormGroup>
320333
)

0 commit comments

Comments
 (0)