Skip to content

Conversation

amy-corson-ibigroup
Copy link
Contributor

Description:
Make sure all available short names are passed to transitive overlay.

A follow up OTP-UI PR is needed because the comment on this line (that a blank string will render no label) is not the case with the new transitive overlay bubbles.

PR Checklist:

  • Does the code follow accessibility standards (WCAG 2.1 AA Compliant)?
  • Are all languages supported (Internationalization/Localization)?
  • Are appropriate Typescript types implemented?

lib/app.js Outdated
@@ -167,7 +167,7 @@ const components = {
* @returns A string with the custom label to display for the given leg, or null to render no label.
*/
getTransitiveRouteLabel: (itineraryLeg) => {
return itineraryLeg.routeShortName // null or undefined or empty string will tell transitive-js to not render a route label.
return itineraryLeg.routeShortName || itineraryLeg.route.shortName // null or undefined or empty string will tell transitive-js to not render a route label.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know route will exist? Will it always have a shortname?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a conditional to route. If there's no short name, it'll return undefined which in theory transitive should handle gracefully ( it doesn't but that's out of the scope of this PR)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the route object is missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it'll return undefined.

Copy link
Collaborator

@miles-grant-ibigroup miles-grant-ibigroup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm nervous but I trust you!

Copy link
Collaborator

@alec-georgoff alec-georgoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

@amy-corson-ibigroup amy-corson-ibigroup merged commit 99076ec into dev Sep 15, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants