From cc4048ec15efa7c5f50dd63931a9479e3f336622 Mon Sep 17 00:00:00 2001 From: Erik Clarizio Date: Thu, 5 Oct 2017 12:17:32 -0700 Subject: [PATCH] Allow required flag to be set/unset for all field types https://bugzilla.redhat.com/show_bug.cgi?id=1492150 --- .../miq_ae_customization_controller/dialogs.rb | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/controllers/miq_ae_customization_controller/dialogs.rb b/app/controllers/miq_ae_customization_controller/dialogs.rb index 7179d8c432c..6f7f54fcedd 100644 --- a/app/controllers/miq_ae_customization_controller/dialogs.rb +++ b/app/controllers/miq_ae_customization_controller/dialogs.rb @@ -965,6 +965,11 @@ def dialog_get_form_vars_field # element type was NOT changed and is present elsif !@edit[:field_typ].blank? @edit[:field_visible] = key[:visible] + + if params[:field_required] + @edit[:field_required] = key[:required] = (params[:field_required] == "true") + end + # set default_value - checkbox if @edit[:field_typ] =~ /Check/ if params[:field_default_value] @@ -987,10 +992,6 @@ def dialog_get_form_vars_field @edit[:field_default_value] ||= "" key[:default_value] ||= "" end - - if params[:field_required] - @edit[:field_required] = key[:required] = (params[:field_required] == "true") - end end if %w(DialogFieldTextBox DialogFieldTextAreaBox).include?(@edit[:field_typ]) @@ -1030,10 +1031,6 @@ def dialog_get_form_vars_field @edit[:field_single_value] = key[:single_value] = (params[:field_single_value] == "true") end - if params[:field_required] - @edit[:field_required] = key[:required] = (params[:field_required] == "true") - end - @edit[:field_sort_by] = key[:sort_by] = params[:field_sort_by] if params[:field_sort_by] @edit[:field_sort_order] = key[:sort_order] = params[:sort_order] if params[:sort_order] @edit[:field_data_typ] = key[:data_typ] = params[:field_data_typ] if params[:data_typ]