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

Field trip august 2024 fixes #1256

Merged
merged 8 commits into from
Aug 30, 2024
8 changes: 6 additions & 2 deletions lib/actions/field-trip.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ export function saveRequestTripItineraries(request, outbound, intl) {
*/
function prepareQueryParams(request, outbound) {
return async function (dispatch, getState) {
const { config } = getState().otp
const { config, currentQuery } = getState().otp
const { modules, transitOperators } = config
const fieldTripOptions = modules?.find((m) => m.id === 'ft')?.options

Expand Down Expand Up @@ -533,7 +533,11 @@ function prepareQueryParams(request, outbound) {
agencies: bannedAgencies
}
}
const locations = await planParamsToQueryAsync(locationsToGeocode, config)
const hasExistingLocations = currentQuery.from || currentQuery.to
const locations =
!hasExistingLocations || window.confirm('Overwrite existing locations?')
? await planParamsToQueryAsync(locationsToGeocode, config)
: { from: currentQuery.from, to: currentQuery.to }
return dispatch(setQueryParam({ ...locations, ...queryParams }))
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/components/admin/mailables-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class MailablesWindow extends Component {
<IconWithText Icon={Envelope}>Mailables</IconWithText>
</WindowHeader>
}
height="300px"
height="400px"
onClickClose={toggleMailables}
scroll={false}
style={{ width: '600px' }}
Expand Down
1 change: 1 addition & 0 deletions lib/components/admin/query-record.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class QueryRecordLayout extends Component {
<CallRecordIcon type="search" />
{params.from.name} to {params.to.name} at {time}
</CallRecordButton>
<hr style={{ margin: 0 }} />
</li>
)
}
Expand Down
22 changes: 13 additions & 9 deletions lib/components/app/call-taker-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,12 @@ class CallTakerPanel extends Component {
}
}

// eslint-disable-next-line complexity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen this warning in other places. Should be disable those as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No! It's a good reminder to make our code better

render() {
const {
activeSearch,
currentQuery,
fieldTripVisible,
groupSize,
intl,
mainPanelContent,
Expand Down Expand Up @@ -267,15 +269,17 @@ class CallTakerPanel extends Component {
/>
</div>
<div className="search-plan-button-container">
<Button
onClick={this._planTrip}
style={{
fontWeight: 'bold',
width: '100%'
}}
>
Plan
</Button>
{!fieldTripVisible && (
<Button
onClick={this._planTrip}
style={{
fontWeight: 'bold',
width: '100%'
}}
>
Plan
</Button>
)}
</div>
<div className="advanced-search-options-container">
{groupSize !== null && maxGroupSize && (
Expand Down
2 changes: 1 addition & 1 deletion lib/components/narrative/default/default-itinerary.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const ITINERARY_ATTRIBUTES = [
includeSeconds={false}
/>
<LegIconWrapper noSpace>
<LegIcon leg={leg} size={5} />
<LegIcon leg={{ ...leg, mode: 'WALK' }} size={5} />
miles-grant-ibigroup marked this conversation as resolved.
Show resolved Hide resolved
</LegIconWrapper>
</>
)
Expand Down
4 changes: 3 additions & 1 deletion lib/components/narrative/default/itinerary-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ export default class ItinerarySummary extends Component {
}
blocks.push(
<Block
className="summary-block mode-block"
className={`summary-block mode-block ${
company === null ? 'non-company' : ''
}`}
key={blocks.length}
mode={leg.mode}
routeColor={leg.routeColor}
Expand Down
7 changes: 7 additions & 0 deletions lib/components/narrative/default/itinerary.css
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@
.otp .option.default-itin > .header .title > .summary > .mode-block {
height: 18px;
width: 18px;
}
.otp
.option.default-itin
> .header
.title
> .summary
> .mode-block.non-company {
color: #eee;
fill: #eee;
}
Expand Down
Loading