ambari git commit: AMBARI-20261 Unexpected popup after disable kerberos "You are in the process of disabling security on your cluster" (dbuzhor)

2017-03-01 Thread dbuzhor
Repository: ambari
Updated Branches:
  refs/heads/trunk baefbcca0 -> a17e6d440


AMBARI-20261 Unexpected popup after disable kerberos "You are in the process of 
disabling security on your cluster" (dbuzhor)


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

Branch: refs/heads/trunk
Commit: a17e6d4405d8405bc602cdfa9d3a4b2e6da86a58
Parents: baefbcc
Author: Denys Buzhor <bde...@hortonworks.com>
Authored: Wed Mar 1 22:20:49 2017 +0200
Committer: Denys Buzhor <bde...@hortonworks.com>
Committed: Wed Mar 1 23:25:09 2017 +0200

--
 ambari-web/app/routes/main.js | 25 -
 1 file changed, 12 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a17e6d44/ambari-web/app/routes/main.js
--
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index d7d2785..4460442 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -444,21 +444,20 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
   self.proceedOnClose();
   return;
 }
-// warn user if disable kerberos command in progress
-var unkerberizeCommand = 
controller.get('tasks').findProperty('command', 'unkerberize');
-if (unkerberizeCommand && 
!unkerberizeCommand.get('isCompleted')) {
-  // user cannot exit wizard during removing kerberos
-  if (unkerberizeCommand.get('status') == 'IN_PROGRESS') {
-
App.showAlertPopup(Em.I18n.t('admin.kerberos.disable.unkerberize.header'), 
Em.I18n.t('admin.kerberos.disable.unkerberize.message'));
-  } else {
-// otherwise show confirmation window
-App.showConfirmationPopup(function () {
-  self.proceedOnClose();
-}, Em.I18n.t('admin.security.disable.onClose'));
-  }
-} else {
+var unkerberizeCommand = 
controller.get('tasks').findProperty('command', 'unkerberize') || 
Em.Object.create();
+var isUnkerberizeInProgress = unkerberizeCommand.get('status') 
=== 'IN_PROGRESS';
+if (controller.get('tasks').everyProperty('status', 
'COMPLETED')) {
   self.proceedOnClose();
+  return;
 }
+// user cannot exit wizard during removing kerberos
+if (isUnkerberizeInProgress) {
+  
App.showAlertPopup(Em.I18n.t('admin.kerberos.disable.unkerberize.header'), 
Em.I18n.t('admin.kerberos.disable.unkerberize.message'));
+  return;
+}
+App.showConfirmationPopup(function () {
+  self.proceedOnClose();
+}, Em.I18n.t('admin.security.disable.onClose'));
   },
   proceedOnClose: function () {
 var self = this;



ambari git commit: AMBARI-20261 Unexpected popup after disable kerberos "You are in the process of disabling security on your cluster" (dbuzhor)

2017-03-01 Thread dbuzhor
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 6b93dc182 -> b78254880


AMBARI-20261 Unexpected popup after disable kerberos "You are in the process of 
disabling security on your cluster" (dbuzhor)


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

Branch: refs/heads/branch-2.5
Commit: b7825488068ae0e634501053d999b6f8b1e0c091
Parents: 6b93dc1
Author: Denys Buzhor <bde...@hortonworks.com>
Authored: Wed Mar 1 22:17:14 2017 +0200
Committer: Denys Buzhor <bde...@hortonworks.com>
Committed: Wed Mar 1 23:23:49 2017 +0200

--
 ambari-web/app/routes/main.js | 25 -
 1 file changed, 12 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b7825488/ambari-web/app/routes/main.js
--
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 05a86f3..35f637c 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -438,21 +438,20 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
   self.proceedOnClose();
   return;
 }
