Skip to content

Commit

Permalink
fix(PatternLayout): Fix call to patternDateTimeFilterChange.
Browse files Browse the repository at this point in the history
Fix #789
  • Loading branch information
binh-dam-ibigroup committed May 10, 2022
1 parent 4d53b59 commit 8a91747
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/manager/components/reporter/components/PatternLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import * as filterActions from '../../../../gtfs/actions/filter'
import * as patternsActions from '../../../../gtfs/actions/patterns'
import * as routesActions from '../../../../gtfs/actions/routes'
import * as timetablesActions from '../../../../gtfs/actions/timetables'
import TripsPerHourChart from './TripsPerHourChart'

import type {Props as ContainerProps} from '../containers/Patterns'
import type {FetchStatus} from '../../../../types'
import type {AllRoutesSubState, RouteListItem} from '../../../../types/reducers'
import type {PatternRowData} from '../../../selectors'

import TripsPerHourChart from './TripsPerHourChart'

type Props = ContainerProps & {
fetchRoutes: typeof routesActions.fetchRoutes,
fetchStatus: FetchStatus,
Expand All @@ -47,6 +47,11 @@ export default class PatternLayout extends Component<Props> {
}
}

_onDateTimeFilterChange = () => {
const {namespace, patternDateTimeFilterChange} = this.props
patternDateTimeFilterChange(namespace)
}

_onSelectRoute = (newRoute: ?RouteListItem) => {
const {namespace, patternRouteFilterChange} = this.props
patternRouteFilterChange(namespace, newRoute ? newRoute.route_id : undefined)
Expand All @@ -60,7 +65,6 @@ export default class PatternLayout extends Component<Props> {
fetching
},
patternData,
patternDateTimeFilterChange,
routeFilter,
routes,
selectTab,
Expand Down Expand Up @@ -97,7 +101,7 @@ export default class PatternLayout extends Component<Props> {
</Row>
<ActiveDateTimeFilter
hideDateTimeField
onChange={patternDateTimeFilterChange}
onChange={this._onDateTimeFilterChange}
version={version} />
</div>
}
Expand Down

0 comments on commit 8a91747

Please sign in to comment.