Bug 1540273 - Service Dialogs: Different behaviour of items wrt default values
Summary: Service Dialogs: Different behaviour of items wrt default values
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.10.0
Assignee: eclarizi
QA Contact: Antonin Pagac
URL:
Whiteboard:
Depends On:
Blocks: 1542610
TreeView+ depends on / blocked
 
Reported: 2018-01-30 16:49 UTC by Antonin Pagac
Modified: 2019-02-11 14:05 UTC (History)
9 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1542610 (view as bug list)
Environment:
Last Closed: 2019-02-11 14:05:04 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
a) Edit Dialog screen (105.80 KB, image/png)
2018-01-30 16:50 UTC, Antonin Pagac
no flags Details
b) Dialog Sample screen (100.92 KB, image/png)
2018-01-30 16:50 UTC, Antonin Pagac
no flags Details
c) Service order screen (86.30 KB, image/png)
2018-01-30 16:51 UTC, Antonin Pagac
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1531316 0 high CLOSED Default Value on Dropdown inside Dialog does not store value 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1541988 0 high CLOSED Service Dialogs: Default value for Radio button not rendered on the editing page 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1541992 0 medium CLOSED [RFE] Service Dialogs: Not able to set default value for Date and Time pickers 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1541999 0 medium CLOSED [RFE] Service Dialogs: Not able to set default value for Tag Control 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1614369 0 unspecified CLOSED [RFE] Service Dialog: Disable the 'Single value' switch in Tag Control when not applicable 2021-02-22 00:41:40 UTC


Description Antonin Pagac 2018-01-30 16:49:37 UTC
Description of problem:
When creating Service Dialogs, there are several items with different behaviour with regards to default values. Text Area and Text Box items are the only ones which are behaving as I would expect.

Text Box:
 - Default value can be added
 - Default value is saved
 - Default value can be seen when editing the dialog
 - Default value can be seen on Dialog Sample screen

Text Area:
 - same as Text Box

Check Box:
 - Default value can be added
 - Default value is saved
 - Default value can be seen when editing the dialog
 * Default value can NOT be seen on Dialog Sample screen

Dropdown:
 - Default value can be added
 - Default value is saved
 - Default value can be seen when editing the dialog
 * Default value can NOT be seen on Dialog Sample screen

Radio Button:
 - Default value can be added
 * Default value is NOT saved
 * Default value can NOT be seen when editing the dialog
 * Default value can NOT be seen on Dialog Sample screen

Datepicker:
 * Default value can NOT be added
 * Date always seem to be one value

Timepicker:
 * Default value can NOT be added
 - Time can be seen when editing the dialog
 * Time can NOT be seen on Dialog Sample screen 
 * Time is missing altogether from service order screen (BZ?)

Tag Control:
 - Default value can be added
 - Default value is saved
 * Default value can NOT be seen when editing the dialog
 * Default value can NOT be seen on Dialog Sample screen
 * The input field looks different in Sample screen and in Order screen (BZ?)


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

How reproducible:
Always

Steps to Reproduce:
1. Navigate to Automation -> Automate -> Customization; Service Dialogs; Configuration -> Add a new Dialog
2. Add one from each item on the left to the new tab
3. Try to edit items and input default values
4. Observe different behaviour with different items on screens:
   a) Edit Dialog screen
   b) Dialog Sample screen
   c) Service ordering screen

Actual results:
Different items behave differently wrt default values

Expected results:
Uniform behaviour of Dialog items; Can add default value to an item and this value is visible in Sample screen and when ordering service

Additional info:
See screenshots of screens a), b), c)

Comment 2 Antonin Pagac 2018-01-30 16:50:23 UTC
Created attachment 1388532 [details]
a) Edit Dialog screen

Comment 3 Antonin Pagac 2018-01-30 16:50:53 UTC
Created attachment 1388533 [details]
b) Dialog Sample screen

