[MGNLUI-6374] Allow to configure the default value resolution strategy in FieldDefinition Created: 30/Oct/20  Updated: 28/Jun/22  Resolved: 28/Jun/22

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

Type: New Feature Priority: Neutral
Reporter: Aleksandr Pchelintcev Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
is depended upon by MGNLUI-6375 Remove generic type of default value ... Closed
Template:
Acceptance criteria:
Empty
Epic Link: Field default values

 Description   

Current approach to configuring the default value is a bit rigid when it comes to typing and conversion.

  • It is simple when the fields presentation form is the same as the model (stored) form, e.g. in case of a simple text field.
  • still okay when the model type stored in JCR is string or simple type: since we convert the default value to presentation form when populating the form, there're no problems (e.g. option list select, where options are stored by their configured string values)
  • it is less shiny with JCR selects: the stored value is string (but typically UUID, depends on the configuration), whereas the default value is typically a path. It works currently due to fuzzy logic in default node-2-backend converter coming with JCR selects: it supports siliently both paths and UUIDs as model forms.
  • problem 1: what if the user needs to specify default value in presentation form, which is different from the model form? Good if the converter detects that the passed value is already in presentation form and will bail out. But what if not? Seems like it would be nice if we could specify in definition that the default value is actually in presentation form.

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