fix: don't allow "new" or "create" as url-friendly names #13596
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, you can create a template named "new", which you'll be unable to view in the dashboard because of a routing conflict. /templates/new is the route of the
CreateTemplatePage
component.Groups, on the other hand, currently use /groups/create as the route for the
CreateGroupPage
. It's also technically not an issue right now, because groups are routed by UUID on the frontend instead of by name, but we don't do that anywhere else in the app and should probably fix that later. As such, we should make sure that any groups created won't conflict when we fix that down the road.Organizations will soon be similar, when I add the /organizations/new page soon.
It would also be nice to consolidate on just /new or just /create as the route that these sorts of pages should live at, (ie. change groups to /groups/new). In the mean time, let's disallow using either as a name, regardless of the resource type.
Given all this, and for consistency, no resource which has a "url-friendly name" should allow "new" or "create" as that name. If we consolidate all of the routes to just one of these options down the road, we can loosen the restriction.