-
-
Notifications
You must be signed in to change notification settings - Fork 495
[EasyAdmin] Add pretty admin URL routes #1381
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
[EasyAdmin] Add pretty admin URL routes #1381
Conversation
The support for pretty admin URLs was introduced in EasyAdmin 4.14.0.
Thanks for the PR 😍 How to test these changes in your application
Diff between recipe versionsIn order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. easycorp/easyadmin-bundle1.17 vs 2.0diff --git a/easycorp/easyadmin-bundle/1.17/config/routes/easy_admin.yaml b/easycorp/easyadmin-bundle/2.0/config/routes/easy_admin.yaml
index 1014c71..c62135c 100644
--- a/easycorp/easyadmin-bundle/1.17/config/routes/easy_admin.yaml
+++ b/easycorp/easyadmin-bundle/2.0/config/routes/easy_admin.yaml
@@ -1,4 +1,4 @@
easy_admin_bundle:
- resource: '@EasyAdminBundle/Controller/AdminController.php'
+ resource: '@EasyAdminBundle/Controller/EasyAdminController.php'
prefix: /admin
type: annotation 2.0 vs 3.0diff --git a/easycorp/easyadmin-bundle/2.0/config/packages/easy_admin.yaml b/easycorp/easyadmin-bundle/2.0/config/packages/easy_admin.yaml
deleted file mode 100644
index 8ad6ecc..0000000
--- a/easycorp/easyadmin-bundle/2.0/config/packages/easy_admin.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-#easy_admin:
-# entities:
-# # List the entity class name you want to manage
-# - App\Entity\Product
-# - App\Entity\Category
-# - App\Entity\User
diff --git a/easycorp/easyadmin-bundle/2.0/config/routes/easy_admin.yaml b/easycorp/easyadmin-bundle/2.0/config/routes/easy_admin.yaml
deleted file mode 100644
index c62135c..0000000
--- a/easycorp/easyadmin-bundle/2.0/config/routes/easy_admin.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-easy_admin_bundle:
- resource: '@EasyAdminBundle/Controller/EasyAdminController.php'
- prefix: /admin
- type: annotation
diff --git a/easycorp/easyadmin-bundle/2.0/manifest.json b/easycorp/easyadmin-bundle/3.0/manifest.json
index dd96174..bd6763a 100644
--- a/easycorp/easyadmin-bundle/2.0/manifest.json
+++ b/easycorp/easyadmin-bundle/3.0/manifest.json
@@ -2,8 +2,5 @@
"bundles": {
"EasyCorp\\Bundle\\EasyAdminBundle\\EasyAdminBundle": ["all"]
},
- "copy-from-recipe": {
- "config/": "%CONFIG_DIR%/"
- },
"aliases": ["admin-gen", "admin-generator", "admin"]
} 3.0 vs 4.14diff --git a/easycorp/easyadmin-bundle/4.14/config/routes/easyadmin.yaml b/easycorp/easyadmin-bundle/4.14/config/routes/easyadmin.yaml
new file mode 100644
index 0000000..083ca15
--- /dev/null
+++ b/easycorp/easyadmin-bundle/4.14/config/routes/easyadmin.yaml
@@ -0,0 +1,3 @@
+easyadmin:
+ resource: .
+ type: easyadmin.routes
diff --git a/easycorp/easyadmin-bundle/3.0/manifest.json b/easycorp/easyadmin-bundle/4.14/manifest.json
index bd6763a..e4b7057 100644
--- a/easycorp/easyadmin-bundle/3.0/manifest.json
+++ b/easycorp/easyadmin-bundle/4.14/manifest.json
@@ -1,6 +1,9 @@
{
"bundles": {
"EasyCorp\\Bundle\\EasyAdminBundle\\EasyAdminBundle": ["all"]
+ },
+ "copy-from-recipe": {
+ "config/": "%CONFIG_DIR%/"
},
"aliases": ["admin-gen", "admin-generator", "admin"]
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR lacks the manifest.json
file, you can add it by copy/pasting the ones from previous versions 👍
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
I don't see how to fix the error in the CI |
I'm not sure to make this change in 4.x version. I was thinking about making it in the upcoming 5.x version. I've been working hard during these past weeks to have 5.x version ready soon. |
Currently, version 4.24 does not work by default.
The
Dashboard is by default generated with pretty url but the route is not autoload |
@javiereguiluz Without this change, creating a new project using EA 4 will not work because maker and docs say that one must use the The solution is either to change the docs for 4.x, or to change the recipe for the version in which the annotation was introduced. For DX, and to ease migration to 5.x, I think it's better to update the recipe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, you are right 🙏 Let's merge this for 4.x branch too. Thanks!
This pull request adds a new route configuration for EasyAdmin in the
easyadmin.yaml
file. The new configuration defines autoload for new pretty URLThe support for pretty admin URLs was introduced in EasyAdmin 4.14.0.