ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rz...@apache.org
Subject ambari git commit: AMBARI-13443. Do not timeout when user is on wizard (rzang)
Date Fri, 16 Oct 2015 00:43:01 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 d794062b8 -> 119a50fcf


AMBARI-13443. Do not timeout when user is on wizard (rzang)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/119a50fc
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/119a50fc
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/119a50fc

Branch: refs/heads/branch-2.1
Commit: 119a50fcfffbb4344995544323b3f06996a51c88
Parents: d794062
Author: Richard Zang <rzang@apache.org>
Authored: Thu Oct 15 17:34:00 2015 -0700
Committer: Richard Zang <rzang@apache.org>
Committed: Thu Oct 15 17:42:03 2015 -0700

----------------------------------------------------------------------
 ambari-web/app/controllers/main.js                           | 8 +++++++-
 .../main/admin/stack_and_upgrade_controller_test.js          | 4 ++--
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/119a50fc/ambari-web/app/controllers/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main.js b/ambari-web/app/controllers/main.js
index b7b0b4a..fb73770 100644
--- a/ambari-web/app/controllers/main.js
+++ b/ambari-web/app/controllers/main.js
@@ -227,7 +227,7 @@ App.MainController = Em.Controller.extend({
   checkActiveness: function() {
     var scope = App.router.get('mainController');
     //console.error("checkActiveness " + scope.get('lastUserActiveTime') + " : " + Date.now());
-    if (Date.now() - scope.get('lastUserActiveTime') > scope.get('userTimeOut')) {
+    if (Date.now() - scope.get('lastUserActiveTime') > scope.get('userTimeOut') &&
!scope.isOnWizard()) {
       scope.set('isUserActive', false);
       //console.error("LOGOUT!");
       scope.unbindActivityEventMonitors();
@@ -241,6 +241,12 @@ App.MainController = Em.Controller.extend({
     this.bindActivityEventMonitors();
   },
 
+  isOnWizard: function() {
+    var isWizard = window.location.href.indexOf('/step') != -1;
+    var isUpgrade = window.location.href.indexOf('/stack/upgrade') != -1;
+    return isWizard || isUpgrade;
+  },
+
   bindActivityEventMonitors: function() {
     $(window).bind('mousemove', this.keepActive);
     $(window).bind('keypress', this.keepActive);

http://git-wip-us.apache.org/repos/asf/ambari/blob/119a50fc/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
index ce176ea..0124608 100644
--- a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
@@ -311,8 +311,8 @@ describe('App.MainAdminStackAndUpgradeController', function() {
           value: '2.2',
           label: 'HDP-2.2',
           type: 'ROLLING',
-          skipComponentFailures: false,
-          skipSCFailures: false
+          skipComponentFailures: 'false',
+          skipSCFailures: 'false'
         },
         success: "runPreUpgradeCheckSuccess",
         error: "runPreUpgradeCheckError"


Mime
View raw message