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 <[email protected]> Authored: Sat Jul 23 00:55:04 2016 +0530 Committer: Sreenath Somarajapuram <[email protected]> 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); });
