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:
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?)
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.
https://github.com/ManageIQ/ui-components/pull/376
https://github.com/ManageIQ/manageiq/pull/18600
migration: https://github.com/ManageIQ/manageiq-schema/pull/357 core: https://github.com/ManageIQ/manageiq/pull/18600 ui: https://github.com/ManageIQ/ui-components/pull/376
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(+)
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(-)
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(-)
https://github.com/ManageIQ/manageiq/pull/18645
Verified in Version 5.11.0.3.20190507174347_a77bd90
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(+)
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