[MGNLUI-5212] Refactor field creation and binding logic Created: 29/May/19  Updated: 19/Jun/19  Resolved: 19/Jun/19

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

Type: Improvement Priority: Neutral
Reporter: Aleksandr Pchelintcev Assignee: Aleksandr Pchelintcev
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 1h 31m
Original Estimate: Not Specified

Issue Links:
supersession
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)
Epic Link: UI framework: forms, dialogs, content editing
Sprint: 6.1 Release Sprint
Story Points: 8

 Description   

Field production

  • Amend FieldDefinition interface - untie the eventual field value type from the generic parameter of the definition (the generic parameter communicates the presentation value - the value of the Vaadin component, the configured type communicates the type of the value written into the backend, it is achieved from presentation value via converters.
  • Remove generic DS parameter from FieldDefinition.
  • Simplify FieldFactory interfaces and implementation - reduce amount of generics and generic boundaries required to declare a field factory type.
  • remove dependency on the I18NAuthoringSupport and Locale in the factory - let them be set by the user of the factory (like FormView}}.
  • let the factories create fields in their own dependency injection context - that way we can e.g. simplify the select field factory implementation greatly - they can inject their own datasource components according to the DS definition associated with the field (vs the DSSupport utility that forces us to look up the correct DS bundle directly in the factory).
  • Tentatively introduce the SelectFieldSupport interface and implementation to simplify the production logic of selects: it is an abstraction with API that can ship all the configurable parts of Vaadin selects (Data Provider, icon/caption generators etc).

Field bindings

  • Introduce the FieldBinder interface which can be used to intercept/transform the binding builder produced by Vaadin Binder. Currently this is the responsibility of ConfiguredBinder class, which now can be dismantled and corner cases it handles now can be handled separately in the FieldBinders related to certain field types (e.g. TextFields need some special binding handling, select fields as well). Field binders can be configured in FieldDefinition.

Choosers

Remove DS defintion generics from the chooser definitions and implementations simplifying them singnificantly.


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