-// warn user if disable kerberos command in progress
-var unkerberizeCommand = 
controller.get('tasks').findProperty('command', 'unkerberize');
-if (unkerberizeCommand && 
!unkerberizeCommand.get('isCompleted')) {
-  // user cannot exit wizard during removing kerberos
-  if (unkerberizeCommand.get('status') == 'IN_PROGRESS') {
-
App.showAlertPopup(Em.I18n.t('admin.kerberos.disable.unkerberize.header'), 
Em.I18n.t('admin.kerberos.disable.unkerberize.message'));
-  } else {
-// otherwise show confirmation window
-App.showConfirmationPopup(function () {
-  self.proceedOnClose();
-}, Em.I18n.t('admin.security.disable.onClose'));
-  }
-} else {
+var unkerberizeCommand = 
controller.get('tasks').findProperty('command', 'unkerberize') || 
Em.Object.create();
+var isUnkerberizeInProgress = unkerberizeCommand.get('status') 
=== 'IN_PROGRESS';
+if (controller.get('tasks').everyProperty('status', 
'COMPLETED')) {
   self.proceedOnClose();
+  return;
 }
+// user cannot exit wizard during removing kerberos
+if (isUnkerberizeInProgress) {
+  
App.showAlertPopup(Em.I18n.t('admin.kerberos.disable.unkerberize.header'), 
Em.I18n.t('admin.kerberos.disable.unkerberize.message'));
+  return;
+}
+App.showConfirmationPopup(function () {
+  self.proceedOnClose();
+}, Em.I18n.t('admin.security.disable.onClose'));
   },
   proceedOnClose: function () {
 var self = this;



ambari git commit: AMBARI-20229 Entries in columns ‘Current Value’ and ‘Resulting Value’ are same in Upgrade pre-checks screen (dbuzhor)

2017-02-28 Thread dbuzhor
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 2ec423c2a -> b3bb57c6a


AMBARI-20229 Entries in columns ‘Current Value’ and ‘Resulting Value’ 
are same in Upgrade pre-checks screen (dbuzhor)


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

Branch: refs/heads/branch-2.5
Commit: b3bb57c6ae769385709434928e6acc76dce66777
Parents: 2ec423c
Author: Denys Buzhor <bde...@hortonworks.com>
Authored: Tue Feb 28 12:03:13 2017 +0200
Committer: Denys Buzhor <bde...@hortonworks.com>
Committed: Tue Feb 28 15:24:09 2017 +0200

--
 .../main/admin/stack_and_upgrade_controller.js  | 11 ++--
 .../admin/stack_and_upgrade_controller_test.js  | 65 
 2 files changed, 72 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b3bb57c6/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js 
b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
index 44faf4d..952021c 100644
--- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
+++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
@@ -935,10 +935,13 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
 if (configsMergeWarning && Em.get(configsMergeWarning, 
'UpgradeChecks.status') === 'WARNING') {
   var configsMergeCheckData = Em.get(configsMergeWarning, 
'UpgradeChecks.failed_detail');
   if (configsMergeCheckData && Em.isArray(configsMergeCheckData)) {
-configs = configsMergeCheckData.map(function (item) {
+configs = configsMergeCheckData.reduce(function (allConfigs, item) {
   var isDeprecated = Em.isNone(item.new_stack_value),
 willBeRemoved = Em.isNone(item.result_value);
-  return {
+  if (!isDeprecated && !willBeRemoved && Em.compare(item.current, 
item.result_value) === 0) {
+return allConfigs;
+  }
+  return allConfigs.concat({
 type: item.type,
 name: item.property,
 currentValue: item.current,
@@ -946,8 +949,8 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
 isDeprecated: isDeprecated,
 resultingValue: willBeRemoved ? 
Em.I18n.t('popup.clusterCheck.Upgrade.configsMerge.willBeRemoved') : 
item.result_value,
 willBeRemoved: willBeRemoved
-  };
-});
+  });
+}, []);
   }
 }
 return configs;

http://git-wip-us.apache.org/repos/asf/ambari/blob/b3bb57c6/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 9e04214..7944e2a 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
@@ -2138,6 +2138,71 @@ describe('App.MainAdminStackAndUpgradeController', 
function() {
   }
 ],
 title: 'normal case'
+  },
+  {
+configsMergeWarning: {
+  UpgradeChecks: {
+status: 'WARNING',
+failed_detail: [
+  {
+type: 't0',
+property: 'p0',
+current: 'c0',
+new_stack_value: 'n0',
+result_value: 'r0'
+  },
+  {
+type: 't1',
+property: 'p1',
+current: 'c1',
+new_stack_value: 'n1'
+  },
+  {
+type: 't2',
+property: 'p2',
+current: 'c2',
+result_value: 'r2'
+  },
+  {
+type: 't3',
+property: 'p3',
+current: 'c3',
+new_stack_value: 'c2',
+result_value: 'c3'
+  }
+]
+  }
+},
+configs: [
+  {
+type: 't0',
+name: 'p0',
+currentValue: 'c0',
+recommendedValue: 'n0',
+isDeprecated: false,
+resultingValue: 'r0',
+willBeRemoved: false
+  },
+  {
+type: 't1',
+   

ambari git commit: AMBARI-20229 Entries in columns ‘Current Value’ and ‘Resulting Value’ are same in Upgrade pre-checks screen (dbuzhor)

2017-02-28 Thread dbuzhor
Repository: ambari
Updated Branches:
  refs/heads/trunk d5efb7727 -> 910da3d5d


AMBARI-20229 Entries in columns ‘Current Value’ and ‘Resulting Value’ 
are same in Upgrade pre-checks screen (dbuzhor)


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

Branch: refs/heads/trunk
Commit: 910da3d5d1e3ccff19ba2bb18095e8afa9026ce7
Parents: d5efb77
Author: Denys Buzhor <bde...@hortonworks.com>
Authored: Tue Feb 28 12:06:41 2017 +0200
Committer: Denys Buzhor <bde...@hortonworks.com>
Committed: Tue Feb 28 15:23:02 2017 +0200

--
 .../main/admin/stack_and_upgrade_controller.js  | 11 ++--
 .../admin/stack_and_upgrade_controller_test.js  | 65 
 2 files changed, 72 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/910da3d5/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js 
b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
index 35b2ecc..a760f0c 100644
--- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
+++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
@@ -963,10 +963,13 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
 if (configsMergeWarning && Em.get(configsMergeWarning, 
'UpgradeChecks.status') === 'WARNING') {
   var configsMergeCheckData = Em.get(configsMergeWarning, 
'UpgradeChecks.failed_detail');
   if (configsMergeCheckData && Em.isArray(configsMergeCheckData)) {
-configs = configsMergeCheckData.map(function (item) {
+configs = configsMergeCheckData.reduce(function (allConfigs, item) {
   var isDeprecated = Em.isNone(item.new_stack_value),
 willBeRemoved = Em.isNone(item.result_value);
-  return {
+  if (!isDeprecated && !willBeRemoved && Em.compare(item.current, 
item.result_value) === 0) {
+return allConfigs;
+  }
+  return allConfigs.concat({
 type: item.type,
 name: item.property,
 currentValue: item.current,
@@ -974,8 +977,8 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
 isDeprecated: isDeprecated,
 resultingValue: willBeRemoved ? 
Em.I18n.t('popup.clusterCheck.Upgrade.configsMerge.willBeRemoved') : 
item.result_value,
 willBeRemoved: willBeRemoved
-  };
-});
+  });
+}, []);
   }
 }
 return configs;

http://git-wip-us.apache.org/repos/asf/ambari/blob/910da3d5/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 8bb6e0d..1d88913 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
@@ -2114,6 +2114,71 @@ describe('App.MainAdminStackAndUpgradeController', 
function() {
   }
 ],
 title: 'normal case'
+  },
+  {
+configsMergeWarning: {
+  UpgradeChecks: {
+status: 'WARNING',
+failed_detail: [
+  {
+type: 't0',
+property: 'p0',
+current: 'c0',
+new_stack_value: 'n0',
+result_value: 'r0'
+  },
+  {
+type: 't1',
+property: 'p1',
+current: 'c1',
+new_stack_value: 'n1'
+  },
+  {
+type: 't2',
+property: 'p2',
+current: 'c2',
+result_value: 'r2'
+  },
+  {
+type: 't3',
+property: 'p3',
+current: 'c3',
+new_stack_value: 'c2',
+result_value: 'c3'
+  }
+]
+  }
+},
+configs: [
+  {
+type: 't0',
+name: 'p0',
+currentValue: 'c0',
+recommendedValue: 'n0',
+isDeprecated: false,
+resultingValue: 'r0',
+willBeRemoved: false
+  },
+  {
+type: 't1',
+   

ambari git commit: AMBARI-20123 Click feedback/disable toggle is missing for transition buttons in Kerberos Wizard - prone to various failures (dbuzhor)

2017-02-23 Thread dbuzhor
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 6a6e92471 -> 80eb198dc


AMBARI-20123 Click feedback/disable toggle is missing for transition buttons in 
Kerberos Wizard - prone to various failures (dbuzhor)


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

Branch: refs/heads/branch-2.5
Commit: 80eb198dc83adbaf0beb8a2450f79a7477c07d04
Parents: 6a6e924
Author: Denys Buzhor <bde...@hortonworks.com>
Authored: Thu Feb 23 10:50:00 2017 +0200
Committer: Denys Buzhor <bde...@hortonworks.com>
Committed: Thu Feb 23 16:33:49 2017 +0200

--
 .../main/admin/kerberos/step1_controller.js |  2 +-
 .../main/admin/kerberos/step2_controller.js | 10 ++-
 .../main/admin/kerberos/step4_controller.js |  2 +
 .../main/admin/kerberos/step5_controller.js |  4 +
 .../wizard/wizardProgressPageController.js  |  2 +
 ambari-web/app/routes/add_kerberos_routes.js| 50 ++---
 ambari-web/app/styles/common.less   |  8 +-
 .../app/templates/common/button_progress.hbs| 29 
 ambari-web/app/templates/common/progress.hbs|  6 +-
 .../app/templates/main/admin/kerberos/step1.hbs |  2 +-
 .../app/templates/main/admin/kerberos/step2.hbs |  5 +-
 .../app/templates/main/admin/kerberos/step3.hbs |  4 +-
 .../app/templates/main/admin/kerberos/step4.hbs |  5 +-
 .../app/templates/main/admin/kerberos/step5.hbs | 13 +++-
 ambari-web/app/views.js |  2 +
 .../common/buttons/button_progress_view.js  | 77 
 .../app/views/common/buttons/wizard_buttons.js  | 35 +
 .../admin/kerberos/step1_controller_test.js |  6 +-
 .../admin/kerberos/step2_controller_test.js |  2 +-
 19 files changed, 213 insertions(+), 51 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/80eb198d/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
--
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js 
b/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
index 2feeb7f..ca0781d 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
@@ -143,7 +143,7 @@ App.KerberosWizardStep1Controller = Em.Controller.extend({
 }
   },
 
-  next: function () {
+  submit: function () {
 if (!this.get('isSubmitDisabled')) {
   App.router.send('next');
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/80eb198d/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
--
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js 
b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
index 992fd34..258a384 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
@@ -60,16 +60,17 @@ App.KerberosWizardStep2Controller = 
App.WizardStep7Controller.extend(App.KDCCred
* Should Back-button be disabled
* @type {boolean}
*/
-  isBackBtnDisabled: Em.computed.alias('testConnectionInProgress'),
+  isBackBtnDisabled: Em.computed.or('testConnectionInProgress', 
'App.router.nextBtnClickInProgress'),
 
   /**
* Should Next-button be disabled
* @type {boolean}
*/
   isSubmitDisabled: function () {
-if (!this.get('stepConfigs.length') || 
this.get('testConnectionInProgress') || this.get('submitButtonClicked')) return 
true;
+if (!this.get('stepConfigs.length') || this.get('testConnectionInProgress')
+  || this.get('submitButtonClicked') || 
App.get('router.nextBtnClickInProgress')) return true;
 return (!this.get('stepConfigs').filterProperty('showConfig', 
true).everyProperty('errorCount', 0) || this.get("miscModalVisible"));
-  }.property('stepConfigs.@each.errorCount', 'miscModalVisible', 
'submitButtonClicked', 'testConnectionInProgress'),
+  }.property('stepConfigs.@each.errorCount', 'miscModalVisible', 
'submitButtonClicked', 'testConnectionInProgress', 
'App.router.nextBtnClickInProgress'),
 
   hostNames: Em.computed.alias('App.allHostNames'),
 
@@ -170,8 +171,8 @@ App.KerberosWizardStep2Controller = 
App.WizardStep7Controller.extend(App.KDCCred
 
   submit: function () {
 var self = this;
-
 if (this.get('isSubmitDisabled')) return false;
+App.set('router.nextBtnClickInProgress', true);
 this.get('wizardController').deleteKerberosService().always(function () {
   self.configureKerberos();

ambari git commit: AMBARI-20123 Click feedback/disable toggle is missing for transition buttons in Kerberos Wizard - prone to various failures (dbuzhor)

2017-02-23 Thread dbuzhor
Repository: ambari
Updated Branches:
  refs/heads/trunk b68bb74c4 -> 307c8ad26


AMBARI-20123 Click feedback/disable toggle is missing for transition buttons in 
Kerberos Wizard - prone to various failures (dbuzhor)


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

Branch: refs/heads/trunk
Commit: 307c8ad26cdefa08e0dfc9454655c16dc603d1ff
Parents: b68bb74
Author: Denys Buzhor <bde...@hortonworks.com>
Authored: Thu Feb 23 10:52:04 2017 +0200
Committer: Denys Buzhor <bde...@hortonworks.com>
Committed: Thu Feb 23 16:32:16 2017 +0200

--
 .../main/admin/kerberos/step1_controller.js |  2 +-
 .../main/admin/kerberos/step2_controller.js | 10 ++-
 .../main/admin/kerberos/step4_controller.js |  2 +
 .../main/admin/kerberos/step5_controller.js |  4 +
 .../wizard/wizardProgressPageController.js  |  2 +
 ambari-web/app/routes/add_kerberos_routes.js| 50 ++---
 ambari-web/app/styles/common.less   |  6 ++
 .../app/templates/common/button_progress.hbs| 29 
 ambari-web/app/templates/common/progress.hbs|  6 +-
 .../app/templates/main/admin/kerberos/step1.hbs |  2 +-
 .../app/templates/main/admin/kerberos/step2.hbs |  5 +-
 .../app/templates/main/admin/kerberos/step3.hbs |  4 +-
 .../app/templates/main/admin/kerberos/step4.hbs |  5 +-
 .../app/templates/main/admin/kerberos/step5.hbs | 13 +++-
 ambari-web/app/views.js |  2 +
 .../common/buttons/button_progress_view.js  | 77 
 .../app/views/common/buttons/wizard_buttons.js  | 36 +
 .../admin/kerberos/step1_controller_test.js |  6 +-
 .../admin/kerberos/step2_controller_test.js |  2 +-
 19 files changed, 213 insertions(+), 50 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/307c8ad2/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
--
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js 
b/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
index c0decfc..2e41e3d 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
@@ -144,7 +144,7 @@ App.KerberosWizardStep1Controller = Em.Controller.extend({
 }
   },
 
-  next: function () {
+  submit: function () {
 if (!this.get('isSubmitDisabled')) {
   App.router.send('next');
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/307c8ad2/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
--
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js 
b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
index 992fd34..258a384 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
@@ -60,16 +60,17 @@ App.KerberosWizardStep2Controller = 
App.WizardStep7Controller.extend(App.KDCCred
* Should Back-button be disabled
* @type {boolean}
*/
-  isBackBtnDisabled: Em.computed.alias('testConnectionInProgress'),
+  isBackBtnDisabled: Em.computed.or('testConnectionInProgress', 
'App.router.nextBtnClickInProgress'),
 
   /**
* Should Next-button be disabled
* @type {boolean}
*/
   isSubmitDisabled: function () {
-if (!this.get('stepConfigs.length') || 
this.get('testConnectionInProgress') || this.get('submitButtonClicked')) return 
true;
+if (!this.get('stepConfigs.length') || this.get('testConnectionInProgress')
+  || this.get('submitButtonClicked') || 
App.get('router.nextBtnClickInProgress')) return true;
 return (!this.get('stepConfigs').filterProperty('showConfig', 
true).everyProperty('errorCount', 0) || this.get("miscModalVisible"));
-  }.property('stepConfigs.@each.errorCount', 'miscModalVisible', 
'submitButtonClicked', 'testConnectionInProgress'),
+  }.property('stepConfigs.@each.errorCount', 'miscModalVisible', 
'submitButtonClicked', 'testConnectionInProgress', 
'App.router.nextBtnClickInProgress'),
 
   hostNames: Em.computed.alias('App.allHostNames'),
 
@@ -170,8 +171,8 @@ App.KerberosWizardStep2Controller = 
App.WizardStep7Controller.extend(App.KDCCred
 
   submit: function () {
 var self = this;
-
 if (this.get('isSubmitDisabled')) return false;
+App.set('router.nextBtnClickInProgress', true);
 this.get('wizardController').deleteKerberosService().always(function () {
   self.configureKerberos();

ambari git commit: AMBARI-20059 Storm config change results in Consistency check failed (dbuzhor)

2017-02-17 Thread dbuzhor
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 924f9964a -> d0eb7db6f


AMBARI-20059 Storm config change results in Consistency check failed (dbuzhor)


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

Branch: refs/heads/branch-2.5
Commit: d0eb7db6feb2993e3133bcaa633f16111630e116
Parents: 924f996
Author: Denys Buzhor <bde...@hortonworks.com>
Authored: Fri Feb 17 00:43:52 2017 +0200
Committer: Denys Buzhor <bde...@hortonworks.com>
Committed: Fri Feb 17 10:19:35 2017 +0200

--
 .../controllers/main/service/info/configs.js| 35 +--
 .../app/mixins/common/track_request_mixin.js|  5 +++
 .../main/service/info/config_test.js| 45 
 3 files changed, 81 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d0eb7db6/ambari-web/app/controllers/main/service/info/configs.js
--
diff --git a/ambari-web/app/controllers/main/service/info/configs.js 
b/ambari-web/app/controllers/main/service/info/configs.js
index 7f2c9c5..32062e8 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -279,6 +279,36 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
   isInit: true,
 
   /**
+   * Returns dependencies at all levels for service including dependencies for 
its childs, children dependencies
+   * and so on.
+   *
+   * @param  {String} serviceName name of services to get dependencies
+   * @returns {String[]}
+   */
+  getServicesDependencies: function(serviceName) {
+var dependencies = Em.getWithDefault(App.StackService.find(serviceName), 
'dependentServiceNames', []);
+var loop = function(dependentServices, allDependencies) {
+  return dependentServices.reduce(function(all, name) {
+var service = App.StackService.find(name);
+if (!service) {
+  return all;
+}
+var serviceDependencies = service.get('dependentServiceNames');
+if (!serviceDependencies.length) {
+  return all.concat(name);
+}
+var missed = _.intersection(_.difference(serviceDependencies, all), 
serviceDependencies);
+if (missed.length) {
+  return loop(missed, all.concat(missed));
+}
+return all;
+  }, allDependencies || dependentServices);
+};
+
+return loop(dependencies).uniq().without(serviceName).toArray();
+  },
+
+  /**
* On load function
* @method loadStep
*/
@@ -286,10 +316,7 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
 var serviceName = this.get('content.serviceName'), self = this;
 App.router.get('mainController').stopPolling();
 this.clearStep();
-this.set('dependentServiceNames', 
(App.StackService.find(serviceName).get('dependentServiceNames') || 
[]).reduce(function(acc, i) {
-  acc.push(i);
-  return Array.prototype.concat.apply(acc, 
App.StackService.find(i).get('dependentServiceNames').toArray()).without(serviceName).uniq();
-}, []));
+this.set('dependentServiceNames', 
this.getServicesDependencies(serviceName));
 this.trackRequestChain(this.loadConfigTheme(serviceName).always(function 
() {
   if (self.get('preSelectedConfigVersion')) {
 self.loadPreSelectedConfigVersion();

http://git-wip-us.apache.org/repos/asf/ambari/blob/d0eb7db6/ambari-web/app/mixins/common/track_request_mixin.js
--
diff --git a/ambari-web/app/mixins/common/track_request_mixin.js 
b/ambari-web/app/mixins/common/track_request_mixin.js
index 4efcecb..c665253 100644
--- a/ambari-web/app/mixins/common/track_request_mixin.js
+++ b/ambari-web/app/mixins/common/track_request_mixin.js
@@ -22,6 +22,11 @@ App.TrackRequestMixin = Em.Mixin.create({
 
   requestsInProgress: [],
 
+  init: function() {
+this.set('requestsInProgress', []);
+this._super([].slice.call(arguments));
+  },
+
   /**
* register request to view to track his progress
* @param {$.ajax} request

http://git-wip-us.apache.org/repos/asf/ambari/blob/d0eb7db6/ambari-web/test/controllers/main/service/info/config_test.js
--
diff --git a/ambari-web/test/controllers/main/service/info/config_test.js 
b/ambari-web/test/controllers/main/service/info/config_test.js
index 7a70127..09772ff 100644
--- a/ambari-web/test/controllers/main/service/info/config_test.js
+++ b/ambari-web/test/controllers/main/service/info/config_tes

ambari git commit: AMBARI-20059 Storm config change results in Consistency check failed (dbuzhor)

2017-02-17 Thread dbuzhor
Repository: ambari
Updated Branches:
  refs/heads/trunk ce404d640 -> 984b35e9c


AMBARI-20059 Storm config change results in Consistency check failed (dbuzhor)


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

Branch: refs/heads/trunk
Commit: 984b35e9c1f3121f6688dc797e93b710db69d6b5
Parents: ce404d6
Author: Denys Buzhor <bde...@hortonworks.com>
Authored: Fri Feb 17 00:48:26 2017 +0200
Committer: Denys Buzhor <bde...@hortonworks.com>
Committed: Fri Feb 17 10:20:25 2017 +0200

--
 .../controllers/main/service/info/configs.js| 35 +--
 .../app/mixins/common/track_request_mixin.js|  5 +++
 .../main/service/info/config_test.js| 45 
 3 files changed, 81 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/984b35e9/ambari-web/app/controllers/main/service/info/configs.js
--
diff --git a/ambari-web/app/controllers/main/service/info/configs.js 
b/ambari-web/app/controllers/main/service/info/configs.js
index d95a2d2..786c6f9 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -278,6 +278,36 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
   isInit: true,
 
   /**
+   * Returns dependencies at all levels for service including dependencies for 
its childs, children dependencies
+   * and so on.
+   *
+   * @param  {String} serviceName name of services to get dependencies
+   * @returns {String[]}
+   */
+  getServicesDependencies: function(serviceName) {
+var dependencies = Em.getWithDefault(App.StackService.find(serviceName), 
'dependentServiceNames', []);
+var loop = function(dependentServices, allDependencies) {
+  return dependentServices.reduce(function(all, name) {
+var service = App.StackService.find(name);
+if (!service) {
+  return all;
+}
+var serviceDependencies = service.get('dependentServiceNames');
+if (!serviceDependencies.length) {
+  return all.concat(name);
+}
+var missed = _.intersection(_.difference(serviceDependencies, all), 
serviceDependencies);
+if (missed.length) {
+  return loop(missed, all.concat(missed));
+}
+return all;
+  }, allDependencies || dependentServices);
+};
+
+return loop(dependencies).uniq().without(serviceName).toArray();
+  },
+
+  /**
* On load function
* @method loadStep
*/
@@ -285,10 +315,7 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
 var serviceName = this.get('content.serviceName'), self = this;
 App.router.get('mainController').stopPolling();
 this.clearStep();
-this.set('dependentServiceNames', 
(App.StackService.find(serviceName).get('dependentServiceNames') || 
[]).reduce(function(acc, i) {
-  acc.push(i);
-  return Array.prototype.concat.apply(acc, 
App.StackService.find(i).get('dependentServiceNames').toArray()).without(serviceName).uniq();
-}, []));
+this.set('dependentServiceNames', 
this.getServicesDependencies(serviceName));
 this.trackRequestChain(this.loadConfigTheme(serviceName).always(function 
() {
   if (self.get('preSelectedConfigVersion')) {
 self.loadPreSelectedConfigVersion();

http://git-wip-us.apache.org/repos/asf/ambari/blob/984b35e9/ambari-web/app/mixins/common/track_request_mixin.js
--
diff --git a/ambari-web/app/mixins/common/track_request_mixin.js 
b/ambari-web/app/mixins/common/track_request_mixin.js
index 4efcecb..c665253 100644
--- a/ambari-web/app/mixins/common/track_request_mixin.js
+++ b/ambari-web/app/mixins/common/track_request_mixin.js
@@ -22,6 +22,11 @@ App.TrackRequestMixin = Em.Mixin.create({
 
   requestsInProgress: [],
 
+  init: function() {
+this.set('requestsInProgress', []);
+this._super([].slice.call(arguments));
+  },
+
   /**
* register request to view to track his progress
* @param {$.ajax} request

http://git-wip-us.apache.org/repos/asf/ambari/blob/984b35e9/ambari-web/test/controllers/main/service/info/config_test.js
--
diff --git a/ambari-web/test/controllers/main/service/info/config_test.js 
b/ambari-web/test/controllers/main/service/info/config_test.js
index 4cc2ef8..9d925be 100644
--- a/ambari-web/test/controllers/main/service/info/config_test.js
+++ b/ambari-web/test/controllers/main/service/info/config_test.js
@@ -

ambari git commit: AMBARI-20028 Operations do not show up in the operations list without a refresh (dbuzhor)

2017-02-15 Thread dbuzhor
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 dd33b2391 -> d2de31ee1


AMBARI-20028 Operations do not show up in the operations list without a refresh 
(dbuzhor)


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

Branch: refs/heads/branch-2.5
Commit: d2de31ee161d3acd6c228ca9c21ee696fefee09a
Parents: dd33b23
Author: Denys Buzhor <bde...@hortonworks.com>
Authored: Wed Feb 15 19:09:42 2017 +0200
Committer: Denys Buzhor <bde...@hortonworks.com>
Committed: Wed Feb 15 21:05:58 2017 +0200

--
 ambari-web/app/controllers/main/service/info/configs.js  | 2 +-
 ambari-web/app/mixins/common/track_request_mixin.js  | 3 ++-
 ambari-web/app/routes/main.js| 4 
 .../app/views/common/configs/config_category_container_view.js   | 4 +++-
 4 files changed, 10 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d2de31ee/ambari-web/app/controllers/main/service/info/configs.js
--
diff --git a/ambari-web/app/controllers/main/service/info/configs.js 
b/ambari-web/app/controllers/main/service/info/configs.js
index 265a216..7f2c9c5 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -235,7 +235,6 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
*/
   clearStep: function () {
 this.abortRequests();
-App.router.get('mainController').stopPolling();
 App.set('componentToBeAdded', {});
 App.set('componentToBeDeleted', {});
 this.clearLoadInfo();
@@ -285,6 +284,7 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
*/
   loadStep: function () {
 var serviceName = this.get('content.serviceName'), self = this;
+App.router.get('mainController').stopPolling();
 this.clearStep();
 this.set('dependentServiceNames', 
(App.StackService.find(serviceName).get('dependentServiceNames') || 
[]).reduce(function(acc, i) {
   acc.push(i);

http://git-wip-us.apache.org/repos/asf/ambari/blob/d2de31ee/ambari-web/app/mixins/common/track_request_mixin.js
--
diff --git a/ambari-web/app/mixins/common/track_request_mixin.js 
b/ambari-web/app/mixins/common/track_request_mixin.js
index 07eaf6e..4efcecb 100644
--- a/ambari-web/app/mixins/common/track_request_mixin.js
+++ b/ambari-web/app/mixins/common/track_request_mixin.js
@@ -37,7 +37,8 @@ App.TrackRequestMixin = Em.Mixin.create({
   completed: ['resolved', 'rejected'].contains(request.state())
 });
 request.always(function() {
-  Em.setProperties(self.get('requestsInProgress').findProperty('id', 
requestId), {
+  var requestInProgress = 
self.get('requestsInProgress').findProperty('id', requestId) || {};
+  Em.setProperties(requestInProgress, {
 completed: true,
 status: request.state()
   });

http://git-wip-us.apache.org/repos/asf/ambari/blob/d2de31ee/ambari-web/app/routes/main.js
--
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 5ead230..05a86f3 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -248,6 +248,10 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
   
router.get('mainController').isLoading.call(router.get('clusterController'), 
'isConfigsPropertiesLoaded').done(function () {
 
router.get('mainHostDetailsController').connectOutlet('mainHostConfigs');
   });
+},
+exitRoute: function (router, context, callback) {
+  router.get('mainController').startPolling();
+  callback();
 }
   }),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/d2de31ee/ambari-web/app/views/common/configs/config_category_container_view.js
--
diff --git 
a/ambari-web/app/views/common/configs/config_category_container_view.js 
b/ambari-web/app/views/common/configs/config_category_container_view.js
index 7f89030..37fc10f 100644
--- a/ambari-web/app/views/common/configs/config_category_container_view.js
+++ b/ambari-web/app/views/common/configs/config_category_container_view.js
@@ -43,7 +43,9 @@ App.ConfigCategoryContainerView = Em.ContainerView.extend({
   pushViews: function () {
 var self = this;
 var categoriesViews = [];
-this.get('categories').forEach(function (category) {
+var catego

ambari git commit: AMBARI-20028 Operations do not show up in the operations list without a refresh (dbuzhor)

2017-02-15 Thread dbuzhor
Repository: ambari
Updated Branches:
  refs/heads/trunk 2db72cdf6 -> 0952b8ff8


AMBARI-20028 Operations do not show up in the operations list without a refresh 
(dbuzhor)


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

Branch: refs/heads/trunk
Commit: 0952b8ff89d871962da19918c00357e8565625c1
Parents: 2db72cd
Author: Denys Buzhor <bde...@hortonworks.com>
Authored: Wed Feb 15 19:36:59 2017 +0200
Committer: Denys Buzhor <bde...@hortonworks.com>
Committed: Wed Feb 15 23:16:29 2017 +0200

--
 ambari-web/app/controllers/main/service/info/configs.js | 2 +-
 ambari-web/app/mixins/common/track_request_mixin.js | 3 ++-
 ambari-web/app/routes/main.js   | 4 
 3 files changed, 7 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0952b8ff/ambari-web/app/controllers/main/service/info/configs.js
--
diff --git a/ambari-web/app/controllers/main/service/info/configs.js 
b/ambari-web/app/controllers/main/service/info/configs.js
index c49bfae..d95a2d2 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -235,7 +235,6 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
*/
   clearStep: function () {
 this.abortRequests();
-App.router.get('mainController').stopPolling();
 App.set('componentToBeAdded', {});
 App.set('componentToBeDeleted', {});
 this.clearLoadInfo();
@@ -284,6 +283,7 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
*/
   loadStep: function () {
 var serviceName = this.get('content.serviceName'), self = this;
+App.router.get('mainController').stopPolling();
 this.clearStep();
 this.set('dependentServiceNames', 
(App.StackService.find(serviceName).get('dependentServiceNames') || 
[]).reduce(function(acc, i) {
   acc.push(i);

http://git-wip-us.apache.org/repos/asf/ambari/blob/0952b8ff/ambari-web/app/mixins/common/track_request_mixin.js
--
diff --git a/ambari-web/app/mixins/common/track_request_mixin.js 
b/ambari-web/app/mixins/common/track_request_mixin.js
index 07eaf6e..4efcecb 100644
--- a/ambari-web/app/mixins/common/track_request_mixin.js
+++ b/ambari-web/app/mixins/common/track_request_mixin.js
@@ -37,7 +37,8 @@ App.TrackRequestMixin = Em.Mixin.create({
   completed: ['resolved', 'rejected'].contains(request.state())
 });
 request.always(function() {
-  Em.setProperties(self.get('requestsInProgress').findProperty('id', 
requestId), {
+  var requestInProgress = 
self.get('requestsInProgress').findProperty('id', requestId) || {};
+  Em.setProperties(requestInProgress, {
 completed: true,
 status: request.state()
   });

http://git-wip-us.apache.org/repos/asf/ambari/blob/0952b8ff/ambari-web/app/routes/main.js
--
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 9ed2dd1..54f36b2 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -248,6 +248,10 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
   
router.get('mainController').isLoading.call(router.get('clusterController'), 
'isConfigsPropertiesLoaded').done(function () {
 
router.get('mainHostDetailsController').connectOutlet('mainHostConfigs');
   });
+},
+exitRoute: function (router, context, callback) {
+  router.get('mainController').startPolling();
+  callback();
 }
   }),
 



ambari git commit: AMBARI-19939 Service Config pages load very slowly

2017-02-09 Thread dbuzhor
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 d64fd8f1e -> 714e60115


AMBARI-19939 Service Config pages load very slowly


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

Branch: refs/heads/branch-2.5
Commit: 714e60115db46584920e3cb1eae7c84ae31b9f5d
Parents: d64fd8f
Author: Denys Buzhor 
Authored: Thu Feb 9 14:16:32 2017 +0200
Committer: Denys Buzhor 
Committed: Thu Feb 9 19:07:00 2017 +0200

--
 .../controllers/main/service/info/configs.js| 13 ++-
 .../app/mixins/common/configs/configs_loader.js |  2 +-
 .../app/mixins/common/track_request_mixin.js| 36 +++-
 ambari-web/app/routes/main.js   | 15 +++-
 .../main/host/configs_service_test.js   |  2 +
 .../main/service/info/config_test.js| 87 +++-
 6 files changed, 144 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/714e6011/ambari-web/app/controllers/main/service/info/configs.js
--
diff --git a/ambari-web/app/controllers/main/service/info/configs.js 
b/ambari-web/app/controllers/main/service/info/configs.js
index 59dbe1d..265a216 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -235,6 +235,7 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
*/
   clearStep: function () {
 this.abortRequests();
+App.router.get('mainController').stopPolling();
 App.set('componentToBeAdded', {});
 App.set('componentToBeDeleted', {});
 this.clearLoadInfo();
@@ -289,7 +290,7 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
   acc.push(i);
   return Array.prototype.concat.apply(acc, 
App.StackService.find(i).get('dependentServiceNames').toArray()).without(serviceName).uniq();
 }, []));
-this.trackRequest(this.loadConfigTheme(serviceName).always(function () {
+this.trackRequestChain(this.loadConfigTheme(serviceName).always(function 
() {
   if (self.get('preSelectedConfigVersion')) {
 self.loadPreSelectedConfigVersion();
   } else {
@@ -300,6 +301,16 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
   },
 
   /**
+   * Turn on polling when all requests are finished
+   */
+  trackRequestsDidChange: function() {
+var allCompleted = 
this.get('requestsInProgress').everyProperty('completed', true);
+if (this.get('requestsInProgress').length && allCompleted) {
+  App.router.get('mainController').startPolling();
+}
+  }.observes('requestsInProgress.@each.completed'),
+
+  /**
* Generate "finger-print" for current stepConfigs[0]
* Used to determine, if user has some unsaved changes (comparing with 
hash)
* @returns {string|null}

http://git-wip-us.apache.org/repos/asf/ambari/blob/714e6011/ambari-web/app/mixins/common/configs/configs_loader.js
--
diff --git a/ambari-web/app/mixins/common/configs/configs_loader.js 
b/ambari-web/app/mixins/common/configs/configs_loader.js
index c888a3e..458c38f 100644
--- a/ambari-web/app/mixins/common/configs/configs_loader.js
+++ b/ambari-web/app/mixins/common/configs/configs_loader.js
@@ -103,7 +103,7 @@ App.ConfigsLoader = Em.Mixin.create(App.GroupsMappingMixin, 
{
 this.set('versionLoaded', false);
 this.set('selectedVersion', this.get('currentDefaultVersion'));
 this.set('preSelectedConfigVersion', null);
-this.trackRequest(App.ajax.send({
+this.trackRequestChain(App.ajax.send({
   name: 'service.serviceConfigVersions.get.current',
   sender: this,
   data: {

http://git-wip-us.apache.org/repos/asf/ambari/blob/714e6011/ambari-web/app/mixins/common/track_request_mixin.js
--
diff --git a/ambari-web/app/mixins/common/track_request_mixin.js 
b/ambari-web/app/mixins/common/track_request_mixin.js
index 6fcc991..07eaf6e 100644
--- a/ambari-web/app/mixins/common/track_request_mixin.js
+++ b/ambari-web/app/mixins/common/track_request_mixin.js
@@ -28,7 +28,36 @@ App.TrackRequestMixin = Em.Mixin.create({
* @method trackRequest
*/
   trackRequest: function (request) {
-this.get('requestsInProgress').push(request);
+var requestId = this.get('requestsInProgress').length;
+var self = this;
+this.get('requestsInProgress').pushObject({
+  request: request,
+  id: requestId,
+  status: request.state(),
+  completed: 

ambari git commit: AMBARI-19939 Service Config pages load very slowly

2017-02-09 Thread dbuzhor
Repository: ambari
Updated Branches:
  refs/heads/trunk ca09c208e -> dbb356774


AMBARI-19939 Service Config pages load very slowly


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

Branch: refs/heads/trunk
Commit: dbb3567740c9a2f5d48baab390c7f10711380f98
Parents: ca09c20
Author: Denys Buzhor 
Authored: Thu Feb 9 15:55:18 2017 +0200
Committer: Denys Buzhor 
Committed: Thu Feb 9 19:03:05 2017 +0200

--
 .../controllers/main/service/info/configs.js| 13 ++-
 .../app/mixins/common/configs/configs_loader.js |  2 +-
 .../app/mixins/common/track_request_mixin.js| 36 +++-
 ambari-web/app/routes/main.js   | 15 +++-
 .../main/host/configs_service_test.js   |  2 +
 .../test/controllers/main/host/details_test.js  |  1 +
 .../main/service/info/config_test.js| 87 +++-
 .../common/configs/configs_loader_test.js   |  7 +-
 8 files changed, 148 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/dbb35677/ambari-web/app/controllers/main/service/info/configs.js
--
diff --git a/ambari-web/app/controllers/main/service/info/configs.js 
b/ambari-web/app/controllers/main/service/info/configs.js
index 319610c..c49bfae 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -235,6 +235,7 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
*/
   clearStep: function () {
 this.abortRequests();
+App.router.get('mainController').stopPolling();
 App.set('componentToBeAdded', {});
 App.set('componentToBeDeleted', {});
 this.clearLoadInfo();
@@ -288,7 +289,7 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
   acc.push(i);
   return Array.prototype.concat.apply(acc, 
App.StackService.find(i).get('dependentServiceNames').toArray()).without(serviceName).uniq();
 }, []));
-this.trackRequest(this.loadConfigTheme(serviceName).always(function () {
+this.trackRequestChain(this.loadConfigTheme(serviceName).always(function 
() {
   if (self.get('preSelectedConfigVersion')) {
 self.loadPreSelectedConfigVersion();
   } else {
@@ -299,6 +300,16 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
   },
 
   /**
+   * Turn on polling when all requests are finished
+   */
+  trackRequestsDidChange: function() {
+var allCompleted = 
this.get('requestsInProgress').everyProperty('completed', true);
+if (this.get('requestsInProgress').length && allCompleted) {
+  App.router.get('mainController').startPolling();
+}
+  }.observes('requestsInProgress.@each.completed'),
+
+  /**
* Generate "finger-print" for current stepConfigs[0]
* Used to determine, if user has some unsaved changes (comparing with 
hash)
* @returns {string|null}

http://git-wip-us.apache.org/repos/asf/ambari/blob/dbb35677/ambari-web/app/mixins/common/configs/configs_loader.js
--
diff --git a/ambari-web/app/mixins/common/configs/configs_loader.js 
b/ambari-web/app/mixins/common/configs/configs_loader.js
index 666cef8..403b871 100644
--- a/ambari-web/app/mixins/common/configs/configs_loader.js
+++ b/ambari-web/app/mixins/common/configs/configs_loader.js
@@ -107,7 +107,7 @@ App.ConfigsLoader = Em.Mixin.create(App.GroupsMappingMixin, 
{
 this.set('versionLoaded', false);
 this.set('selectedVersion', this.get('currentDefaultVersion'));
 this.set('preSelectedConfigVersion', null);
-this.trackRequest(App.ajax.send({
+this.trackRequestChain(App.ajax.send({
   name: 'service.serviceConfigVersions.get.current',
   sender: this,
   data: {

http://git-wip-us.apache.org/repos/asf/ambari/blob/dbb35677/ambari-web/app/mixins/common/track_request_mixin.js
--
diff --git a/ambari-web/app/mixins/common/track_request_mixin.js 
b/ambari-web/app/mixins/common/track_request_mixin.js
index 6fcc991..07eaf6e 100644
--- a/ambari-web/app/mixins/common/track_request_mixin.js
+++ b/ambari-web/app/mixins/common/track_request_mixin.js
@@ -28,7 +28,36 @@ App.TrackRequestMixin = Em.Mixin.create({
* @method trackRequest
*/
   trackRequest: function (request) {
-this.get('requestsInProgress').push(request);
+var requestId = this.get('requestsInProgress').length;
+var self = this;
+