Skip to content

Commit

Permalink
fix(gtfsplus): fix react warnings (key, proptypes)
Browse files Browse the repository at this point in the history
  • Loading branch information
landonreed committed Mar 14, 2017
1 parent 23c4f00 commit 8d5eb28
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/gtfs/components/gtfssearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getFeed, getFeedId } from '../../common/util/modules'

export default class GtfsSearch extends Component {
static propTypes = {
value: PropTypes.string
value: PropTypes.object
}
constructor (props) {
super(props)
Expand Down
6 changes: 3 additions & 3 deletions lib/gtfsplus/components/GtfsPlusEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getConfigProperty } from '../../common/util/config'

export default class GtfsPlusEditor extends Component {
static propTypes = {
onComponentMount: PropTypes.function
onComponentMount: PropTypes.func
}
constructor (props) {
super(props)
Expand Down Expand Up @@ -111,8 +111,8 @@ export default class GtfsPlusEditor extends Component {

<Row>
<Col xs={2}>
{getConfigProperty('modules.gtfsplus.spec').map(table => {
return (<p>
{getConfigProperty('modules.gtfsplus.spec').map((table, index) => {
return (<p key={index}>
<Button
bsStyle={table.id === this.state.activeTableId ? 'info' : 'default'}
key={table.id}
Expand Down
8 changes: 4 additions & 4 deletions lib/gtfsplus/components/GtfsPlusTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default class GtfsPlusTable extends Component {
? `${routeEntity.route_short_name} - ${routeEntity.route_long_name}`
: routeEntity.route_long_name
}
: ''
: null

return (
<GtfsSearch
Expand All @@ -110,7 +110,7 @@ export default class GtfsPlusTable extends Component {
const stopEntity = this.props.getGtfsEntity('stop', currentValue)
const stopValue = stopEntity
? {'value': stopEntity.stop_id, 'label': stopEntity.stop_name}
: ''
: null

return (
<GtfsSearch
Expand Down Expand Up @@ -235,8 +235,8 @@ export default class GtfsPlusTable extends Component {
<Table>
<thead>
<tr>
{table.fields.map(field => {
return (<th style={colHeaderStyle} className={`col-md-${field.columnWidth}`}>
{table.fields.map((field, index) => {
return (<th style={colHeaderStyle} key={index} className={`col-md-${field.columnWidth}`}>
{field.name}{field.required ? ' *' : ''}
<Glyphicon
glyph='question-sign'
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/components/FeedSourceViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default class FeedSourceViewer extends Component {
<ControlLabel>Feed source fetch URL</ControlLabel>
<InputGroup>
<FormControl
value={typeof this.state.url !== 'undefined' ? this.state.url : fs.url}
value={typeof this.state.url !== 'undefined' ? this.state.url : fs.url || ''}
onChange={(evt) => {
this.setState({url: evt.target.value})
}}
Expand Down
4 changes: 3 additions & 1 deletion lib/manager/containers/ActiveFeedVersionNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ const mapStateToProps = (state, ownProps) => {
}
}
const { jobs } = state.status.jobMonitor
const validationJob = feedVersionIndex >= 1 && jobs.find(j => j.type === 'VALIDATE_FEED' && j.feedVersion.id === feedVersions[feedVersionIndex - 1].id)
const validationJob = feedVersionIndex >= 1
? jobs.find(j => j.type === 'VALIDATE_FEED' && j.feedVersion.id === feedVersions[feedVersionIndex - 1].id)
: null
return {
feedVersionIndex,
validationJob,
Expand Down

0 comments on commit 8d5eb28

Please sign in to comment.