Repository: tez
Updated Branches:
  refs/heads/master 3466f77b9 -> 014d7c4ab


TEZ-3226. Tez UI 2: All DAGs UX improvements. (Sreenath Somarajapuram via 
hitesh)


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

Branch: refs/heads/master
Commit: 8c59eb8cddbea316335c8e49c6bf8287a4127a78
Parents: 3466f77
Author: Hitesh Shah <[email protected]>
Authored: Fri Apr 22 15:30:16 2016 -0700
Committer: Hitesh Shah <[email protected]>
Committed: Fri Apr 22 15:30:16 2016 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 tez-ui2/pom.xml                                 |  1 +
 tez-ui2/src/main/resources/META-INF/LICENSE.txt |  2 +-
 .../webapp/app/components/dags-page-search.js   | 39 ++++++-----
 .../webapp/app/components/dags-pagination-ui.js | 44 ++++++-------
 tez-ui2/src/main/webapp/app/controllers/dags.js |  4 +-
 tez-ui2/src/main/webapp/app/routes/dags.js      | 17 +++--
 .../webapp/app/styles/dags-page-search.less     | 22 ++++++-
 .../templates/components/dags-page-search.hbs   | 69 ++++++++++----------
 .../templates/components/dags-pagination-ui.hbs | 38 ++++-------
 tez-ui2/src/main/webapp/app/templates/dags.hbs  |  8 +--
 tez-ui2/src/main/webapp/package.json            |  2 +-
 .../components/dags-pagination-ui-test.js       | 49 +++++++++++---
 .../webapp/tests/unit/controllers/dags-test.js  |  6 +-
 .../main/webapp/tests/unit/routes/dags-test.js  |  2 +-
 15 files changed, 185 insertions(+), 119 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index eab656b..049f90c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -6,6 +6,7 @@ Release 0.8.4: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-3226. Tez UI 2: All DAGs UX improvements.
   TEZ-3077. TezClient.waitTillReady should support timeout.
   TEZ-3202. Reduce the memory need for jobs with high number of segments
   TEZ-3165. Allow Inputs/Outputs to be initialized serially, control processor 
initialization relative to Inputs/Outputs

