From 13b1ae937de34113424f14f6796172a56755000f Mon Sep 17 00:00:00 2001 From: sharhio Date: Wed, 6 Sep 2023 14:04:11 +0300 Subject: [PATCH 1/2] chore: dt-5890 tampere disclaimer for call journey tickets --- app/component/ItineraryTab.js | 61 +++++++++++++++++++--------- app/configurations/config.default.js | 2 + app/configurations/config.tampere.js | 4 ++ app/translations.js | 6 +++ 4 files changed, 54 insertions(+), 19 deletions(-) diff --git a/app/component/ItineraryTab.js b/app/component/ItineraryTab.js index 55e0b4cb67..3fae93afe4 100644 --- a/app/component/ItineraryTab.js +++ b/app/component/ItineraryTab.js @@ -25,6 +25,7 @@ import { legContainsRentalBike, getTotalDrivingDuration, getTotalDrivingDistance, + isCallAgencyPickupType, } from '../util/legUtils'; import { BreakpointConsumer } from '../util/withBreakpoint'; @@ -213,6 +214,8 @@ class ItineraryTab extends React.Component { const suggestionIndex = this.context.match.params.secondHash ? Number(this.context.match.params.secondHash) + 1 : Number(this.context.match.params.hash) + 1; + const itineraryContainsCallLegs = itinerary.legs.some(leg => isCallAgencyPickupType(leg)); + return (

@@ -235,7 +238,7 @@ class ItineraryTab extends React.Component { futureText={extraProps.futureText} isMultiRow={extraProps.isMultiRow} isMobile={this.props.isMobile} - hideBottomDivider={shouldShowFarePurchaseInfo(config,breakpoint,fares)} + hideBottomDivider={shouldShowFarePurchaseInfo(config, breakpoint, fares)} /> ) : ( <> @@ -278,15 +281,15 @@ class ItineraryTab extends React.Component { ), shouldShowFareInfo(config) && ( shouldShowFarePurchaseInfo(config,breakpoint,fares) ? ( - ) : ( ) + fares={fares} + zones={getZones(itinerary.legs)} + legs={itinerary.legs} + />) ),
-
- -
+ {config.showCallAgencyDisclaimer && itineraryContainsCallLegs ? + (
+ + + + +
+ ) : ( +
+ +
+ )}

)} Date: Wed, 20 Sep 2023 10:47:03 +0300 Subject: [PATCH 2/2] chore: dt-5890 call agency config --- app/component/ItineraryTab.js | 10 +++++----- app/configurations/config.default.js | 2 -- app/configurations/config.tampere.js | 9 +++++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/component/ItineraryTab.js b/app/component/ItineraryTab.js index 3fae93afe4..8f2c9d0a0c 100644 --- a/app/component/ItineraryTab.js +++ b/app/component/ItineraryTab.js @@ -308,21 +308,21 @@ class ItineraryTab extends React.Component {
- {config.showCallAgencyDisclaimer && itineraryContainsCallLegs ? + {config.callAgencyInfo && itineraryContainsCallLegs ? (
- +
diff --git a/app/configurations/config.default.js b/app/configurations/config.default.js index 394c44b0bb..f07fee279d 100644 --- a/app/configurations/config.default.js +++ b/app/configurations/config.default.js @@ -427,8 +427,6 @@ export default { primaryAgencyName: ..., */ }, - // DT-5890 - showCallAgencyDisclaimer: false, useTicketIcons: false, showRouteInformation: false, diff --git a/app/configurations/config.tampere.js b/app/configurations/config.tampere.js index ab5d87e052..4ab4aebf28 100644 --- a/app/configurations/config.tampere.js +++ b/app/configurations/config.tampere.js @@ -76,14 +76,15 @@ export default configMerger(walttiConfig, { ticketInformation: { primaryAgencyName: 'Tampereen seudun joukkoliikenne', - callAgencyInfoLink: 'https://nysse.fi/nyssykka', - callAgencyInfoLinkText: 'nysse.fi/nyssykka', }, - showCallAgencyDisclaimer: true, - ticketLink: 'https://www.nysse.fi/liput-ja-hinnat.html', + callAgencyInfo: { + callAgencyInfoLink: 'https://nysse.fi/nyssykka', + callAgencyInfoLinkText: 'nysse.fi/nyssykka', + }, + // mapping fareId from OTP fare identifiers to human readable form fareMapping: function mapFareId(fareId) { return fareId && fareId.substring