Skip to content

Commit

Permalink
Merge pull request #2051 from europ/remove-ui-constants-43
Browse files Browse the repository at this point in the history
Remove TASK_STATES from UiConstants
  • Loading branch information
martinpovolny authored Aug 30, 2017
2 parents c851e67 + 4338ec1 commit 9c26bd0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
17 changes: 16 additions & 1 deletion app/controllers/miq_task_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ class MiqTaskController < ApplicationController
[100, 100],
].freeze

TASK_STATES = [
[N_("Initializing"), "initializing"],
[N_("Cancelling"), "Cancelling"],
[N_("Aborting"), "Aborting"],
[N_("Finished"), "Finished"],
[N_("Snapshot Create"), "Snapshot_create"],
[N_("Scanning"), "Scanning"],
[N_("Snapshot Delete"), "Snapshot_delete"],
[N_("Synchronizing"), "Synchronizing"],
[N_("Deploy Smartproxy"), "Deploy_smartproxy"],
[N_("Initialized"), "Initialized"],
[N_("Queued"), "Queued"],
[N_("Active"), "Active"]
].freeze

def index
@tabform = nil
# TODO: remove :feature => "job_my_smartproxy" and :feature => "job_all_smartproxy" from miq_user_roles.yml
Expand Down Expand Up @@ -224,7 +239,7 @@ def tasks_set_default_options
:error => true,
:warn => true,
:running => true,
:states => UiConstants::TASK_STATES,
:states => TASK_STATES,
:state_choice => "all",
:time_period => 0,
}
Expand Down
6 changes: 0 additions & 6 deletions app/helpers/ui_constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ module UiConstants
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"],
[N_("Snapshot Delete"), "Snapshot_delete"], [N_("Synchronizing"), "Synchronizing"],
[N_("Deploy Smartproxy"), "Deploy_smartproxy"],
[N_("Initialized"), "Initialized"], [N_("Queued"), "Queued"], [N_("Active"), "Active"]].freeze

PROV_STATES = {
"pending_approval" => N_("Pending Approval"),
Expand Down
8 changes: 4 additions & 4 deletions spec/controllers/miq_task_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
:running => true,
:state_choice => "all",
:time_period => 0,
:states => UiConstants::TASK_STATES}
:states => MiqTaskController::TASK_STATES}
end

it "all defaults" do
Expand Down Expand Up @@ -225,7 +225,7 @@
:running => true,
:state_choice => "all",
:time_period => 0,
:states => UiConstants::TASK_STATES}
:states => MiqTaskController::TASK_STATES}
end

it "all defaults" do
Expand Down Expand Up @@ -455,7 +455,7 @@
:zone => "<all>",
:user_choice => "all",
:time_period => 0,
:states => UiConstants::TASK_STATES}
:states => MiqTaskController::TASK_STATES}
end

it "all defaults" do
Expand Down Expand Up @@ -649,7 +649,7 @@
:state_choice => "all",
:user_choice => "all",
:time_period => 0,
:states => UiConstants::TASK_STATES}
:states => MiqTaskController::TASK_STATES}
end

it "all defaults" do
Expand Down

0 comments on commit 9c26bd0

Please sign in to comment.