Skip to content

Commit e9a558c

Browse files
authored
Merge pull request #553 from ibi-group/mtc-gtfsplus
Add GTFS+ validation issue details
2 parents f1797a7 + 5c65a19 commit e9a558c

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

lib/common/util/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function getGtfsPlusSpec (): Array<GtfsSpecTable> {
3737
const CONFIG: DataToolsConfig = window.DT_CONFIG
3838
const GTFS_PLUS_SPEC = CONFIG.specifications.gtfsplus
3939
if (!GTFS_PLUS_SPEC) throw new Error('GTFS+ yml configuration file is not defined!')
40-
return GTFS_PLUS_SPEC
40+
return GTFS_PLUS_SPEC.sort((table1, table2) => table1.name.localeCompare(table2.name))
4141
}
4242

4343
/**

lib/gtfsplus/components/GtfsPlusVersionSummary.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
// @flow
22

3+
import moment from 'moment'
34
import React, {Component} from 'react'
4-
import {Panel, Row, Col, Table, Button, ButtonToolbar, Glyphicon, Alert} from 'react-bootstrap'
5+
import {
6+
Alert,
7+
Button,
8+
ButtonToolbar,
9+
Col,
10+
Glyphicon,
11+
Panel,
12+
Row,
13+
Table
14+
} from 'react-bootstrap'
515
import {browserHistory, Link} from 'react-router'
6-
import moment from 'moment'
716

8-
import {getGtfsPlusSpec} from '../../common/util/config'
917
import * as gtfsPlusActions from '../actions/gtfsplus'
1018

19+
import {getGtfsPlusSpec} from '../../common/util/config'
1120
import type {Props as ContainerProps} from '../containers/ActiveGtfsPlusVersionSummary'
21+
import type {GtfsPlusValidationIssue} from '../../types'
1222
import type {GtfsPlusReducerState, ManagerUserState} from '../../types/reducers'
1323

1424
type Props = ContainerProps & {
@@ -51,7 +61,7 @@ export default class GtfsPlusVersionSummary extends Component<Props, State> {
5161
return issuesForTable[tableId].length.toLocaleString()
5262
}
5363

54-
_getTableLevelIssues = (tableId: string) => {
64+
_getTableLevelIssues = (tableId: string): ?Array<GtfsPlusValidationIssue> => {
5565
const {issuesForTable} = this.props
5666
if (!issuesForTable) return null
5767
if (!(tableId in issuesForTable)) return null
@@ -214,7 +224,7 @@ export default class GtfsPlusVersionSummary extends Component<Props, State> {
214224
{tableLevelIssues.length} critical table issue(s):
215225
<ul>
216226
{tableLevelIssues.map((issue, i) =>
217-
<li key={i}>{issue.description}</li>)}
227+
<li key={i}>{issue.fieldName}: {issue.description}</li>)}
218228
</ul>
219229
</small>
220230
: null

0 commit comments

Comments
 (0)