diff --git a/app/controllers/application_controller/filter/expression.rb b/app/controllers/application_controller/filter/expression.rb index 621897428474..ff2d6a018e79 100644 --- a/app/controllers/application_controller/filter/expression.rb +++ b/app/controllers/application_controller/filter/expression.rb @@ -566,8 +566,8 @@ def val_type_for(key, field) def self.through_choices(from_choice) # Return the through_choices pulldown array for FROM datetime/date operators tc = if ViewHelper::FROM_HOURS.include?(from_choice) ViewHelper::FROM_HOURS - elsif FROM_DAYS.include?(from_choice) - FROM_DAYS + elsif ViewHelper::FROM_DAYS.include?(from_choice) + ViewHelper::FROM_DAYS elsif FROM_WEEKS.include?(from_choice) FROM_WEEKS elsif FROM_MONTHS.include?(from_choice) diff --git a/app/views/layouts/exp_atom/_edit_field.html.haml b/app/views/layouts/exp_atom/_edit_field.html.haml index 5ebf81b94bc9..3665f6c2ba5e 100644 --- a/app/views/layouts/exp_atom/_edit_field.html.haml +++ b/app/views/layouts/exp_atom/_edit_field.html.haml @@ -75,7 +75,7 @@ "data-miq_sparkle_off" => true) - else - opts = (@edit[@expkey][:val1][:type] == :datetime ? ViewHelper::FROM_HOURS : []) - - opts += FROM_DAYS + FROM_WEEKS + FROM_MONTHS + FROM_QUARTERS + ViewHelper::FROM_YEARS + - opts += ViewHelper::FROM_DAYS + FROM_WEEKS + FROM_MONTHS + FROM_QUARTERS + ViewHelper::FROM_YEARS = select_tag('chosen_from_1', options_for_select(Hash[opts.map {|x| [_(x), x]}], @edit[@expkey][:exp_value][0]), :class => 'selectpicker', diff --git a/app/views/layouts/exp_atom/_edit_find.html.haml b/app/views/layouts/exp_atom/_edit_find.html.haml index fd24d7266c3c..9c9c361d4426 100644 --- a/app/views/layouts/exp_atom/_edit_find.html.haml +++ b/app/views/layouts/exp_atom/_edit_find.html.haml @@ -61,7 +61,7 @@ "data-miq_sparkle_off" => true) - else - opts = (@edit[@expkey][:val1][:type] == :datetime ? ViewHelper::FROM_HOURS : []) - - opts += FROM_DAYS + FROM_WEEKS + FROM_MONTHS + FROM_QUARTERS + ViewHelper::FROM_YEARS + - opts += ViewHelper::FROM_DAYS + FROM_WEEKS + FROM_MONTHS + FROM_QUARTERS + ViewHelper::FROM_YEARS = select_tag('chosen_from_1', options_for_select(Hash[opts.map{|x| [_(x), x]}], @edit[@expkey][:exp_value][0]), :multiple => false, @@ -176,7 +176,7 @@ "data-miq_sparkle_off" => true) - else - opts = (@edit[@expkey][:val2][:type] == :datetime ? ViewHelper::FROM_HOURS : []) - - opts += FROM_DAYS + FROM_WEEKS + FROM_MONTHS + FROM_QUARTERS + ViewHelper::FROM_YEARS + - opts += ViewHelper::FROM_DAYS + FROM_WEEKS + FROM_MONTHS + FROM_QUARTERS + ViewHelper::FROM_YEARS = select_tag('chosen_from_2', options_for_select(Hash[opts.map {|x| [_(x), x]}], @edit[@expkey][:exp_cvalue][0]), :multiple => false, diff --git a/app/views/report/_form_styling.html.haml b/app/views/report/_form_styling.html.haml index 2ec17e9155b8..4f1a242deb5a 100644 --- a/app/views/report/_form_styling.html.haml +++ b/app/views/report/_form_styling.html.haml @@ -57,7 +57,7 @@ "data-miq_sparkle_off" => true, "data-miq_observe" => {:url => url}.to_json) - elsif [:datetime, :date].include?(field_type) - - opts = (field_type == :datetime ? ViewHelper::FROM_HOURS : []) + FROM_DAYS + FROM_WEEKS + FROM_MONTHS + FROM_QUARTERS + ViewHelper::FROM_YEARS + - opts = (field_type == :datetime ? ViewHelper::FROM_HOURS : []) + ViewHelper::FROM_DAYS + FROM_WEEKS + FROM_MONTHS + FROM_QUARTERS + ViewHelper::FROM_YEARS = select_tag("styleval_#{f_idx}_#{s_idx}", options_for_select(Hash[opts.map {|x| [_(x), x]}], styles[s_idx][:value]), :multiple => false,