Skip to content

Commit

Permalink
Remove TASK_TIME_PERIODS from UiConstants
Browse files Browse the repository at this point in the history
  • Loading branch information
europ committed Aug 30, 2017
1 parent 56483b5 commit 7f1cc7f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
11 changes: 11 additions & 0 deletions app/helpers/miq_task_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module MiqTaskHelper
TASK_TIME_PERIODS = {
0 => N_("Today"),
1 => N_("1 Day Ago"),
2 => N_("2 Days Ago"),
3 => N_("3 Days Ago"),
4 => N_("4 Days Ago"),
5 => N_("5 Days Ago"),
6 => N_("6 Days Ago")
}.freeze
end
10 changes: 0 additions & 10 deletions app/helpers/ui_constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ module UiConstants

VALID_PLANNING_VM_MODES = PlanningHelper::PLANNING_VM_MODES.keys.index_by(&:to_s)

TASK_TIME_PERIODS = {
0 => N_("Today"),
1 => N_("1 Day Ago"),
2 => N_("2 Days Ago"),
3 => N_("3 Days Ago"),
4 => N_("4 Days Ago"),
5 => N_("5 Days Ago"),
6 => N_("6 Days Ago")
}

PROV_TIME_PERIODS = {
1 => N_("Last 24 Hours"),
7 => N_("Last 7 Days"),
Expand Down
2 changes: 1 addition & 1 deletion app/views/miq_task/_tasks_options.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
= _("24 Hour Time Period")
.col-md-8
= select_tag("time_period",
options_for_select(Array(TASK_TIME_PERIODS.invert).sort_by(&:last).map{|x| [_(x[0]), x[1]]}, @tasks_options[@tabform][:time_period]),
options_for_select(Array(MiqTaskHelper::TASK_TIME_PERIODS.invert).sort_by(&:last).map{|x| [_(x[0]), x[1]]}, @tasks_options[@tabform][:time_period]),
:class => "selectpicker")
:javascript
miqInitSelectPicker();
Expand Down

0 comments on commit 7f1cc7f

Please sign in to comment.