blob: a552592c02c2406e2db5fe82fdedcbe4e044c7e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
module Gitlab
module Ci
module Status
module Deployment
module Common
def has_details?
can?(current_user, :read_environment, environment) &&
can?(user, :read_deployment, subject)
end
def details_path
project_job_path(subject.project, subject.deployable)
end
def environment_name
environment.name
end
def environment_path
project_environment_path(subject.project, subject.environment)
end
def deployment_path
project_job_path(subject.project, subject.deployable)
end
def external_url
subject.environment.external_url
end
def stop_url
if can?(current_user, :stop_environment, environment)
stop_project_environment_path(project, environment)
end
end
def metrics_url
if environment.has_metrics?
metrics_project_environment_deployment_path(project, environment, subject)
end
end
def metrics_monitoring_url
environment_metrics_path(environment)
end
def deployed_at
subject.deployed_at
end
def deployed_at_formatted
subject.deployed_at_formatted
end
def environment
subject.environment
end
end
end
end
end
end
|