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
Combination bulk actions progress modal #28751
Combination bulk actions progress modal #28751
Conversation
zuk3975
commented
Jun 14, 2022
•
edited
edited
Questions | Answers |
---|---|
Branch? | 8.0.x |
Description? | Add progress modal (which was introduced in #26004) to Combination bulk actions in new product page. Also make bulk endpoint accept array of combinationIds and handle form violation errors visualisation. |
Type? | refacto |
Category? | BO |
BC breaks? | no |
Deprecations? | no |
Fixed ticket? | |
Related PRs | If theme, autoupgrade or other module change is needed, provide a link to related PRs here. |
How to test? | Try bulk actions in new product combination page. It should show progress modal same as in product page. |
Possible impacts? |
Hi, thanks for this contribution! I found some issues with the Pull Request description:
Would you mind having a look at it? This will help us understand how interesting your contribution is, thank you very much! About linked issuesPlease consider opening an issue before submitting a Pull Request:
(Note: this is an automated message, but answering it will reach a real human) |
This pull request seems to contain new translation strings. I have summarized them below to ease up review:
(Note: this is an automated message, but answering it will reach a real human) |
d744998
to
e1757f0
Compare
…eds some polishing
7d0f552
to
f08156c
Compare
Some concerns:
|
admin-dev/themes/new-theme/js/pages/product/components/combination-list/bulk-delete-handler.ts
Outdated
Show resolved
Hide resolved
admin-dev/themes/new-theme/js/pages/product/components/combination-list/bulk-delete-handler.ts
Outdated
Show resolved
Hide resolved
admin-dev/themes/new-theme/js/pages/product/components/combination-list/bulk-edition-handler.ts
Outdated
Show resolved
Hide resolved
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.
Some small comments, but overall lgtm
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.
Thanks @zuk3975
great work this one turned out to be more complex than I anticipated. I have a few minor suggestions that are not that important. But the main comment is about how we could handle the form validation a bit more cleanly see the big comment on bulk-edition-handler.ts
in particular
And I also suggested a possible optimization of the bulk controller
admin-dev/themes/new-theme/js/components/modal/progress-modal.ts
Outdated
Show resolved
Hide resolved
admin-dev/themes/new-theme/js/pages/product/components/combination-list/bulk-delete-handler.ts
Outdated
Show resolved
Hide resolved
* This property contains a form content fetched from api when form constraints are violated during form submit. | ||
* This form will already have rendered errors where they belong (depending on violated fields). |
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.
* This property contains a form content fetched from api when form constraints are violated during form submit. | |
* This form will already have rendered errors where they belong (depending on violated fields). | |
* This property contains a form content fetched from api when form constraints are invalid during form submit. | |
* This form will already have rendered errors where they belong (depending on invalid fields). |
admin-dev/themes/new-theme/js/pages/product/components/combination-list/bulk-edition-handler.ts
Outdated
Show resolved
Hide resolved
admin-dev/themes/new-theme/js/pages/product/components/combination-list/bulk-edition-handler.ts
Outdated
Show resolved
Hide resolved
src/Core/Domain/Product/Combination/Exception/BulkCombinationException.php
Show resolved
Hide resolved
$combinationIds = json_decode($combinationIds); | ||
$errors = []; | ||
foreach ($combinationIds as $combinationId) { | ||
try { |
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.
I think this part could be optimized, for now the form is rebuilt for each provided combination but it's always the same data so no need to build the form in the loop it could be built only once outside of the loop
src/PrestaShopBundle/Controller/Admin/Sell/Catalog/Product/CombinationController.php
Show resolved
Hide resolved
src/PrestaShopBundle/Controller/Admin/Sell/Catalog/Product/CombinationController.php
Outdated
Show resolved
Hide resolved
…enable after re-render
…ng to correctly set it in both PRE_SET and SUBMIT phases in case of invalid data in the form
6808c6a
to
bc18317
Compare
…onRepository::bulkDelete method
…avoid a blank state
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.
Thanks @zuk3975