[MGNLUI-2018] TreeTable should not expand the node that is selected. Created: 03/Sep/13  Updated: 15/Sep/13  Resolved: 12/Sep/13

Status: Closed
Project: Magnolia UI
Component/s: tree/list
Affects Version/s: 5.0.3
Fix Version/s: 5.1

Type: Bug Priority: Critical
Reporter: Christopher Zimmermann Assignee: Christopher Zimmermann
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLUI-1805 Leaving the focus on a cell being edi... 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
Sprint: 5.1 Beta1- Frontend

 Description   

Currently whenever something is selected with the WorkbenchPresenter.select() method, it causes the tree to expand to those items - which is good.
The problem is that it ALSO causes those nodes themselves to expand.

However, in solving this issue we must take care that a content node IS expanded when a property is added to it. For example with the addPropertyAction. See related ticket.

Also see:
http://wiki.magnolia-cms.com/display/DEV/Handling+completion+of+an+Action



 Comments   
Comment by Christopher Zimmermann [ 12/Sep/13 ]
  • ContentChangedEvent now has isProperty parameter, so that listeners can respond appropriately to the event.
  • When event indicates a property, BrowserPresenter passes workbenchPresenter.select() the id of the changed property, instead of the previously selected items, which is appropriate.
  • TreeViewImpl.expandTreeToNode no longer expands the node that is passed, as it should do based on its name.

Notes: I decided to implement it this way instead of passing a presenter as a parameter to the event in BrowserPresenter because overall it seemed more consistant with how all actions notify the browser/workbench of content changes. It seemed strange to pass in a presenter that would only be used in the case of an addPropertyAction or an 'addWorkbenchPropertyAction'.

Also I realized that expandTreeToNode actually was basically working OK (just expanding too far) and the real culprit was that the event handler in BrowserPresenter was no longer passing the id of the ACTUAL thing that got changed - the property.

Comment by Christopher Zimmermann [ 12/Sep/13 ]

Mikael review:

  • in ContentChangeEvent: use primitive booleans (not Booleans)
  • rename ContentChangeEvent#isProperty to propertyChange, then the getter becomes isPropertyChange()
  • remove setChangedItemIsProperty(boolean) in AbstractRepositoryAction, use JcrItemUtil#isPropertyItemId instead
Comment by Christopher Zimmermann [ 15/Sep/13 ]

There was a problem with the original fix, when properties or content nodes were added to existing nodes - the exisisting node did not get automatically expanded as it should have. now it does.

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