summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-10-17 11:44:08 +0100
committerFilipa Lacerda <filipa@gitlab.com>2016-10-17 11:44:08 +0100
commit92d12fab66e66358e8fb9204870053e4bab66b71 (patch)
tree1072ec5d11eb36a60e93b8c0e41de6dea0824a91
parent7aea16b64624eb681a1c134759a8f4fa1e5b2a78 (diff)
downloadgitlab-ce-92d12fab66e66358e8fb9204870053e4bab66b71.tar.gz
Updates MR template to include stop link
-rw-r--r--app/assets/javascripts/merge_request_widget.js.es611
1 files changed, 11 insertions, 0 deletions
diff --git a/app/assets/javascripts/merge_request_widget.js.es6 b/app/assets/javascripts/merge_request_widget.js.es6
index fcadc4bc515..fb55d13a223 100644
--- a/app/assets/javascripts/merge_request_widget.js.es6
+++ b/app/assets/javascripts/merge_request_widget.js.es6
@@ -17,6 +17,12 @@
View on <%- external_url_formatted %>
</a>
</span>
+ <span class="close-env-container js-close-env-link">
+ <a href="<%- stop_url %>" class="close-evn-link" data-method="post" rel="nofollow" data-confirm="Are you sure you want to close this environment?">
+ <i class="fa fa-stop-circle-o"/>
+ Stop environment
+ </a>
+ </span>
</div>
</div>`;
@@ -205,6 +211,11 @@
if ($(`.mr-state-widget #${ environment.id }`).length) return;
const $template = $(DEPLOYMENT_TEMPLATE);
if (!environment.external_url || !environment.external_url_formatted) $('.js-environment-link', $template).remove();
+
+ if (!environment.stop_url) {
+ $('.js-close-env-link', $template).remove();
+ }
+
if (environment.deployed_at && environment.deployed_at_formatted) {
environment.deployed_at = $.timeago(environment.deployed_at) + '.';
} else {