Skip to content

Commit

Permalink
Merge pull request #2313 from eclarizio/allow_required_flag_for_all_d…
Browse files Browse the repository at this point in the history
…ialog_field_types

Allow required flag to be set/unset for all dialog field types
  • Loading branch information
h-kataria authored Oct 9, 2017
2 parents 22f6ef3 + cc4048e commit f40bb3b
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 f40bb3b

Please sign in to comment.