[MGNLUI-4535] Complex fields - repeatable fields and groups Created: 18/Jul/18  Updated: 29/Aug/18  Resolved: 03/Aug/18

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

Type: Story Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Ngoc Nguyenthanh
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 6d 7h
Original Estimate: 4d

Attachments: PNG File generatedAppDefinition.png     PNG File multiValueFieldData.png     PNG File repeatableCompositeField.png     PNG File repeatableCompositeFieldAppDefinition.png     PNG File repeatableCompositeFieldData.png     PNG File repeatableField.png    
Issue Links:
Cloners
clones MGNLUI-4521 Complex fields - composite groups of ... 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)
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: Content types Developer Preview
Sprint: Saigon 150
Story Points: 8

 Description   

User story:

As a Business Analyst / Developer, I can define a field or group as repeatable.

Acceptance criteria:



 Comments   
Comment by Mikaël Geljić [ 23/Jul/18 ]

to consider as well: defining sub-models at the root of content-type definition, so that a sub-model can be reused on different levels.

Comment by Hieu Nguyen Duc [ 31/Jul/18 ]

As discussed, we've come up with keeping subModels in model and just flat subModel elements into the same level.

model:
   subModels:
      - name: SubModel1
      - name: SubModel2

 because sub-models are not exposed to other CTs. They should be just nested and reusable elements.

Comment by Christopher Zimmermann [ 28/Aug/18 ]

Please describe how to make a field or a group repeatable, and/or provide an example - or link to a document.

Comment by Hieu Nguyen Duc [ 29/Aug/18 ]

This is how the implementation meets the acceptance criteria.

1) Repeatable single field

Given this content type

datasource:
  workspace: tourists
model:
  properties:
    - name: address
      multiple: true

"address" field will be generated as a MultiValueField

Generated app definiton shows

Data are stored as

2) Repeatable group of fields

Given this content type

datasource:
  workspace: tourists
model:
  properties:
    - name: address
      type: address
      multiple: true
  subModels:
    - name: address
      properties:
        - name: street
        - name: district
        - name: city

"address" field will be generated as a MultiValueField that wraps a CompositeField

Generated app definiton shows

Data are stored as

Reference:

Documentation is ongoing: https://documentation.magnolia-cms.com/display/DOCS57/Model+definition

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