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/app/call-taker-panel.js b/lib/components/app/call-taker-panel.js index 5889c69d7..a0a1eafaf 100644 --- a/lib/components/app/call-taker-panel.js +++ b/lib/components/app/call-taker-panel.js @@ -139,7 +139,7 @@ class CallTakerPanel extends Component { if ( // Only enabled when field trip is enabled, as otherwise // this flashes a lot, possibly to an annoying extent - this.props.fieldTripEnabled && + this.props.fieldTripVisible && (prevProps?.currentQuery?.from?.name !== this.props?.currentQuery?.from?.name || prevProps?.currentQuery?.to?.name !== @@ -338,7 +338,7 @@ class CallTakerPanel extends Component { // connect to the redux store const mapStateToProps = (state) => { - const { activeId, requests } = state.callTaker.fieldTrip + const { activeId, groupSize, requests, visible } = state.callTaker.fieldTrip const request = requests.data.find((req) => req.id === activeId) const showUserSettings = getShowUserSettings(state) const moduleConfig = getModuleConfig(state, Modules.CALL_TAKER)?.options @@ -351,8 +351,8 @@ const mapStateToProps = (state) => { return { activeSearch: getActiveSearch(state), currentQuery: state.otp.currentQuery, - fieldTripEnabled: isModuleEnabled(state, Modules.FIELD_TRIP), - groupSize: state.callTaker.fieldTrip.groupSize, + fieldTripVisible: visible, + groupSize, mainPanelContent: state.otp.ui.mainPanelContent, maxGroupSize: getGroupSize(request), modeDropdownOptions: diff --git a/lib/components/form/call-taker/advanced-options.js b/lib/components/form/call-taker/advanced-options.js index d1b66277c..b755d11a7 100644 --- a/lib/components/form/call-taker/advanced-options.js +++ b/lib/components/form/call-taker/advanced-options.js @@ -237,11 +237,11 @@ class AdvancedOptions extends Component { name="walkReluctance" onChange={this._setWalkTolerance} options={[ - { text: 'Avoid Walking', value: 15 }, { text: 'Normal Walking', value: 3 }, + { text: 'Avoid Walking', value: 15 }, { text: 'Prefer walking', value: 1 } ]} - style={{ display: 'block' }} + style={{ display: 'block', width: '33ch' }} value={this.props.modeSettingValues.walkReluctance} /> diff --git a/lib/components/narrative/default/default-itinerary.js b/lib/components/narrative/default/default-itinerary.js index bfbf25518..353cf9709 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 } } diff --git a/lib/components/narrative/narrative-itinerary.js b/lib/components/narrative/narrative-itinerary.js index a070a8f3a..196548e63 100644 --- a/lib/components/narrative/narrative-itinerary.js +++ b/lib/components/narrative/narrative-itinerary.js @@ -21,8 +21,9 @@ export default class NarrativeItinerary extends Component { } __setItinToActiveIndex = () => { - const { index, setActiveItinerary } = this.props + const { index, setActiveItinerary, setVisibleItinerary } = this.props setActiveItinerary && setActiveItinerary({ index }) + setVisibleItinerary && setVisibleItinerary({ index }) } _onDirectClick = () => {