[MGNLUI-3509] Action availability inconsistent when switching between subapps Created: 29/Jul/15  Updated: 15/Apr/16  Resolved: 18/Nov/15

Status: Closed
Project: Magnolia UI
Component/s: actionbar, content app, user interaction
Affects Version/s: 5.3.10, 5.4
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Richard Gange Assignee: Oanh Thai Hoang
Resolution: Obsolete Votes: 0
Labels: support
Remaining Estimate: 3d 1h
Time Spent: 7h
Original Estimate: 4d

Attachments: PNG File error.png    
Issue Links:
Relates
relates to MGNLUI-3562 After deleting an content app item ta... Closed
causality
duplicate
is duplicated by MGNLUI-3660 Actions disabled after editing a publ... Closed
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: Saigon 19
Story Points: 8

 Description   

When switching between subapps the state of the subapp can be come inconsistent.

To recreate:

  1. Open any content app
  2. Double click on a data item to trigger the opening of the detail subapp
  3. Now click back to the browser subapp
  4. Observe that the node you previously double clicked is selected (shouldn't be) but neither the actionbar or the url actually reflect that state


 Comments   
Comment by Oanh Thai Hoang [ 18/Nov/15 ]

Hi mgeljic,

This bug can be reproduced in version 5.3.10 but can't reproduce for later versions. After investigating, I found out it has been totally fixed in ticket: https://jira.magnolia-cms.com/browse/MGNLUI-3562.

Here is the part has fixed the issue in TreeViewImpl class:

@Override
    public void select(List<Object> itemIds) {
        tree.setValue(null);
        Object firstItemId = itemIds == null || itemIds.isEmpty() ? null : itemIds.get(0);
        if (firstItemId == null) {
            return;
        }
        for (Object id : itemIds) {
            tree.select(id);
        }
        rowScroller.bringRowIntoView(firstItemId);
    }

Before the fix applied, the sentence tree.setValue(null) was put after the if condition. Therefore, there is a case that return sentence will be called and finished without setting null to tree.

For more details, please refer to the PR: https://git.magnolia-cms.com/projects/PLATFORM/repos/ui/commits/f2407432fe7aae54e165edf0ef8364c50a67ef7c

Comment by Mikaël Geljić [ 18/Nov/15 ]

Thanks for the findings! Any chance this can be backported to 5.3.x?
Meanwhile I can confirm, so I'm removing 5.4.4 from fixVersions.

PS: I would argue that item should remain selected when double-clicking/switching back (cc @weder), but we can first fix this inconsistency, then revisit it in followup ticket.

Comment by Oanh Thai Hoang [ 18/Nov/15 ]

Hi mgeljic

Thank you for your information. It already backported to version 5.3.11 at commit c8e61814c9. I did test in version 5.3.12-SNAPSHOT also. It works well

Comment by Mikaël Geljić [ 18/Nov/15 ]

Ah, I misread your comment perfect then, will update ticket accordingly (btw I think you copied wrong commit hash above, but it's ok nvm)

Comment by Jan Haderka [ 19/Nov/15 ]

In summary: This issue have been resolved in Magnolia 5.3.11 while fixing MGNLUI-3562.

Comment by Andreas Weder [ 19/Nov/15 ]

mgeljic I agree: the item you open should still be selected when you return.

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