Bug 1757888 - Service catalog default set to "none" if set to non required with a default value
Summary: Service catalog default set to "none" if set to non required with a default v...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Provisioning
Version: 5.10.8
Hardware: All
OS: All
medium
high
Target Milestone: GA
: 5.12.0
Assignee: Martin Hradil
QA Contact: Niyaz Akhtar Ansari
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks: 1783375 1783377
TreeView+ depends on / blocked
 
Reported: 2019-10-02 16:08 UTC by Tuan
Modified: 2023-03-24 15:34 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1783375 1783377 (view as bug list)
Environment:
Last Closed: 2020-06-10 12:48:59 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Comment 5 William Fitzgerald 2019-10-03 13:33:10 UTC
Tuan,

Can I get a copy of the dialog?

Thanks

Billy

Comment 21 CFME Bot 2019-12-02 15:20:33 UTC
New commit detected on ManageIQ/ui-components/master:

https://github.com/ManageIQ/ui-components/commit/5c16e8081dc13c4191d4a02d0705e821f12dc460
commit 5c16e8081dc13c4191d4a02d0705e821f12dc460
Author:     Martin Hradil <mhradil>
AuthorDate: Mon Nov 25 20:19:19 2019 -0500
Commit:     Martin Hradil <mhradil>
CommitDate: Mon Nov 25 20:19:19 2019 -0500

    dialog-user: fix integer dropdown 0 default_value handling

    Have a dropdown with integer data_type,
    have the values set so that one value is 0,
    select that value as default value.

    Loading the dialog, default_value: '0' comes from the server,
    DialogData#setDefaultValue converts it to numeric 0, based on the data type,
    but when it gets called again, the numeric 0 fails a falsy check, and the first option in the list gets used instead.

    Adding a data_type === 'integer', default_value === 0 exception to the falsy check.

    (A better but also much larger fix would be to refactor dialog user so that setDefaultValue never gets called twice on the same data.)

    Before:

    numReq old 0 string
           new 0 number
    numOpt old 0 string
           new 0 number
    strReq old 0 string
           new 0 string
    strOpt old 0 string
           new 0 string
    numReq old 0 number
           new 1 number
    numOpt old 0 number
           new null object
    strReq old 0 string
           new 0 string
    strOpt old 0 string
           new 0 string

    Now:

    numReq old 0 string
           new 0 number
    numOpt old 0 string
           new 0 number
    strReq old 0 string
           new 0 string
    strOpt old 0 string
           new 0 string
    numReq old 0 number
           new 0 number
    numOpt old 0 number
           new 0 number
    strReq old 0 string
           new 0 string
    strOpt old 0 string
           new 0 string

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1757888

 src/dialog-user/services/dialogData.ts | 5 +-
 1 file changed, 4 insertions(+), 1 deletion(-)


Note You need to log in before you can comment on or make changes to this bug.