diff --git a/i18n/english.yml b/i18n/english.yml index 077e780ae..c8c0bcd83 100644 --- a/i18n/english.yml +++ b/i18n/english.yml @@ -824,6 +824,7 @@ components: normalizeStopTimes: Normalize stop times normalizeStopTimesQuestion: Normalize stop times? selectBeginningPatternStop: "Select beginning pattern stop:" + tooFewTimepoints: "You must have more than 1 timepoint to interpolate times" usageExplanationOne: This feature is useful when the travel times for one or more pattern stops change. Take for example a pattern that has been re-routed along to travel a longer distance, has had a diff --git a/i18n/german.yml b/i18n/german.yml index 22107e85b..c80aeca22 100644 --- a/i18n/german.yml +++ b/i18n/german.yml @@ -836,6 +836,7 @@ components: normalizeStopTimes: Normalize stop times normalizeStopTimesQuestion: Normalize stop times? selectBeginningPatternStop: "Select beginning pattern stop:" + tooFewTimepoints: "You must have more than 1 timepoint to interpolate times" usageExplanationOne: This feature is useful when the travel times for one or more pattern stops change. Take for example a pattern that has been re-routed along to travel a longer distance, has had a diff --git a/i18n/polish.yml b/i18n/polish.yml index ae0c16bd3..4db630110 100644 --- a/i18n/polish.yml +++ b/i18n/polish.yml @@ -827,6 +827,7 @@ components: normalizeStopTimes: Normalize stop times normalizeStopTimesQuestion: Normalize stop times? selectBeginningPatternStop: "Select beginning pattern stop:" + tooFewTimepoints: "You must have more than 1 timepoint to interpolate times" usageExplanationOne: This feature is useful when the travel times for one or more pattern stops change. Take for example a pattern that has been re-routed along to travel a longer distance, has had a diff --git a/lib/editor/components/pattern/NormalizeStopTimesModal.js b/lib/editor/components/pattern/NormalizeStopTimesModal.js index 3f41cb4fc..5fdc5fd34 100644 --- a/lib/editor/components/pattern/NormalizeStopTimesModal.js +++ b/lib/editor/components/pattern/NormalizeStopTimesModal.js @@ -2,7 +2,7 @@ import Icon from '@conveyal/woonerf/components/icon' import React, { Component } from 'react' -import { Alert, Button, Checkbox, ControlLabel, FormControl, Modal } from 'react-bootstrap' +import { Alert, Button, Checkbox, ControlLabel, FormControl, Modal, OverlayTrigger, Tooltip } from 'react-bootstrap' import * as tripPatternActions from '../../actions/tripPattern' import type { GtfsStop, Pattern } from '../../../types' @@ -48,6 +48,8 @@ export default class NormalizeStopTimesModal extends Component { render () { const { Body, Footer, Header, Title } = Modal const { activePattern, stops } = this.props + const timepoints = activePattern.patternStops.filter(ps => ps.timepoint === 1) + const interpolationDisabled = timepoints.length < 2 return (
@@ -77,12 +79,20 @@ export default class NormalizeStopTimesModal extends Component { } )} - - {this.messages('interpolateStopTimes')} - +
+ {this.messages('tooFewTimepoints')}} + placement='bottom' + > + + + {/* Separate label so that tooltip appears over checkbox. Hack: Padding to align center with checkbox */} + {this.messages('interpolateStopTimes')} +

{this.state.patternStopIndex === 0