Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 14C64200B4C for ; Fri, 22 Jul 2016 21:23:41 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1358D160A6D; Fri, 22 Jul 2016 19:23:41 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 35AA7160A5A for ; Fri, 22 Jul 2016 21:23:40 +0200 (CEST) Received: (qmail 33550 invoked by uid 500); 22 Jul 2016 19:23:39 -0000 Mailing-List: contact commits-help@tez.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tez.apache.org Delivered-To: mailing list commits@tez.apache.org Received: (qmail 33541 invoked by uid 99); 22 Jul 2016 19:23:38 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jul 2016 19:23:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D4C4CE058E; Fri, 22 Jul 2016 19:23:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sree@apache.org To: commits@tez.apache.org Message-Id: <8888ed64a7d04be2ba1332f4858fc5c2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: tez git commit: TEZ-3370. Tez UI: Display the log link as N/A if the app does not provide a log link (sree) Date: Fri, 22 Jul 2016 19:23:38 +0000 (UTC) archived-at: Fri, 22 Jul 2016 19:23:41 -0000 Repository: tez Updated Branches: refs/heads/master e610b00d3 -> 97fa44fbf TEZ-3370. Tez UI: Display the log link as N/A if the app does not provide a log link (sree) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/97fa44fb Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/97fa44fb Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/97fa44fb Branch: refs/heads/master Commit: 97fa44fbf6f55f7eb8660f3d299c9969d3f236a3 Parents: e610b00 Author: Sreenath Somarajapuram Authored: Sat Jul 23 00:55:04 2016 +0530 Committer: Sreenath Somarajapuram Committed: Sat Jul 23 00:55:04 2016 +0530 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../main/webapp/app/controllers/dag/attempts.js | 18 +++++++------ .../webapp/app/controllers/task/attempts.js | 18 +++++++------ .../webapp/app/controllers/vertex/attempts.js | 18 +++++++------ .../tests/unit/controllers/dag/attempts-test.js | 27 ++++++++++++++++++++ .../unit/controllers/task/attempts-test.js | 27 ++++++++++++++++++++ .../unit/controllers/vertex/attempts-test.js | 27 ++++++++++++++++++++ 7 files changed, 112 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/97fa44fb/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 364ff2c..9cbb2f1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -80,6 +80,7 @@ ALL CHANGES: TEZ-3318. Tez UI: Polling is not restarted after RM recovery TEZ-3329. Tez ATS data is incomplete for a vertex which fails or gets killed before initialization TEZ-3333. Tez UI: Handle cases where Vertex/Task/Task Attempt data is missing + TEZ-3370. Tez UI: Display the log link as N/A if the app does not provide a log link Release 0.8.5: Unreleased http://git-wip-us.apache.org/repos/asf/tez/blob/97fa44fb/tez-ui/src/main/webapp/app/controllers/dag/attempts.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/controllers/dag/attempts.js b/tez-ui/src/main/webapp/app/controllers/dag/attempts.js index 9f9ba15..1c661d1 100644 --- a/tez-ui/src/main/webapp/app/controllers/dag/attempts.js +++ b/tez-ui/src/main/webapp/app/controllers/dag/attempts.js @@ -107,14 +107,16 @@ export default MultiTableController.extend({ target: "_blank" }, getCellContent: function (row) { - return [{ - href: row.get("logURL"), - text: "View" - }, { - href: row.get("logURL"), - text: "Download", - download: true - }]; + if(row.get("logURL")) { + return [{ + href: row.get("logURL"), + text: "View" + }, { + href: row.get("logURL"), + text: "Download", + download: true + }]; + } } }]) }); http://git-wip-us.apache.org/repos/asf/tez/blob/97fa44fb/tez-ui/src/main/webapp/app/controllers/task/attempts.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/controllers/task/attempts.js b/tez-ui/src/main/webapp/app/controllers/task/attempts.js index 6f8257f..140e4b2 100644 --- a/tez-ui/src/main/webapp/app/controllers/task/attempts.js +++ b/tez-ui/src/main/webapp/app/controllers/task/attempts.js @@ -85,14 +85,16 @@ export default MultiTableController.extend(AutoCounterColumn, { target: "_blank" }, getCellContent: function (row) { - return [{ - href: row.get("logURL"), - text: "View" - }, { - href: row.get("logURL"), - text: "Download", - download: true - }]; + if(row.get("logURL")) { + return [{ + href: row.get("logURL"), + text: "View" + }, { + href: row.get("logURL"), + text: "Download", + download: true + }]; + } } }]) }); http://git-wip-us.apache.org/repos/asf/tez/blob/97fa44fb/tez-ui/src/main/webapp/app/controllers/vertex/attempts.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/controllers/vertex/attempts.js b/tez-ui/src/main/webapp/app/controllers/vertex/attempts.js index bdda7f8..7e4d12b 100644 --- a/tez-ui/src/main/webapp/app/controllers/vertex/attempts.js +++ b/tez-ui/src/main/webapp/app/controllers/vertex/attempts.js @@ -97,14 +97,16 @@ export default MultiTableController.extend(AutoCounterColumn, { target: "_blank" }, getCellContent: function (row) { - return [{ - href: row.get("logURL"), - text: "View" - }, { - href: row.get("logURL"), - text: "Download", - download: true - }]; + if(row.get("logURL")) { + return [{ + href: row.get("logURL"), + text: "View" + }, { + href: row.get("logURL"), + text: "Download", + download: true + }]; + } } }]) }); http://git-wip-us.apache.org/repos/asf/tez/blob/97fa44fb/tez-ui/src/main/webapp/tests/unit/controllers/dag/attempts-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/dag/attempts-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/dag/attempts-test.js index f1d3d01..3a90018 100644 --- a/tez-ui/src/main/webapp/tests/unit/controllers/dag/attempts-test.js +++ b/tez-ui/src/main/webapp/tests/unit/controllers/dag/attempts-test.js @@ -38,4 +38,31 @@ test('Basic creation test', function(assert) { assert.ok(controller); assert.ok(controller.breadcrumbs); assert.ok(controller.columns); + + assert.equal(controller.get("columns.length"), 11); +}); + +test('Log column test', function(assert) { + let controller = this.subject({ + send: Ember.K, + beforeSort: {bind: Ember.K}, + initVisibleColumns: Ember.K, + getCounterColumns: function () { + return []; + } + }), + url = "http://abc.com", + logColumnDef = controller.get("columns").findBy('id', 'log'), + content; + + assert.notOk(logColumnDef.getCellContent(Ember.Object.create())); + + content = logColumnDef.getCellContent(Ember.Object.create({ + logURL: url + })); + assert.equal(content[0].href, url); + assert.equal(content[0].text, "View"); + assert.equal(content[1].href, url); + assert.equal(content[1].text, "Download"); + assert.equal(content[1].download, true); }); http://git-wip-us.apache.org/repos/asf/tez/blob/97fa44fb/tez-ui/src/main/webapp/tests/unit/controllers/task/attempts-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/task/attempts-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/task/attempts-test.js index 4db8dac..749a67b 100644 --- a/tez-ui/src/main/webapp/tests/unit/controllers/task/attempts-test.js +++ b/tez-ui/src/main/webapp/tests/unit/controllers/task/attempts-test.js @@ -38,4 +38,31 @@ test('Basic creation test', function(assert) { assert.ok(controller); assert.ok(controller.breadcrumbs); assert.ok(controller.columns); + + assert.equal(controller.get("columns.length"), 9); +}); + +test('Log column test', function(assert) { + let controller = this.subject({ + send: Ember.K, + beforeSort: {bind: Ember.K}, + initVisibleColumns: Ember.K, + getCounterColumns: function () { + return []; + } + }), + url = "http://abc.com", + logColumnDef = controller.get("columns").findBy('id', 'log'), + content; + + assert.notOk(logColumnDef.getCellContent(Ember.Object.create())); + + content = logColumnDef.getCellContent(Ember.Object.create({ + logURL: url + })); + assert.equal(content[0].href, url); + assert.equal(content[0].text, "View"); + assert.equal(content[1].href, url); + assert.equal(content[1].text, "Download"); + assert.equal(content[1].download, true); }); http://git-wip-us.apache.org/repos/asf/tez/blob/97fa44fb/tez-ui/src/main/webapp/tests/unit/controllers/vertex/attempts-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/vertex/attempts-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/vertex/attempts-test.js index 142fa58..e2eae25 100644 --- a/tez-ui/src/main/webapp/tests/unit/controllers/vertex/attempts-test.js +++ b/tez-ui/src/main/webapp/tests/unit/controllers/vertex/attempts-test.js @@ -38,4 +38,31 @@ test('Basic creation test', function(assert) { assert.ok(controller); assert.ok(controller.breadcrumbs); assert.ok(controller.columns); + + assert.equal(controller.get("columns.length"), 10); +}); + +test('Log column test', function(assert) { + let controller = this.subject({ + send: Ember.K, + beforeSort: {bind: Ember.K}, + initVisibleColumns: Ember.K, + getCounterColumns: function () { + return []; + } + }), + url = "http://abc.com", + logColumnDef = controller.get("columns").findBy('id', 'log'), + content; + + assert.notOk(logColumnDef.getCellContent(Ember.Object.create())); + + content = logColumnDef.getCellContent(Ember.Object.create({ + logURL: url + })); + assert.equal(content[0].href, url); + assert.equal(content[0].text, "View"); + assert.equal(content[1].href, url); + assert.equal(content[1].text, "Download"); + assert.equal(content[1].download, true); });