Skip to content

Commit

Permalink
Merge pull request #1313 from opentripplanner/field-trip-fixes-dec-24
Browse files Browse the repository at this point in the history
Field trip fixes dec 24
  • Loading branch information
miles-grant-ibigroup authored Dec 13, 2024
2 parents 7ea6e15 + b19e30f commit b4364d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lib/actions/field-trip.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
setPendingRequests,
updateOtpUrlParams
} from './api'
import { setLocation } from './map'
import { toggleCallHistory } from './call-taker'

if (typeof fetch === 'undefined') require('isomorphic-fetch')
Expand Down Expand Up @@ -534,8 +535,8 @@ function prepareQueryParams(request, outbound) {
const hasExistingLocations = currentQuery.from || currentQuery.to
const locations =
!hasExistingLocations ||
window.confirm(
'Use custom set locations? Pressing "Cancel" will use the locations you have typed in. Pressing "OK" will use the locations currently saved to the field trip'
!window.confirm(
'Use custom set locations? Pressing "OK" will use the locations you have typed in. Pressing "Cancel" will use the locations currently saved to the field trip'
)
? await planParamsToQueryAsync(locationsToGeocode, config)
: { from: currentQuery.from, to: currentQuery.to }
Expand Down Expand Up @@ -1078,6 +1079,8 @@ export function clearActiveFieldTrip() {
return function (dispatch) {
dispatch(setActiveFieldTrip(null))
dispatch(clearActiveSearch())
dispatch(setLocation({ location: null, locationType: 'from' }))
dispatch(setLocation({ location: null, locationType: 'to' }))
dispatch(setQueryParam({ numItineraries: undefined }))
dispatch(clearSaveable())
}
Expand Down
3 changes: 2 additions & 1 deletion lib/components/admin/field-trip-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class FieldTripList extends Component {
}

_onCloseActiveFieldTrip = () => {
this.props.setActiveFieldTrip(null)
this.props.clearActiveFieldTrip()
}

_getReportUrl = () => {
Expand Down Expand Up @@ -268,6 +268,7 @@ const mapStateToProps = (state) => {
}

const mapDispatchToProps = {
clearActiveFieldTrip: fieldTripActions.clearActiveFieldTrip,
fetchFieldTripDetails: fieldTripActions.fetchFieldTripDetails,
fetchFieldTrips: fieldTripActions.fetchFieldTrips,
setActiveFieldTrip: fieldTripActions.setActiveFieldTrip,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/form/add-place-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const AddPlaceButton = ({
const disabled = !from || !to || maxPlacesDefined
return (
<button
className="clear-button-formatting"
className="clear-button-formatting add-place-button"
disabled={disabled}
onClick={onClick}
style={{ marginBottom: '5px', marginLeft: '10px' }}
Expand Down

0 comments on commit b4364d3

Please sign in to comment.