From 294386c39b7df4ee407e9ad35658f04def1a82a8 Mon Sep 17 00:00:00 2001 From: "philip.cline" Date: Fri, 1 Sep 2023 00:15:55 -0400 Subject: [PATCH 1/2] feat(PatternLinkErrorMessage): add route short names --- lib/common/actions/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/common/actions/index.js b/lib/common/actions/index.js index b63d3bf14..65e7e6187 100644 --- a/lib/common/actions/index.js +++ b/lib/common/actions/index.js @@ -142,8 +142,8 @@ function getErrorMessageFromJson ( if (patternsMatch) { const patterns = patternsMatch.split(',').map(pattern => { pattern = pattern.slice(1, -1) // Remove curly braces - const [patternId, routeId] = pattern.split('-') - return {patternId, routeId} + const [patternId, routeId, routeShortName] = pattern.split('-') + return {patternId, routeId, routeShortName} }) detail = } @@ -183,7 +183,7 @@ const PatternLinkErrorMessage = (props) => { return (
  • - {`Route ${pattern.routeId}, Pattern ${pattern.patternId}`} + {`Route ${pattern.routeShortName}, Pattern ${pattern.patternId}`}
  • ) From bfcde9e384936bb2ae673b4abe2ec6b2cfe82eeb Mon Sep 17 00:00:00 2001 From: "philip.cline" Date: Tue, 26 Sep 2023 13:11:54 -0400 Subject: [PATCH 2/2] refactor(PatternLinkMessage): fall back to route ID --- lib/common/actions/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/common/actions/index.js b/lib/common/actions/index.js index 65e7e6187..d155597d2 100644 --- a/lib/common/actions/index.js +++ b/lib/common/actions/index.js @@ -142,8 +142,8 @@ function getErrorMessageFromJson ( if (patternsMatch) { const patterns = patternsMatch.split(',').map(pattern => { pattern = pattern.slice(1, -1) // Remove curly braces - const [patternId, routeId, routeShortName] = pattern.split('-') - return {patternId, routeId, routeShortName} + const [patternId, internalRouteId, routeShortName, routeId] = pattern.split('-') + return {patternId, internalRouteId, routeShortName, routeId} }) detail = } @@ -179,11 +179,12 @@ const PatternLinkErrorMessage = (props) => { padding: '5px 10px' }}> {patterns.map((pattern, index) => { - const patternPath = `../edit/route/${pattern.routeId}/trippattern/${pattern.patternId}` + // The URL path requires the internal ID for the route record rather than the actual GTFS Route ID. + const patternPath = `../edit/route/${pattern.internalRouteId}/trippattern/${pattern.patternId}` return (
  • - {`Route ${pattern.routeShortName}, Pattern ${pattern.patternId}`} + {`Route ${pattern.routeShortName || pattern.routeId}, Pattern ${pattern.patternId}`}
  • )