[PAGES-1494] Area Inheritance: maxComponents and type:single inconsistant Created: 30/Oct/23  Updated: 14/Dec/23  Resolved: 09/Nov/23

Status: Closed
Project: Magnolia pages module
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0, 6.2.33

Type: Bug Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Anh Vu
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: 0d Remaining Estimate: 0d
Σ Time Spent: 5d 5h Time Spent: 5d 5h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
Cloners
clones MAGNOLIA-9139 Area Inheritance: maxComponents and t... Closed
Relates
relates to MAGNOLIA-9156 Area Inheritance - SPA: Users can add... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
PAGES-1495 Implementation Sub-task Completed Anh Vu  
PAGES-1496 Review Sub-task Completed Oanh Thai Hoang  
PAGES-1497 Pre-Integration QA Sub-task Completed Oanh Thai Hoang  
PAGES-1498 QA Sub-task Completed Canh Nguyen  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Release notes required:
Yes
Date of First Response:
Epic Link: SPA Editor Backlog
Sprint: DevX 50
Story Points: 3
Team: DeveloperX
Work Started:
Approved:
Yes

 Description   

The area properties "type:single" and "maxComponents" work inconsistantly when using "Component Inheritance" in Freemarker and in headless mode.

Expectation:

Inherited components are treated just like actual components in an area as regards to those two properties.

  • If "type:single", and an area has an inherited component, then an author cannot add any more components.
  • If "maxComponents:1" and an area has an inherited component, then an author cannot add any more components.
  • if "maxComponents:3" and an area has an inherited component, then an author can only add 2 more components to the area.

Current behaviour:

In all cases, the area already has 1 inherited component.

Freemarker with maxComponents:1 -> Author can add another component. (Unexpected.)

Freemarker with type:single -> Author cannot add another component. (As expected.)

SPA with maxComponents:1 -> Author can add another component. (Unexpected.)

SPA with type:single -> Author can add another component.  (Unexpected.)

Notes:

This demo project may be useful for this bug: https://git.magnolia-cms.com/projects/DOCUMENTATION/repos/component-inheritance-examples/browse



 Comments   
Comment by Anh Vu [ 01/Nov/23 ]

Discovery output:
The ticket is to handle the area Inheritance SPA issue where users can add another component when a single type area which has inherited components.

The problem is that the getComponents() function of CmsNode class is used to check if the Add component button is enabled and the component place holder area is shown but the inherited components from parents are not cms node, hence they are not counted.

Solution: We can use "showAddButton" and "showNewComponentArea" properties to check instead.

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