[MGNLUI-5623] CanMove rule allows an item to move onto itself Created: 22/Jan/20  Updated: 19/Feb/20  Resolved: 10/Feb/20

Status: Closed
Project: Magnolia UI
Component/s: framework
Affects Version/s: 6.2
Fix Version/s: 6.2

Type: Bug Priority: Neutral
Reporter: Michael Duerig Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 5.15h
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Sprint: Declarative REST 15, 6.2 Ramp-up 16
Story Points: 3

 Description   

The CanMoveRule under some circumstances allows moving an item onto itself. Also it might not allow a move operation that should be allowed.

Steps to reproduce

  • Open Personas NEW app
  • Click on Sara Byrne
  • Click Move persona
  • Observe how in the chooser Sara Byrne is available, while she should not be. I.e. the buttons at the bottom of the dialog should be grayed.
  • Cancel the chooser dialog
  • Reload the page (or directly point the browser to http://localhost:8080/magnolia_dx_core_demo_webapp_war_exploded/.magnolia/admincentral#app:personas-app:browser;/Sara-Byrne: )
  • Click on Jayden Harris
  • Observe how in the chooser Sara Byrne is not available, while all other personas are available. Expected behaviour is all but Jayden Harris available. (Note: the fact that personas can be moved into personas is a different issue. See MGNLPN-173)

Additional observation

After opening any persona for editing and switching back to the browser tab the CanMove rule behaves correctly.

Analysis so far

The LocationController injected into the CanMove rule initially tracks a DefaultLocation instance. This instance does not reflect the selected item in the browser. Switching to a different tab injects the ContentBrowserSubApp.BrowserLocation from the SubAppContext, which from there on correctly reflects the selected item.

Things tried

I tried using LocationContext to track the current location including the selected item in the CanMove rule, however the injected instance differs from that in Browser. At this point I'm not sure whether this is the intended behaviour.

Workaround

Open a detail tab for any item and switch back to the browser tab. At this point the CanMove rule behaves correctly.

 



 Comments   
Comment by Dai Ha [ 11/Feb/20 ]

Issue:

  • Could not retrieve selected item on browsers app via LocationController.where() due to there was not actual goTo triggered.

Fix:

  • Instead of LocationController, use BrowserSubappContext to get current selected item in subapp location.

Verified with latest 6.2 dx-core build.

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