Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-01-24 19:52:50 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2017-01-24 19:52:50 +0300
commit3cd17c9430c7575b0c1f1041947f3cd0d991f00c (patch)
tree12638383d600ae6d5c8cbf6c27da7bdb2199f5e7 /app/serializers/environment_entity.rb
parent8faabdf7d33b575de11b043cfe6698021d33a973 (diff)
parent8c0e358a972ca9cb2176ff9289a5a89b0c909a93 (diff)
Merge remote-tracking branch 'origin/master' into 24147-delete-env-button
Diffstat (limited to 'app/serializers/environment_entity.rb')
-rw-r--r--app/serializers/environment_entity.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/app/serializers/environment_entity.rb b/app/serializers/environment_entity.rb
index bfccfd8bb7c..7279de59aa8 100644
--- a/app/serializers/environment_entity.rb
+++ b/app/serializers/environment_entity.rb
@@ -9,12 +9,27 @@ class EnvironmentEntity < Grape::Entity
expose :last_deployment, using: DeploymentEntity
expose :can_run_stop_action?
- expose :environment_url do |environment|
- namespace_project_environment_url(
+ expose :environment_path do |environment|
+ namespace_project_environment_path(
environment.project.namespace,
environment.project,
environment)
end
+ expose :stop_path do |environment|
+ stop_namespace_project_environment_path(
+ environment.project.namespace,
+ environment.project,
+ environment)
+ end
+
+ expose :terminal_path, if: ->(environment, _) { environment.has_terminals? } do |environment|
+ can?(request.user, :admin_environment, environment.project) &&
+ terminal_namespace_project_environment_path(
+ environment.project.namespace,
+ environment.project,
+ environment)
+ end
+
expose :created_at, :updated_at
end