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 1 commit
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
6 changes: 3 additions & 3 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, routeId, routeShortName] = pattern.split('-')
return {patternId, routeId, routeShortName}
})
detail = <PatternLinkErrorMessage detail={detail} patterns={patterns} />
}
Expand Down Expand Up @@ -183,7 +183,7 @@ const PatternLinkErrorMessage = (props) => {
return (
<li style={{listStyle: 'none', margin: '3px 0px'}}>
<a href={patternPath}>
{`Route ${pattern.routeId}, Pattern ${pattern.patternId}`}
{`Route ${pattern.routeShortName}, Pattern ${pattern.patternId}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not working with a number of feeds I previously imported. For these feeds, the route short name is undefined. You should fall back on route ID IMO.

Copy link
Contributor Author

@philip-cline philip-cline Sep 26, 2023

Choose a reason for hiding this comment

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

I agree, good call. I have added route ID as a fall back in bfcde9e

</a>
</li>
)
Expand Down