Inplace editing consolidation A: Bug-fixing (MGNLUI-259)

[MGNLUI-272] Properties set on tree root are not aligned properly Created: 29/Nov/12  Updated: 11/Feb/13  Resolved: 21/Dec/12

Status: Closed
Project: Magnolia UI
Component/s: design, tree/list
Affects Version/s: 5.0
Fix Version/s: 5.0

Type: Sub-task Priority: Major
Reporter: Mikaël Geljić Assignee: Mikaël Geljić
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File root-level-properties-misalignment.png    
Template:
Date of First Response:
Sprint: Iteration 2013-17, Beta 2

 Description   

Properties at root level have an offset that makes them look as if they were from the next level (cf. last three properties in attached screenshot)

Sidenote to check: does it actually make sense to have properties on root node

  • there might be some if tree root is not JCR root
  • properties displayed without their belonging node do certainly not make sense.


 Comments   
Comment by Andreas Weder [ 03/Dec/12 ]

Added component(s) to make it easier to filter issues.

Comment by Mikaël Geljić [ 17/Dec/12 ]

low-level cause: depth being incorrectly calculated to 1 for root properties.

Comment by Mikaël Geljić [ 17/Dec/12 ]

root cause being server sending incorrect depth as 0 for non-property items under root node.

JCR spec states that root node is 0 (which we never display in vaadin), first level is 1 for both subnodes and properties of the root node, and so on.

HierarchicalJcrContainer#isRoot(Item item) is obviously wrong, despite I understand that the level should ultimately be lowered by 1 to set correct padding for 1st level nodes. At least the code of this method looks hardly understandable and introduces a difference between property level and node level. Such difference should not exist.

public boolean isRoot(Item item) throws RepositoryException {
    if (!item.isNode()) {
        return false;
    }
    int depthOfRootNodesInTree = getRootNode().getDepth() + 1;
    return item.getDepth() <= depthOfRootNodesInTree;
}
Comment by Federico Grilli [ 21/Dec/12 ]

Reopened after review.
Please use camel case for test methods names.

Comment by Mikaël Geljić [ 21/Dec/12 ]

Fixed test methods case in MGNLUI-457

Generated at Mon Feb 12 08:35:16 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.