[MGNLUI-4194] Generalize code for move-availability (dialog, dnd) Created: 19/Apr/17  Updated: 30/Jun/17  Resolved: 10/May/17

Status: Closed
Project: Magnolia UI
Component/s: content app, workbench
Affects Version/s: None
Fix Version/s: 5.5.4

Type: Improvement Priority: Neutral
Reporter: Mikaël Geljić Assignee: Sang Ngo Huu
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 3d 7h
Original Estimate: 3d

Issue Links:
Cloners
Relates
relates to MGNLUI-4097 Selection should remain on the source... Closed
causality
caused by MGNLUI-4170 Move Before and Move After buttons ar... Closed
is causing CNTCTSAPP-102 Update the ContactDropConstraint to m... Closed
is causing MGNLCAMPU-60 Update the CampaignDropConstraint to ... Closed
is causing MGNLCAT-173 Update the CategorizationDropConstrai... Closed
is causing MGNLDAM-714 Update the AssetsDropConstraint to ma... Closed
is causing MGNLGROOVY-162 Update the GroovyDropConstraint to ma... Closed
is causing MGNLGS-133 Update the GoogleSiteMapDropConstrain... Closed
is causing MGNLINTEMPL-86 Update the InplaceTemplatingDropConst... Closed
is causing MGNLPN-385 Update the SegmentDropConstraint to m... Closed
is causing MGNLRSSAGG-212 Update the RSSAggregatorDropConstrain... Closed
is causing PAGES-133 Update the TemplateTypeRestrictionDro... Closed
relation
is related to MGNLSITE-79 "Move Before" and "Move After" button... Closed
supersession
is superseded by MGNLUI-4207 Replace move-predicates back with dro... 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)
Sprint: Saigon 92, Saigon 93, Saigon 94, Saigon 95
Story Points: 5

 Description   

As DEV-477 confirmed: there is redundancy between `DropConstraints` (dnd) and `MovePredicates` (move-dialogs), especially for their JCR implementations.

In a first step, we're able to delegate from MovePossibilityPredicates to a new default JCR DropConstraint;
then we try replacing move-predicates altogether with direct usage of the configured drop-constraint.
Lastly, old drop-constraint JCR impls may now extend the new one.



 Comments   
Comment by Mikaël Geljić [ 09/May/17 ]

Until PAGES-133, this currently logs an exception when unselecting a page in the move-dialog (trying to get root's parent).

2017-05-09 17:19:48,664 WARN  ages.app.dnd.TemplateTypeRestrictionDropConstraint: Failed to resolve target item [] parent
javax.jcr.ItemNotFoundException: Root node doesn't have a parent
        ...
        at info.magnolia.jcr.decoration.ContentDecoratorNodeWrapper.getParent(ContentDecoratorNodeWrapper.java:121)
        at info.magnolia.pages.app.dnd.TemplateTypeRestrictionDropConstraint.checkIfAllowedAsChildOfTargetItemParent(TemplateTypeRestrictionDropConstraint.java:128)
        at info.magnolia.pages.app.dnd.TemplateTypeRestrictionDropConstraint.allowedAfter(TemplateTypeRestrictionDropConstraint.java:115)
        at info.magnolia.ui.contentapp.movedialog.MoveDialogPresenterImpl.isMovePossible(MoveDialogPresenterImpl.java:257)
        at info.magnolia.ui.contentapp.movedialog.MoveDialogPresenterImpl.updatePossibleMoveLocations(MoveDialogPresenterImpl.java:236)
        at info.magnolia.ui.contentapp.movedialog.MoveDialogPresenterImpl.lambda$start$f3276528$1(MoveDialogPresenterImpl.java:174)

This may not be a blocker, as it's only a log entry and doesn't happen for regular page selection.
I could not produce anything close to it on 5.5.3—but then pages app didn't even seem to have custom move predicates.

Comment by Mikaël Geljić [ 10/May/17 ]

Was integrated and partially reverted because of regressions with root-node availability (MGNLUI-4207) and the exception log statement above, due along with PAGES-133.

The new JcrDropConstraint was kept, along with rebase of other implementations on it.
In effect, move-predicates are enabled again until these two issues are fixed.

We expect move-predicates to be completely ignored again with MGNLUI-4207 (5.5.5).

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