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

Add route short names to stop deletion warning #985

Merged
merged 2 commits into from
Sep 27, 2023
Merged
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
9 changes: 5 additions & 4 deletions lib/common/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, internalRouteId, routeShortName, routeId] = pattern.split('-')
return {patternId, internalRouteId, routeShortName, routeId}
})
detail = <PatternLinkErrorMessage detail={detail} patterns={patterns} />
}
Expand Down Expand Up @@ -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 (
<li style={{listStyle: 'none', margin: '3px 0px'}}>
<a href={patternPath}>
{`Route ${pattern.routeId}, Pattern ${pattern.patternId}`}
{`Route ${pattern.routeShortName || pattern.routeId}, Pattern ${pattern.patternId}`}
</a>
</li>
)
Expand Down
Loading