Comment 4 Antonin Pagac 2018-01-30 16:51:32 UTC
Created attachment 1388534 [details]
c) Service order screen

Comment 5 eclarizi 2018-02-01 19:29:44 UTC
All of the sample screen inconsistencies can be fixed relatively simply, and I think this BZ is probably a good place to capture that fix. The rest of the fixes for the various types of fields I would recommend creating new BZs for.

For Checkbox, I can definitely fix that for this BZ

For Dropdown, looks like it depends on the values that are in the dropdown, as I have one that is A/B/C and the default value shows up fine in the sample. If I use 1/2/3 and One/Two/Three as the descriptions, then it fails. So there is definitely a problem there that I will dig into and fix for this BZ

For Radio button, the database saves the value correctly, but it is just having a problem correctly selecting the value when it is being rendered. I can fix this for the sample page but on the editing page it may need to be a different issue.

For Date and Datetime picker, I think a new BZ should be created for not being able to set a default value at all. This may have been an oversight by Roman when we first transitioned to using the new editor. This also would impact the sample screen. I'm not seeing the issue where the time control doesn't show up at all while ordering.

For TagControl, I wasn't able to set a default value, so I don't know how you were able to do it. This may end up being another BZ where we add the functionality to have a default value for TagControl. Anyway, by default, I believe TagControl's 'Single Value' property is set to false which would give you the multiple dropdown style like you see in the order screen. I'm not sure why the sample value shows you a single style dropdown, as when I tested locally it was showing the multiple style as expected.

Comment 6 Antonin Pagac 2018-02-05 10:36:33 UTC
Using 5.9.0.19

In reply to comment 5:

 - for Radio button on the editing page I will open a new BZ

 - for Date and Time picker, I will open a new BZ wrt not able to set default values at all. Steps to reproduce the missing time control issue:
1. Create a new Dialog and add a Timepicker item to it
2. Create new Catalog item, choose the new Dialog in the "Dialog" dropdown
3. Create new Catalog, add new Catalog item to it
4. Observe different behaviour when trying to order via
   a) OPS UI: Services -> Service Catalogs -> new Catalog -> Order; here the Timepicker is visible
   b) SSUI: Service Catalog -> Catalog item; here you are able to choose only date, no time is visible

 - for Tag control, you are correct, there is no default value. I choose a Category and that filled the Entries, that's all, so I'll create a new BZ to add the default value functionality.
For the dropdown issue, 'Single value' is indeed set to false and it gives me multiple style dropdown on the ordering screen but not on the sample screen. Steps to reproduce (5.9.0.19):
1. Create a new dialog and add Tag Control item to it
2. Edit the Tag Control item; for Category, choose any of the available options
   Notice the Single value is off by default
3. Save the item; save the Dialog
4. Click on the dialog name in the All Dialogs tree
5. Observe single-style dropdown on sample screen


Please consider the reproduce steps above and let me know if you are seeing these issues.

Comment 8 CFME Bot 2018-02-05 21:23:47 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:
https://github.com/ManageIQ/manageiq-ui-classic/commit/d7b73448ea823d73b75e69d73bce3ed58e860689

commit d7b73448ea823d73b75e69d73bce3ed58e860689
Author:     Erik Clarizio <eclarizio>
AuthorDate: Mon Feb 5 10:41:11 2018 -0800
Commit:     Erik Clarizio <eclarizio>
CommitDate: Mon Feb 5 12:03:50 2018 -0800

    Adjust dialog sample page default values
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1540273

 app/views/miq_ae_customization/_dialog_sample.html.haml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comment 9 eclarizi 2018-02-05 21:39:31 UTC
Hey Antonin, I was able to reproduce most of the other issues but I can't seem to reproduce the Tag Control one where you're seeing a single-style select dropdown on the sample screen when the 'Single value' property is false. I tried on a fresh 5.9.0.19 appliance as well.

Do you have a reproducing appliance I can take a look at somewhere?

