Selaa lähdekoodia

Merge remote-tracking branch 'origin/trunk' into trunk

aBabiichuk 11 vuotta sitten
vanhempi
commit
d7dd184c36

+ 14 - 6
ambari-web/app/views/common/filter_view.js

@@ -89,6 +89,12 @@ var wrapperView = Ember.View.extend({
    */
   emptyValue: '',
 
+  /**
+   * empty value that actually applied to filtering on server,
+   * used with Select filter where displayed and actual filter value are different
+   */
+  appliedEmptyValue: "",
+
   /**
    * reset value to empty string if emptyValue selected
    */
@@ -202,12 +208,14 @@ var wrapperView = Ember.View.extend({
       // value assigned to hidden option
       hiddenValue = values[Number(currentValueIndex == 0)];
     }, this);
-    // our select
-    var $select = $(this.get('element')).find(this.get('classInlineAttr'));
-    // now hide option with current value
-    $select.find('option[value="{0}"]'.format(this.get('value'))).css('display', 'none');
-    // and show option that was hidden
-    $select.find('option[value="{0}"'.format(hiddenValue)).css('display', 'block');
+    if (hiddenValue) {
+      // our select
+      var $select = $(this.get('element')).find(this.get('classInlineAttr'));
+      // now hide option with current value
+      $select.find('option[value="{0}"]'.format(this.get('value'))).css('display', 'none');
+      // and show option that was hidden
+      $select.find('option[value="{0}"'.format(hiddenValue)).css('display', 'block');
+    }
   }
 });
 

+ 1 - 0
ambari-web/app/views/common/table_view.js

@@ -99,6 +99,7 @@ App.TableView = Em.View.extend(App.UserPref, {
         if (view) {
           if (view.get('emptyValue')) {
             view.set('value', view.get('emptyValue'));
+            self.saveFilterConditions(condition.iColumn, view.get('appliedEmptyValue'), condition.type, false);
           } else {
             view.set('value', condition.value);
           }

+ 1 - 0
ambari-web/app/views/main/dashboard/config_history_view.js

@@ -155,6 +155,7 @@ App.MainConfigHistoryView = App.TableView.extend({
         displayAs: 'Custom'
       }
     ],
+    appliedEmptyValue: ["", ""],
     fieldType: 'filter-input-width,modified-filter',
     content: ['Any', 'Past 1 hour',  'Past 1 Day', 'Past 2 Days', 'Past 7 Days', 'Past 14 Days', 'Past 30 Days', 'Custom', 'Custom2'],
     valueBinding: "controller.modifiedFilter.optionValue",

+ 6 - 0
ambari-web/app/views/main/dashboard/widgets.js

@@ -383,6 +383,12 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, {
         toDelete = self.removeWidget(toDelete, item);
       }, this);
     }
+    else {
+      var graphs = ['11', '12', '13', '14'];
+      graphs.forEach ( function (item) {
+        toDelete = self.removeWidget(toDelete, item);
+      }, this);
+    }
     if (this.get('mapreduce_model') != null) {
       var map = ['6', '7', '8', '9', '10', '16', '18'];
       var flag = self.containsWidget(toDelete, map[0]);