http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/tez-ui2/pom.xml
----------------------------------------------------------------------
diff --git a/tez-ui2/pom.xml b/tez-ui2/pom.xml
index 25d6008..8273974 100644
--- a/tez-ui2/pom.xml
+++ b/tez-ui2/pom.xml
@@ -96,6 +96,7 @@
             <exclude>src/main/webapp/package.json</exclude>
             <exclude>src/main/webapp/testem.json</exclude>
             <exclude>src/main/webapp/public/assets/images/*</exclude>
+            <exclude>src/main/webapp/WEB-INF/wro.xml</exclude>
           </excludes>
         </configuration>
       </plugin>

http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/tez-ui2/src/main/resources/META-INF/LICENSE.txt
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/resources/META-INF/LICENSE.txt 
b/tez-ui2/src/main/resources/META-INF/LICENSE.txt
index 604f249..708d33f 100644
--- a/tez-ui2/src/main/resources/META-INF/LICENSE.txt
+++ b/tez-ui2/src/main/resources/META-INF/LICENSE.txt
@@ -231,7 +231,7 @@ The Apache TEZ tez-ui bundles the following files under the 
MIT License:
  - ember-bootstrap v0.5.1 (https://github.com/kaliber5/ember-bootstrap) - 
Copyright 2015 kaliber5 GmbH.
  - more-js v0.8.2 (https://github.com/sreenaths/snippet-ss)
  - snippet-ss v1.11.0 (https://github.com/sreenaths/snippet-ss)
- - em-tgraph v0.0.3 (https://github.com/sreenaths/em-tgraph)
+ - em-tgraph v0.0.4 (https://github.com/sreenaths/em-tgraph)
  - em-table v0.3.12 (https://github.com/sreenaths/em-table)
  - em-helpers v0.5.8 (https://github.com/sreenaths/em-helpers)
  - ember-cli-app-version v1.0.0 
(https://github.com/EmberSherpa/ember-cli-app-version) - Authored by Taras 
Mankovski <[email protected]>

http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/tez-ui2/src/main/webapp/app/components/dags-page-search.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/components/dags-page-search.js 
b/tez-ui2/src/main/webapp/app/components/dags-page-search.js
index f95a901..f1cc71b 100644
--- a/tez-ui2/src/main/webapp/app/components/dags-page-search.js
+++ b/tez-ui2/src/main/webapp/app/components/dags-page-search.js
@@ -21,24 +21,33 @@ import Ember from 'ember';
 export default Ember.Component.extend({
   classNames: ['dags-page-search'],
 
+  dagName: Ember.computed.oneWay("tableDefinition.dagName"),
+  dagID: Ember.computed.oneWay("tableDefinition.dagID"),
+  submitter: Ember.computed.oneWay("tableDefinition.submitter"),
+  status: Ember.computed.oneWay("tableDefinition.status"),
+  appID: Ember.computed.oneWay("tableDefinition.appID"),
+  callerID: Ember.computed.oneWay("tableDefinition.callerID"),
+
+  sendSearch: function () {
+    this.get('parentView').sendAction('search', {
+      dagName: this.get("dagName"),
+      dagID: this.get("dagID"),
+      submitter: this.get("submitter"),
+      status: this.get("status"),
+      appID: this.get("appID"),
+      callerID: this.get("callerID"),
+    });
+  },
+
   actions: {
-    dagNameChanged: function (value) {
-      this.get('targetObject.targetObject').send('searchChanged', 'dagName', 
value);
-    },
-    dagIDChanged: function (value) {
-      this.get('targetObject.targetObject').send('searchChanged', 'dagID', 
value);
-    },
-    submitterChanged: function (value) {
-      this.get('targetObject.targetObject').send('searchChanged', 'submitter', 
value);
-    },
     statusChanged: function (value) {
-      this.get('targetObject.targetObject').send('searchChanged', 'status', 
value);
-    },
-    appIDChanged: function (value) {
-      this.get('targetObject.targetObject').send('searchChanged', 'appID', 
value);
+      this.set("status", value);
     },
-    callerIDChanged: function (value) {
-      this.get('targetObject.targetObject').send('searchChanged', 'callerID', 
value);
+    statusKeyPress: function () {
+      this.sendSearch();
     },
+    search: function () {
+      this.sendSearch();
+    }
   }
 });

http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/tez-ui2/src/main/webapp/app/components/dags-pagination-ui.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/components/dags-pagination-ui.js 
b/tez-ui2/src/main/webapp/app/components/dags-pagination-ui.js
index 624f4d8..8d88b45 100644
--- a/tez-ui2/src/main/webapp/app/components/dags-pagination-ui.js
+++ b/tez-ui2/src/main/webapp/app/components/dags-pagination-ui.js
@@ -29,21 +29,6 @@ export default Ember.Component.extend({
     return this.get('tableDefinition.pageNum') === 1;
   }),
 
-  atLast: Ember.computed('tableDefinition.pageNum', 
'dataProcessor.totalPages', function () {
-    return this.get('tableDefinition.pageNum') === 
this.get('dataProcessor.totalPages');
-  }),
-
-  loadButton: Ember.computed("tableDefinition.moreAvailable",
-      "tableDefinition.loadingMore",
-      "tableDefinition.rowCount", function () {
-    var rowCount = this.get("tableDefinition.rowCount"),
-        moreAvailable = this.get("tableDefinition.moreAvailable");
-    return {
-      title: moreAvailable ? `Load ${rowCount} more record(s)` : "All 
available records loaded",
-      disabled: !moreAvailable || this.get("tableDefinition.loadingMore")
-    };
-  }),
-
   rowCountOptions: Ember.computed('tableDefinition.rowCountOptions', 
'tableDefinition.rowCount', function () {
     var options = this.get('tableDefinition.rowCountOptions'),
         rowCount = this.get('tableDefinition.rowCount');
@@ -56,7 +41,9 @@ export default Ember.Component.extend({
     });
   }),
 
-  _possiblePages: Ember.computed('tableDefinition.pageNum', 
'dataProcessor.totalPages', function () {
+  _possiblePages: Ember.computed('tableDefinition.pageNum',
+      'tableDefinition.moreAvailable',
+      'dataProcessor.totalPages', function () {
     var pageNum = this.get('tableDefinition.pageNum'),
         totalPages = this.get('dataProcessor.totalPages'),
         possiblePages = [],
@@ -64,7 +51,11 @@ export default Ember.Component.extend({
         endPage = totalPages,
         delta = 0;
 
-    if(totalPages > 3) {
+    if(this.get('tableDefinition.moreAvailable')) {
+      totalPages++;
+    }
+
+    if(totalPages > 1) {
       startPage = pageNum - 1;
       endPage = pageNum + 1;
 
@@ -79,10 +70,14 @@ export default Ember.Component.extend({
       endPage += delta;
     }
 
+    startPage = Math.max(startPage, 1);
+    endPage = Math.min(endPage, totalPages);
+
     while(startPage <= endPage) {
       possiblePages.push({
         isCurrent: startPage === pageNum,
-        pageNum: startPage++
+        isLoadPage: startPage === totalPages,
+        pageNum: startPage++,
       });
     }
 
@@ -97,10 +92,15 @@ export default Ember.Component.extend({
       }
     },
     changePage: function (value) {
-      this.get('parentView').send('pageChanged', value);
+      if(value === 1) {
+        this.get('parentView').sendAction('reload');
+      }
+      else if(this.get('dataProcessor.totalPages') < value) {
+        this.get('parentView').sendAction('loadPage', value);
+      }
+      else {
+        this.get('parentView').send('pageChanged', value);
+      }
     },
-    loadMore: function () {
-      this.get('parentView').sendAction('loadMore');
-    }
   }
 });

http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/tez-ui2/src/main/webapp/app/controllers/dags.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/controllers/dags.js 
b/tez-ui2/src/main/webapp/app/controllers/dags.js
index 3109ebd..b35c693 100644
--- a/tez-ui2/src/main/webapp/app/controllers/dags.js
+++ b/tez-ui2/src/main/webapp/app/controllers/dags.js
@@ -155,8 +155,8 @@ export default TableController.extend({
   },
 
   actions: {
-    searchChanged: function (propertyName, value) {
-      this.set(propertyName, value);
+    search: function (properties) {
+      this.setProperties(properties);
     },
     pageChanged: function (pageNum) {
       this.set("pageNum", pageNum);

http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/tez-ui2/src/main/webapp/app/routes/dags.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/routes/dags.js 
b/tez-ui2/src/main/webapp/app/routes/dags.js
index 4a74a0f..33366c8 100644
--- a/tez-ui2/src/main/webapp/app/routes/dags.js
+++ b/tez-ui2/src/main/webapp/app/routes/dags.js
@@ -32,6 +32,8 @@ export default AbstractRoute.extend({
     status: REFRESH,
     appID: REFRESH,
     callerID: REFRESH,
+
+    rowCount: REFRESH
   },
 
   loaderQueryParams: {
@@ -125,10 +127,11 @@ export default AbstractRoute.extend({
     });
 
     this.set("controller.loadingMore", true);
-    this.load(null, query).then(function (data) {
+    return this.load(null, query).then(function (data) {
       if(that.get("controller.loadingMore")) {
         that.set("controller.loadingMore", false);
         that.get("loadedValue").pushObjects(data);
+        return data;
       }
     });
   },
@@ -137,10 +140,16 @@ export default AbstractRoute.extend({
     setLoadTime: function (time) {
       this.set("controller.loadTime", time);
     },
-    loadMore: function () {
-      if(this.get("controller.moreAvailable")) {
+    loadPage: function (page) {
+      var that = this;
+      if(this.get("controller.moreAvailable") && 
!this.get("controller.loadingMore")) {
         this.send("resetTooltip");
-        this.loadNewPage();
+        this.loadNewPage().then(function (data) {
+          if(data) {
+            that.set("controller.pageNum", page);
+          }
+          return data;
+        });
       }
     },
     reload: function () {

http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/tez-ui2/src/main/webapp/app/styles/dags-page-search.less
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/styles/dags-page-search.less 
b/tez-ui2/src/main/webapp/app/styles/dags-page-search.less
index 2081156..d38ce09 100644
--- a/tez-ui2/src/main/webapp/app/styles/dags-page-search.less
+++ b/tez-ui2/src/main/webapp/app/styles/dags-page-search.less
@@ -19,7 +19,25 @@
 .dags-page-search {
   text-align: justify;
 
-  margin-bottom: 5px;
+  position: relative;
+
+  width: 100%;
+  height: 65px;
+
+  .form-group {
+    position: absolute;
+    left: 0px;
+    right: 35px;
+  }
+
+  button {
+    position: absolute;
+    right: 0px;
+    top: 22px;
+    width: 30px;
+    height: 30px;
+    padding: 4px;
+  }
 
   .search-element {
     display: inline-block;
@@ -52,7 +70,7 @@
 @media screen and (min-width: 1300px) {
   .dags-page-search{
     float: left;
-    width: 60%;
+    width: 70%;
 
     .form-group {
       margin-bottom: 0px;

http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/tez-ui2/src/main/webapp/app/templates/components/dags-page-search.hbs
----------------------------------------------------------------------
diff --git 
a/tez-ui2/src/main/webapp/app/templates/components/dags-page-search.hbs 
b/tez-ui2/src/main/webapp/app/templates/components/dags-page-search.hbs
index 94015dc..60a0958 100644
--- a/tez-ui2/src/main/webapp/app/templates/components/dags-page-search.hbs
+++ b/tez-ui2/src/main/webapp/app/templates/components/dags-page-search.hbs
@@ -19,34 +19,34 @@
 <div class="form-group">
   <div class="search-element dag-name">
     <label for="pwd">DAG Name:</label>
-    <input
-        type="text"
-        class="form-control input-sm"
-        placeholder="Search..."
-        value={{tableDefinition.dagName}}
-        onchange={{action "dagNameChanged" value="target.value"}}>
+    {{input value=dagName
+      type="text"
+      class="form-control input-sm"
+      placeholder="Search..."
+      enter="search"
+    }}
   </div><div class="search-element">
     <label for="pwd">ID:</label>
-    <input
-        type="text"
-        class="form-control input-sm"
-        placeholder="Search..."
-        value={{tableDefinition.dagID}}
-        onchange={{action "dagIDChanged" value="target.value"}}>
+    {{input value=dagID
+      type="text"
+      class="form-control input-sm"
+      placeholder="Search..."
+      enter="search"
+    }}
   </div><div class="search-element">
     <label for="pwd">Submitter:</label>
-    <input
-        type="text"
-        class="form-control input-sm"
-        placeholder="Search..."
-        value={{tableDefinition.submitter}}
-        onchange={{action "submitterChanged" value="target.value"}}>
+    {{input value=submitter
+      type="text"
+      class="form-control input-sm"
+      placeholder="Search..."
+      enter="search"
+    }}
   </div><div class="search-element">
     <label for="pwd">Status:</label>
-    <select
+    <select value={{status}}
         class="form-control input-sm"
-        value={{tableDefinition.status}}
-        onchange={{action "statusChanged" value="target.value"}}>
+        onchange={{action "statusChanged" value="target.value"}}
+        {{action "statusKeyPress" on="keyPress"}}>
       <option value="">All</option>
       <option value="SUBMITTED">Submitted</option>
       <option value="RUNNING">Running</option>
@@ -56,19 +56,22 @@
     </select>
   </div><div class="search-element">
     <label for="pwd">Application ID:</label>
-    <input
-        type="text"
-        class="form-control input-sm"
-        placeholder="Search..."
-        value={{tableDefinition.appID}}
-        onchange={{action "appIDChanged" value="target.value"}}>
+    {{input value=appID
+      type="text"
+      class="form-control input-sm"
+      placeholder="Search..."
+      enter="search"
+    }}
   </div><div class="search-element">
     <label for="pwd">Caller ID:</label>
-    <input
-        type="text"
-        class="form-control input-sm"
-        placeholder="Search..."
-        value={{tableDefinition.callerID}}
-        onchange={{action "callerIDChanged" value="target.value"}}>
+    {{input value=callerID
+      type="text"
+      class="form-control input-sm"
+      placeholder="Search..."
+      enter="search"
+    }}
   </div>
 </div>
+<button type="button" class="btn btn-success" {{action 'search'}}>
+  <i class="fa fa-search" aria-hidden="true"></i>
+</button>

http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/tez-ui2/src/main/webapp/app/templates/components/dags-pagination-ui.hbs
----------------------------------------------------------------------
diff --git 
a/tez-ui2/src/main/webapp/app/templates/components/dags-pagination-ui.hbs 
b/tez-ui2/src/main/webapp/app/templates/components/dags-pagination-ui.hbs
index f0fddc1..d4ebe4f 100644
--- a/tez-ui2/src/main/webapp/app/templates/components/dags-pagination-ui.hbs
+++ b/tez-ui2/src/main/webapp/app/templates/components/dags-pagination-ui.hbs
@@ -18,37 +18,27 @@
 
 <ul class="page-list">
   <li class="{{unless atFirst 'clickable'}}" {{action 'changePage' 1}}>
-    First
+    {{#if dataProcessor.processedRows.length}}
+      First
+    {{else}}
+      No Records!
+    {{/if}}
   </li>
   {{#each _possiblePages as |page|}}
     <li class="{{if page.isCurrent 'is-current' 'clickable'}}" {{action 
'changePage' page.pageNum}}>
-      {{page.pageNum}}
+      {{#if page.isLoadPage}}
+        {{#if tableDefinition.loadingMore}}
+          <i class="fa fa-spinner fa-spin" aria-hidden="true"></i>
+        {{else}}
+          {{page.pageNum}}
+        {{/if}}
+      {{else}}
+        {{page.pageNum}}
+      {{/if}}
     </li>
   {{/each}}
-  <li title="{{dataProcessor.totalPages}} pages loaded{{if 
tableDefinition.moreAvailable ', more are available'}}"
-      class="{{unless atLast 'clickable'}}" {{action 'changePage' 
dataProcessor.totalPages}}>
-    {{#if tableDefinition.moreAvailable}}
-      {{dataProcessor.totalPages}} ...
-    {{else}}
-      Last - {{dataProcessor.totalPages}}
-    {{/if}}
-  </li>
 </ul>
 
-<button type="button" title={{loadButton.title}}
-    class="btn {{if loadButton.disabled 'disabled'}} {{if 
tableDefinition.moreAvailable 'btn-success' 'btn-default'}}"
-    {{action "loadMore" }}>
-  {{#if tableDefinition.moreAvailable}}
-    {{#if tableDefinition.loadingMore}}
-      <i class="fa fa-spinner fa-spin"></i>
-    {{else}}
-      Load
-    {{/if}}
-  {{else}}
-    All loaded!
-  {{/if}}
-</button>
-
 <div class='row-select'>
   <select title="Select rows to display" class="form-control" 
onchange={{action "rowSelected" value="target.value"}}>
     {{#each rowCountOptions as |option|}}

http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/tez-ui2/src/main/webapp/app/templates/dags.hbs
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/app/templates/dags.hbs 
b/tez-ui2/src/main/webapp/app/templates/dags.hbs
index 6e04caf..d2e35de 100644
--- a/tez-ui2/src/main/webapp/app/templates/dags.hbs
+++ b/tez-ui2/src/main/webapp/app/templates/dags.hbs
@@ -31,11 +31,11 @@
     definition=definition
     enableSort=false
 
-    searchAction="searchChanged"
-    sortAction="sortChanged"
     rowAction="rowCountChanged"
-    pageAction="pageChanged"
-    loadMore="loadMore"
+
+    search="search"
+    loadPage="loadPage"
+    reload="reload"
   }}
 {{else}}
   {{partial "loading"}}

http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/tez-ui2/src/main/webapp/package.json
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/package.json 
b/tez-ui2/src/main/webapp/package.json
index 6282e89..018c088 100644
--- a/tez-ui2/src/main/webapp/package.json
+++ b/tez-ui2/src/main/webapp/package.json
@@ -58,6 +58,6 @@
   "dependencies": {
     "em-helpers": "0.5.8",
     "em-table": "0.3.12",
-    "em-tgraph": "0.0.3"
+    "em-tgraph": "0.0.4"
   }
 }

http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/tez-ui2/src/main/webapp/tests/integration/components/dags-pagination-ui-test.js
----------------------------------------------------------------------
diff --git 
a/tez-ui2/src/main/webapp/tests/integration/components/dags-pagination-ui-test.js
 
b/tez-ui2/src/main/webapp/tests/integration/components/dags-pagination-ui-test.js
index 8c75343..e38a7be 100644
--- 
a/tez-ui2/src/main/webapp/tests/integration/components/dags-pagination-ui-test.js
+++ 
b/tez-ui2/src/main/webapp/tests/integration/components/dags-pagination-ui-test.js
@@ -35,9 +35,7 @@ test('Basic creation test', function(assert) {
   assert.equal(this.$('select').length, 1);
 
   assert.equal(this.$('.page-list').length, 1);
-  assert.equal(this.$('li').length, 2);
-
-  assert.equal(this.$('.btn').length, 1);
+  assert.equal(this.$('li').length, 1);
 
   // Template block usage:" + EOL +
   this.render(hbs`
@@ -61,16 +59,19 @@ test('Page list test', function(assert) {
   });
   this.set("processor", {
     totalPages: 10,
+    processedRows: {
+      length: 10
+    }
   });
 
   this.render(hbs`{{dags-pagination-ui tableDefinition=tableDefinition 
dataProcessor=processor}}`);
 
   return wait().then(() => {
-    assert.equal(this.$('li').length, 5);
+    assert.equal(this.$('li').length, 4);
+    assert.equal(this.$('li').eq(0).text().trim(), "First");
     assert.equal(this.$('li').eq(1).text().trim(), "4");
     assert.equal(this.$('li').eq(2).text().trim(), "5");
     assert.equal(this.$('li').eq(3).text().trim(), "6");
-    assert.equal(this.$('li').eq(4).text().trim(), "10 ...");
   });
 });
 
@@ -85,13 +86,45 @@ test('Page list - moreAvailable false test', 
function(assert) {
     rowCountOptions: []
   });
   this.set("processor", {
-    totalPages: 10,
+    totalPages: 5,
+    processedRows: {
+      length: 10
+    }
   });
 
   this.render(hbs`{{dags-pagination-ui tableDefinition=tableDefinition 
dataProcessor=processor}}`);
 
   return wait().then(() => {
-    assert.equal(this.$('li').length, 5);
-    assert.equal(this.$('li').eq(4).text().trim(), "Last - 10");
+    assert.equal(this.$('li').length, 4);
+    assert.equal(this.$('li').eq(1).text().trim(), "3");
+    assert.equal(this.$('li').eq(2).text().trim(), "4");
+    assert.equal(this.$('li').eq(3).text().trim(), "5");
+  });
+});
+
+test('Page list - moreAvailable true test', function(assert) {
+  this.set("tableDefinition", {
+    pageNum: 5,
+    rowCount: 5,
+
+    loadingMore: false,
+    moreAvailable: true,
+
+    rowCountOptions: []
+  });
+  this.set("processor", {
+    totalPages: 5,
+    processedRows: {
+      length: 10
+    }
+  });
+
+  this.render(hbs`{{dags-pagination-ui tableDefinition=tableDefinition 
dataProcessor=processor}}`);
+
+  return wait().then(() => {
+    assert.equal(this.$('li').length, 4);
+    assert.equal(this.$('li').eq(1).text().trim(), "4");
+    assert.equal(this.$('li').eq(2).text().trim(), "5");
+    assert.equal(this.$('li').eq(3).text().trim(), "6");
   });
 });

http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/tez-ui2/src/main/webapp/tests/unit/controllers/dags-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/dags-test.js 
b/tez-ui2/src/main/webapp/tests/unit/controllers/dags-test.js
index 506af5c..f244305 100644
--- a/tez-ui2/src/main/webapp/tests/unit/controllers/dags-test.js
+++ b/tez-ui2/src/main/webapp/tests/unit/controllers/dags-test.js
@@ -26,7 +26,7 @@ moduleFor('controller:dags', 'Unit | Controller | dags', {
 });
 
 test('Basic creation test', function(assert) {
-  assert.expect(2 + 3 + 1 + 4);
+  assert.expect(2 + 3 + 1 + 3 + 1 + 1);
 
   let controller = this.subject({
     initVisibleColumns: Ember.K,
@@ -46,5 +46,7 @@ test('Basic creation test', function(assert) {
   assert.ok(controller.queryParams);
   assert.ok(controller.headerComponentNames);
   assert.ok(controller.definition);
-  assert.ok(controller.actions.searchChanged);
+
+  assert.ok(controller.actions.search);
+  assert.ok(controller.actions.pageChanged);
 });

http://git-wip-us.apache.org/repos/asf/tez/blob/8c59eb8c/tez-ui2/src/main/webapp/tests/unit/routes/dags-test.js
----------------------------------------------------------------------
diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/dags-test.js 
b/tez-ui2/src/main/webapp/tests/unit/routes/dags-test.js
index d6e358c..dfa8223 100644
--- a/tez-ui2/src/main/webapp/tests/unit/routes/dags-test.js
+++ b/tez-ui2/src/main/webapp/tests/unit/routes/dags-test.js
@@ -40,7 +40,7 @@ test('Basic creation test', function(assert) {
   assert.ok(route.loadNewPage);
 
   assert.ok(route.actions.setLoadTime);
-  assert.ok(route.actions.loadMore);
+  assert.ok(route.actions.loadPage);
   assert.ok(route.actions.reload);
 
   assert.ok(route.actions.willTransition);

Reply via email to