Skip to content

Commit

Permalink
add showBatchUiItineraryHeaders config option
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Sep 18, 2023
1 parent 66a0ac8 commit f8cd005
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions example-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ itinerary:

# Whether to show the "# itineraries found" text above the itinerary results
showHeaderText: false
# Whether to show the mode descriptions in the batch UI results. Defaults to true
showBatchUiItineraryHeaders: false
# Whether to hide the gray loading bars that appear while results are loading
hideSkeletons: true
# Whether the itinerary listing background should match the header
Expand Down
16 changes: 10 additions & 6 deletions lib/components/narrative/default/default-itinerary.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ class DefaultItinerary extends NarrativeItinerary {
return false
}

// eslint-disable-next-line complexity
render() {
const {
accessibilityScoreGradationMap,
active,
co2Config,
configCosts,
defaultFareType,
Expand All @@ -262,11 +262,11 @@ class DefaultItinerary extends NarrativeItinerary {
LegIcon,
setActiveLeg,
showRealtimeAnnotation,
showResultHeaders,
visible
} = this.props
const isFlexItinerary = itinerary.legs.some(isFlex)
const isCallAhead = itinerary.legs.some(isAdvanceBookingRequired)
const isContDropoff = itinerary.legs.some(isCoordinationRequired)
const { SvgIcon } = this.context

const localizedGradationMapWithIcons = localizeGradationMap(
Expand Down Expand Up @@ -321,9 +321,11 @@ class DefaultItinerary extends NarrativeItinerary {
onClick={this._onHeaderClick}
>
<div className="title">
<h3>
<ItineraryDescription intl={intl} itinerary={itinerary} />
</h3>
{showResultHeaders && (
<h3>
<ItineraryDescription intl={intl} itinerary={itinerary} />
</h3>
)}
<ItinerarySummary itinerary={itinerary} LegIcon={LegIcon} />
{itineraryHasAccessibilityScores(itinerary) && (
<AccessibilityRating
Expand Down Expand Up @@ -407,7 +409,9 @@ const mapStateToProps = (state, ownProps) => {
defaultFareType: state.otp.config.itinerary?.defaultFareType || {
mediumId: null,
riderCategoryId: null
}
},
showResultHeaders:
state.otp.config.itinerary?.showBatchUiItineraryHeaders !== false
}
}

Expand Down

0 comments on commit f8cd005

Please sign in to comment.