summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-11-18 22:31:53 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-11-18 22:31:59 +0100
commit3176e298308f16acca50fc7c127f84e0dc3678ad (patch)
tree7f84c11353d084e0e0dbd59484ba95c88c66405e
parentb1f5af40598528fbc1326946376a595d41793537 (diff)
downloadgitlab-ce-3176e298308f16acca50fc7c127f84e0dc3678ad.tar.gz
Expose stop_path for environment to not construct that in frontend
-rw-r--r--app/assets/javascripts/environments/components/environment_item.js.es62
-rw-r--r--app/assets/javascripts/environments/components/environment_stop.js.es62
-rw-r--r--app/serializers/environment_entity.rb7
3 files changed, 9 insertions, 2 deletions
diff --git a/app/assets/javascripts/environments/components/environment_item.js.es6 b/app/assets/javascripts/environments/components/environment_item.js.es6
index 9241b5472a7..2f7d1d2a177 100644
--- a/app/assets/javascripts/environments/components/environment_item.js.es6
+++ b/app/assets/javascripts/environments/components/environment_item.js.es6
@@ -475,7 +475,7 @@
<div v-if="isStoppable && canCreateDeployment"
class="inline js-stop-component-container">
<stop-component
- :stop_url="model.environment_path">
+ :stop_url="model.stop_path">
</stop-component>
</div>
diff --git a/app/assets/javascripts/environments/components/environment_stop.js.es6 b/app/assets/javascripts/environments/components/environment_stop.js.es6
index 2fc56b89429..171d2d7fae3 100644
--- a/app/assets/javascripts/environments/components/environment_stop.js.es6
+++ b/app/assets/javascripts/environments/components/environment_stop.js.es6
@@ -15,7 +15,7 @@
computed: {
stopUrl() {
- return `${this.stop_url}/stop`;
+ return this.stop_url;
},
},
diff --git a/app/serializers/environment_entity.rb b/app/serializers/environment_entity.rb
index 93534ef1b15..7e0fc9c071e 100644
--- a/app/serializers/environment_entity.rb
+++ b/app/serializers/environment_entity.rb
@@ -16,5 +16,12 @@ class EnvironmentEntity < Grape::Entity
environment)
end
+ expose :stop_path do |environment|
+ stop_namespace_project_environment_path(
+ environment.project.namespace,
+ environment.project,
+ environment)
+ end
+
expose :created_at, :updated_at
end