Browse Source

AMBARI-8596. Global Notifications should be added to newly created groups at once.(xiwang)

Xi Wang 10 years ago
parent
commit
bca33177dd

+ 2 - 1
ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js

@@ -102,6 +102,7 @@ App.ManageAlertGroupsController = Em.Controller.extend({
       });
     }
     this.set('alertNotifications', alertNotifications);
+    this.set('alertGlobalNotifications', alertNotifications.filterProperty('global'));
   },
 
   onLoadAlertNotificationsError: function () {
@@ -666,7 +667,7 @@ App.ManageAlertGroupsController = Em.Controller.extend({
         var newAlertGroup = App.AlertGroupComplex.create({
           name: this.get('alertGroupName').trim(),
           definitions: [],
-          notifications: []
+          notifications: self.get('alertGlobalNotifications')
         });
         self.get('alertGroups').pushObject(newAlertGroup);
         self.set('selectedAlertGroup', newAlertGroup);

+ 2 - 0
ambari-web/app/styles/common.less

@@ -110,6 +110,8 @@
   border: 1px solid #ebebeb;
   z-index: 1000;
   min-width: 65px;
+  max-height: 150px;
+  overflow: auto;
 }
 .typeahead-box ul{
   list-style-type: none;

+ 1 - 1
ambari-web/app/views/common/editable_list.js

@@ -108,7 +108,7 @@ App.EditableList = Ember.View.extend({
       } else {
         // Load typeahed items based on current input
         var items = self.get('availableItemsToAdd');
-        self.set('typeahead', items.slice(0, 5));
+        self.set('typeahead', items);
         self.set('selectedTypeahed', 0);
       }
     } else {