Skip to content

Commit 56722ce

Browse files
committed
DT-6929 fix link, support for future route desc
1 parent f0aa356 commit 56722ce

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

app/component/itinerary/ItineraryDetails.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,19 +220,23 @@ function ItineraryDetails(
220220
}
221221

222222
if (config.replacementBusNotification) {
223-
itinerary.legs.forEach(leg => {
224-
const { route, trip } = leg;
225-
if (
226-
(route && getRouteMode(route, config)?.includes('replacement')) ||
227-
(trip &&
228-
(trip.submode?.includes('replacement') ||
229-
trip.submode?.includes(714)))
230-
) {
231-
const notification = config.replacementBusNotification;
223+
itinerary.legs.forEach(({ route, trip }) => {
224+
const isReplacementRoute =
225+
route?.desc?.length &&
226+
getRouteMode(route, config)?.includes('replacement');
227+
const isReplacementTrip =
228+
trip?.submode?.includes('replacement') || trip?.submode?.includes(714);
229+
230+
if (isReplacementRoute || isReplacementTrip) {
231+
const notification =
232+
isReplacementRoute && config.showRouteDescNotification
233+
? { content: route.desc, link: route.url }
234+
: config.replacementBusNotification;
235+
232236
disclaimers.push(
233237
<RouteDisclaimer
234238
key="replacementBusNotification"
235-
text={notification.content?.[currentLanguage].join(' ')}
239+
text={notification.content?.[currentLanguage]?.join(' ')}
236240
href={notification.link?.[currentLanguage]}
237241
linkText={intl.formatMessage({ id: 'extra-info' })}
238242
/>,

app/configurations/config.default.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,4 +862,5 @@ export default {
862862
allowFlexJourneys: false,
863863
allowDirectFlexJourneys: false,
864864
allowedFlexRouteTypes: [1501],
865+
showRouteDescNotification: false,
865866
};

app/configurations/config.hsl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ export default {
772772
],
773773
},
774774
link: {
775-
fi: 'hsl.fi/korvaavabussi',
775+
fi: 'https://hsl.fi/korvaavabussi',
776776
},
777777
},
778778

0 commit comments

Comments
 (0)