Skip to content

Commit

Permalink
DialogFieldImporter - set load_values_on_init when importing from v…
Browse files Browse the repository at this point in the history
…ersion 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
  • Loading branch information
himdel committed May 22, 2019
1 parent 021ca46 commit 79da7db
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/models/dialog_field_importer.rb
Expand Up @@ -7,6 +7,18 @@ def import_field(dialog_field_attributes, export_version = DialogImportService::
dialog_field_attributes["dynamic"] = true
end

if export_version < 2
dialog_field_attributes["load_values_on_init"] = if !dialog_field_attributes["show_refresh_button"]
# no refresh button, always true
true
elsif dialog_field_attributes["load_values_on_init"].nil?
# unspecified, default to true
true
else
!!dialog_field_attributes["load_values_on_init"]
end
end

if DialogField::DIALOG_FIELD_TYPES.include?(dialog_field_attributes["type"])
dialog_field_type_class = dialog_field_attributes["type"].constantize
resource_action_attributes = dialog_field_attributes.delete("resource_action")
Expand Down

0 comments on commit 79da7db

Please sign in to comment.