[MGNLUI-5625] Harmonize nodeType configuration for definitions Created: 24/Jan/20  Updated: 25/Feb/20  Resolved: 30/Jan/20

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

Type: Task Priority: Neutral
Reporter: Rishab Dhar Assignee: Rishab Dhar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File maps-converted-tostring.png    
Template:
Acceptance criteria:
Empty
Task DoR:
Empty

 Description   

Background: While fixing the issue MGNLUI-5624, it was discovered that publish incl. subpages action was unavailable on dx-core, but available on ce. Upon further investigation it was found, that this behavior was due to incorrect nodeType configuration in pages-app decorator in personalization-pages-app module in dx-core. The nodeType configuration expected by the info.magnolia.ui.availability.rule.JcrHasChildrenRuleDefinition was a list of strings, but the decoration provided a list of NodeType Objects of the form:

nodeTypes:
  - name: mgnl:page
  - name: mgnl:variants

It was further noted that other nodeType configurations in personalization-pages/decorations/pages-app/apps/pages-app.yaml were of the form of List of NodeType objects. As a consequence, there are two things that need to be analyzed and fixed:

  • So, there are In order to avoid confusion, maintain consistency, and avoid a source of potential bugs in configuration of nodeTypes, all nodeTypes should be maintained as a single type
  • Fix the bugs in configurations where nodeTypes property configured is not of the same type as expected by the Definition


 Comments   
Comment by Rishab Dhar [ 29/Jan/20 ]

After further analysis with mgeljic it was found the source of the bug is due to incorrect translation of yaml properties defined using Maps into string values via their toString() methods to populate a collection.

Comment by Rishab Dhar [ 30/Jan/20 ]

Some important points regarding changes made:

  • Only primitives, enums, and Strings can be configured in yaml for Definition properties expecting a Collection of Strings.
  • Configuring complex types such as Maps, Lists, Objects, as property values for Collections of Strings would emit warning messages and not register misconfigured property values into the collection.

Regarding personalization module - all nodeType properties have been updated in pages-app.yaml as a list of Strings to maintain consistency.

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