Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8284ba0
fix(SavedTripScreen): Do not leave screen if there is an error saving…
binh-dam-ibigroup Sep 17, 2020
dc63ad5
feat(Form input validation): Begin make basic validations.
binh-dam-ibigroup Sep 25, 2020
064721b
refactor: Migrate locations pane to use Formik.
binh-dam-ibigroup Sep 28, 2020
ea247d9
refactor(FavoriteLocationsPane): Maintain home and work locations at …
binh-dam-ibigroup Sep 29, 2020
e14b286
refactor(FavoriteLocationsPane): Extract and memoize event handlers.
binh-dam-ibigroup Sep 29, 2020
cd37cda
refactor(UserAccountScreen): Don't save locations with blank addresses.
binh-dam-ibigroup Sep 29, 2020
1bd8444
fix(monitored-trip): update API call to use pagination endpoint
landonreed Sep 29, 2020
35c5a96
refactor(FavoriteLocationsPane): Tweak comments.
binh-dam-ibigroup Sep 30, 2020
8cb5686
refactor(Trip panes): Make trip panes work with Formik
binh-dam-ibigroup Sep 30, 2020
cade3eb
refactor(SavedTripScreen): Remove state.
binh-dam-ibigroup Sep 30, 2020
d58ee57
refactor(UserAccountScreen): Complete validation schema
binh-dam-ibigroup Sep 30, 2020
3908261
refactor(SavedTripScreen): Add check that at least one day is monitored.
binh-dam-ibigroup Sep 30, 2020
2d56f42
improvement(TripNotificationsPane): Populate notif. mode. Add alert i…
binh-dam-ibigroup Sep 30, 2020
fb18f75
refactor(Add comments regarding Formik props, per PR feedback.):
binh-dam-ibigroup Oct 5, 2020
6902c2b
refactor(UserAccount,SavedTripScreen): Address PR comments
binh-dam-ibigroup Oct 9, 2020
f623214
Merge branch 'dev' into form-validation
binh-dam-ibigroup Oct 9, 2020
cf194ec
fix(SavedTripEditor): Fix bad merge.
binh-dam-ibigroup Oct 9, 2020
7af3181
Merge pull request #239 from opentripplanner/form-validation
binh-dam-ibigroup Oct 9, 2020
94ed85f
Merge branch 'dev' into dont-exit-if-save-fails
binh-dam-ibigroup Oct 9, 2020
861f5e8
refactor(SavedTripScreen): Move navigation after trip persistence to …
binh-dam-ibigroup Oct 9, 2020
3fd0a0a
refactor(SavedTripScreen): Fix a few things.
binh-dam-ibigroup Oct 9, 2020
342de8c
Merge pull request #238 from opentripplanner/pagination-update
landonreed Oct 12, 2020
1b9d84e
Merge pull request #232 from opentripplanner/dont-exit-if-save-fails
binh-dam-ibigroup Oct 12, 2020
886430d
fix(batch): get error prop from state; skip sort if batch disabled
landonreed Oct 20, 2020
d9931fe
test: update snapshot
landonreed Oct 21, 2020
6e06f43
Merge pull request #259 from opentripplanner/batch-routing-fixes
landonreed Oct 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Object {
"filter": "ALL",
"sort": Object {
"direction": "ASC",
"type": "BEST",
"type": null,
},
},
"location": Object {
Expand Down
6 changes: 5 additions & 1 deletion lib/actions/user.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createAction } from 'redux-actions'

