Skip to content
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

Conversation

Wojdylak
Copy link
Member

@Wojdylak Wojdylak commented Apr 22, 2024

Q A
Branch? bootstrap-admin-panel
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets N/A
License MIT

image

@Wojdylak Wojdylak requested review from a team as code owners April 22, 2024 13:39
@probot-autolabeler probot-autolabeler bot added the Admin AdminBundle related issues and PRs. label Apr 22, 2024
@Wojdylak Wojdylak force-pushed the SYL-3436-product-variants-generation-page branch from e7973d2 to 53f8825 Compare April 23, 2024 09:08
Copy link

github-actions bot commented Apr 23, 2024

Bunnyshell Preview Environment deleted

Available commands:

  • /bns:deploy to redeploy the environment

@Wojdylak Wojdylak force-pushed the SYL-3436-product-variants-generation-page branch from 18c30d1 to 438d769 Compare April 23, 2024 13:23
@TheMilek
Copy link
Member

/bns:start

@TheMilek
Copy link
Member

I would maybe only change the channelPricing tabs to accordion, as it is done on product variants, but could be done later as an improvement ✌️

@Wojdylak Wojdylak force-pushed the SYL-3436-product-variants-generation-page branch from 438d769 to 9cf22a2 Compare April 24, 2024 13:45
Comment on lines -92 to -109
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
Copy link
Contributor

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}}) }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{ 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?

Comment on lines +7 to +11
<div>
{% for optionValue in form.optionValues %}
{{ optionValue.vars.label|trans }}: <span class="fw-bold me-1">{{ optionValue.vars.value }}</span>
{% endfor %}
</div>
Copy link
Contributor

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

Comment on lines +81 to +85
'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"]',
Copy link
Member

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

Comment on lines +66 to +67


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@GSadee GSadee merged commit 1f24328 into Sylius:bootstrap-admin-panel Apr 25, 2024
19 checks passed
@Wojdylak Wojdylak deleted the SYL-3436-product-variants-generation-page branch May 23, 2024 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin AdminBundle related issues and PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants