Skip to content

Commit

Permalink
Merge pull request #4863 from HSLdevcom/DT-5890
Browse files Browse the repository at this point in the history
Dt 5890
  • Loading branch information
vesameskanen authored Sep 21, 2023
2 parents a7bdc0e + f87d53f commit 064f7ec
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 19 deletions.
61 changes: 42 additions & 19 deletions app/component/ItineraryTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
legContainsRentalBike,
getTotalDrivingDuration,
getTotalDrivingDistance,
isCallAgencyPickupType,
} from '../util/legUtils';
import { BreakpointConsumer } from '../util/withBreakpoint';

Expand Down Expand Up @@ -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 (
<div className="itinerary-tab">
<h2 className="sr-only">
Expand All @@ -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)}
/>
) : (
<>
Expand Down Expand Up @@ -278,15 +281,15 @@ class ItineraryTab extends React.Component {
),
shouldShowFareInfo(config) && (
shouldShowFarePurchaseInfo(config,breakpoint,fares) ? (
<MobileTicketPurchaseInformation
fares={fares}
zones={getZones(itinerary.legs)}
<MobileTicketPurchaseInformation
fares={fares}
zones={getZones(itinerary.legs)}
/>) :
( <TicketInformation
fares={fares}
zones={getZones(itinerary.legs)}
legs={itinerary.legs}
/>)
fares={fares}
zones={getZones(itinerary.legs)}
legs={itinerary.legs}
/>)
),
<div
className={cx('momentum-scroll itinerary-tabs__scroll', {
Expand All @@ -305,17 +308,37 @@ class ItineraryTab extends React.Component {
<div className="icon-container">
<Icon className="info" img="icon-icon_info" />
</div>
<div className="description-container">
<FormattedMessage
id="separate-ticket-required-disclaimer"
values={{
agencyName: get(
config,
'ticketInformation.primaryAgencyName',
),
}}
/>
</div>
{config.callAgencyInfo && itineraryContainsCallLegs ?
(<div className="description-container">
<FormattedMessage
id="separate-ticket-required-for-call-agency-disclaimer"
values={{
callAgencyInfoUrl: get(
config,
'callAgencyInfo.callAgencyInfoLink',
),
}}
/>
<a href={config.callAgencyInfo.callAgencyInfoLink}>
<FormattedMessage
id={config.callAgencyInfo.callAgencyInfoLinkText}
defaultMessage={config.callAgencyInfo.callAgencyInfoLinkText}
/>
</a>
</div>
) : (
<div className="description-container">
<FormattedMessage
id="separate-ticket-required-disclaimer"
values={{
agencyName: get(
config,
'ticketInformation.primaryAgencyName',
),
}}
/>
</div>
)}
</div>
)}
<ItineraryLegs
Expand Down
5 changes: 5 additions & 0 deletions app/configurations/config.tampere.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ export default configMerger(walttiConfig, {

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
Expand Down
6 changes: 6 additions & 0 deletions app/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,8 @@ const translations = {
'A separate ticket is required for this part of the itinerary.',
'separate-ticket-required-disclaimer':
'This itinerary contains one or more legs for which {agencyName} does not sell tickets.',
'separate-ticket-required-for-call-agency-disclaimer':
'Voit tarkistaa kutsuliikenteen maksutavat ja käytännöt ',
'set-specific-settings': 'Set more specific settings',
'set-stop-as-routes': "Set the stop as route's",
settings: 'Settings',
Expand Down Expand Up @@ -2598,6 +2600,8 @@ const translations = {
'Tälle matkan osuudelle tarvitaan erillinen lippu.',
'separate-ticket-required-disclaimer':
'Matka sisältää yhden tai useamman osuuden, jonka lippujen myynnistä {agencyName} ei vastaa.',
'separate-ticket-required-for-call-agency-disclaimer':
'Voit tarkistaa kutsuliikenteen maksutavat ja käytännöt ',
'set-specific-settings': 'Aseta tarkemmat asetukset',
'set-stop-as-routes': 'Aseta pysäkki reitin',
settings: 'Asetukset',
Expand Down Expand Up @@ -4516,6 +4520,8 @@ const translations = {
'Denna etapp av resan kräver en separat biljett.',
'separate-ticket-required-disclaimer':
'Resan består av en eller fleta etapper vilka kräver biljetter som inte säljs av {agencyName}.',
'separate-ticket-required-for-call-agency-disclaimer':
'Voit tarkistaa kutsuliikenteen maksutavat ja käytännöt ',
'set-specific-settings': 'Ställa avancerade inställningar',
'set-stop-as-routes': 'Ställa hållplats som rutter',
settings: 'Anpassa',
Expand Down

0 comments on commit 064f7ec

Please sign in to comment.