From f8cd0059ab00c5320f1088bf43ffcc6bb6a86a50 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Mon, 18 Sep 2023 13:41:38 -0400 Subject: [PATCH] add showBatchUiItineraryHeaders config option --- example-config.yml | 2 ++ .../narrative/default/default-itinerary.js | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/example-config.yml b/example-config.yml index 63fbf78cc..fef2e9d79 100644 --- a/example-config.yml +++ b/example-config.yml @@ -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 diff --git a/lib/components/narrative/default/default-itinerary.js b/lib/components/narrative/default/default-itinerary.js index f7f98e49c..5f7baafa1 100644 --- a/lib/components/narrative/default/default-itinerary.js +++ b/lib/components/narrative/default/default-itinerary.js @@ -249,10 +249,10 @@ class DefaultItinerary extends NarrativeItinerary { return false } + // eslint-disable-next-line complexity render() { const { accessibilityScoreGradationMap, - active, co2Config, configCosts, defaultFareType, @@ -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( @@ -321,9 +321,11 @@ class DefaultItinerary extends NarrativeItinerary { onClick={this._onHeaderClick} >
-

- -

+ {showResultHeaders && ( +

+ +

+ )} {itineraryHasAccessibilityScores(itinerary) && ( { defaultFareType: state.otp.config.itinerary?.defaultFareType || { mediumId: null, riderCategoryId: null - } + }, + showResultHeaders: + state.otp.config.itinerary?.showBatchUiItineraryHeaders !== false } }