TEZ-3615. Tez UI: Table changes (sree)
Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/e1b0b281 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/e1b0b281 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/e1b0b281 Branch: refs/heads/TEZ-1190 Commit: e1b0b28128ff7ec99ddb46e955fa3b4b0583c068 Parents: 16b93de Author: Sreenath Somarajapuram <[email protected]> Authored: Thu Feb 9 17:12:48 2017 +0530 Committer: Sreenath Somarajapuram <[email protected]> Committed: Thu Feb 9 17:12:48 2017 +0530 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../main/webapp/app/controllers/home/queries.js | 20 +++++----- tez-ui/src/main/webapp/app/controllers/table.js | 4 +- tez-ui/src/main/webapp/package.json | 2 +- .../tests/unit/controllers/home/queries-test.js | 4 +- .../webapp/tests/unit/controllers/table-test.js | 39 ++++++++++++++++++++ 6 files changed, 55 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/e1b0b281/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 215cb08..6991f05 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -193,6 +193,7 @@ ALL CHANGES: TEZ-3594. Tez UI: Graphical view tooltip issues TEZ-3598. Tez UI: Text formatting changes TEZ-3602. Tez UI: Query Name field is not required + TEZ-3615. Tez UI: Table changes Release 0.8.5: Unreleased http://git-wip-us.apache.org/repos/asf/tez/blob/e1b0b281/tez-ui/src/main/webapp/app/controllers/home/queries.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/controllers/home/queries.js b/tez-ui/src/main/webapp/app/controllers/home/queries.js index 648f98e..49da719 100644 --- a/tez-ui/src/main/webapp/app/controllers/home/queries.js +++ b/tez-ui/src/main/webapp/app/controllers/home/queries.js @@ -85,6 +85,7 @@ export default TableController.extend({ headerTitle: 'Query ID', contentPath: 'entityID', cellComponentName: 'em-table-linked-cell', + minWidth: "250px", getCellContent: function (row) { return { routeName: "query", @@ -96,11 +97,13 @@ export default TableController.extend({ id: 'requestUser', headerTitle: 'User', contentPath: 'requestUser', + minWidth: "100px", },{ id: 'status', headerTitle: 'Status', contentPath: 'status', cellComponentName: 'em-table-status-cell', + minWidth: "105px", },{ id: 'queryText', headerTitle: 'Query', @@ -110,6 +113,7 @@ export default TableController.extend({ headerTitle: 'DAG ID', contentPath: 'dag.firstObject.entityID', cellComponentName: 'em-table-linked-cell', + minWidth: "250px", getCellContent: function (row) { return { routeName: "dag", @@ -129,6 +133,7 @@ export default TableController.extend({ id: 'clientAddress', headerTitle: 'Client Address', contentPath: 'clientAddress', + hiddenByDefault: true, },{ id: 'startTime', headerTitle: 'Start Time', @@ -166,22 +171,17 @@ export default TableController.extend({ id: 'executionMode', headerTitle: 'Execution Mode', contentPath: 'executionMode', + minWidth: "100px", },{ id: 'hiveAddress', headerTitle: 'Hive Server 2 Address', - contentPath: 'hiveAddress' + contentPath: 'hiveAddress', + hiddenByDefault: true, },{ id: 'instanceType', headerTitle: 'Client Type', - contentPath: 'instanceType' - },{ - id: 'sessionID', - headerTitle: 'Session ID', - contentPath: 'sessionID', - },{ - id: 'threadName', - headerTitle: 'Thread Name', - contentPath: 'threadName', + contentPath: 'instanceType', + minWidth: "100px", }]), getCounterColumns: function () { http://git-wip-us.apache.org/repos/asf/tez/blob/e1b0b281/tez-ui/src/main/webapp/app/controllers/table.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/controllers/table.js b/tez-ui/src/main/webapp/app/controllers/table.js index f0bce1c..d472e02 100644 --- a/tez-ui/src/main/webapp/app/controllers/table.js +++ b/tez-ui/src/main/webapp/app/controllers/table.js @@ -63,8 +63,8 @@ export default AbstractController.extend({ var visibleColumnIDs = this.get("localStorage").get(this.get("storageID")) || {}; this.get('columns').forEach(function (config) { - if(visibleColumnIDs[config.id] !== false) { - visibleColumnIDs[config.id] = true; + if(visibleColumnIDs[config.id] === undefined) { + visibleColumnIDs[config.id] = !Ember.get(config, "hiddenByDefault"); } }); http://git-wip-us.apache.org/repos/asf/tez/blob/e1b0b281/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 149c81a..8985f82 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.8.0", - "em-table": "0.4.0", + "em-table": "0.6.0", "em-tgraph": "0.0.10" } } http://git-wip-us.apache.org/repos/asf/tez/blob/e1b0b281/tez-ui/src/main/webapp/tests/unit/controllers/home/queries-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/home/queries-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/home/queries-test.js index cf36c7a..ccec36c 100644 --- a/tez-ui/src/main/webapp/tests/unit/controllers/home/queries-test.js +++ b/tez-ui/src/main/webapp/tests/unit/controllers/home/queries-test.js @@ -37,11 +37,11 @@ test('Basic creation test', function(assert) { assert.ok(controller.breadcrumbs); assert.ok(controller.headerComponentNames); - assert.ok(controller.headerComponentNames.length, 3); + assert.equal(controller.headerComponentNames.length, 3); assert.ok(controller.definition); assert.ok(controller.columns); - assert.ok(controller.columns.length, 9); + assert.equal(controller.columns.length, 16); assert.ok(controller.getCounterColumns); http://git-wip-us.apache.org/repos/asf/tez/blob/e1b0b281/tez-ui/src/main/webapp/tests/unit/controllers/table-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/controllers/table-test.js b/tez-ui/src/main/webapp/tests/unit/controllers/table-test.js index 110fec2..c12f156 100644 --- a/tez-ui/src/main/webapp/tests/unit/controllers/table-test.js +++ b/tez-ui/src/main/webapp/tests/unit/controllers/table-test.js @@ -63,3 +63,42 @@ test('Basic creation test', function(assert) { assert.ok(controller.actions.openColumnSelector); assert.ok(controller.actions.columnsSelected); }); + +test('initVisibleColumns test', function(assert) { + let controller = this.subject({ + send: Ember.K, + localStorage: Ember.Object.create(), + columns: [] + }); + + controller.set("columns", [{ + id: "c1", + }, { + id: "c2", + }, { + id: "c3", + }]); + controller.initVisibleColumns(); + assert.equal(controller.get("visibleColumnIDs.c1"), true); + assert.equal(controller.get("visibleColumnIDs.c2"), true); + assert.equal(controller.get("visibleColumnIDs.c3"), true); + + controller.set("columns", [{ + id: "c1", + hiddenByDefault: true, + }, { + id: "c2", + }, { + id: "c3", + hiddenByDefault: true, + }]); + controller.initVisibleColumns(); + assert.equal(controller.get("visibleColumnIDs.c1"), false); + assert.equal(controller.get("visibleColumnIDs.c2"), true); + assert.equal(controller.get("visibleColumnIDs.c3"), false); + + controller.initVisibleColumns(); + assert.equal(controller.get("visibleColumnIDs.c1"), false); + assert.equal(controller.get("visibleColumnIDs.c2"), true); + assert.equal(controller.get("visibleColumnIDs.c3"), false); +});
