[MGNLUI-6802] Move dialog: cannot move item to root Created: 28/Jul/21  Updated: 19/Mar/23  Resolved: 09/Mar/23

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.28
Fix Version/s: 6.3.0, 6.2.30

Type: Bug Priority: Neutral
Reporter: Sang Ngo Huu Assignee: Adam Siska
Resolution: Fixed Votes: 0
Labels: VN-Testing
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 4.5h Time Spent: 4.5h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
relation
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLUI-7885 Implementation Sub-task Completed Adam Siska  
MGNLUI-7886 Review Sub-task Completed Quach Hao Thien  
MGNLUI-7887 Pre-int QA Sub-task Completed Quach Hao Thien  
MGNLUI-7888 QA Sub-task Closed Antonín Juran  
MGNLUI-7906 Fix Norsu Assets Move test Sub-task Completed Adam Siska  
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
Release notes required:
Yes
Date of First Response:
Epic Link: Issues with moving content item
Sprint: Nucleus 31
Story Points: 2
Team: Nucleus
Work Started:

 Description   

Should be possible to move (sub)item into root folder.

Steps to reproduce

  1. Select /travel-demo/video folder (2nd level folder/asset)
  2. hit Move action
  3. (only in old assets app) unselect folder
  4. hit Inside button (note that Before and After buttons should be disabled here, see MGNLUI-6809)

Expected results

video folder is moved to the assets root
.. Justify non-trivial expectations with a link to a doc or a relevant discussion.

Actual results

nothing happens

Workaround

Drag&drop or we have possibility to move an item to root with selecting item on the top level on Move dialog chooser and use Before or After action there.
 

Development notes



 Comments   
Comment by Antonín Juran [ 27/Jan/23 ]

Discovery

Moving item(s) is implemented in MoveAction#execute(). Datasource API doesn't provide method for getting root item which could be used there in case if no item selected. We could disable Choose/Inside action if no item selected on the Move dialog chooser as suggested on MGNLUI-6809 ticket.

We have possibility to move an item to root with selecting item on the top level on Move dialog chooser and use Before or After action there.

We could introduce getRoot method in info.magnolia.ui.contentapp.Datasource interface and implement the method in its implementing classes (in JcrDatasource class it's already implemented).
Then we could assign as the target item a value from Datasource#getRoot if no item has been selected by chooser. (final T target = chooseResult.getChoice().orElse(datasource.getRoot());). In this case also DropLocation there should be set with DropLocation.ON_TOP value.

Comment by Roman Kovařík [ 30/Jan/23 ]

Added ajuran's suggestion to the workaround section.

This won't be possible in Norsu unfortunately as there isn't/won't be any before/after action (there is no natural ordering).

Comment by Roman Kovařík [ 31/Jan/23 ]

The original discovery was valid for the JCR case, unfortunately not usable for Norsu. Therefore this ticket is still valid.

Comment by Adam Siska [ 23/Feb/23 ]

Discovery

(note: for norsu case, implementing same thing in NorsuDatasource#moveItems is mentioned here https://jira.magnolia-cms.com/browse/NORSU-1091)

Generated at Mon Feb 12 09:40:09 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.