Bug 1531316
| Summary: | Default Value on Dropdown inside Dialog does not store value | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | Satoe Imaishi <simaishi> | ||||||
| Component: | UI - OPS | Assignee: | eclarizi | ||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Antonin Pagac <apagac> | ||||||
| Severity: | high | Docs Contact: | |||||||
| Priority: | high | ||||||||
| Version: | 5.9.0 | CC: | apagac, brant.evans, cpelland, dclarizi, hkataria, jhardy, jtullo, jwarnica, lavenel, mpovolny, obarenbo, oscardalmauroig | ||||||
| Target Milestone: | GA | ||||||||
| Target Release: | 5.9.0 | ||||||||
| Hardware: | x86_64 | ||||||||
| OS: | Mac OS | ||||||||
| Whiteboard: | testathon | ||||||||
| Fixed In Version: | 5.9.0.22 | Doc Type: | If docs needed, set a value | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | 1516721 | Environment: | |||||||
| Last Closed: | 2018-03-06 15:31:05 UTC | Type: | --- | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | CFME Core | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Bug Depends On: | 1516721 | ||||||||
| Bug Blocks: | |||||||||
| Attachments: |
|
||||||||
|
Comment 2
Satoe Imaishi
2018-01-08 16:22:27 UTC
I'm still not seeing the default value appear on the dropdown element. Although I have set the default value in the options tab to be the key and value that I created, my dropdown still shows "<None>" as a default value. Version-Release number of selected component (if applicable): 5.9.0.17 New commit detected on ManageIQ/ui-components/master: https://github.com/ManageIQ/ui-components/commit/592de0a50ddcdc61a9ccdce598b76d13be64ebf5 commit 592de0a50ddcdc61a9ccdce598b76d13be64ebf5 Author: Roman Blanco <rblanco> AuthorDate: Fri Jan 19 17:23:02 2018 +0100 Commit: Roman Blanco <rblanco> CommitDate: Fri Jan 19 20:10:27 2018 +0100 Corrected displaying of default value in Dialog Editor preview Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1531316 issue was introduced in commit 9245795638b338b7fb5898a9ee9d407543b0bda4 src/dialog-editor/components/field/field.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) Appliance version 5.9.0.18 The default values are now displayed when adding or editing dialog: Automation -> Automate -> Customization; Service Dialogs; Configuration -> Add a new Dialog / Edit this Dialog The bug still remains when using the provisioning dialog to order a service (Services -> Catalogs; Service Catalogs; <new catalog>; Order), looks like the dialog doesn't work with default values. This can be seen also via SUI. The current problem probably is, the Dialog User does not work correctly with the update I've done regarding storing `default_value`. I'm working on it. Roman So far what I know, is that while loading the data in the Dialog User, the `default_value` for the dropdown field is not loaded correctly, and is always `null`. The problem is already in the `setupField` method: https://github.com/ManageIQ/ui-components/blob/6286f9e8751b362bb2e97aec4bbde91958e75c95/src/dialog-user/services/dialogData.ts#L14 The same is for: https://github.com/ManageIQ/ui-components/blob/6286f9e8751b362bb2e97aec4bbde91958e75c95/src/dialog-user/components/dialog-user/dialogUser.ts#L48 - `this.dialog` already has `null` instead of the correct value. Created attachment 1392115 [details]
missing default_value in request
This looks to be an API issue (service dialog serializer).
The dropdown has the `default_value` set correctly (`"Three"`), as can be seen on the top part of the attached screenshot.
After sending a GET request, the `default_value` of the dropdown dialog field has a value `null`.
I've asked Jillian Tullo for a help with the issue.
I was able to look into the issue with Roman, and from what I can tell it is not an API issue, but an issue in the serializer. I have reached out to Erik Clarizio as well for some guidance, who believes it is also a serializer issue. New commit detected on ManageIQ/ui-components/master: https://github.com/ManageIQ/ui-components/commit/e9b6f5ffa88b311c44c316f43bcf79c07562c178 commit e9b6f5ffa88b311c44c316f43bcf79c07562c178 Author: Erik Clarizio <eclarizio> AuthorDate: Thu Feb 8 13:30:12 2018 -0800 Commit: Erik Clarizio <eclarizio> CommitDate: Thu Feb 8 14:16:21 2018 -0800 Ensure value and description values for drop down fields are correct https://bugzilla.redhat.com/show_bug.cgi?id=1531316 In a sample value list: ["1", "one"], ["2", "two"], "one" and "two" should be the values shown on the drop-down, but "1" and "2" should be what is sent as the actual value. Before this commit, it was the other way around which is incorrect. src/dialog-editor/components/field/field.html | 4 ++-- .../components/modal-field-template/drop-down-list.html | 4 ++-- src/dialog-user/components/dialog-user/dialogField.html | 11 +++++++---- 3 files changed, 11 insertions(+), 8 deletions(-) New commit detected on ManageIQ/ui-components/master: https://github.com/ManageIQ/ui-components/commit/cebfbc5d1a5475ca959d13a9019aaaa3ff5188ea commit cebfbc5d1a5475ca959d13a9019aaaa3ff5188ea Author: Erik Clarizio <eclarizio> AuthorDate: Thu Feb 8 13:31:56 2018 -0800 Commit: Erik Clarizio <eclarizio> CommitDate: Thu Feb 8 14:18:09 2018 -0800 Ensure multivalue drop-downs show their default values properly https://bugzilla.redhat.com/show_bug.cgi?id=1531316 default_value initially gets set as a string, but for multivalue dropdowns it needs to be an array src/dialog-editor/components/field/field.html | 1 + .../components/field/fieldComponent.spec.ts | 24 ++++++++++++++++++++++ .../components/field/fieldComponent.ts | 10 +++++++++ .../components/dialog-user/dialogField.html | 6 ++++-- .../components/dialog-user/dialogField.spec.ts | 8 ++++++++ .../components/dialog-user/dialogField.ts | 10 +++++++++ 6 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 src/dialog-editor/components/field/fieldComponent.spec.ts New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/d51217471073936f8337620cb959982aecf9b3b5 commit d51217471073936f8337620cb959982aecf9b3b5 Author: Erik Clarizio <eclarizi> AuthorDate: Thu Feb 8 14:11:33 2018 -0800 Commit: Erik Clarizio <eclarizi> CommitDate: Fri Feb 9 07:28:57 2018 -0800 Use correct comparison for multi-value default value inclusion rules https://bugzilla.redhat.com/show_bug.cgi?id=1531316 Since the default value for a multi-value drop-down is a string, comparing directly to the list of values in a drop-down did not work. It needs to be converted to an array and then compare the overlap to see if the default value is appropriate. app/models/dialog_field_drop_down_list.rb | 14 +++++ .../orchestration_template_service_dialog_spec.rb | 4 +- spec/models/dialog_field_drop_down_list_spec.rb | 64 ++++++++++++++++------ 3 files changed, 64 insertions(+), 18 deletions(-) ui-components change is included in 1.0.11 https://github.com/ManageIQ/manageiq-ui-classic/pull/3387 New commit detected on ManageIQ/manageiq/gaprindashvili: https://github.com/ManageIQ/manageiq/commit/35c564c61ea4844c04476ed694b07176e5d3e4ca commit 35c564c61ea4844c04476ed694b07176e5d3e4ca Author: Greg McCullough <gmccullo> AuthorDate: Fri Feb 9 16:17:58 2018 -0500 Commit: Satoe Imaishi <simaishi> CommitDate: Fri Feb 9 18:32:56 2018 -0500 Merge pull request #16978 from eclarizio/BZ1531316 Use correct comparison for multi-value default value inclusion rules (cherry picked from commit 6056dc85b025d7fa6b1a533fd5c6bd9ec03e7652) https://bugzilla.redhat.com/show_bug.cgi?id=1531316 app/models/dialog_field_drop_down_list.rb | 14 +++++ .../orchestration_template_service_dialog_spec.rb | 4 +- spec/models/dialog_field_drop_down_list_spec.rb | 64 ++++++++++++++++------ 3 files changed, 64 insertions(+), 18 deletions(-) Verified with 5.9.0.21. Default value for dropdown now works in all screens correctly. No it doesn't! I'm now looking at ordering screen in SUI and the Dropdown element seems to be broken. It contains numbers instead of strings and it does NOT show default value (see screenshot). So it works everywhere except the SUI. Created attachment 1396358 [details]
Dropdown element in SUI
This is fixed in https://github.com/ManageIQ/manageiq-ui-service/pull/1383. New commit detected on ManageIQ/manageiq-ui-service/gaprindashvili: https://github.com/ManageIQ/manageiq-ui-service/commit/53e1d03bbbd3fd443988a4387ad52044e18df5d9 commit 53e1d03bbbd3fd443988a4387ad52044e18df5d9 Author: Allen Wight <allen.b.wight> AuthorDate: Tue Feb 13 07:57:38 2018 -0500 Commit: Satoe Imaishi <simaishi> CommitDate: Thu Feb 15 13:15:54 2018 -0500 Merge pull request #1383 from chalettu/dialog-select-ui-components Updated UI components version to remedy dialog select issue (cherry picked from commit 2ee001eb3df3a646666126e14595fba8d471c782) https://bugzilla.redhat.com/show_bug.cgi?id=1531316 package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) Appliance version: 5.9.0.22 Works perfectly, marking as verified. |