You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2015/08/11 11:21:11 UTC

ambari git commit: AMBARI-12714. FE: Adding 100 definitions to the alert group takes to much time (onechiporenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk 8a12fecf1 -> 02eb29b14


AMBARI-12714. FE: Adding 100 definitions to the alert group takes to much time (onechiporenko)


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

Branch: refs/heads/trunk
Commit: 02eb29b1473d79ebbae82b3c9455a1f0e47fabd2
Parents: 8a12fec
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Tue Aug 11 12:16:05 2015 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Tue Aug 11 12:16:05 2015 +0300

----------------------------------------------------------------------
 .../alerts/manage_alert_groups_controller.js    | 39 +++++++++++---------
 ambari-web/package.json                         |  2 +-
 .../manage_alert_groups_controller_test.js      |  3 +-
 3 files changed, 23 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/02eb29b1/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js b/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js
index b2ead3f..2ca2536 100644
--- a/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js
+++ b/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js
@@ -163,13 +163,15 @@ App.ManageAlertGroupsController = Em.Controller.extend({
    * @method loadAlertNotifications
    */
   loadAlertNotifications: function () {
-    this.set('isLoaded', false);
-    this.set('alertGroups', []);
-    this.set('originalAlertGroups', []);
-    this.set('selectedAlertGroup', null);
-    this.set('isRemoveButtonDisabled', true);
-    this.set('isRenameButtonDisabled', true);
-    this.set('isDuplicateButtonDisabled', true);
+    this.setProperties({
+      isLoaded: false,
+      alertGroups: [],
+      originalAlertGroups: [],
+      selectedAlertGroup: null,
+      isRemoveButtonDisabled: true,
+      isRenameButtonDisabled: true,
+      isDuplicateButtonDisabled: true
+    });
     return App.ajax.send({
       name: 'alerts.notifications',
       sender: this,
@@ -244,10 +246,12 @@ App.ManageAlertGroupsController = Em.Controller.extend({
         notifications: targets
       });
     });
-    this.set('alertGroups', alertGroups);
-    this.set('isLoaded', true);
-    this.set('originalAlertGroups', this.copyAlertGroups(this.get('alertGroups')));
-    this.set('selectedAlertGroup', this.get('alertGroups')[0]);
+    this.setProperties({
+      alertGroups: alertGroups,
+      isLoaded: true,
+      originalAlertGroups: this.copyAlertGroups(alertGroups),
+      selectedAlertGroup: this.get('alertGroups')[0]
+    });
   },
 
   /**
@@ -257,9 +261,11 @@ App.ManageAlertGroupsController = Em.Controller.extend({
   buttonObserver: function () {
     var selectedAlertGroup = this.get('selectedAlertGroup');
     var flag = selectedAlertGroup && selectedAlertGroup.get('default');
-    this.set('isRemoveButtonDisabled', flag);
-    this.set('isRenameButtonDisabled', flag);
-    this.set('isDuplicateButtonDisabled', false);
+    this.setProperties({
+      isRemoveButtonDisabled: flag,
+      isRenameButtonDisabled: flag,
+      isDuplicateButtonDisabled: false
+    });
   }.observes('selectedAlertGroup'),
 
   /**
@@ -433,10 +439,7 @@ App.ManageAlertGroupsController = Em.Controller.extend({
   addDefinitionsCallback: function (selectedDefs) {
     var group = this.get('selectedAlertGroup');
     if (selectedDefs) {
-      var alertGroupDefs = group.get('definitions');
-      selectedDefs.forEach(function (defObj) {
-        alertGroupDefs.pushObject(defObj);
-      }, this);
+      group.get('definitions').pushObjects(selectedDefs);
     }
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/02eb29b1/ambari-web/package.json
----------------------------------------------------------------------
diff --git a/ambari-web/package.json b/ambari-web/package.json
index d18b162..10a9314 100644
--- a/ambari-web/package.json
+++ b/ambari-web/package.json
@@ -1,7 +1,7 @@
 {
   "name": "Ambari",
   "description": "Front-end package for the Apache Ambari Project",
-  "version": "2.1.0",
+  "version": "2.2.0",
   "homepage": "http://ambari.apache.org/",
   "repository": {
     "type": "git",

http://git-wip-us.apache.org/repos/asf/ambari/blob/02eb29b1/ambari-web/test/controllers/main/alerts/manage_alert_groups_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/alerts/manage_alert_groups_controller_test.js b/ambari-web/test/controllers/main/alerts/manage_alert_groups_controller_test.js
index 67d3397..dc1fc1f 100644
--- a/ambari-web/test/controllers/main/alerts/manage_alert_groups_controller_test.js
+++ b/ambari-web/test/controllers/main/alerts/manage_alert_groups_controller_test.js
@@ -212,8 +212,7 @@ describe('App.ManageAlertGroupsController', function () {
     };
 
     var result = function (originalDefs, addedDefs) {
-      var result = originalDefs.concat(addedDefs);
-      return result;
+      return originalDefs.concat(addedDefs);
     };
 
     var tests = [