[MGNLUI-4595] Automatically add the `name` field to the detail subapp if missing Created: 26/Jul/18  Updated: 11/Oct/18  Resolved: 23/Aug/18

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

Type: Improvement Priority: Neutral
Reporter: Mikaël Geljić Assignee: Hieu Nguyen Duc
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 2d 2.5h
Original Estimate: 2d

Attachments: PNG File image-2018-10-11-09-36-46-381.png    
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: Content types Developer Preview
Sprint: Saigon 152
Story Points: 3

 Description   

In content-apps, we usually add the name field to the editor/form-definition first.

This way, the JCR node name is automatically deduced from the name property (just sanitized from its white space and other special chars); the SaveFormAction takes care of that by convention.

We should add it by default, in first position, if the CT model doesn't include it, and is a JCR model.



 Comments   
Comment by Christoph Meier [ 26/Jul/18 ]

Generally I think it is a good idea to generate the name field.

I just wonder whether we should allow to disable the autogeneration of the name field (if it's not in the mode). E.g. with the property autogenerateNameField on the info.magnolia.types.model.ModelDefinition with the default value true.

Just an idea ¯_(ツ)_/¯

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

We've decided always generating "name" field if it's missing. Users can disable it via app decoration. This way prevents content type definition from coupling with UI.

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