-
Notifications
You must be signed in to change notification settings - Fork 349
Adding admin url in profiler bar #8042
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
base: 2.6
Are you sure you want to change the base?
Conversation
c24bcc4
to
7964a3f
Compare
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.
Looks good! When you fix the phpstan issues and resolve the other comment, we can merge this to 2.6 :)
Only register the service in dev. Currently the only way I see is either with attributes + autowiring or php in the service container so no way in the xml.
@mamazu You could also create a separate services.xml file for the dev service and only register it in the SuluWebsiteExtension when the application is run in dev mode
/** @var string $webspaceKey */ | ||
$webspaceKey = $request->attributes->get('_sulu')->getAttribute('webspace')->getKey(); | ||
/** @var string $pageId */ | ||
$pageId = $request->attributes->get('structure')?->getUuid(); |
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.
we should also check if this is really a page, otherwise the url will not work
/** @var string $pageId */ | ||
$pageId = $request->attributes->get('structure')?->getUuid(); | ||
|
||
return '/admin/#/webspaces/' . $webspaceKey . '/pages/' . $locale . '/' . $pageId . '/details'; |
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.
Hmm, we probably also need a way to get the prefix for the routes, as this can be configured differently per project 🤔
e.g.
sulu_tag_api:
resource: "@SuluTagBundle/Resources/config/routing_api.yml"
type: rest
prefix: /sulu/admin/api
sulu_admin:
resource: "@SuluAdminBundle/Resources/config/routing.yml"
prefix: /sulu/admin
sulu_admin_api:
resource: "@SuluAdminBundle/Resources/config/routing_api.yml"
type: rest
prefix: /sulu/admin/api
from the config/routes/sulu_admin.yaml
6ec5e01
to
77ade88
Compare
@Prokyonn ready for review. The remaining test failure is not related to the pr. |
77ade88
to
5ebdcd5
Compare
What's in this PR?
A way to generate a link to the admin panel for a given site.
Why?
For debugging purposes it's nice to get the admin url for the current page to make it easier to find where to configured.
Problems