|
|
@ -3,7 +3,8 @@ import styled from 'styled-components' |
|
|
|
import { connect } from 'react-redux' |
|
|
|
import { connect } from 'react-redux' |
|
|
|
import { Redirect, Link } from 'react-router-dom' |
|
|
|
import { Redirect, Link } from 'react-router-dom' |
|
|
|
|
|
|
|
|
|
|
|
import HorizontalInput from './parts/HorizontalInput' |
|
|
|
import Input from './parts/Input' |
|
|
|
|
|
|
|
import Select from './parts/Select' |
|
|
|
import { updateRoute, createRoute, deleteRoute } from '../actions/route'; |
|
|
|
import { updateRoute, createRoute, deleteRoute } from '../actions/route'; |
|
|
|
import store from '../store' |
|
|
|
import store from '../store' |
|
|
|
|
|
|
|
|
|
|
@ -23,7 +24,7 @@ class RouteForm extends Component { |
|
|
|
short_name: "", |
|
|
|
short_name: "", |
|
|
|
long_name: "", |
|
|
|
long_name: "", |
|
|
|
desc: "", |
|
|
|
desc: "", |
|
|
|
route_type: "2", |
|
|
|
route_type: "3", |
|
|
|
route_url: "", |
|
|
|
route_url: "", |
|
|
|
route_color: "", |
|
|
|
route_color: "", |
|
|
|
route_text_color: "", |
|
|
|
route_text_color: "", |
|
|
@ -94,63 +95,72 @@ class RouteForm extends Component { |
|
|
|
<StyledRouteForm> |
|
|
|
<StyledRouteForm> |
|
|
|
<h1 className="title">{one.route_id || 'New Route'} </h1> |
|
|
|
<h1 className="title">{one.route_id || 'New Route'} </h1> |
|
|
|
<div className="content"> |
|
|
|
<div className="content"> |
|
|
|
<HorizontalInput |
|
|
|
<Input |
|
|
|
label="Route ID" |
|
|
|
label="Route ID" |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
fieldName="route_id" |
|
|
|
fieldName="route_id" |
|
|
|
value={one.route_id || ''} |
|
|
|
value={one.route_id || ''} |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
|
|
|
|
|
|
|
|
<HorizontalInput |
|
|
|
<Input |
|
|
|
label="Short Name" |
|
|
|
label="Short Name" |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
fieldName="short_name" |
|
|
|
fieldName="short_name" |
|
|
|
value={one.short_name || ''} |
|
|
|
value={one.short_name || ''} |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
|
|
|
|
|
|
|
|
<HorizontalInput |
|
|
|
<Input |
|
|
|
label="Long Name" |
|
|
|
label="Long Name" |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
fieldName="long_name" |
|
|
|
fieldName="long_name" |
|
|
|
value={one.long_name || ''} |
|
|
|
value={one.long_name || ''} |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
|
|
|
|
|
|
|
|
<HorizontalInput |
|
|
|
<Input |
|
|
|
label="Description" |
|
|
|
label="Description" |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
fieldName="desc" |
|
|
|
fieldName="desc" |
|
|
|
value={one.desc || ''} |
|
|
|
value={one.desc || ''} |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
|
|
|
|
|
|
|
|
<HorizontalInput |
|
|
|
<Select |
|
|
|
label="Route Type" |
|
|
|
label="Route Type" |
|
|
|
type="text" |
|
|
|
|
|
|
|
fieldName="route_type" |
|
|
|
fieldName="route_type" |
|
|
|
value={one.route_type || ''} |
|
|
|
value={one.route_type || ''} |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
handleChange={this.handleChange} |
|
|
|
|
|
|
|
choices={[ |
|
|
|
<HorizontalInput |
|
|
|
{ value: '0', label: 'Tram, Light rail' }, |
|
|
|
|
|
|
|
{ value: '1', label: 'Subway (within metro area)' }, |
|
|
|
|
|
|
|
{ value: '2', label: 'Rail' }, |
|
|
|
|
|
|
|
{ value: '3', label: 'Bus' }, |
|
|
|
|
|
|
|
{ value: '4', label: 'Ferry' }, |
|
|
|
|
|
|
|
{ value: '5', label: 'Cable car' }, |
|
|
|
|
|
|
|
{ value: '6', label: 'Gondola' }, |
|
|
|
|
|
|
|
{ value: '7', label: 'Funicular (steep inclines)' }, |
|
|
|
|
|
|
|
]} /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Input |
|
|
|
label="Route URL" |
|
|
|
label="Route URL" |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
fieldName="route_url" |
|
|
|
fieldName="route_url" |
|
|
|
value={one.route_url || ''} |
|
|
|
value={one.route_url || ''} |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
|
|
|
|
|
|
|
|
<HorizontalInput |
|
|
|
<Input |
|
|
|
label="Route Color" |
|
|
|
label="Route Color" |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
fieldName="route_color" |
|
|
|
fieldName="route_color" |
|
|
|
value={one.route_color || ''} |
|
|
|
value={one.route_color || ''} |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
|
|
|
|
|
|
|
|
<HorizontalInput |
|
|
|
<Input |
|
|
|
label="Route Text Color" |
|
|
|
label="Route Text Color" |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
fieldName="route_text_color" |
|
|
|
fieldName="route_text_color" |
|
|
|
value={one.route_text_color || ''} |
|
|
|
value={one.route_text_color || ''} |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
handleChange={this.handleChange} /> |
|
|
|
|
|
|
|
|
|
|
|
<HorizontalInput |
|
|
|
<Input |
|
|
|
label="Route Sort Order" |
|
|
|
label="Route Sort Order" |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
fieldName="route_sort_order" |
|
|
|
fieldName="route_sort_order" |
|
|
|