Commit 63312b98 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Merge branch '22191-delete-dynamic-envs-mr' of gitlab.com:gitlab-org/gitlab-ce...

Merge branch '22191-delete-dynamic-envs-mr' of gitlab.com:gitlab-org/gitlab-ce into 22191-delete-dynamic-envs-mr
parents 53d79469 a8cc76e2
...@@ -17,6 +17,12 @@ ...@@ -17,6 +17,12 @@
View on <%- external_url_formatted %> View on <%- external_url_formatted %>
</a> </a>
</span> </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>
</div>`; </div>`;
...@@ -205,6 +211,11 @@ ...@@ -205,6 +211,11 @@
if ($(`.mr-state-widget #${ environment.id }`).length) return; if ($(`.mr-state-widget #${ environment.id }`).length) return;
const $template = $(DEPLOYMENT_TEMPLATE); const $template = $(DEPLOYMENT_TEMPLATE);
if (!environment.external_url || !environment.external_url_formatted) $('.js-environment-link', $template).remove(); 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) { if (environment.deployed_at && environment.deployed_at_formatted) {
environment.deployed_at = $.timeago(environment.deployed_at) + '.'; environment.deployed_at = $.timeago(environment.deployed_at) + '.';
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment