-
-
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
[Admin][Product] Add generate variants page #16162
[Admin][Product] Add generate variants page #16162
Conversation
Wojdylak
commented
Apr 22, 2024
•
edited
Loading
edited
Q | A |
---|---|
Branch? | bootstrap-admin-panel |
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Related tickets | N/A |
License | MIT |
e7973d2
to
53f8825
Compare
Bunnyshell Preview Environment deletedAvailable commands:
|
...us/Bundle/AdminBundle/Resources/views/Product/generate_variants/header/breadcrumbs.html.twig
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Resources/views/Product/generate_variants/form/variants.html.twig
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Twig/Component/Product/GenerateVariantsFormComponent.php
Outdated
Show resolved
Hide resolved
18c30d1
to
438d769
Compare
src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/product/generate_variants.yaml
Show resolved
Hide resolved
/bns:start |
I would maybe only change the |
src/Sylius/Bundle/AdminBundle/Twig/Component/Product/GenerateVariantsFormComponent.php
Outdated
Show resolved
Hide resolved
438d769
to
9cf22a2
Compare
…uctVariantsFormComponent
sylius_admin_product_variant_generate: | ||
path: /generate | ||
methods: [GET, POST] | ||
defaults: | ||
_controller: sylius.controller.product::updateAction | ||
_sylius: | ||
template: "@SyliusAdmin/ProductVariant/generate.html.twig" | ||
section: admin | ||
permission: true | ||
redirect: | ||
route: sylius_admin_product_variant_index | ||
parameters: { productId: $productId } | ||
form: | ||
type: Sylius\Bundle\ProductBundle\Form\Type\ProductGenerateVariantsType | ||
repository: | ||
method: find | ||
arguments: [$productId] | ||
flash: sylius.product_variant.generate |
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.
Why?
{% set fallback_hook = hook_name(parent_fallback_hook, 'form') %} | ||
|
||
<div class="container-xl" {{ attributes }}> | ||
{{ form_start(form, {'attr': {'class': 'ui loadable form', 'novalidate': 'novalidate', 'id': form.vars.id}}) }} |
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.
{{ form_start(form, {'attr': {'class': 'ui loadable form', 'novalidate': 'novalidate', 'id': form.vars.id}}) }} | |
{{ form_start(form, {'attr': {'novalidate': 'novalidate'}}) }} |
Do we even need theses 2?
<div> | ||
{% for optionValue in form.optionValues %} | ||
{{ optionValue.vars.label|trans }}: <span class="fw-bold me-1">{{ optionValue.vars.value }}</span> | ||
{% endfor %} | ||
</div> |
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.
Would be nice to check how that'd look with a lot of options
'generate_button' => '[data-test-generate-button]', | ||
'delete_button' => '#sylius_product_generate_variants_variants_%position% [data-test-delete-button]', | ||
'code' => '#sylius_product_generate_variants_variants_%position% [data-test-code]', | ||
'channel_pricings' => '#sylius_product_generate_variants_variants_%position% [data-test-channel-pricings]', | ||
'form' => '[data-live-name-value="sylius_admin:product:generate_product_variants_form"]', |
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.
Keys should be in alphabetical order
|
||
|
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.