Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions lib/components/narrative/default/default-itinerary.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export default class DefaultItinerary extends NarrativeItinerary {
itinerary,
LegIcon,
setActiveLeg,
setActiveStep
setActiveStep,
user
} = this.props
return (
<div className={`option default-itin${active ? ' active' : ''}`}>
Expand All @@ -32,7 +33,10 @@ export default class DefaultItinerary extends NarrativeItinerary {
<span className='title'>Itinerary {index + 1}</span>{' '}
<span className='duration pull-right'>{formatDuration(itinerary.duration)}</span>{' '}
<span className='arrivalTime'>{formatTime(itinerary.startTime)}—{formatTime(itinerary.endTime)}</span>
<span className='pull-right'><LinkButton to='/savetrip'>Save</LinkButton></span>{' '}
{user && (<>
<span className='pull-right'><LinkButton to='/savetrip'>Save</LinkButton></span>{' '}
</>
)}
<ItinerarySummary itinerary={itinerary} LegIcon={LegIcon} />
</button>
{(active || expanded) &&
Expand Down
6 changes: 4 additions & 2 deletions lib/components/narrative/itinerary-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ItineraryCarousel extends Component {
}

render () {
const { activeItinerary, itineraries, itineraryClass, hideHeader, pending } = this.props
const { activeItinerary, itineraries, itineraryClass, hideHeader, pending, user } = this.props
if (pending) return <Loading small />
if (!itineraries) return null

Expand All @@ -61,6 +61,7 @@ class ItineraryCarousel extends Component {
key: index,
expanded: this.props.expanded,
onClick: this._onItineraryClick,
user,
...this.props
})
})
Expand Down Expand Up @@ -112,7 +113,8 @@ const mapStateToProps = (state, ownProps) => {
activeLeg: activeSearch && activeSearch.activeLeg,
activeStep: activeSearch && activeSearch.activeStep,
companies: state.otp.currentQuery.companies,
timeFormat: coreUtils.time.getTimeFormat(state.otp.config)
timeFormat: coreUtils.time.getTimeFormat(state.otp.config),
user: state.user.loggedInUser
}
}

Expand Down
7 changes: 5 additions & 2 deletions lib/components/narrative/line-itin/line-itinerary.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export default class LineItinerary extends NarrativeItinerary {
onClick,
setActiveLeg,
showRealtimeAnnotation,
timeFormat
timeFormat,
user
} = this.props

if (!itinerary) {
Expand All @@ -76,7 +77,9 @@ export default class LineItinerary extends NarrativeItinerary {
timeOptions={timeOptions}
/>

<span className='pull-right'><LinkButton to='/savetrip'>Save this option</LinkButton></span>
{user &&
<span className='pull-right'><LinkButton to='/savetrip'>Save this option</LinkButton></span>
}

{showRealtimeAnnotation && <SimpleRealtimeAnnotation />}
{active || expanded
Expand Down
5 changes: 4 additions & 1 deletion lib/components/narrative/narrative-itineraries.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class NarrativeItineraries extends Component {
itineraries,
itineraryClass,
realtimeEffects,
useRealtime
useRealtime,
user
} = this.props
if (!itineraries) return null

Expand Down Expand Up @@ -69,6 +70,7 @@ class NarrativeItineraries extends Component {
key: index,
active: index === activeItinerary,
routingType: 'ITINERARY',
user,
...this.props
})
})}
Expand All @@ -95,6 +97,7 @@ const mapStateToProps = (state, ownProps) => {
activeLeg: activeSearch && activeSearch.activeLeg,
activeStep: activeSearch && activeSearch.activeStep,
useRealtime,
user: state.user.loggedInUser,
companies: state.otp.currentQuery.companies
}
}
Expand Down
7 changes: 5 additions & 2 deletions lib/components/narrative/tabbed-itineraries.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ class TabbedItineraries extends Component {
itineraryClass,
realtimeEffects,
useRealtime,
timeFormat
timeFormat,
user
} = this.props
if (!itineraries) return null

Expand Down Expand Up @@ -123,6 +124,7 @@ class TabbedItineraries extends Component {
active: true,
routingType: 'ITINERARY',
showRealtimeAnnotation,
user,
...this.props
})}

Expand All @@ -149,7 +151,8 @@ const mapStateToProps = (state, ownProps) => {
useRealtime,
companies: state.otp.currentQuery.companies,
tnc: state.otp.tnc,
timeFormat: getTimeFormat(state.otp.config)
timeFormat: getTimeFormat(state.otp.config),
user: state.user.loggedInUser
}
}

Expand Down