Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: don't allow "new" or "create" as url-friendly names#13596

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
aslilac merged 5 commits intomainfromno-new-name
Jun 18, 2024

Conversation

aslilac
Copy link
Member

  • 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 theCreateTemplatePage component.

  • Groups, on the other hand, currently use /groups/create as the route for theCreateGroupPage. 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.

Emyrk reacted with laugh emoji
@aslilacaslilac requested a review fromEmyrkJune 18, 2024 18:12
Copy link
Member

@EmyrkEmyrk left a comment

Choose a reason for hiding this comment

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

Good catch!

Unfortunately the actual error text will be quite cryptic.

field: name detail: Validation failed for tag "template_name" with value: "new"

This is an issue with thevalidate library. It's no worse than the current name validation.

@aslilac
Copy link
MemberAuthor

Unfortunately the actual error text will be quite cryptic.

boo. unfortunate that it just throws the actual error text away. 🙃

@aslilacaslilac merged commite987ad1 intomainJun 18, 2024
28 checks passed
@aslilacaslilac deleted the no-new-name branchJune 18, 2024 21:36
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 18, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@EmyrkEmyrkEmyrk approved these changes

Assignees

@aslilacaslilac

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@aslilac@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp