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:
authorValery Sizov <valery@gitlab.com>2016-11-22 14:17:15 +0300
committerValery Sizov <valery@gitlab.com>2016-11-22 14:18:49 +0300
commit38193f24ad7a50e753548f5b15c89a1420f3f920 (patch)
tree257c66abdae7bb33ef87724b3aabdf105786f97a
parentacaa6d733b37b18eb44a5d6e3b79f69ee821f62a (diff)
Stop DOSing from MR pagestop-dos-from-mr-page
-rw-r--r--app/assets/javascripts/merge_request_widget.js.es614
-rw-r--r--changelogs/unreleased/stop-dos-from-mr-page.yml4
2 files changed, 16 insertions, 2 deletions
diff --git a/app/assets/javascripts/merge_request_widget.js.es6 b/app/assets/javascripts/merge_request_widget.js.es6
index 54929cd8f24..b0e28ecbd97 100644
--- a/app/assets/javascripts/merge_request_widget.js.es6
+++ b/app/assets/javascripts/merge_request_widget.js.es6
@@ -144,6 +144,11 @@
};
MergeRequestWidget.prototype.getCIStatus = function(showNotification) {
+ // Only perform pulling if tab is active
+ if (document.hidden) {
+ return;
+ }
+
var _this;
_this = this;
$('.ci-widget-fetching').show();
@@ -199,6 +204,11 @@
};
MergeRequestWidget.prototype.getCIEnvironmentsStatus = function() {
+ // Only perform pulling if tab is active
+ if (document.hidden) {
+ return;
+ }
+
$.getJSON(this.opts.ci_environments_status_url, (environments) => {
if (this.cancel) return;
this.readyForCIEnvironmentCheck = true;
@@ -212,11 +222,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-stop-env-link', $template).remove();
}
-
+
if (environment.deployed_at && environment.deployed_at_formatted) {
environment.deployed_at = gl.utils.getTimeago().format(environment.deployed_at, 'gl_en') + '.';
} else {
diff --git a/changelogs/unreleased/stop-dos-from-mr-page.yml b/changelogs/unreleased/stop-dos-from-mr-page.yml
new file mode 100644
index 00000000000..ccf12905bde
--- /dev/null
+++ b/changelogs/unreleased/stop-dos-from-mr-page.yml
@@ -0,0 +1,4 @@
+---
+title: Stop DOSing from MR page
+merge_request:
+author: