[PAGES-143] Single component areas using SKIP_RENDERING allow add more than one components Created: 09/Aug/17  Updated: 21/Aug/17  Resolved: 09/Aug/17

Status: Closed
Project: Magnolia pages module
Component/s: None
Affects Version/s: 5.5.5
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Mercedes Iruela Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File SKIP_RENDERIN-areaTypeListMaxCompReached.png     PNG File SKIP_RENDERING-areaTypeSingle.png    
Issue Links:
relation
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
Date of First Response:

 Description   

Imagine that there is an area with a model class that, under certain conditions hides the area by returning RenderingModel.SKIP_RENDERING on execute().

If area type=list and maxComponents=4, you can add components until reach the maximun number of components:

footer:
    type: list
    maxComponents: 4

Result in pages app:

If area type=single, you can add components even if there is already a component:

footer:
    type: single

Result in pages app: you cannot add component in-area green bars but you can add components using the Add component action in the action bar:

When this happens, the action remains available to add additional components even when the area is configured as type: single and the limit of 1 has been reached.
The in-area edit action however continues to display "New 'area name' component" but the + icon does not appear and clicking the new component placeholder has no effect.
We do not believe this is the correct behaviour. Other single areas disable the Add Component action when their limit is reached and stop displaying the "New 'area name' component" placeholder.



 Comments   
Comment by Mercedes Iruela [ 09/Aug/17 ]

If the area is not going to be rendered, maybe this area green bars shouldn´t be displayed.

Comment by Mercedes Iruela [ 09/Aug/17 ]

After some discussions this ticket was closed:

Basically, type=single means that Magnolia renders single (type in this case is type of rendering loop) not that the area can't have more than one component. For example, imagine a configuration where you have configured list first and create multiple components, then change to single. Magnolia doesn't do retro validation and logic should not be based on such assumption. If you require single component to exist, you should have list with maxC=1.

Comment by OLD Chris Jennings [ 18/Aug/17 ]

I raised the original support ticket that lead to his issue and I disagree with it being closed.
The situation you describe of changing a list to a single is different and does not seem relevant here.

My issue is described in the last line, "Other single areas disable the Add Component action when their limit is reached and stop displaying the "New 'area name' component" placeholder." Will you please reconsider?

Comment by Mercedes Iruela [ 21/Aug/17 ]

We understand your concern and after reconsidering this issue again the conclusion is what this type is being used in a wrong way in this case. As we said previously the type is taken into account when rendering the area to render just a single component or a list of components. If you want to limit the number of components that can be added by an editor to an area you should use maxComponents (this property is only applicable to list areas).

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