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)
Created attachment 1388532 [details] a) Edit Dialog screen
Created attachment 1388533 [details] b) Dialog Sample screen
Created attachment 1388534 [details] c) Service order screen
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.
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.
https://github.com/ManageIQ/manageiq-ui-classic/pull/3371
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(-)
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
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.
@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
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
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(-)
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(-)
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(-)
Verified with 5.10.0.8. Default values now consistent across different screens. For other issues there are BZs and RFEs opened.