Repository: tez Updated Branches: refs/heads/master 852e80d84 -> b2be0d553
TEZ-3653. Tez UI: Swimlane tooltip is not proper for running DAGs (sree) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/b2be0d55 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/b2be0d55 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/b2be0d55 Branch: refs/heads/master Commit: b2be0d553c54ce4eb9f1315e17da47eb760d9aa5 Parents: 852e80d Author: Sreenath Somarajapuram <[email protected]> Authored: Mon Mar 13 18:46:30 2017 +0530 Committer: Sreenath Somarajapuram <[email protected]> Committed: Mon Mar 13 18:46:30 2017 +0530 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../main/webapp/app/controllers/dag/swimlane.js | 12 +++--------- tez-ui/src/main/webapp/app/models/timed.js | 10 ++-------- .../app/templates/components/em-tooltip.hbs | 18 +++++++++++------- .../src/main/webapp/app/utils/vertex-process.js | 5 +++-- .../main/webapp/tests/unit/models/timed-test.js | 8 ++++---- .../tests/unit/utils/vertex-process-test.js | 7 ++++++- 7 files changed, 30 insertions(+), 31 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/b2be0d55/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 87dda41..df0caa1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -219,6 +219,7 @@ ALL CHANGES: TEZ-3642. Tez UI: Auto-refresh is not stopping when DAG is the main entity TEZ-3503. Tez UI: Support search by queue name TEZ-3656. Tez UI: Status correction is not working as expected + TEZ-3653. Tez UI: Swimlane tooltip is not proper for running DAGs Release 0.8.6: Unreleased http://git-wip-us.apache.org/repos/asf/tez/blob/b2be0d55/tez-ui/src/main/webapp/app/controllers/dag/swimlane.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/controllers/dag/swimlane.js b/tez-ui/src/main/webapp/app/controllers/dag/swimlane.js index 8793992..bbac40b 100644 --- a/tez-ui/src/main/webapp/app/controllers/dag/swimlane.js +++ b/tez-ui/src/main/webapp/app/controllers/dag/swimlane.js @@ -55,16 +55,12 @@ export default MultiTableController.extend({ id: 'startTime', headerTitle: 'Start Time', contentPath: 'startTime', - cellDefinition: { - type: 'date' - } + cellComponentName: 'date-formatter', },{ id: 'endTime', headerTitle: 'End Time', contentPath: 'endTime', - cellDefinition: { - type: 'date' - } + cellComponentName: 'date-formatter', },{ id: 'duration', headerTitle: 'Duration', @@ -80,9 +76,7 @@ export default MultiTableController.extend({ id: 'firstTaskStartTime', headerTitle: 'First Task Start Time', contentPath: 'firstTaskStartTime', - cellDefinition: { - type: 'date' - } + cellComponentName: 'date-formatter', },{ id: 'totalTasks', headerTitle: 'Tasks', http://git-wip-us.apache.org/repos/asf/tez/blob/b2be0d55/tez-ui/src/main/webapp/app/models/timed.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/models/timed.js b/tez-ui/src/main/webapp/app/models/timed.js index 8892814..0be71f9 100644 --- a/tez-ui/src/main/webapp/app/models/timed.js +++ b/tez-ui/src/main/webapp/app/models/timed.js @@ -30,14 +30,8 @@ export default AbstractModel.extend({ var startTime = this.get("startTime"), endTime = this.get("endTime"); - if(startTime !== undefined && endTime !== undefined && startTime !== null && endTime !== null) { - if(startTime <= 0) { - return new Error("Start time is less than or equal to zero!"); - } - else if(endTime <= 0) { - return new Error("End time is less than or equal to zero!"); - } - else if(startTime > endTime) { + if(startTime > 0 && endTime > 0) { + if(startTime > endTime) { let delta = startTime - endTime; return new Error(`Start time is greater than end time by ${delta} msecs!`); } http://git-wip-us.apache.org/repos/asf/tez/blob/b2be0d55/tez-ui/src/main/webapp/app/templates/components/em-tooltip.hbs ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/templates/components/em-tooltip.hbs b/tez-ui/src/main/webapp/app/templates/components/em-tooltip.hbs index 65f33db..385baa1 100644 --- a/tez-ui/src/main/webapp/app/templates/components/em-tooltip.hbs +++ b/tez-ui/src/main/webapp/app/templates/components/em-tooltip.hbs @@ -35,13 +35,17 @@ {{prop.name}} </td> <td> - {{txt prop.value - type=prop.type - format=prop.format - timeZone=prop.timeZone - valueFormat=prop.valueFormat - valueTimeZone=prop.valueTimeZone - valueUnit=prop.valueUnit}} + {{#if prop.componentName}} + {{component prop.componentName content=prop.value}} + {{else}} + {{txt prop.value + type=prop.type + format=prop.format + timeZone=prop.timeZone + valueFormat=prop.valueFormat + valueTimeZone=prop.valueTimeZone + valueUnit=prop.valueUnit}} + {{/if}} </td> </tr> {{/each}} http://git-wip-us.apache.org/repos/asf/tez/blob/b2be0d55/tez-ui/src/main/webapp/app/utils/vertex-process.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/utils/vertex-process.js b/tez-ui/src/main/webapp/app/utils/vertex-process.js index b592550..c69fb71 100644 --- a/tez-ui/src/main/webapp/app/utils/vertex-process.js +++ b/tez-ui/src/main/webapp/app/utils/vertex-process.js @@ -200,9 +200,10 @@ export default Process.extend({ let properties = this.getVisibleProps().map(function (definition) { return { name: definition.get("headerTitle"), - value: that.get("vertex").get(definition.get("contentPath")), + value: definition.getCellContent(that.get("vertex")), type: Ember.get(definition, "cellDefinition.type"), - format: Ember.get(definition, "cellDefinition.format") + format: Ember.get(definition, "cellDefinition.format"), + componentName: Ember.get(definition, "cellComponentName") }; }); http://git-wip-us.apache.org/repos/asf/tez/blob/b2be0d55/tez-ui/src/main/webapp/tests/unit/models/timed-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/models/timed-test.js b/tez-ui/src/main/webapp/tests/unit/models/timed-test.js index 77b4308..a9ac4e1 100644 --- a/tez-ui/src/main/webapp/tests/unit/models/timed-test.js +++ b/tez-ui/src/main/webapp/tests/unit/models/timed-test.js @@ -49,11 +49,11 @@ test('duration test', function(assert) { assert.equal(model.get("duration"), 0); model.set("startTime", 0); - assert.equal(model.get("duration").message, "Start time is less than or equal to zero!"); + assert.equal(model.get("duration"), undefined); resetAndCheckModel(); model.set("endTime", 0); - assert.equal(model.get("duration").message, "End time is less than or equal to zero!"); + assert.equal(model.get("duration"), undefined); resetAndCheckModel(); model.set("endTime", 50); @@ -61,11 +61,11 @@ test('duration test', function(assert) { resetAndCheckModel(); model.set("startTime", -100); - assert.equal(model.get("duration").message, "Start time is less than or equal to zero!"); + assert.equal(model.get("duration"), undefined); resetAndCheckModel(); model.set("endTime", -200); - assert.equal(model.get("duration").message, "End time is less than or equal to zero!"); + assert.equal(model.get("duration"), undefined); resetAndCheckModel(); model.set("startTime", undefined); http://git-wip-us.apache.org/repos/asf/tez/blob/b2be0d55/tez-ui/src/main/webapp/tests/unit/utils/vertex-process-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/unit/utils/vertex-process-test.js b/tez-ui/src/main/webapp/tests/unit/utils/vertex-process-test.js index f9342a5..414704a 100644 --- a/tez-ui/src/main/webapp/tests/unit/utils/vertex-process-test.js +++ b/tez-ui/src/main/webapp/tests/unit/utils/vertex-process-test.js @@ -220,6 +220,9 @@ test('getTooltipContents-event test', function(assert) { }); test('getTooltipContents-process test', function(assert) { + function getCellContent(row) { + return row.get(this.get("contentPath")); + } var process = VertexProcess.create({ name: "TestName", vertex: Ember.Object.create({ @@ -232,6 +235,7 @@ test('getTooltipContents-process test', function(assert) { id: "prop1", headerTitle: "Prop 1", contentPath: "prop1", + getCellContent: getCellContent, cellDefinition: { type: "Type1", format: "Format1" @@ -239,7 +243,8 @@ test('getTooltipContents-process test', function(assert) { }), Ember.Object.create({ id: "prop2", headerTitle: "Prop 2", - contentPath: "prop2" + contentPath: "prop2", + getCellContent: getCellContent })]; } });