In addition to the above merged PR, this will need to be merged as well to fix the timepicker issue:
https://github.com/ManageIQ/ui-components/pull/248

Comment 10 eclarizi 2018-02-05 22:12:20 UTC
It looks like for some reason it depends on the category selected. I was consistently using the "department" category and it was showing a multiple select box. Using for example "environment", it is showing a single select dropdown. I'll look into why it only works for some categories and not others.

Comment 11 Brant Evans 2018-02-05 22:20:04 UTC
@eclarizi,

I think that is related to how the tag category is defined. A tag category has "Single Value" property. If set to true then only one value from that tag category can be assigned. If it is false then any number are able to be set.

The dialog element for a tag control sounds like it is working as I'd expect. If the category has "Single Value" set to true then a drop-down is displayed that only allows selecting one value. If set to false then the dialog element allows selecting multiple values.

"department" category has "Single Value" set to false. "environment" has "Single Value" set to true.

Brant

Comment 12 eclarizi 2018-02-06 02:57:01 UTC
Thanks Brant, you're right, the category itself is a subclass of Classification, which has the "single_value" column in the database. This means that the actual running of the dialog when you order it and it showing multi-select is a bug, and it should only be allowing the use of a single select instead of a multi-select.

I've put together a PR to fix that here:
https://github.com/ManageIQ/manageiq/pull/16955

Comment 13 CFME Bot 2018-02-06 15:40:12 UTC
New commit detected on ManageIQ/ui-components/master:
https://github.com/ManageIQ/ui-components/commit/1154f59815ac4bcf1ed439a425cd10b08e732586

commit 1154f59815ac4bcf1ed439a425cd10b08e732586
Author:     Erik Clarizio <eclarizio>
AuthorDate: Mon Feb 5 13:29:06 2018 -0800
Commit:     Erik Clarizio <eclarizio>
CommitDate: Mon Feb 5 13:29:06 2018 -0800

    Update to new style of uib-timepicker as a property of a div
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1540273

 src/dialog-user/components/dialog-user/dialogField.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 14 CFME Bot 2018-02-06 15:40:18 UTC
New commit detected on ManageIQ/ui-components/master:
https://github.com/ManageIQ/ui-components/commit/0694c631fb12ba6120eaee80c629e5449ac9baee

commit 0694c631fb12ba6120eaee80c629e5449ac9baee
Author:     Erik Clarizio <eclarizio>
AuthorDate: Mon Feb 5 13:29:47 2018 -0800
Commit:     Erik Clarizio <eclarizio>
CommitDate: Mon Feb 5 13:29:47 2018 -0800

    Ensure checkbox for dialog-user component uses the default value on load
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1540273

 src/dialog-user/components/dialog-user/dialogField.html | 1 -
 src/dialog-user/services/dialogData.spec.ts             | 4 ++--
 src/dialog-user/services/dialogData.ts                  | 3 ---
 3 files changed, 2 insertions(+), 6 deletions(-)

Comment 16 CFME Bot 2018-02-06 18:21:52 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/d1d5161e3bad5b762a1b6e1d1b0bbabb3e69a72a

commit d1d5161e3bad5b762a1b6e1d1b0bbabb3e69a72a
Author:     Erik Clarizio <eclarizi>
AuthorDate: Mon Feb 5 18:48:24 2018 -0800
Commit:     Erik Clarizio <eclarizi>
CommitDate: Mon Feb 5 18:53:35 2018 -0800

    Use correct value for force_single_value when serializing TagControl
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1540273

 app/models/dialog_field_serializer.rb       |  5 ++++-
 spec/models/dialog_field_serializer_spec.rb | 14 ++++++++++----
 2 files changed, 14 insertions(+), 5 deletions(-)

Comment 17 Antonin Pagac 2018-08-09 13:07:19 UTC
Verified with 5.10.0.8.

Default values now consistent across different screens. For other issues there are BZs and RFEs opened.


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