Bug 1442383
| Summary: | Self Service UI does not properly select defaults for dynamic drop downs | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | Ian Tewksbury <itewksbu> | ||||||||||||
| Component: | UI - Service | Assignee: | Chris Hale <chhale> | ||||||||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Shveta <sshveta> | ||||||||||||
| Severity: | medium | Docs Contact: | |||||||||||||
| Priority: | medium | ||||||||||||||
| Version: | 5.7.0 | CC: | dclarizi, fdewaley, itewksbu, jhardy, obarenbo, simaishi, sshveta | ||||||||||||
| Target Milestone: | GA | Keywords: | TestOnly | ||||||||||||
| Target Release: | 5.9.0 | ||||||||||||||
| Hardware: | Unspecified | ||||||||||||||
| OS: | Unspecified | ||||||||||||||
| Whiteboard: | ssui | ||||||||||||||
| Fixed In Version: | 5.9.0.1 | Doc Type: | If docs needed, set a value | ||||||||||||
| Doc Text: | Story Points: | --- | |||||||||||||
| Clone Of: | |||||||||||||||
| : | 1444060 1444062 (view as bug list) | Environment: | |||||||||||||
| Last Closed: | 2018-03-06 14:44:10 UTC | Type: | Bug | ||||||||||||
| Regression: | --- | Mount Type: | --- | ||||||||||||
| Documentation: | --- | CRM: | |||||||||||||
| Verified Versions: | Category: | --- | |||||||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||||||
| Embargoed: | |||||||||||||||
| Bug Depends On: | |||||||||||||||
| Bug Blocks: | 1444060, 1444062 | ||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Ian Tewksbury
2017-04-14 12:23:21 UTC
Can you send me a copy of the dialog you created and also point me to the appliance you tested this on? I am unable to reproduce this locally and these two things would help me to determine if this is reproducible. Created attachment 1272136 [details]
dialog
Created attachment 1272137 [details]
self service - no defaults
Created attachment 1272138 [details]
ops ui - defaults work
Created attachment 1272139 [details]
one example of the method populating one of the dynamic drop downs
@Chris, I have attached what I think you were asking for. Let me know if you need more. Blue skies, Ian Ian, The method you attached does not have a default value set for the dropdown based on the code you sent. I have tested a dynamic dropdown locally where I set the default_value in ruby code that defines that dynamic dropdown. The SUI does recognize this if it is set. Created attachment 1272143 [details]
Setting of Defaults
Could you test out modifying your dropdown to define a default similar to how I have attached and see if that sets the default that you had defined @Chris, Should the default value be the key or the value from the hash? It is unclear from your example since both key and value are the same string. Then, also assuming this works, why do I need to set this for Self Service but for the OPS UI the behavior is to select the first option in the list? That is inconsistent. ```
dialog_field = $evm.object
dialog_field["sort_by"] = "value"
dialog_field["sort_order"] = "ascending"
dialog_field["data_type"] = "integer"
dialog_field["required"] = true
dialog_field['default_value'] = organization_index['results'][0]['id']
dialog_field["values"] = Hash[ *organization_index['results'].collect { |item| [item['id'], item['label']] }.flatten ]
```
That still doesn't work.
Ian, If its possible to give me access to the appliance you are experiencing this issue on , it would help me to take a look and see what the API is returning for this drop down. Chris, I sent you an email with the log in info for the internal lab. @Chris, For my own edification, what was the issue? I looked at the pull request, was it something to do with having an int value rathe rather then a string value? Fixed in 5.9.0.4.20171024163837_ef71ea6 |