Skip to content

Fix limitation preventing to declare create and show routes from the list view#10782

Merged
djhi merged 1 commit intomasterfrom
fix-create-dialog-limitation
Jun 12, 2025
Merged

Fix limitation preventing to declare create and show routes from the list view#10782
djhi merged 1 commit intomasterfrom
fix-create-dialog-limitation

Conversation

@slax57
Copy link
Copy Markdown
Contributor

@slax57 slax57 commented Jun 12, 2025

Problem

If a resource declares both a list view and an edit view

<Resource name="posts" list={PostList} edit={PostEdit} />

Then it's impossible to declare other routes (such as the create or show routes) from within the list view, because they overlap with the route declared for the edit view.

This prevents notably from being able to use a CreateDialog with a regular Edit view.
Hence this note in the EE doc:

Note: You can't use the <CreateDialog> and have a standard <Edit> specified on your <Resource>, because the <Routes> declarations would conflict. If you need this, use the <CreateInDialogButton> instead.

Solution

Do not register the edit route if the location matches the create route or the show route.

How To Test

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@slax57 slax57 added the RFR Ready For Review label Jun 12, 2025
Copy link
Copy Markdown
Contributor

@djhi djhi left a comment

Choose a reason for hiding this comment

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

Awesome stories, great job!

@djhi djhi added this to the 5.8.5 milestone Jun 12, 2025
@djhi djhi merged commit 1987db1 into master Jun 12, 2025
15 checks passed
@djhi djhi deleted the fix-create-dialog-limitation branch June 12, 2025 15:42
@djhi djhi modified the milestones: 5.8.5, 5.9.0 Jun 23, 2025
@djhi djhi restored the fix-create-dialog-limitation branch June 25, 2025 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants