Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning to RouteLayout component about page size #994

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions i18n/english.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,8 @@ components:
line: Line
priority: Priority
problemType: Problem Type
RouteLayout:
pageSizeNotice: ⚠️ Summary below shows a maximum of %pageSize% routes.
SelectFileModal:
ok: OK
cancel: Cancel
Expand Down
2 changes: 2 additions & 0 deletions i18n/german.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,8 @@ components:
und eine detailierte Beschreibung der Schritte, die Sie zuvor ausgeführt haben
an <a href='mailto:%supportEmail%'>%supportEmail%</a>.
view: Ansehen
RouteLayout:
pageSizeNotice: ⚠️ Summary below shows a maximum of %pageSize% routes.
SelectFileModal:
cancel: Abbrechen
ok: OK
Expand Down
2 changes: 2 additions & 0 deletions i18n/polish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,8 @@ components:
the following text (current URL and error details), and a detailed description
of the steps you followed to <a href='mailto:%supportEmail%'>%supportEmail%</a>.
view: View
RouteLayout:
pageSizeNotice: ⚠️ Summary below shows a maximum of %pageSize% routes.
SelectFileModal:
cancel: Cancel
ok: OK
Expand Down
13 changes: 10 additions & 3 deletions lib/manager/components/reporter/components/RouteLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Alert,
Button,
Col,
ControlLabel,
ListGroup,
ListGroupItem,
Pagination,
Expand All @@ -17,13 +18,14 @@ import Loading from '../../../../common/components/Loading'
import ActiveDateTimeFilter from '../containers/ActiveDateTimeFilter'
import * as routesActions from '../../../../gtfs/actions/routes'
import * as patternsActions from '../../../../gtfs/actions/patterns'
import TripsPerHourChart from './TripsPerHourChart'

import { getComponentMessages } from '../../../../common/util/config'
import type {Props as ContainerProps} from '../containers/Routes'
import type {RouteRowData} from '../../../selectors'
import type {FetchStatus} from '../../../../types'
import type {AllRoutesSubState, RouteListItem} from '../../../../types/reducers'

import TripsPerHourChart from './TripsPerHourChart'

type Props = ContainerProps & {
allRoutes: AllRoutesSubState,
fetchRouteDetails: typeof routesActions.fetchRouteDetails,
Expand All @@ -40,6 +42,8 @@ type Props = ContainerProps & {
const PAGE_SIZE = 10

export default class RouteLayout extends Component<Props> {
messages = getComponentMessages('RouteLayout')

componentWillMount () {
const {fetchRouteDetails, fetchRoutes, fetchStatus, version} = this.props
const {namespace} = version
Expand Down Expand Up @@ -118,7 +122,10 @@ export default class RouteLayout extends Component<Props> {
hideDateTimeField
onChange={this._onDateTimeFilterChange}
version={version} />

{/* TODO: Fix Pagination in this component and remove this warning */}
<ControlLabel style={{paddingTop: '10px'}}>
{this.messages('pageSizeNotice').replace('%pageSize%', PAGE_SIZE.toString())}
</ControlLabel>
{fetching &&
<Loading />
}
Expand Down