Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dt 5890 #4863

Merged
merged 2 commits into from
Sep 21, 2023
Merged

Dt 5890 #4863

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading