-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[AdminUser][Customer] Improve Twig hook structure by adding left
and right
sections
#17585
Conversation
…d `right` sections
WalkthroughThe pull request introduces significant updates to the Sylius framework version 2.0.3, focusing on restructuring admin user and customer form configurations. The changes primarily involve introducing new left and right sections in Twig hooks, reorganizing form layouts, and adjusting section priorities. The modifications enhance form customization capabilities while maintaining the existing functionality. The update also includes updates to method signatures, service configurations, and template structures across multiple bundles. Changes
Sequence DiagramsequenceDiagram
participant Form as Admin Form
participant Left as Sections#Left
participant Right as Sections#Right
Form->>Left: Render Account Section
Form->>Left: Render Other Left Sections
Form->>Right: Render Personal Information
Form->>Right: Render Extra Information
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 3
🧹 Nitpick comments (2)
src/Sylius/Bundle/AdminBundle/templates/customer/form/sections.html.twig (1)
3-10
: Consider simplifying the nested row structure.The template currently has nested
row
divs which might be unnecessary. Consider removing the outer row since it only contains the hooks and the inner row.-<div class="row"> {% hook 'sections' %} - <div class="row"> + <div class="row"> <div class="col-12 col-md-6"> {% hook 'sections#left' %} </div> <div class="col-12 col-md-6"> {% hook 'sections#right' %} </div> - </div> </div>src/Sylius/Bundle/AdminBundle/templates/admin_user/form/sections.html.twig (1)
3-10
: Template structure maintains consistency with customer form.The identical structure between admin user and customer templates is good for maintainability. However, the same nested row simplification could be applied here.
-<div class="row"> {% hook 'sections' %} - <div class="row"> + <div class="row"> <div class="col-12 col-md-6"> {% hook 'sections#left' %} </div> <div class="col-12 col-md-6"> {% hook 'sections#right' %} </div> - </div> </div>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
UPGRADE-2.0.md
(1 hunks)src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/admin_user/create.yaml
(1 hunks)src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/admin_user/update.yaml
(1 hunks)src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/customer/create.yaml
(1 hunks)src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/customer/update.yaml
(1 hunks)src/Sylius/Bundle/AdminBundle/templates/admin_user/form/sections.html.twig
(1 hunks)src/Sylius/Bundle/AdminBundle/templates/admin_user/form/sections/account.html.twig
(1 hunks)src/Sylius/Bundle/AdminBundle/templates/admin_user/form/sections/personal_information.html.twig
(1 hunks)src/Sylius/Bundle/AdminBundle/templates/customer/form/sections.html.twig
(1 hunks)src/Sylius/Bundle/AdminBundle/templates/customer/form/sections/account_credentials.html.twig
(1 hunks)src/Sylius/Bundle/AdminBundle/templates/customer/form/sections/extra_information.html.twig
(1 hunks)src/Sylius/Bundle/AdminBundle/templates/customer/form/sections/general.html.twig
(1 hunks)
✅ Files skipped from review due to trivial changes (4)
- src/Sylius/Bundle/AdminBundle/templates/admin_user/form/sections/personal_information.html.twig
- src/Sylius/Bundle/AdminBundle/templates/admin_user/form/sections/account.html.twig
- src/Sylius/Bundle/AdminBundle/templates/customer/form/sections/general.html.twig
- src/Sylius/Bundle/AdminBundle/templates/customer/form/sections/extra_information.html.twig
🔇 Additional comments (7)
src/Sylius/Bundle/AdminBundle/templates/customer/form/sections.html.twig (1)
4-9
: LGTM! Well-structured responsive layout.
The two-column layout with responsive classes and semantic hook names (sections#left
and sections#right
) is well implemented. The Bootstrap grid classes ensure proper mobile-first responsiveness.
src/Sylius/Bundle/AdminBundle/templates/customer/form/sections/account_credentials.html.twig (1)
1-14
: LGTM! Improved layout using card component.
The transition from column-based to card-based layout provides better visual hierarchy and semantic structure. The implementation:
- Uses proper Bootstrap card component structure
- Maintains the existing conditional logic
- Provides clear visual separation of content
src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/admin_user/create.yaml (1)
20-22
: LGTM: General section properly disabled
The general section is correctly disabled to allow for the new left/right section structure.
src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/admin_user/update.yaml (1)
22-31
: LGTM: Consistent with create form structure
The update form configuration perfectly mirrors the create form structure, maintaining UI consistency.
src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/customer/create.yaml (1)
20-22
: LGTM: General section properly disabled
The general section is correctly disabled to support the new left/right structure.
src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/customer/update.yaml (1)
27-41
: LGTM! The changes align with the new Twig hooks structure.
The modifications effectively reorganize the customer update form by:
- Disabling the general section in the main form sections
- Adding left and right sections to improve the form layout
- Properly distributing form sections between left (general, account_credentials) and right (extra_information)
This change follows the new Twig hooks pattern and improves the form structure without breaking existing functionality.
UPGRADE-2.0.md (1)
1-13
: LGTM! Comprehensive upgrade documentation.
The upgrade guide thoroughly documents all necessary changes for migrating to Sylius 2.0.3, including:
- Initial setup requirements
- Package dependencies
- Constructor signatures
- Service and class changes
- Frontend modifications
- Twig hooks implementation
The documentation is well-structured and provides clear instructions for implementing each change.
src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/admin_user/create.yaml
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/customer/create.yaml
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/customer/create.yaml
Show resolved
Hide resolved
Bunnyshell Preview Environment deletedAvailable commands:
|
Summary by CodeRabbit