import { routeTo } from './ui'
import {
addTrip,
addUser,
Expand Down Expand Up @@ -40,7 +41,7 @@ export function fetchUserMonitoredTrips (accessToken) {
if (otpMiddleware) {
const { data: trips, status: fetchStatus } = await getTrips(otpMiddleware, accessToken)
if (fetchStatus === 'success') {
dispatch(setCurrentUserMonitoredTrips(trips))
dispatch(setCurrentUserMonitoredTrips(trips.data))
}
}
}
Expand Down Expand Up @@ -154,6 +155,9 @@ export function createOrUpdateUserMonitoredTrip (tripData, isNew, silentOnSucces

// Reload user's monitored trips after add/update.
await dispatch(fetchUserMonitoredTrips(accessToken))

// Finally, navigate to the saved trips page.
dispatch(routeTo('/savedtrips'))
} else {
alert(`An error was encountered:\n${JSON.stringify(result)}`)
}
Expand Down
5 changes: 2 additions & 3 deletions lib/components/form/error-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import TripTools from '../narrative/trip-tools'

import { getActiveSearch } from '../../util/state'
import { getActiveErrors } from '../../util/state'

class ErrorMessage extends Component {
static propTypes = {
Expand Down Expand Up @@ -45,9 +45,8 @@ class ErrorMessage extends Component {
// connect to the redux store

const mapStateToProps = (state, ownProps) => {
const activeSearch = getActiveSearch(state.otp)
return {
error: activeSearch && activeSearch.response && activeSearch.response.error,
error: getActiveErrors(state.otp)[0],
currentQuery: state.otp.currentQuery,
errorMessages: state.otp.config.errorMessages
}
Expand Down
9 changes: 7 additions & 2 deletions lib/components/mobile/results-screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ import MobileNavigationBar from './navigation-bar'
import { MobileScreens, setMobileScreen } from '../../actions/ui'
import { setUseRealtimeResponse } from '../../actions/narrative'
import { clearActiveSearch } from '../../actions/form'
import { getActiveItineraries, getActiveSearch, getRealtimeEffects } from '../../util/state'
import {
getActiveErrors,
getActiveItineraries,
getActiveSearch,
getRealtimeEffects
} from '../../util/state'

const LocationContainer = styled.div`
font-weight: 300;
Expand Down Expand Up @@ -239,7 +244,7 @@ const mapStateToProps = (state, ownProps) => {
return {
query: state.otp.currentQuery,
realtimeEffects,
error: response && response.error,
error: getActiveErrors(state.otp)[0],
resultCount:
response
? activeSearch.query.routingType === 'ITINERARY'
Expand Down
8 changes: 6 additions & 2 deletions lib/components/narrative/narrative-routing-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import Loading from './loading'
import TabbedItineraries from './tabbed-itineraries'
import ErrorMessage from '../form/error-message'

import { getActiveSearch, getActiveItineraries } from '../../util/state'
import {
getActiveErrors,
getActiveItineraries,
getActiveSearch
} from '../../util/state'
import { setMainPanelContent } from '../../actions/ui'

class NarrativeRoutingResults extends Component {
Expand Down Expand Up @@ -47,7 +51,7 @@ const mapStateToProps = (state, ownProps) => {
const pending = activeSearch ? Boolean(activeSearch.pending) : false
return {
mainPanelContent: state.otp.ui.mainPanelContent,
error: activeSearch && activeSearch.response && activeSearch.response.error,
error: getActiveErrors(state.otp)[0],
itineraries: getActiveItineraries(state.otp),
pending,
routingType: activeSearch && activeSearch.query.routingType
Expand Down
67 changes: 35 additions & 32 deletions lib/components/user/existing-account-display.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,46 @@
import React, { Component } from 'react'
import React from 'react'

import LinkButton from './link-button'
import StackedPaneDisplay from './stacked-pane-display'

/**
* This component handles the existing account display.
*/
class ExistingAccountDisplay extends Component {
render () {
const { onCancel, onComplete, panes } = this.props
const paneSequence = [
{
pane: () => <p><LinkButton to='/savedtrips'>Edit my trips</LinkButton></p>,
title: 'My trips'
},
{
pane: panes.terms,
props: { disableCheckTerms: true },
title: 'Terms'
},
{
pane: panes.notifications,
title: 'Notifications'
},
{
pane: panes.locations,
title: 'My locations'
}
]
const ExistingAccountDisplay = props => {
// The props include Formik props that provide access to the current user data
// and to its own blur/change/submit event handlers that automate the state.
// We forward the props to each pane so that their individual controls
// can be wired to be managed by Formik.
const { onCancel, panes } = props
const paneSequence = [
{
pane: () => <p><LinkButton to='/savedtrips'>Edit my trips</LinkButton></p>,
title: 'My trips'
},
{
pane: panes.terms,
props: { ...props, disableCheckTerms: true },
title: 'Terms'
},
{
pane: panes.notifications,
props,
title: 'Notifications'
},
{
pane: panes.locations,
props,
title: 'My locations'
}
]

return (
<StackedPaneDisplay
onCancel={onCancel}
onComplete={onComplete}
paneSequence={paneSequence}
title='My Account'
/>
)
}
return (
<StackedPaneDisplay
onCancel={onCancel}
paneSequence={paneSequence}
title='My Account'
/>
)
}

export default ExistingAccountDisplay
Loading