Skip to content

Commit

Permalink
Allow required flag to be set/unset for all field types
Browse files Browse the repository at this point in the history
  • Loading branch information
eclarizio committed Oct 5, 2017
1 parent 3b5612c commit cc4048e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions app/controllers/miq_ae_customization_controller/dialogs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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])
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit cc4048e

Please sign in to comment.