-
-
Notifications
You must be signed in to change notification settings - Fork 162
Add multi-select drag & drop support for objectMultihref condition lists #2960
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
Conversation
Modified objectMultihref.js to iterate through all selected records in data.records instead of only processing the first record. This enables users to select multiple data objects (products, categories, customers, etc.) and drag them all at once into condition lists. Fixes the issue where each data object had to be added individually to condition lists in cart price rules, product price rules, shipping rules, and other rule configurations. Co-authored-by: dpfaffenbauer <5981845+dpfaffenbauer@users.noreply.github.com>
| } else { | ||
| return Ext.dd.DropZone.prototype.dropNotAllowed; | ||
| // Check if any of the records can be dropped | ||
| for (var i = 0; i < data.records.length; i++) { |
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.
@copilot Expected a for-of loop instead of a for loop with this simple iteration.
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.
Updated to use for-of loop in dbfac39.
| type: data.className | ||
| }; | ||
| // Process all records in the drag selection | ||
| for (var i = 0; i < data.records.length; i++) { |
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.
@copilot Expected a for-of loop instead of a for loop with this simple iteration.
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.
Updated to use for-of loop in dbfac39.
Address code review feedback to use for-of loops for simpler iteration over data.records arrays in both onNodeOver and onNodeDrop handlers. Co-authored-by: dpfaffenbauer <5981845+dpfaffenbauer@users.noreply.github.com>
|
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |



src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/object/objectMultihref.jsonNodeDrophandler only processesdata.records[0]instead of all recordsonNodeDropandonNodeOverhandlers to support multiple recordsonNodeOverto check if ANY of the dragged records can be droppedonNodeDropto iterate through all records and add each valid onefor-ofloops per code review feedbackOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.