From dc991ddffc287263c2b4fd218d43e2f501b181dc Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Tue, 14 Oct 2014 18:34:09 +0200 Subject: Adding feature toggle for auto reload so we can disable it in the functional tests --- service/test/support/integration_helper.py | 1 + web-ui/app/js/features/features.js | 3 +++ web-ui/app/js/mail_list/domain/refresher.js | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/service/test/support/integration_helper.py b/service/test/support/integration_helper.py index 326ec7cd..7b6af2e4 100644 --- a/service/test/support/integration_helper.py +++ b/service/test/support/integration_helper.py @@ -146,6 +146,7 @@ class SoledadTestBase: # setup app PixelatedMail.from_email_address = self.mail_address self.app = pixelated.user_agent.app.test_client() + pixelated.user_agent.DISABLED_FEATURES.append('autoReload') self.account = FakeAccount() self.pixelated_mailboxes = PixelatedMailBoxes(self.account) self.mail_sender = mock() diff --git a/web-ui/app/js/features/features.js b/web-ui/app/js/features/features.js index e008b5fc..1a00658d 100644 --- a/web-ui/app/js/features/features.js +++ b/web-ui/app/js/features/features.js @@ -48,6 +48,9 @@ define([], function() { isEnabled: function (featureName) { return ! _.contains(getDisabledFeatures(), featureName); }, + isAutoRefreshEnabled: function () { + return this.isEnabled('autoRefresh'); + }, isLogoutEnabled: function () { return _.has(getDispatcherFeatures(), 'logout'); }, diff --git a/web-ui/app/js/mail_list/domain/refresher.js b/web-ui/app/js/mail_list/domain/refresher.js index 6f3b1c04..38c9cde5 100644 --- a/web-ui/app/js/mail_list/domain/refresher.js +++ b/web-ui/app/js/mail_list/domain/refresher.js @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with Pixelated. If not, see . */ -define(['flight/lib/component', 'page/events'], function(defineComponent, events) { +define(['flight/lib/component', 'page/events', 'features'], function(defineComponent, events, features) { 'use strict'; return defineComponent(refresher); @@ -34,7 +34,9 @@ define(['flight/lib/component', 'page/events'], function(defineComponent, events }; this.after('initialize', function () { - this.setupRefresher(); + if (features.isAutoRefreshEnabled()) { + this.setupRefresher(); + } }); } } -- cgit v1.2.3