summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-10-17 18:14:26 +0900
committerShinya Maeda <shinya@gitlab.com>2018-10-17 18:14:26 +0900
commit813437d7e27ab93021641e89912e1b04a07316ad (patch)
treedf7be6d86a7db064bfe92249796fe768956c1b47
parentb3398c07d47e6ac8c750a972c74e0ceeb5d88b5d (diff)
parentd6e62bffad5e313fcc3abb6a2391e25c05f3caa0 (diff)
downloadgitlab-ce-813437d7e27ab93021641e89912e1b04a07316ad.tar.gz
Merge branch 'deployment-status-presenter' into use-deployment-status-in-job-log-page
-rw-r--r--lib/gitlab/ci/status/deployment/common.rb23
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/gitlab/ci/status/deployment/common.rb b/lib/gitlab/ci/status/deployment/common.rb
index a552592c02c..64bb7c4e032 100644
--- a/lib/gitlab/ci/status/deployment/common.rb
+++ b/lib/gitlab/ci/status/deployment/common.rb
@@ -4,12 +4,12 @@ module Gitlab
module Deployment
module Common
def has_details?
- can?(current_user, :read_environment, environment) &&
+ can?(user, :read_environment, environment) &&
can?(user, :read_deployment, subject)
end
def details_path
- project_job_path(subject.project, subject.deployable)
+ project_job_path(project, deployable)
end
def environment_name
@@ -17,11 +17,11 @@ module Gitlab
end
def environment_path
- project_environment_path(subject.project, subject.environment)
+ project_environment_path(project, environment)
end
def deployment_path
- project_job_path(subject.project, subject.deployable)
+ project_job_path(project, deployable)
end
def external_url
@@ -29,7 +29,7 @@ module Gitlab
end
def stop_url
- if can?(current_user, :stop_environment, environment)
+ if can?(user, :stop_environment, environment)
stop_project_environment_path(project, environment)
end
end
@@ -41,7 +41,8 @@ module Gitlab
end
def metrics_monitoring_url
- environment_metrics_path(environment)
+ # environment_metrics_path(environment)
+ metrics_project_environment_path(project, environment)
end
def deployed_at
@@ -49,12 +50,20 @@ module Gitlab
end
def deployed_at_formatted
- subject.deployed_at_formatted
+ subject.formatted_deployment_time
end
def environment
subject.environment
end
+
+ def project
+ subject.project
+ end
+
+ def deployable
+ subject.deployable
+ end
end
end
end