tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hit...@apache.org
Subject tez git commit: TEZ-2116. Tez UI: dags page filter does not work if more than one filter is specified. (Prakash Ramachandran via hitesh)
Date Wed, 18 Feb 2015 18:11:59 GMT
Repository: tez
Updated Branches:
  refs/heads/branch-0.6 7de84bb4f -> 32632b460


TEZ-2116. Tez UI: dags page filter does not work if more than one filter is specified. (Prakash
Ramachandran via hitesh)

(cherry picked from commit b756bc0d406ac519de87d8c088c954e81c188ae6)


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

Branch: refs/heads/branch-0.6
Commit: 32632b460087904d384c46a25762b755312a156d
Parents: 7de84bb
Author: Hitesh Shah <hitesh@apache.org>
Authored: Wed Feb 18 10:11:04 2015 -0800
Committer: Hitesh Shah <hitesh@apache.org>
Committed: Wed Feb 18 10:11:53 2015 -0800

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../app/scripts/controllers/dags_controller.js  |  4 ++--
 .../app/scripts/mixins/paginated_content.js     | 21 ++++++++++++++++++--
 3 files changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/32632b46/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 4daeb85..d10b528 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -6,6 +6,7 @@ Release 0.6.1: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-2116. Tez UI: dags page filter does not work if more than one filter is specified.
   TEZ-2106. TEZ UI: Display data load time, and add a refresh button for items that can be
refreshed.
   TEZ-2114. Tez UI: task/task attempt status is not available when its running.
   TEZ-2112. Tez UI: fix offset calculation, add home button to breadcrumbs.

http://git-wip-us.apache.org/repos/asf/tez/blob/32632b46/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js
index 880378a..c1aea73 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js
@@ -50,9 +50,9 @@ App.DagsController = Em.ObjectController.extend(App.PaginatedContentMixin,
App.C
   loadData: function() {
     var filters = {
       primary: {
-        user: this.user_filter,
+        dagName: this.dagName_filter,
         applicationId: this.appId_filter,
-        dagName: this.dagName_filter
+        user: this.user_filter
       },
       secondary: {
         status: this.status_filter

http://git-wip-us.apache.org/repos/asf/tez/blob/32632b46/tez-ui/src/main/webapp/app/scripts/mixins/paginated_content.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/mixins/paginated_content.js b/tez-ui/src/main/webapp/app/scripts/mixins/paginated_content.js
index 7b08036..f371f28 100644
--- a/tez-ui/src/main/webapp/app/scripts/mixins/paginated_content.js
+++ b/tez-ui/src/main/webapp/app/scripts/mixins/paginated_content.js
@@ -181,11 +181,28 @@ App.PaginatedContentMixin = Em.Mixin.create({
     };
 
     var f = this._paginationFilters;
-    var primary = f.primary;
+    var primary = f.primary || {};
     var secondary = f.secondary || {};
 
-    primary = this._concatFilters(primary);
+    // TimelineRest API allows only one primaryFilter but any number of
+    // secondary filters. secondary filters are first checked in otherInfo
+    // field and then in primaryFilter field. this is tricky (for ex. when
+    // otherInfo and primaryFilter has same key). so we move all filters
+    // other than first non null primary to secondary.
+    var foundOnePrimaryFilter = false;
+    $.each(primary, function(name, value) {
+      if (!value) {
+        delete primary[name];
+        return true;
+      }
+      if (foundOnePrimaryFilter) {
+        secondary[name] = value;
+        delete primary[name];
+      }
+      foundOnePrimaryFilter = true;
+    });
 
+    primary = this._concatFilters(primary);
     secondary = this._concatFilters(secondary);
 
     if (!Em.empty(primary)) {


Mime
View raw message