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 2016/02/02 11:31:21 UTC

ambari git commit: AMBARI-14874. Alert Instance filter issues (onechiporenko)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 54d4287b8 -> 7c89909a8


AMBARI-14874. Alert Instance filter issues (onechiporenko)


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

Branch: refs/heads/branch-2.2
Commit: 7c89909a87fb6611ac31f864b75dff87889b5b88
Parents: 54d4287
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Tue Feb 2 12:09:18 2016 +0200
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Tue Feb 2 12:30:08 2016 +0200

----------------------------------------------------------------------
 ambari-web/app/messages.js                                  | 3 ++-
 ambari-web/app/templates/main/alerts/definition_details.hbs | 6 ++++++
 ambari-web/app/views/common/table_view.js                   | 6 ++----
 ambari-web/app/views/main/alerts/definition_details_view.js | 8 ++++++++
 4 files changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7c89909a/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index ac35051..ecd97bd 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -992,7 +992,7 @@ Em.I18n.translations = {
   'alerts.definition.details.serviceHost': 'Service / Host',
   'alerts.definition.details.24-hour': '24-Hour',
   'alerts.definition.details.notification': 'Notification',
-  'alerts.definition.details.noAlerts': 'No alert instances to show',
+  'alerts.definition.details.noAlerts': 'No alert instances to display',
   'alerts.definition.details.configs.thresholdsErrorMsg': 'Critical threshold should be larger than warning threshold',
 
   'alerts.notifications.error.email': 'Must be a valid email address',
@@ -2682,6 +2682,7 @@ Em.I18n.translations = {
   'tableView.filters.clearAllFilters': 'clear filters',
   'tableView.filters.showAll': 'Show All',
   'tableView.filters.filteredConfigVersionInfo': '{0} of {1} versions showing',
+  'tableView.filters.filteredAlertInstancesInfo': '{0} of {1} instances showing',
 
   'rollingrestart.dialog.title': 'Restart {0}s',
   'rollingrestart.dialog.primary': 'Trigger Rolling Restart',

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c89909a/ambari-web/app/templates/main/alerts/definition_details.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/alerts/definition_details.hbs b/ambari-web/app/templates/main/alerts/definition_details.hbs
index a56890c..3b4aedf 100644
--- a/ambari-web/app/templates/main/alerts/definition_details.hbs
+++ b/ambari-web/app/templates/main/alerts/definition_details.hbs
@@ -242,6 +242,12 @@
         </table>
 
         <div class="page-bar">
+          <div class="filtered-info span4">
+            {{#if view.showFilteredContent}}
+              <label>{{view.filteredContentInfo}} - <a {{action clearFilters target="view"}}
+                href="#">{{t tableView.filters.clearAllFilters}}</a></label>
+            {{/if}}
+          </div>
           <div class="items-on-page">
             <label>{{t common.show}}: {{view view.rowsPerPageSelectView selectionBinding="view.displayLength"}}</label>
           </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c89909a/ambari-web/app/views/common/table_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/table_view.js b/ambari-web/app/views/common/table_view.js
index 5423054..f44cc7f 100644
--- a/ambari-web/app/views/common/table_view.js
+++ b/ambari-web/app/views/common/table_view.js
@@ -497,10 +497,8 @@ App.TableView = Em.View.extend(App.UserPref, {
    */
   clearFilters: function() {
     this.set('filterConditions', []);
-    this.get('_childViews').forEach(function(childView) {
-      if (childView['clearFilter']) {
-        childView.clearFilter();
-      }
+    this.get('childViews').forEach(function(childView) {
+      Em.tryInvoke(childView, 'clearFilter');
     });
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c89909a/ambari-web/app/views/main/alerts/definition_details_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/alerts/definition_details_view.js b/ambari-web/app/views/main/alerts/definition_details_view.js
index 3ca2abc..093840c 100644
--- a/ambari-web/app/views/main/alerts/definition_details_view.js
+++ b/ambari-web/app/views/main/alerts/definition_details_view.js
@@ -42,6 +42,14 @@ App.MainAlertDefinitionDetailsView = App.TableView.extend({
 
   colPropAssoc: ['serviceName', 'hostName', 'state'],
 
+  /**
+   * return filtered number of all content number information displayed on the page footer bar
+   * @returns {String}
+   */
+  filteredContentInfo: function () {
+    return Em.I18n.t('tableView.filters.filteredAlertInstancesInfo').format(this.get('filteredCount'), this.get('totalCount'));
+  }.property('filteredCount', 'totalCount'),
+
   content: function () {
     return this.get('controller.alerts');
   }.property('controller.alerts.@each'),