[MGNLUI-6691] DefaultValue on comboBoxField switcher in switchable field not working for boolean values Created: 07/May/21  Updated: 21/May/21  Resolved: 18/May/21

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

Type: Bug Priority: Neutral
Reporter: Christopher Chard Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: VN-Testing
Remaining Estimate: Not Specified
Time Spent: 16m
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:
Epic Link: Field default values
Sprint: UI FW 28
Story Points: 3

 Description   

Minimum sample:

        showImage:
          $type: switchableField
          field:
            $type: comboBoxField
            defaultValue: false
            datasource:
              $type: optionListDatasource
              options:
                - name: false
                  value: false
                - name: true
                  value: true

Expected: Default value is shown on initial dialog opening
Reality: Default value not working. It must be alphanumeric, as the documentation states here: https://documentation.magnolia-cms.com/display/DOCS62/Field+definition.

However, this is a pity, as often times switchable fields and select fields in our code base have true/false values.

Developer notes
A] explicitly mention in DOCu that boolean/number values has to be closed in apostrophes.
B] Fix in the code
C] Use checkbox in such case (might be not possible)?


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