Bug 1729046 - Dynamic Dropdown dialog values show "Nothing is selected" on service order page
Summary: Dynamic Dropdown dialog values show "Nothing is selected" on service order page
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.10.7
Hardware: Unspecified
OS: Unspecified
Target Milestone: GA
: 5.11.0
Assignee: Tina Fitzgerald
QA Contact: Niyaz Akhtar Ansari
Red Hat CloudForms Documentation
: 1729082 (view as bug list)
Depends On:
Blocks: 1729594
TreeView+ depends on / blocked
Reported: 2019-07-11 09:30 UTC by Niyaz Akhtar Ansari
Modified: 2019-12-13 15:01 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1729594 (view as bug list)
Last Closed: 2019-12-13 15:01:24 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:

Attachments (Terms of Use)
Screenshot showing actual result. (78.83 KB, image/png)
2019-07-11 09:30 UTC, Niyaz Akhtar Ansari
no flags Details
datastore (968.38 KB, application/zip)
2019-07-11 09:31 UTC, Niyaz Akhtar Ansari
no flags Details
dialog (3.68 KB, text/plain)
2019-07-11 09:32 UTC, Niyaz Akhtar Ansari
no flags Details
Datastore_2_issue (955.14 KB, application/zip)
2019-07-11 13:05 UTC, Niyaz Akhtar Ansari
no flags Details
dialog_2_issue (2.49 KB, text/plain)
2019-07-11 13:05 UTC, Niyaz Akhtar Ansari
no flags Details

Description Niyaz Akhtar Ansari 2019-07-11 09:30:43 UTC
Created attachment 1589360 [details]
Screenshot showing actual result.

Description of problem:

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Import service automate domain and service dialog
2. Add dialog in service 
3. Click on service order

Actual results:
Dynamic Dropdown dialog values show "Nothing is selected"

Expected results:

Additional info:

Comment 2 Niyaz Akhtar Ansari 2019-07-11 09:31:51 UTC
Created attachment 1589362 [details]

Comment 3 Niyaz Akhtar Ansari 2019-07-11 09:32:15 UTC
Created attachment 1589363 [details]

Comment 5 Niyaz Akhtar Ansari 2019-07-11 13:05:02 UTC
Created attachment 1589469 [details]

I have found same issue with these dialog and datastore

Comment 6 Niyaz Akhtar Ansari 2019-07-11 13:05:28 UTC
Created attachment 1589470 [details]

Comment 8 Niyaz Akhtar Ansari 2019-07-11 13:46:40 UTC
It was working on 5.10.6 build

Comment 9 Martin Hradil 2019-07-11 13:51:11 UTC
> It was working on 5.10.6 build

That would fit,
integer key support was fixed in https://github.com/ManageIQ/ui-components/pull/394,
that's the most likely cause of the change.

Still, we can only support string keys and integer keys if we make sure to check the data types, which is exactly what exposes this issue.

Comment 10 Martin Hradil 2019-07-11 13:54:02 UTC
(The difference is that that PR focused on multiselects, where the keys types are preserved, as opposed to single value selects, where it's a string).

I think we will have to convert default_value to the type mentioned in data_type,
which will make these valid from the API:

data_type: "integer"
default_value: "2"
values: [[2, "HrPBH"], [3, "Jerry"], [1, "Meeseeks"]]

data_type: "string"
default_value: "2"
values: [["2", "HrPBH"], ["3", "Jerry"], ["1", "Meeseeks"]]

But these would still be invalid:

data_type: "integer"
default_value: "2"
values: [["2", "HrPBH"], ["3", "Jerry"], ["1", "Meeseeks"]]

data_type: "string"
default_value: "2"
values: [[2, "HrPBH"], [3, "Jerry"], [1, "Meeseeks"]]

Comment 12 Martin Hradil 2019-07-11 14:11:12 UTC
(assuming the above turns out to be the right solution:)


Comment 13 Tina Fitzgerald 2019-07-11 15:21:55 UTC
*** Bug 1729082 has been marked as a duplicate of this bug. ***

Comment 14 CFME Bot 2019-07-12 18:32:59 UTC
New commits detected on ManageIQ/ui-components/master:

commit 135048cb8b05d5ab43bfc1ef9f196928beefb8d6
Author:     Martin Hradil <mhradil@redhat.com>
AuthorDate: Thu Jul 11 10:08:16 2019 -0400
Commit:     Martin Hradil <mhradil@redhat.com>
CommitDate: Thu Jul 11 10:08:16 2019 -0400

    DialogUser - convert single-select default_value to the right data_type

    Introduced in https://github.com/ManageIQ/ui-components/pull/394,
    we now require default_value's type to match the types of keys in values.

    But the API never returns a non-string default_value - we have to do the conversion to the right type.
    For multiselects, the value is JSON-encoded and already preserves types,
    but for single select, even integer values get passed as strings.

    => converting in setDefaultValue

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

 src/dialog-user/services/dialogData.ts | 13 +-
 1 file changed, 9 insertions(+), 4 deletions(-)

commit d496c24d0461d2d10034c2b340c09d680fd81427
Author:     Martin Hradil <mhradil@redhat.com>
AuthorDate: Fri Jul 12 11:01:12 2019 -0400
Commit:     Martin Hradil <mhradil@redhat.com>
CommitDate: Fri Jul 12 11:01:12 2019 -0400

    dialogData.convertDropdownValue: converts values in default_value and values to the right data_type

    so that we have just one place to run the type conversions


 src/dialog-user/services/dialogData.ts | 39 +-
 1 file changed, 25 insertions(+), 14 deletions(-)

Comment 18 Ganesh Hubale 2019-07-25 10:56:47 UTC
Hi @Nikhil,

Niyaz is on PTO.

So I checked by importing datastore(datastore_2_issue) and dialog(dialog_2_issue).

I can see that default values are visible instead of "Nothing is selected" while ordering service catalog in general OPS UI. Also values are getting updated dynamically with respect parent value of dropdown and I can able to order catalog item by selecting values from dialog.


Comment 20 Nikhil Dhandre 2019-07-25 12:51:44 UTC
Thanks Ganesh..

I tested this with Version: and working awesome for OPS-UI and SSUI.

with its working fine for OPS-UI but same issue with SSUI (comment 17)

This relates with one of BZ- https://bugzilla.redhat.com/show_bug.cgi?id=1687061

Testing steps:

Comment 21 Martin Hradil 2019-07-25 12:55:47 UTC
Moving back to ON_QA, please retest on a current appliance :).

The change landed in master SUI only 3 days ago, via https://github.com/ManageIQ/manageiq-ui-service/pull/1560

So this would indeed not work in 20190712 which is 2 weeks old.

Comment 22 Nikhil Dhandre 2019-07-25 16:12:53 UTC
Hey Martin,

right, Its working fine with Version:

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