bug #15006 Fix adding more than one product attribute at once (jakubtobiasz)

This PR was merged into the 1.12 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.12
| Bug fix?        | yes
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | fixes #14521
| License         | MIT


Commits
-------

e4d8d790b2 Add a Behat scenario reproducing being unable to add two product attributes at once
1e7a0be7a5 Fix being unable to add two product attributes at once
This commit is contained in:
Kamil Grygierzec 2023-05-04 13:22:19 +02:00 committed by GitHub
commit e4c4365549
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View file

@ -0,0 +1,25 @@
@managing_products
Feature: Adding a new integer product attribute
In order to manage the product attributes easily
As an Administrator
I want to be able to add many product attributes at once
Background:
Given the store operates on a single channel in "United States"
And the store has a non-translatable text product attribute "Author"
And the store has a non-translatable text product attribute "ISBN"
And I am logged in as an administrator
@ui @javascript @no-api
Scenario: Adding two text attributes to a product
When I want to create a new simple product
And I specify its code as "HARRY_POTTER_1"
And I name it "Harry Potter and the Sorcerer's Stone" in "English (United States)"
And I set its price to "$10.99" for "United States" channel
And I set its non-translatable "Author" attribute to "J.K. Rowling"
And I set its non-translatable "ISBN" attribute to "978-1338878929"
And I add it
Then I should be notified that it has been successfully created
And the product "Harry Potter and the Sorcerer's Stone" should appear in the store
And non-translatable attribute "Author" of product "Harry Potter and the Sorcerer's Stone" should be "J.K. Rowling"
And non-translatable attribute "ISBN" of product "Harry Potter and the Sorcerer's Stone" should be "978-1338878929"

View file

@ -128,7 +128,7 @@ const setAttributeChoiceListener = function setAttributeChoiceListener() {
$('#sylius_product_attribute_choice').val('');
addAttributesNumber($.grep(attributeFormElements, a => $(a).hasClass('attribute')).length);
addAttributesNumber(attributeFormElements.find('.attribute').length);
modifySelectorOnAttributesListElementDelete();
$('form').removeClass('loading');