[MGNLUI-5402] Re-implement the basic horizontal/vertical layout options for v8 composite field items Created: 01/Oct/19  Updated: 22/Feb/21  Resolved: 22/Feb/21

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

Type: Improvement Priority: Neutral
Reporter: Martin Drápela Assignee: Unassigned
Resolution: Obsolete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2019-10-01-10-16-05-353.png     PNG File image-2019-10-15-10-43-20-228.png    
Issue Links:
Problem/Incident
is caused by MGNLUI-5386 DOC: Composite field - 6 UI 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)
Date of First Response:
Epic Link: UI framework: depending issues

 Description   

In V8, the layout property is there for the composite field, but associates with PlainFormLayoutDefinition, which unfortunately gives no layout config option.

If users migrate and leave there their original layout setting (e.g. layout: vertical (horizontal was default)), the instance won't like it due to the fact that info.magnolia.ui.framework.layout.LayoutDefinition seems to be called, but is used for different purposes:

2019-10-01 09:34:17,185 WARN agnolia.config.source.yaml.YamlConfigurationSource: 
Severity type: MAJOR 
Title: contacts-v8/subApps/detail/form/properties/address/layout: [Definition resolution] - Source data processing problem 
Problem details: Failed to instantiate an object of type [interface info.magnolia.ui.framework.layout.LayoutDefinition] due to [Failed to create instance of [interface info.magnolia.ui.framework.layout.LayoutDefinition]], null is returned

https://git.magnolia-cms.com/projects/PLATFORM/repos/ui.pub/browse/magnolia-ui-framework/src/main/java/info/magnolia/ui/field/CompositeFieldDefinition.java:

 

@Data
@FieldType("compositeField")
public class CompositeFieldDefinition<T> extends ConfiguredComplexPropertyDefinition<T> implements FormDefinition<T> {
private Class<EditorView<T>> implementationClass = (Class) FormView.class;
private List<EditorPropertyDefinition> properties = new ArrayList<>();
private LayoutDefinition layout = new PlainFormLayoutDefinition();
}

 

 

Before V8, users could easily configure the layout of field in a composition

            fields:
              compo-vertical:
                fieldType: composite
                label: compo-vertical
                layout: vertical
                fields:
                  compoV-1:
                    fieldType: text
                    label: compoV-1 
                    placeholder: compoV-1
                  compoV-2:
                    fieldType: text
                    label: compoV-2
                    placeholder: compoV-2
              compo-horizontal:
                fieldType: composite
                label: compo-horizontal-default
                fields:
                  compoH-1:
                    fieldType: text
                    label: compoH-1 
                    placeholder: compoH-1 
                  compoH-2:
                    fieldType: text
                    label: compoH-2
                    placeholder: compoH-2 

to get:



 Comments   
Comment by Šimon Demočko [ 22/Feb/21 ]

Tested, works.

 

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