diff --git a/lib/actions/form.js b/lib/actions/form.js index c16405f17..bb6c401b9 100644 --- a/lib/actions/form.js +++ b/lib/actions/form.js @@ -55,6 +55,7 @@ export function resetForm(full = false) { // If fully resetting form, also clear the active search, from/to // locations, and query params. dispatch(clearActiveSearch()) + dispatch(settingQueryParam({ departArrive: 'NOW' })) dispatch(setLocation({ location: null, locationType: 'from' })) dispatch(setLocation({ location: null, locationType: 'to' })) // Get query params. Delete everything except sessionId. diff --git a/lib/actions/plan.js b/lib/actions/plan.js index da09f0da8..7803f7671 100644 --- a/lib/actions/plan.js +++ b/lib/actions/plan.js @@ -11,7 +11,7 @@ import { getFirstStopId } from '../util/itinerary' import { routingQuery } from './api' import { setQueryParam } from './form' -const SERVICE_BREAK = '03:00' +const SERVICE_BREAK = '03:30' const NINETY_SECONDS = 90000 function updateParamsAndPlan(params) { diff --git a/lib/components/admin/mailables-window.js b/lib/components/admin/mailables-window.js index 05232c2d4..585515d36 100644 --- a/lib/components/admin/mailables-window.js +++ b/lib/components/admin/mailables-window.js @@ -48,11 +48,6 @@ class SelectedMailable extends Component { updateField(index, 'largeFormat', evt.target.checked) } - _changeSmallFormat = (evt) => { - const { index, updateField } = this.props - updateField(index, 'smallFormat', evt.target.checked) - } - _changeQuantity = (evt) => { const { index, updateField } = this.props updateField(index, 'quantity', evt.target.value) @@ -62,8 +57,7 @@ class SelectedMailable extends Component { render() { const { index, mailable } = this.props - const largeId = `largeFormat-${index}` - const smallId = `smallFormat-${index}` + const id = `largeFormat-${index}` return ( @@ -76,26 +70,15 @@ class SelectedMailable extends Component { type="number" value={mailable.quantity} /> -
- - -
{mailable.largePrint && (
-
@@ -122,11 +105,9 @@ class MailablesWindow extends Component { } _addMailable = (mailable) => { - if (!this.state.mailables.find((m) => m.name === mailable.name)) { - const mailables = [...this.state.mailables] - mailables.push({ ...mailable, quantity: 1, smallFormat: true }) - this.setState({ mailables }) - } + const mailables = [...this.state.mailables] + mailables.push({ ...mailable, quantity: 1 }) + this.setState({ mailables }) } _removeMailable = (mailable) => { @@ -156,9 +137,9 @@ class MailablesWindow extends Component { const { mailables: selectedMailables } = this.state const { items } = mailablesConfig if (!callTaker.mailables.visible) return null - const selectableMailables = items.filter( - (m) => !selectedMailables.find((mailable) => mailable.name === m.name) - ) + // If items should not be addable twice, then this line can be amended + const selectableMailables = items + return ( - {time} -
- {params.from.name} to {params.to.name} + {params.from.name} to {params.to.name} at {time} ) diff --git a/lib/components/narrative/default/itinerary.css b/lib/components/narrative/default/itinerary.css index 656a4b9ef..91a5e089c 100644 --- a/lib/components/narrative/default/itinerary.css +++ b/lib/components/narrative/default/itinerary.css @@ -198,6 +198,8 @@ .otp .option.default-itin > .header .title > .summary > .mode-block { height: 18px; width: 18px; + color: #eee; + fill: #eee; } .otp .option.default-itin > .header .title > .summary > .arrow-block { diff --git a/lib/util/mailables.js b/lib/util/mailables.js index fc5437797..5705cc92d 100644 --- a/lib/util/mailables.js +++ b/lib/util/mailables.js @@ -113,22 +113,13 @@ async function writePDF(formData, imageData, otpConfig) { const tableData = { headers: ['Item', 'Quantity'], - rows: mailables - .map((mailable) => { - let { largeFormat, largePrint, name, quantity, smallFormat } = mailable - const rows = [] - - if (smallFormat) { - rows.push([name, quantity]) - } - - if (largePrint && largeFormat) { - name += ' (LARGE PRINT)' - rows.push([name, quantity]) - } - return rows - }) - .flat() + rows: mailables.map((mailable) => { + let { largeFormat, largePrint, name, quantity } = mailable + if (largePrint && largeFormat) { + name += ' (LARGE PRINT)' + } + return [name, quantity] + }) } doc.table(tableData, {