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 7dacd0a commit 3157d28
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 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
9 changes: 0 additions & 9 deletions app/helpers/ui_constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +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")
}
TASK_STATES = [[N_("Initializing"), "initializing"],
[N_("Cancelling"), "Cancelling"], [N_("Aborting"), "Aborting"], [N_("Finished"), "Finished"],
[N_("Snapshot Create"), "Snapshot_create"], [N_("Scanning"), "Scanning"],
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 3157d28

Please sign in to comment.