Bug 1684575 - The "Load values on init" option for a service dialog element is only visible when "Show Refresh Button" is set to "yes"
Summary: The "Load values on init" option for a service dialog element is only visible...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.10.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: GA
: 5.11.0
Assignee: Martin Hradil
QA Contact: Niyaz Akhtar Ansari
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-01 15:07 UTC by Peter McGowan
Modified: 2023-03-24 14:36 UTC (History)
14 users (show)

Fixed In Version: 5.11.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-12 13:35:55 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:4199 0 None None None 2019-12-12 13:36:08 UTC

Description Peter McGowan 2019-03-01 15:07:34 UTC
Description of problem:
The "Load values on init" option for a service dialog element is only visible when "Show Refresh Button" is set to "yes" in the UI dialog editor. The option of whether to run an element's dynamic method when the dialog initially loads should be user-selectable whether or not the element displays a Refresh button. 

As an example it is useful to have a dialog with several dynamically-populated elements, however with only the first (say drop-down) element populated at dialog load time. Depending on the user's selection in this first element, further dynamic elements can be automatically triggered, however it is not valid for these subsequent elements to run at load time because the first element has not been user-selected.

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

How reproducible:
every time

Steps to Reproduce:
1. Create a service dialog using the UI dialog editor. Add a single text box element
2. In the element's definition in the UI editor, in the "Field Information" tab, select Dynamic -> Yes
3. In the "Options' tab, notice that by default the "Load values on init" slider is hidden.
4. Set the "Show Refresh Button" to be "Yes". Notice that this now makes visible the "Load values on init" slider.

Actual results:
The the "Load values on init" slider is only visible when "Show Refresh Button" is set to "Yes"

Expected results:
The the "Load values on init" slider should always be visible

Additional info:

Comment 4 Martin Hradil 2019-03-27 11:54:56 UTC
Given that "Load Values on Init" is enabled (not visible, but enabled), when "Show Refresh Button" is off,
it looks like this BZ is asking for an option to disable loading values on init when show refresh button is also disabled?

That would effectively mean the field will never get populated by any server values.
Which seems rather useless because that can also be achieved by not providing a value in the first place, or not making the field dynamic.


Is that really something we want?
Maybe the proper solution would be to add a "Values will be autoloaded on init" info message whenever "show refresh button" is disabled?
(Or show the "Load Values on Init" switch, but greyed out, read only, set to enabled?)

Comment 5 Peter McGowan 2019-03-27 12:23:57 UTC
This is correct, we would like the element's dynamic method to only be triggered from the "Fields to Refresh" field of a prior element, and not run when the dialog initially loads.

Comment 12 CFME Bot 2019-04-01 13:37:25 UTC
New commit detected on ManageIQ/manageiq-schema/master:

https://github.com/ManageIQ/manageiq-schema/commit/e8c1faa5dbbf46ae3d4c2ac2ac462da64dd988c2
commit e8c1faa5dbbf46ae3d4c2ac2ac462da64dd988c2
Author:     Martin Hradil <mhradil>
AuthorDate: Wed Mar 27 09:37:01 2019 -0400
Commit:     Martin Hradil <mhradil>
CommitDate: Wed Mar 27 09:37:01 2019 -0400

    Dialog field - set load_values_on_init to true where show_refresh_button was not enabled

    Replaces code that was previously hardcoded in the model..

        def load_values_on_init?
          return true unless show_refresh_button
          load_values_on_init
        end

    Needed to make it posssible to set both these fields to false,
    without breaking all the old fields where the value of `load_values_on_init` previously didn't matter.

    https://bugzilla.redhat.com/show_bug.cgi?id=1684567
    https://bugzilla.redhat.com/show_bug.cgi?id=1684575

 db/migrate/20190327132620_dialog_field_load_values_on_init.rb | 11 +
 1 file changed, 11 insertions(+)

Comment 13 CFME Bot 2019-04-08 19:31:57 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/1ca148ee613e1d9fde259c18eef8f588150b65bf
commit 1ca148ee613e1d9fde259c18eef8f588150b65bf
Author:     Martin Hradil <mhradil>
AuthorDate: Wed Mar 27 09:14:00 2019 -0400
Commit:     Martin Hradil <mhradil>
CommitDate: Wed Mar 27 09:14:00 2019 -0400

    Dialog fields - make load_values_on_init independent of show_refresh_button

    Before, show_refresh_button being falsy meant that load_values_on_init would be considered true.

    Now, the two are independent, allowing for a field to only be refreshed by other fields.

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

 app/models/dialog_field_sorted_item.rb | 7 +-
 app/models/dialog_field_text_box.rb | 7 +-
 2 files changed, 2 insertions(+), 12 deletions(-)

Comment 14 CFME Bot 2019-04-09 10:38:21 UTC
New commit detected on ManageIQ/ui-components/master:

https://github.com/ManageIQ/ui-components/commit/114c60d16d2811acdf92df227d20222fc975f5ec
commit 114c60d16d2811acdf92df227d20222fc975f5ec
Author:     Martin Hradil <mhradil>
AuthorDate: Wed Mar 27 08:17:15 2019 -0400
Commit:     Martin Hradil <mhradil>
CommitDate: Wed Mar 27 08:17:15 2019 -0400

    Dialog editor: make "Load Values on Init" independent of "Show Refresh Button"

    Before, load values on init was implied when show refresh button was false

    Now, both can be set independently, allowing a field to only refresh because of "fields to refresh".

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

 src/dialog-editor/components/modal-field-template/dynamic-values.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 21 Niyaz Akhtar Ansari 2019-05-14 16:27:27 UTC
Verified in Version 5.11.0.3.20190507174347_a77bd90

Comment 22 CFME Bot 2019-06-03 09:40:47 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/79da7dbe6c7edd35d65adaa52e65d73a11ecfe16
commit 79da7dbe6c7edd35d65adaa52e65d73a11ecfe16
Author:     Martin Hradil <mhradil>
AuthorDate: Wed Apr 10 08:09:10 2019 -0400
Commit:     Martin Hradil <mhradil>
CommitDate: Wed Apr 10 08:09:10 2019 -0400

    DialogFieldImporter - set `load_values_on_init` when importing from version 1 export

    Applies the same change as ManageIQ/manageiq-schema#357 when importing older exported service dialogs.

    https://bugzilla.redhat.com/show_bug.cgi?id=1684575
    https://bugzilla.redhat.com/show_bug.cgi?id=1684567

 app/models/dialog_field_importer.rb | 12 +
 1 file changed, 12 insertions(+)

Comment 24 errata-xmlrpc 2019-12-12 13:35:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:4199


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