[MGNLUI-6563] switchableField ignoring required property Created: 15/Feb/21  Updated: 01/Jul/21  Resolved: 08/Apr/21

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

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

Issue Links:
Problem/Incident
duplicate
duplicates MGNLUI-5571 Provide possibility to set field prop... Closed
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: Support for required property
Sprint: UI FW 25
Story Points: 5

 Description   

Steps to reproduce

  1.  Create a switchableField as follows:
    form:
      properties:
        title:
          $type: switchableField
          field:
            $type: radioButtonGroupField
            layout: horizontal
            required: true
            datasource:
              $type: optionListDatasource
              options:
                - name: foo
                  value: foo
                - name: bar
                  value: bar
          itemProvider:
            $type: jcrChildNodeProvider
      layout:
        $type: tabbedLayout
        tabs:
          firstTab:
            label: First
            fields:
              - name: title
    footerLayout:
      $type: defaultEditorActionLayout
      primaryActions:
        commit: commit 
  1. Create the component on a page
  2. Check you can save it without making any selection

Expected results

You must make any selection for saving the component

Actual results

The switchable field can be saved empty 

Workaround

Development notes



 Comments   
Comment by Ioannis Spyronis [ 01/Jul/21 ]

Hi. Is that fixed in 6.2.8 or a later version? I cannot find it in Documentation.

Comment by Roman Kovařík [ 01/Jul/21 ]

Hi spyronis,

 
The property has to be specified at the switcher field level

Hope that helps.
Roman

Comment by Ioannis Spyronis [ 01/Jul/21 ]

When I used that in radioButtonGroupField it was ok

Thanks.

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