Skip to content

Commit

Permalink
undefined trunkRoute error handling (#433)
Browse files Browse the repository at this point in the history
* fix combining rows

* MM-484: Allow launching separate services as different instances (#363)

* MM-484: Allow launching separate services as different instances

* Add default value to PUBLISHER_RENDER_URL

* MM-497: Endpoint for render URL generation, Update README about service splitting (#364)

* MM-497: Endpoint for render URL generation

* Update README about the sectioning of the service, new start commands and explanations.

* Remove extra slash from fallback url

* Allow route title to enter the padding area

This allow rendering to continue and not to fail if the route title is too long.

* MM-495: Rename ticket-zones.json, update README (#365)

* MM-502: Add more functionality to generateRenderUrl endpoint and rendering (#366)

* MM-502: Add current date by default unless date is included in generateRenderUrl params

* Tweak order of local setup commands, add moment to dependencies

* MM-502: Add parameter to hide address info from timetable render

* MM-502: Add print button to rendered document, and a parameter to hide it from document

* Update yarn.locl

---------

Co-authored-by: Juho Hänninen <juho.hanninen@cgi.com>

* Fix url env variables for server (#368)

* Fix url env variables for server

* Fix webpack errors due to fs reference in browser app

* Fix build and type errors

* Fix server host checking

* Add link to publisher-server for worker

* MM-504: Add redirect parameter to generateRenderUrl endpoint

* Remove forever from deployment

* Add publisher server url to env to be build in the image

* Fix and enhance puppeteer console logging

* Remove trailing slash from server url env

* Upgrade hsl-map-style

* Fix single departure grouping with same minutes

* Add filtering for duplicate departures

* Drop console statement

* day specific a4 timetable departures

* bug fixes

* l_rail color added

* legend updated

* translations

* style reference update

* yarn.lock

* revert package.json and yarn.lock

* new color and background color for stopPoster

* yarn.lock update

* L-rail icon and color update

* MM-507: Add Docker Compose setup for development (#383)

* MM-507: Add docker compose configuration for development

* MM-507: Add setup instructions in README

* Add font instructions to README, tidy up

* Persist postgresql volume, add db dependency for startup sequence

* Use tram diagram also on light rail stops

(cherry picked from commit d0932d1)

* Resize Pikaratikka's icon to render it correctly

* fixed StopPoster timetable columns

* removed redundant prop

* #26114: language change for print button (#388)

* #26114: Add language choices into the print button on timetable rendering

* #26236: Fix StopPosterA3 generating error (#391)

* Fix StopPosterA3 generating error

* Refactor stopId property from A3Timetable to prevent same error

* Merge conflict fix

* empty day columns fixed

* AB#27362: Scripted test stops (#393)

* AB#27362: Script test stop posters

* Fix typo in component name

* Add poster download to test script

* Remove comments

* Add test results folder to gitignore

* AB#27362: Script test stop posters

Fix typo in component name

Add poster download to test script

Remove comments

Add test results folder to gitignore

* yarn.lock and dockerfile updates

* update react

* deprecated lifecycles removed

* WIP: Create line timetable component

* Include app.js for new component

* AB#32085: WIP: Add LineTimetable component

* Change routeIdentifier property

* AB#32085: Add LineTimetable to test script

* Add font styling, tweak font sizes and date formatting

* AB#33201: Fix wrong route color in StopPoster

* Add build command to compose and fix output folder location

* Revert "Merge pull request #397 from HSLdevcom/AB#32085_line_timetable"

This reverts commit 91be8f2, reversing
changes made to 1bdc2b9.

* Revert "#AB25283 Node/React update"

* Revert "Revert "Merge pull request #397 from HSLdevcom/AB#32085_line_timetable""

This reverts commit 89aa890.

* Revert "Revert "#AB25283 Node/React update""

* build fix

* removing fast refresh from dev webpack

* removing fast refresh from webpack.common

* node env

* AB#33966: Pass api key to client-side in env variables (#407)

* Revert "AB#33966: Pass api key to client-side in env variables (#407)"

This reverts commit da5eaf4.

* AB#33966: Expose local env file in compose to pass apikey without extra commands (#408)

* AB#32085: add print button (#409)

* AB#33966: Expose local env file in compose to pass apikey without extra commands

* AB#32085: Add missing print button to line timetable, cleanup unused code and components

* AB#32085: Remove unused prop

* AB#32667: Add smaller size variant to TerminalPoster component (#399)

* Bump map-style version to 1.1.3 (#412)

* WIP: Bug fix for stop poster

* AB#37216: Fix horizontal overflow error on large terminal route lists (#413)

* Fix trunk route color in route diagram (#414)

* Fix trunk route color in route diagram

* Add coloring to terminalAreaRoutes

* AB#39315: remove opening times from SVG (#416)

* AB#39315: Remove opening times from SVG

* AB#39315: Resize new SVG

* AB#39315: Revert resize

* AB#32085: Refactor generateRenderUrl endpoint to accept LineTimetable requests (#410)

* AB#32085: Show both directions in same timetable (#411)

* AB#32085: Show both directions in same timetable, include variants

* Add different layout when querying for routes that don't have timed stops

* Tweak styling

* WIP: Variants and new GraphQL queries

* Add new test stops and LineTimetable test runs

* Refactor queries and line timetable rendering logic

* AB#32085: WIP: Refactored line timetables

* AB#32085: WIP - Refactor LineTimetable logic, grouping bug to be fixed

* Remove unused code, add latest test script

* AB#32085: Add padding, limit number of timed stops

* AB#32085: Tweak styling, refactor render logic (#419)

* AB#32085: Tweak styling, refactor render logic

* Tweak styling, merge separate friday departures to weekday departures

* Add fix for partial departures along a route

* Partial departure fix continues

* Shorten train IDs so they display correctly

* AB#32085: Change LineTimetable print layout to A5 (#420)

* AB#32085: Change print layout to A5, tweak styling

* Variant logic for tram routes

* Add empty array checks to timetable rendering

* AB#44831: Add font styling to StopPoster map legend texts (#421)

* AB#44831: Add italics to Stop Poster TableHeaders (#422)

* AB#46862: Refactor route filtering logic (#425)

* AB#32085: Add page numbering (#424)

* AB#32085: Add page numbers

* Add page numbering to other rendering state

* Add styling tweaks and note filtering

* WIP: tweak styling for better page breaks

* Add tweaked test script

* Fix duplicate hour cutoff bug

* WIP: Latest tweaks for linetimetable printing

* Fix page break issues when printing

* Remove unused code for LineTimetable

* Add footnote styling

* AB#32085: Tweak print parameters, clean up (#428)

* AB#32085: Tweak LineTimetable font styles (#429)

* AB#48147: Improve missing line data error handling (#431)

* AB#48147: Improve empty line node array error handling (#432)

---------

Co-authored-by: Anton <anton.jyrkiainen@helsinki.fi>
Co-authored-by: Juho Hänninen <juho.hanninen@cgi.com>
Co-authored-by: Juho Hänninen <hannisenjuho@gmail.com>
Co-authored-by: Anton Jyrkiäinen <anton.jyrkiainen@gmail.com>
  • Loading branch information
5 people authored Dec 9, 2024
1 parent 3a975e4 commit e59c3f6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/components/map/stopMapContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,24 @@ const stopsMapper = stopGroup => ({
const destinationSe = mergedRouteSegment.destinationSe
? mergedRouteSegment.destinationSe
: get(mergedRouteSegment, 'route.nodes[0].destinationSe');

let trunkRoute;

try {
trunkRoute =
mergedRouteSegment.line.nodes && mergedRouteSegment.line.nodes[0].trunkRoute === '1';
} catch (e) {
trunkRoute = false;
}

return {
routeId: trimRouteId(mergedRouteSegment.routeId),
destinationFi,
destinationSe,
viaFi: mergedRouteSegment.viaFi,
viaSe: mergedRouteSegment.viaSe,
mode: mergedRouteSegment.route.nodes[0].mode,
trunkRoute:
mergedRouteSegment.line.nodes && mergedRouteSegment.line.nodes[0].trunkRoute === '1',
trunkRoute,
};
}),
).sort(routeCompare),
Expand Down
9 changes: 8 additions & 1 deletion src/util/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ function routesToTree(routes, { stopZone, shortId }, height = 'auto', width = MA
type: 'stop',
zone: stop.stopZone,
routeSegments: stop.routeSegments.nodes.map(segment => {
const trunkRoute = segment.line.nodes[0].trunkRoute === '1';

let trunkRoute;
try {
trunkRoute = segment.line.nodes[0].trunkRoute === '1';
} catch (e) {
trunkRoute = false;
}

return {
...segment,
trunkRoute,
Expand Down

0 comments on commit e59c3f6

Please sign in to comment.