[MGNLUI-8135] Drag and Drop action only moves visible selected items Created: 23/Jun/23  Updated: 12/Sep/23  Resolved: 17/Jul/23

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.36
Fix Version/s: 6.3.0, 6.2.37

Type: Bug Priority: Neutral
Reporter: Jordan Elmore Assignee: Quach Hao Thien
Resolution: Fixed Votes: 0
Labels: VN-Analysis, VN-Maintenance
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 6d 1.5h Time Spent: 6d 1.5h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File image-2023-07-03-13-58-10-358.png    
Issue Links:
Problem/Incident
causality
is causing MGNLUI-8318 Drag and Drop action only moves selec... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLUI-8157 Implementation Sub-task Completed Quach Hao Thien  
MGNLUI-8158 Review Sub-task Completed Adam Siska  
MGNLUI-8159 PreintQA Sub-task Completed Adam Siska  
MGNLUI-8160 QA Sub-task Closed Antonín Juran  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:
Visible to:
Chuck Aksamit
Sprint: Nucleus 40
Story Points: 3
Team: Nucleus
Work Started:
Approved:
Yes

 Description   

Steps to reproduce

  1. Login to demo org
  2. Select a number of assets
  3. Move the screen so you can only see a portion of the selected list
  4. Drag the list to different folder
  5. Notice only the visible portion of the list is moved(screen video attached to make replication easier)

.. Logs, screenshots, gifs...

Expected results

Entire list is moved

Actual results

Only visible portion of list is moved

Workaround

Use the move item button on the action bar to move the assets  

Development notes



 Comments   
Comment by Quach Hao Thien [ 03/Jul/23 ]

Discovery

This is the expected behavior of Vaadin Grid Drag&Drop as explained in this vaadin ticket  

Propose solution:

 

Comment by Roman Kovařík [ 03/Jul/23 ]

Could we just move the dragged items + items in ValueContext?

Comment by Quach Hao Thien [ 03/Jul/23 ]

Discovery Update

This is the expected behavior of Vaadin Grid Drag&Drop as explained in this vaadin ticket  

Propose solution:

@Override
protected List<T> getDraggedItems() {
    return new ArrayList<>(super.getGridDragSource().getGrid().getSelectedItems());
} 

By using this approach, we ignore the data send from client and using the selectedItems in the grid itself as draggedItems

  • Note: The counting badger would need to be justified as well, see
Comment by Quach Hao Thien [ 12/Jul/23 ]

Solution

As the default behavior of Vaadin, not all the selected items are able to be Dragged&Dropped unless they're all visible on the view (the screen). 

The solution to fix this problem is to revise that behavior by using patching on the Vaadin client code, and allowing drag&drop all selected items without any issue.

More detail of the patch: https://git.magnolia-cms.com/projects/PLATFORM/repos/ui/browse/magnolia-ui-vaadin-common-widgets/src/main/patches/griddragsourceconnector.txt#26,36 

Comment by Roman Kovařík [ 14/Jul/23 ]

So I've heard that the reason for this approach was that the quickfix described in the discovery wouldn't fix the "counting badger".

So I guess instead of hiding the badger or other solution, we've patched the client side.

Could this have some performance issues? I see it's iterating whole dataset, is it really the whole dataset (e.g. thousands of items)?

Comment by Quach Hao Thien [ 17/Jul/23 ]

Solution changed:

  • Using the grid's selected items as dragged items instead of dragged items
    send from the payload.
  • Hide the dnd counting badge as it's giving confusing information.
Generated at Mon Feb 12 14:09:23 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.