Skip to content

Commit 8d5eb28

Browse files
committed
fix(gtfsplus): fix react warnings (key, proptypes)
1 parent 23c4f00 commit 8d5eb28

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

lib/gtfs/components/gtfssearch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { getFeed, getFeedId } from '../../common/util/modules'
77

88
export default class GtfsSearch extends Component {
99
static propTypes = {
10-
value: PropTypes.string
10+
value: PropTypes.object
1111
}
1212
constructor (props) {
1313
super(props)

lib/gtfsplus/components/GtfsPlusEditor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { getConfigProperty } from '../../common/util/config'
99

1010
export default class GtfsPlusEditor extends Component {
1111
static propTypes = {
12-
onComponentMount: PropTypes.function
12+
onComponentMount: PropTypes.func
1313
}
1414
constructor (props) {
1515
super(props)
@@ -111,8 +111,8 @@ export default class GtfsPlusEditor extends Component {
111111

112112
<Row>
113113
<Col xs={2}>
114-
{getConfigProperty('modules.gtfsplus.spec').map(table => {
115-
return (<p>
114+
{getConfigProperty('modules.gtfsplus.spec').map((table, index) => {
115+
return (<p key={index}>
116116
<Button
117117
bsStyle={table.id === this.state.activeTableId ? 'info' : 'default'}
118118
key={table.id}

lib/gtfsplus/components/GtfsPlusTable.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default class GtfsPlusTable extends Component {
9090
? `${routeEntity.route_short_name} - ${routeEntity.route_long_name}`
9191
: routeEntity.route_long_name
9292
}
93-
: ''
93+
: null
9494

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

115115
return (
116116
<GtfsSearch
@@ -235,8 +235,8 @@ export default class GtfsPlusTable extends Component {
235235
<Table>
236236
<thead>
237237
<tr>
238-
{table.fields.map(field => {
239-
return (<th style={colHeaderStyle} className={`col-md-${field.columnWidth}`}>
238+
{table.fields.map((field, index) => {
239+
return (<th style={colHeaderStyle} key={index} className={`col-md-${field.columnWidth}`}>
240240
{field.name}{field.required ? ' *' : ''}
241241
<Glyphicon
242242
glyph='question-sign'

lib/manager/components/FeedSourceViewer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export default class FeedSourceViewer extends Component {
175175
<ControlLabel>Feed source fetch URL</ControlLabel>
176176
<InputGroup>
177177
<FormControl
178-
value={typeof this.state.url !== 'undefined' ? this.state.url : fs.url}
178+
value={typeof this.state.url !== 'undefined' ? this.state.url : fs.url || ''}
179179
onChange={(evt) => {
180180
this.setState({url: evt.target.value})
181181
}}

lib/manager/containers/ActiveFeedVersionNavigator.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ const mapStateToProps = (state, ownProps) => {
3939
}
4040
}
4141
const { jobs } = state.status.jobMonitor
42-
const validationJob = feedVersionIndex >= 1 && jobs.find(j => j.type === 'VALIDATE_FEED' && j.feedVersion.id === feedVersions[feedVersionIndex - 1].id)
42+
const validationJob = feedVersionIndex >= 1
43+
? jobs.find(j => j.type === 'VALIDATE_FEED' && j.feedVersion.id === feedVersions[feedVersionIndex - 1].id)
44+
: null
4345
return {
4446
feedVersionIndex,
4547
validationJob,

0 commit comments

Comments
 (0)