[MGNLUI-5684] Extend MultiFormView to use LayoutProducer Created: 25/Feb/20  Updated: 11/Mar/21  Resolved: 11/Mar/21

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

Type: Improvement Priority: Neutral
Reporter: Šimon Demočko Assignee: Roman Kovařík
Resolution: Won't Do Votes: 0
Labels: multifield
Remaining Estimate: 0d
Time Spent: 5h 20m
Original Estimate: Not Specified

Attachments: PNG File new Personas app multifield misaligned due to VerticalLayout.png     PNG File new multifield using VerticalLayout to conserve space, no alignment necessary.png     PNG File old Personas app aligned.png    
Issue Links:
Relates
relates to MGNLUI-6399 Multifield control buttons cover the ... Closed
dependency
is depended upon by MGNLUI-5052 Improve vertical display of multivalu... Closed
is depended upon by MGNLUI-6526 Allow extend MultiFormView Closed
relation
is related to MGNLUI-5846 Cannot See Multivalue Field Within Cu... Closed
Template:
Acceptance criteria:
[ ]* Take into consideration the changes stories app
[ ]* Use FormLayoutProducer for detail subapp in new personas app multifield to have vertical alignment
[ ]* Use stackedLayoutProducer in dialogs to have captions on top in narrow layouts (dialogs, e.g. choose audience dialog)
[ ]* provide reasonable defaults - a simple multifield with just one type of field provided should not have captions at the top - those would be redundant.
[ ]* NarrowVerticalLayout will be likely superseded by this solution, consider removal
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)
[ ]* https://jira.magnolia-cms.com/browse/MGNLUI-5684?focusedCommentId=252702&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-252702
Date of First Response:
Epic Link: M6 MultiFormView
Sprint: UI FW 22, UI FW 23
Story Points: 8

 Description   

Currently MultiFormView uses VerticalLayout so as to make it look better in certain contexts

  • e.g. narrow choose audience dialog in pages app to allow trait fields to expand through whole row,

but it makes more sense to have it as FormLayout in other

  • e.g. Persona app traits tab to achieve horizontal alignment of fields.

We can imagine that in certain cases it might be beneficial to be able to layout the entry components as e.g. tiles/columns etc.

All that speaks for adopting the layout producer concept introduced for the general form view. Not to mention that doing so will increase consistency and predictability among different form implementations.

High-level steps to accomplish:

  • consider changes to MultiFormView definition
  • extract layouting logic into a dedicated layout producer.
  • consider potential problems or handling move/delete actions (may require additional API to be added directly to MultiFormView).
  • consider 1-2 alternative layout producer impls


 Comments   
Comment by Roman Kovařík [ 02/Mar/21 ]

For QA:

  • check info.magnolia.personalization.ui.TraitRulesFieldDefinition and make sure that operand selector field doesn't render any un-wanted captions (in the form of non-provided i18n keys).
  • just in case - verify info.magnolia.personalization.ui.TraitValueFieldDefinition

 Fields are wrapped in containers and the wrappers inherit the caption from the fields. When both show the caption, this is the result. The container label is preferred here.

May be related: https://git.magnolia-cms.com/projects/PLATFORM/repos/ui.pub/commits/2ec30fbc56ff68db95d9d55a4be7ea0f9e7a1ec6#magnolia-ui-framework/src/main/java/info/magnolia/ui/framework/layout/field/FieldLayoutComponent.java

Comment by Roman Kovařík [ 03/Mar/21 ]

The indentation problems on the screenshot don't seem to be present anymore (http://nightly.magnolia-cms.com)

check info.magnolia.personalization.ui.TraitRulesFieldDefinition and make sure that operand selector field doesn't render any un-wanted captions (in the form of non-provided i18n keys).

This field is a composite, not multi field. Not related?

check info.magnolia.personalization.ui.TraitRulesFieldDefinition and make sure that operand selector field doesn't render any un-wanted captions

Usage of different layouts doesn't seems to do any difference.
As the problem is not present for simple fields, it rather looks like problem of the inner composite field, not a problem of the multifield layout itself.

but it makes more sense to have it as FormLayout in other

  • e.g. Persona app traits tab to achieve horizontal alignment of fields.

Does this mean field captions at the left side instead of top?
Using FormLayout on it's own doesn't make any difference (probably because it's nested in a parent FormLayout) = captions still on top.
Or do want to force some restyling in alternative layouts?

All that speaks for adopting the layout producer concept introduced for the general form view. Not to mention that doing so will increase consistency and predictability among different form implementations.

This probably still makes sense (if only for MGNLUI-6399), the original purpose of ticket still not 100% clear to me though.
 
For the record the API which should be moved is already used in couple of modules.
https://git.magnolia-cms.com/plugins/servlet/search?q=%22extends%20MultiFormView%22
The part of the effort would be to fix/release all of these at the same time.

Here you can see how would be affected. The changes are quite minimal, at least compared to my expectations. It's because the API requirements for MGNLUI-6526 are not so much about layout, rather about the internal logic of the multiform view itself.

sdemocko As you was involved in the multi form efforts, could you help me to reevaluate the need/expectation from this ticket?

Comment by Šimon Demočko [ 05/Mar/21 ]

Moved responses to #MGNLUI-5684 on slack

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