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-3428. Tez UI: First Tab not needed for few entries in DAG listings (sree)
Date Thu, 13 Oct 2016 08:08:30 GMT
Repository: tez
Updated Branches:
  refs/heads/master c9b09cbf6 -> b4be3619a


TEZ-3428. Tez UI: First Tab not needed for few entries in DAG listings (sree)


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

Branch: refs/heads/master
Commit: b4be3619a5d0de563d44bf406c13f947075f2941
Parents: c9b09cb
Author: Sreenath Somarajapuram <sree@apache.org>
Authored: Thu Oct 13 13:38:05 2016 +0530
Committer: Sreenath Somarajapuram <sree@apache.org>
Committed: Thu Oct 13 13:38:05 2016 +0530

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../webapp/app/components/dags-pagination-ui.js |  4 +--
 .../templates/components/dags-pagination-ui.hbs | 10 +++----
 tez-ui/src/main/webapp/package.json             |  2 +-
 .../components/dags-pagination-ui-test.js       | 30 +++++++++++++++++++-
 5 files changed, 37 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/b4be3619/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 0f9e43c..79b0e38 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -116,6 +116,7 @@ ALL CHANGES:
   TEZ-3370. Tez UI: Display the log link as N/A if the app does not provide a log link
   TEZ-3398. Tez UI: Bread crumb link to Application from Application details dag/configuration
tab is broken
   TEZ-3433. Tez UI: Searching using wrong ID causes error in all DAGs page
+  TEZ-3428. Tez UI: First Tab not needed for few entries in DAG listings
 
 Release 0.8.5: Unreleased
 

http://git-wip-us.apache.org/repos/asf/tez/blob/b4be3619/tez-ui/src/main/webapp/app/components/dags-pagination-ui.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/components/dags-pagination-ui.js b/tez-ui/src/main/webapp/app/components/dags-pagination-ui.js
index 8d88b45..4983ea2 100644
--- a/tez-ui/src/main/webapp/app/components/dags-pagination-ui.js
+++ b/tez-ui/src/main/webapp/app/components/dags-pagination-ui.js
@@ -25,8 +25,8 @@ export default Ember.Component.extend({
   classNames: ['pagination-ui'],
   isVisible: Ember.computed.alias('tableDefinition.enablePagination'),
 
-  atFirst: Ember.computed('tableDefinition.pageNum', function () {
-    return this.get('tableDefinition.pageNum') === 1;
+  showFirst: Ember.computed('_possiblePages', function () {
+    return this.get("dataProcessor.totalPages") && this.get('_possiblePages.0.pageNum')
!== 1;
   }),
 
   rowCountOptions: Ember.computed('tableDefinition.rowCountOptions', 'tableDefinition.rowCount',
function () {

http://git-wip-us.apache.org/repos/asf/tez/blob/b4be3619/tez-ui/src/main/webapp/app/templates/components/dags-pagination-ui.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/components/dags-pagination-ui.hbs b/tez-ui/src/main/webapp/app/templates/components/dags-pagination-ui.hbs
index d4ebe4f..6f8730c 100644
--- a/tez-ui/src/main/webapp/app/templates/components/dags-pagination-ui.hbs
+++ b/tez-ui/src/main/webapp/app/templates/components/dags-pagination-ui.hbs
@@ -17,13 +17,11 @@
 }}
 
 <ul class="page-list">
-  <li class="{{unless atFirst 'clickable'}}" {{action 'changePage' 1}}>
-    {{#if dataProcessor.processedRows.length}}
+  {{#if showFirst}}
+    <li title="Go to first page" class="clickable" {{action 'changePage' 1}}>
       First
-    {{else}}
-      No Records!
-    {{/if}}
-  </li>
+    </li>
+  {{/if}}
   {{#each _possiblePages as |page|}}
     <li class="{{if page.isCurrent 'is-current' 'clickable'}}" {{action 'changePage' page.pageNum}}>
       {{#if page.isLoadPage}}

http://git-wip-us.apache.org/repos/asf/tez/blob/b4be3619/tez-ui/src/main/webapp/package.json
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/package.json b/tez-ui/src/main/webapp/package.json
index 785812b..629c2af 100644
--- a/tez-ui/src/main/webapp/package.json
+++ b/tez-ui/src/main/webapp/package.json
@@ -58,7 +58,7 @@
   },
   "dependencies": {
     "em-helpers": "0.5.13",
-    "em-table": "0.3.16",
+    "em-table": "0.3.17",
     "em-tgraph": "0.0.5"
   }
 }

http://git-wip-us.apache.org/repos/asf/tez/blob/b4be3619/tez-ui/src/main/webapp/tests/integration/components/dags-pagination-ui-test.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/tests/integration/components/dags-pagination-ui-test.js
b/tez-ui/src/main/webapp/tests/integration/components/dags-pagination-ui-test.js
index e38a7be..90c040f 100644
--- a/tez-ui/src/main/webapp/tests/integration/components/dags-pagination-ui-test.js
+++ b/tez-ui/src/main/webapp/tests/integration/components/dags-pagination-ui-test.js
@@ -21,6 +21,8 @@ import hbs from 'htmlbars-inline-precompile';
 
 import wait from 'ember-test-helpers/wait';
 
+import Ember from 'ember';
+
 moduleForComponent('dags-pagination-ui', 'Integration | Component | dags pagination ui',
{
   integration: true
 });
@@ -35,7 +37,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, 1);
+  assert.equal(this.$('li').length, 0);
 
   // Template block usage:" + EOL +
   this.render(hbs`
@@ -128,3 +130,29 @@ test('Page list - moreAvailable true test', function(assert) {
     assert.equal(this.$('li').eq(3).text().trim(), "6");
   });
 });
+
+test('No data test', function(assert) {
+  var customRowCount = 2,
+      definition = {
+        rowCount: customRowCount,
+        loadingMore: false,
+        moreAvailable: true,
+
+        rowCountOptions: []
+      },
+      processor;
+
+  Ember.run(function () {
+    processor = {
+      tableDefinition: definition,
+      rows: Ember.A()
+    };
+  });
+
+  this.set('definition', definition);
+  this.set('processor', processor);
+  this.render(hbs`{{dags-pagination-ui tableDefinition=definition dataProcessor=processor}}`);
+
+  var paginationItems = this.$('li');
+  assert.equal(paginationItems.length, 0);
+});
\ No newline at end of file


Mime
View raw message