Skip to content

Commit

Permalink
TEZ-3570. Tez UI: Wait for sometime before tooltips are displayed (sree)
Browse files Browse the repository at this point in the history
  • Loading branch information
sreenaths committed Jan 9, 2017
1 parent 8a0da34 commit e1f5288
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ ALL CHANGES:
TEZ-3502. Tez UI: Search in All DAGs page doesn't work with numeric values
TEZ-3546. Tez UI: On sorting asc - Not Available must be at the top
TEZ-3555. Tez UI: Build is failing in RHEL6
TEZ-3570. Tez UI: Wait for sometime before tooltips are displayed

Release 0.8.5: Unreleased

Expand Down
8 changes: 4 additions & 4 deletions tez-ui/src/main/webapp/app/components/em-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ export default Ember.Component.extend({
}
this.set("_contents", contents);

this.set("show", true);
Ember.run.later(this, function () {
this.set("bubbles", this.$(".bubble"));
this.set("show", true);
this.renderTip();
Ember.run.debounce(this, "renderTip", 500);
});
}
else if(tip){
Expand Down Expand Up @@ -95,7 +95,7 @@ export default Ember.Component.extend({
y: event.clientY
});

if(Ember.get(event, "data.tip")) {
if(Ember.get(event, "data.tip") && event.data.get("tip").is(":visible")) {
event.data.renderTip();
}
},
Expand All @@ -115,7 +115,7 @@ export default Ember.Component.extend({
},

renderTip: function () {
if(this.get("show")) {
if(this.get("show") && !this.get("isDestroyed")) {
let x = this.get("x"),
y = this.get("y"),

Expand Down
1 change: 0 additions & 1 deletion tez-ui/src/main/webapp/app/initializers/jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import Ember from 'ember';

export function initialize(/* application */) {
Ember.$(document).tooltip({
delay: 20,
tooltipClass: 'generic-tooltip'
});

Expand Down
4 changes: 3 additions & 1 deletion tez-ui/src/main/webapp/app/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export default Ember.Route.extend({
resetTooltip: function () {
Ember.$(document).tooltip("destroy");
Ember.$(document).tooltip({
delay: 20,
show: {
delay: 500
},
tooltipClass: 'generic-tooltip'
});
},
Expand Down
8 changes: 2 additions & 6 deletions tez-ui/src/main/webapp/app/utils/vertex-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ export default Process.extend({
vertexDescription = `Contribution ${options.contribution}%`;
/* falls through */
case "process-name":
case "event-bar":
case "process-line":
let properties = this.getVisibleProps().map(function (definition) {
return {
name: definition.get("headerTitle"),
Expand All @@ -210,12 +212,6 @@ export default Process.extend({
description: vertexDescription
}];
break;
case "event-bar":
case "process-line":
contents = [{
title: this.get("name"),
}];
break;
case "event":
var edge;
contents = options.events.map(function (event) {
Expand Down
2 changes: 1 addition & 1 deletion tez-ui/src/main/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@
"dependencies": {
"em-helpers": "0.5.14",
"em-table": "0.4.0",
"em-tgraph": "0.0.7"
"em-tgraph": "0.0.9"
}
}
5 changes: 3 additions & 2 deletions tez-ui/src/main/webapp/tests/unit/initializers/jquery-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ module('Unit | Initializer | jquery', {
}
});

test('it works', function(assert) {
test('Basic creation test', function(assert) {
JqueryInitializer.initialize(application);

assert.ok(true);
assert.ok(Ember.$(document).tooltip( "instance" ));
assert.equal(Ember.$.ajaxSetup().cache, false);
});
24 changes: 21 additions & 3 deletions tez-ui/src/main/webapp/tests/unit/utils/vertex-process-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ test('getTooltipContents-process test', function(assert) {
return [Ember.Object.create({
id: "prop1",
headerTitle: "Prop 1",
contentPath: "prop1"
contentPath: "prop1",
cellDefinition: {
type: "Type1",
format: "Format1"
}
}), Ember.Object.create({
id: "prop2",
headerTitle: "Prop 2",
Expand All @@ -242,10 +246,24 @@ test('getTooltipContents-process test', function(assert) {

var processTooltip = process.getTooltipContents("event-bar")[0];
assert.equal(processTooltip.title, "TestName");
assert.notOk(processTooltip.properties);
assert.equal(processTooltip.properties[0].name, "Prop 1");
assert.equal(processTooltip.properties[0].value, "val1");
assert.equal(processTooltip.properties[0].type, "Type1");
assert.equal(processTooltip.properties[0].format, "Format1");
assert.equal(processTooltip.properties[1].name, "Prop 2");

processTooltip = process.getTooltipContents("process-line")[0];
assert.equal(processTooltip.title, "TestName");
assert.notOk(processTooltip.properties);
assert.equal(processTooltip.properties[0].name, "Prop 1");
assert.equal(processTooltip.properties[0].value, "val1");
assert.equal(processTooltip.properties[0].type, "Type1");
assert.equal(processTooltip.properties[0].format, "Format1");
assert.equal(processTooltip.properties[1].name, "Prop 2");

processTooltip = process.getTooltipContents("consolidated-process", {
contribution: 10
})[0];
assert.equal(processTooltip.title, "TestName");
assert.equal(processTooltip.description, "Contribution 10%");

});

0 comments on commit e1f5288

Please sign in to comment.