You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rz...@apache.org on 2015/10/16 02:38:31 UTC

ambari git commit: AMBARI-13443. Do not timeout when user is on wizard (rzang)

Repository: ambari
Updated Branches:
  refs/heads/trunk d834d3a37 -> 082db1cc2


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/082db1cc
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/082db1cc
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/082db1cc

Branch: refs/heads/trunk
Commit: 082db1cc29c106f1a817683485143b39f39ca8f4
Parents: d834d3a
Author: Richard Zang <rz...@apache.org>
Authored: Thu Oct 15 17:34:00 2015 -0700
Committer: Richard Zang <rz...@apache.org>
Committed: Thu Oct 15 17:37:26 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/082db1cc/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/082db1cc/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"