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

[AdminBundle]: "Add rule" in shipping methods no longer opens full rule form #14009

Closed
sabat24 opened this issue May 20, 2022 · 5 comments
Closed
Labels
Bug Confirmed bugs or bugfixes. Frontend Issues and PRs related to frontend

Comments

@sabat24
Copy link

sabat24 commented May 20, 2022

Sylius version affected: 1.1.11

Description
Same bug as #13463 but for Shipping Methods.

Possible Solution

Add below code to Resources/private/js/app.js somewhere inside $(document).ready(() => {

$('#sylius_shipping_method_rules > a[data-form-collection="add"]').on('click', () => {
    setTimeout(() => {
      $('select[name^="sylius_shipping_method[rules]"][name$="[type]"]').last().change();
    }, 50);
  });

Side Note

There should be more generic solution to handle such things not directly related to field names nor ids. It would help us when we extending some forms and would avoid such bugs from your side each time you change field name or add something.

@Ferror
Copy link
Contributor

Ferror commented May 25, 2022

Hi @sabat24 ! thanks for the issue.

I looked at it and could not reproduce the issue under https://master.demo.sylius.com/admin/shipping-methods/ (maybe it's already fixed or sth) Do you mind sending us ex. loom video (https://www.loom.com/) 😄

@Ferror Ferror added the Potential Bug Potential bugs or bugfixes, that needs to be reproduced. label May 25, 2022
@sabat24
Copy link
Author

sabat24 commented May 25, 2022

@Ferror

Go to https://master.demo.sylius.com/admin/shipping-methods/new and click on Add rule button. Then you will see

obraz

instead of

obraz

As you can see in first screenshot there are no configuration fields for the rule.

@Ferror
Copy link
Contributor

Ferror commented May 25, 2022

Alright, now I see it. The first time it is chosen the input does not appear. Would you like to open a PR with the improvement?

@Ferror Ferror added Bug Confirmed bugs or bugfixes. Frontend Issues and PRs related to frontend and removed Potential Bug Potential bugs or bugfixes, that needs to be reproduced. labels May 25, 2022
@sabat24
Copy link
Author

sabat24 commented May 25, 2022

Sure. Will do it in few days as soon as I write Behat tests for it.

GSadee added a commit that referenced this issue Jan 20, 2023
…e separate module (coldic3)

This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.11             |
| Bug fix?        | no                                                       |
| New feature?    | no                                                       |
| BC breaks?      | no                                                       |
| Deprecations?   | no |
| Related tickets | fixes #13845, #14009                      |
| License         | MIT                                                          |

Commits
-------

c03289f [UI][DX] Extract form collection event handlers to the separate module
@jakubtobiasz
Copy link
Contributor

Hello 👋🏼,
this issue has been resolved by #14730.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed bugs or bugfixes. Frontend Issues and PRs related to frontend
Projects
None yet
Development

No branches or pull requests

3 participants