[MGNLUI-3537] Extending SwitchableField Created: 27/Aug/15  Updated: 09/Feb/17  Resolved: 19/Aug/16

Status: Closed
Project: Magnolia UI
Component/s: dialogs
Affects Version/s: 5.3.10, 5.4.1
Fix Version/s: 5.5

Type: Improvement Priority: Neutral
Reporter: Vincent Gombert Assignee: Ngoc Nguyenthanh
Resolution: Fixed Votes: 0
Labels: support
Remaining Estimate: 0.5h
Time Spent: 1d 3.5h
Original Estimate: 1.5d

Issue Links:
Relates
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: AX: better form fields
Sprint: Saigon 57
Story Points: 3

 Description   

While creating an extension of SwitchableField, i needed to override 2 classes that might be improved:

  1. SwitchableFieldFactory might use the D class parameter to extend AbstractFieldFactory and D might extend SwitchableFieldDefinition (which leads to SwitchableFieldFactory<D extends SwitchableFieldDefinition> extends AbstractFieldFactory<D, PropertysetItem>)
  2. SwitchableField might declare its member fieldMap as protected or provide a getFieldByName() method


 Comments   
Comment by Mikaël Geljić [ 26/Oct/15 ]

I happened to fix bullet #1 locally about a week ago; MultiValueFieldFactory was also similarly affected.
https://git.magnolia-cms.com/users/mgeljic/repos/ui/commits?until=refs%2Fheads%2Fbugfix%2FMGNLUI-3537-extending-switchablefield

This change *is* binary-compatible, but not compile-time compatible.
Extending factories may be affected (either at construct level, or if #getFieldDefinition() is overridden). And we cannot provide deprecation here, as the fixed generic typing would conflict with the old constructor.

Comment by Ngoc Nguyenthanh [ 16/Aug/16 ]

Re #1, those factories need to be aligned also

LinkFieldFactory
MultiValueFieldFactory
OptionGroupFieldFactory
TwinColSelectFieldFactory
Generated at Mon Feb 12 09:07:36 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.