tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject tez git commit: TEZ-3580. Tez UI: Pagination broken on queries page (sree)
Date Tue, 24 Jan 2017 09:14:40 GMT
Repository: tez
Updated Branches:
  refs/heads/master b31cf3351 -> 02f7842c9


TEZ-3580. Tez UI: Pagination broken on queries page (sree)


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

Branch: refs/heads/master
Commit: 02f7842c996ec5890be1c4f88b85d802a37e926e
Parents: b31cf33
Author: Sreenath Somarajapuram <sree@apache.org>
Authored: Tue Jan 24 14:31:25 2017 +0530
Committer: Sreenath Somarajapuram <sree@apache.org>
Committed: Tue Jan 24 14:31:25 2017 +0530

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../src/main/webapp/app/routes/home/queries.js  |  4 ++-
 .../webapp/app/styles/queries-page-search.less  |  2 +-
 .../webapp/tests/unit/routes/home/index-test.js |  4 ++-
 .../tests/unit/routes/home/queries-test.js      | 37 ++++++++++++++++++++
 5 files changed, 45 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/02f7842c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d6c4d49..597df5d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -174,6 +174,7 @@ ALL CHANGES:
   TEZ-3571. Tez UI: Display a Total Timeline View for Hive Queries
   TEZ-2712. Tez UI: Display the vertex description in the tooltip of vertex in DAG view UI
   TEZ-3583. Tez UI: UTs are flaky because of a dependency issue
+  TEZ-3580. Tez UI: Pagination broken on queries page
 
 Release 0.8.5: Unreleased
 

http://git-wip-us.apache.org/repos/asf/tez/blob/02f7842c/tez-ui/src/main/webapp/app/routes/home/queries.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/routes/home/queries.js b/tez-ui/src/main/webapp/app/routes/home/queries.js
index 7528ba7..50d9f54 100644
--- a/tez-ui/src/main/webapp/app/routes/home/queries.js
+++ b/tez-ui/src/main/webapp/app/routes/home/queries.js
@@ -87,7 +87,9 @@ export default ServerSideOpsRoute.extend({
       });
     }
 
-    return this._super(value, query, options);
+    return this._super(value, query, options).then(function (records) {
+      return records.toArray();
+    });
   },
 
   setupController: function (controller, model) {

http://git-wip-us.apache.org/repos/asf/tez/blob/02f7842c/tez-ui/src/main/webapp/app/styles/queries-page-search.less
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/styles/queries-page-search.less b/tez-ui/src/main/webapp/app/styles/queries-page-search.less
index 6c73cc9..a4a38ab 100644
--- a/tez-ui/src/main/webapp/app/styles/queries-page-search.less
+++ b/tez-ui/src/main/webapp/app/styles/queries-page-search.less
@@ -63,7 +63,7 @@
 @media screen and (min-width: 1300px) {
   .queries-page-search{
     float: left;
-    width: 80%;
+    width: 75%;
 
     .form-group {
       margin-bottom: 0px;

http://git-wip-us.apache.org/repos/asf/tez/blob/02f7842c/tez-ui/src/main/webapp/tests/unit/routes/home/index-test.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/tests/unit/routes/home/index-test.js b/tez-ui/src/main/webapp/tests/unit/routes/home/index-test.js
index 0399490..99d7cf6 100644
--- a/tez-ui/src/main/webapp/tests/unit/routes/home/index-test.js
+++ b/tez-ui/src/main/webapp/tests/unit/routes/home/index-test.js
@@ -126,12 +126,14 @@ test('load - query + filter test', function(assert) {
     }
   });
 
-  assert.expect(3 + 3 + 2 + 3 + 2);
+  assert.expect(3 + 3 + 2 + 1 + 3 + 2);
 
   assert.notOk(route.get("controller.moreAvailable"), "moreAvailable shouldn't be set!");
   assert.equal(route.get("fromId"), null, "fromId shouldn't be set");
 
   return route.load(null, query).then(function (records) {
+    assert.ok(Array.isArray(records));
+
     assert.equal(records.get("length"), 2, "Length should be 2!");
     assert.equal(records.get("0.entityID"), testEntityID1);
     assert.equal(records.get("1.entityID"), testEntityID2);

http://git-wip-us.apache.org/repos/asf/tez/blob/02f7842c/tez-ui/src/main/webapp/tests/unit/routes/home/queries-test.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/tests/unit/routes/home/queries-test.js b/tez-ui/src/main/webapp/tests/unit/routes/home/queries-test.js
index d43a76b..2e39928 100644
--- a/tez-ui/src/main/webapp/tests/unit/routes/home/queries-test.js
+++ b/tez-ui/src/main/webapp/tests/unit/routes/home/queries-test.js
@@ -63,6 +63,43 @@ test('loaderQueryParams test', function(assert) {
   assert.equal(Object.keys(route.get("loaderQueryParams")).length, 11 + 1);
 });
 
+test('load - query test', function(assert) {
+  let route = this.subject({
+        controller: Ember.Object.create()
+      }),
+      testEntityID1 = "entity_1",
+      testSubmitter = "sub",
+      query = {
+        limit: 5,
+        submitter: testSubmitter
+      },
+      resultRecords = Ember.A([
+        Ember.Object.create({
+          submitter: testSubmitter,
+          entityID: testEntityID1
+        })
+      ]);
+
+  route.loader = Ember.Object.create({
+    query: function (type, query, options) {
+      assert.equal(type, "hive-query");
+      assert.equal(query.limit, 6);
+      assert.equal(options.reload, true);
+      return Ember.RSVP.resolve(resultRecords);
+    },
+  });
+
+  assert.expect(3 + 1 + 2);
+
+  return route.load(null, query).then(function (records) {
+    assert.ok(Array.isArray(records));
+
+    assert.equal(records.get("length"), 1);
+    assert.equal(records.get("0.entityID"), testEntityID1);
+  });
+
+});
+
 test('actions.willTransition test', function(assert) {
   let route = this.subject({
     controller: Ember.Object.create()


Mime
View raw message