Add getSection at ResourceControllerEvent
Describe the proposed solution
Add setSection to ResourceControllerEvent and pass section from request configuration:
// sylius/resource-bundle/src/Bundle/Controller/EventDispatcher.php
// ...
$event = new ResourceControllerEvent($resource);
$event->setSection($requestConfiguration->getSection());
Alternative solution
Add whole requestConfiguration to event.
Additional context
When we subscribe to (for example) sylius.product.show event to embed some tracker html code like Google tag manager - we don't want to embed it at admin area. So we should somehow know what section (shop, admin, admin_api, etc) we're at to skip non-shop sections.
I will provide PR if this idea looks good for core team.
That's a reasonable expectation. Thanks for the report.
Ditto.
This is fixed in the 0.4.0 release.