Commit e050bc06 by kevalbhatt

ATLAS-3174 : UI : Exclude process or deleted entity from search drop-down if…

ATLAS-3174 : UI : Exclude process or deleted entity from search drop-down if respective options are chosen
parent eaee02fe
...@@ -219,9 +219,6 @@ define(['require', ...@@ -219,9 +219,6 @@ define(['require',
that.lineageData = $.extend(true, {}, data); that.lineageData = $.extend(true, {}, data);
that.relationshipMap = that.crateLineageRelationshipHashMap(data); that.relationshipMap = that.crateLineageRelationshipHashMap(data);
that.guidEntityMap = $.extend(true, {}, data.guidEntityMap); that.guidEntityMap = $.extend(true, {}, data.guidEntityMap);
if (that.lineageData) {
that.renderLineageTypeSearch();
}
that.generateData({ "relationshipMap": that.relationshipMap, "guidEntityMap": that.guidEntityMap }); that.generateData({ "relationshipMap": that.relationshipMap, "guidEntityMap": that.guidEntityMap });
that.toggleDisableState({ that.toggleDisableState({
"el": that.$(".graph-button-group button,select[data-id='selectDepth']") "el": that.$(".graph-button-group button,select[data-id='selectDepth']")
...@@ -442,6 +439,7 @@ define(['require', ...@@ -442,6 +439,7 @@ define(['require',
this.fromToNodeData[this.guid]['isLineage'] = false; this.fromToNodeData[this.guid]['isLineage'] = false;
this.findImpactNodeAndUpdateData({ "relationshipMap": filterRelationshipMap, "guid": this.guid, "getStyleObjStr": getStyleObjStr }); this.findImpactNodeAndUpdateData({ "relationshipMap": filterRelationshipMap, "guid": this.guid, "getStyleObjStr": getStyleObjStr });
} }
this.renderLineageTypeSearch();
this.createGraph(); this.createGraph();
}, },
findImpactNodeAndUpdateData: function(options) { findImpactNodeAndUpdateData: function(options) {
...@@ -759,17 +757,19 @@ define(['require', ...@@ -759,17 +757,19 @@ define(['require',
}); });
svgGroup.selectAll("g.edgePath path.path").on('click', function(d) { svgGroup.selectAll("g.edgePath path.path").on('click', function(d) {
var data = { obj: _.find(that.lineageData.relations, { "fromEntityId": d.v, "toEntityId": d.w }) }, var data = { obj: _.find(that.lineageData.relations, { "fromEntityId": d.v, "toEntityId": d.w }) };
relationshipId = data.obj.relationshipId; if (data.obj) {
require(['views/graph/PropagationPropertyModal'], function(PropagationPropertyModal) { var relationshipId = data.obj.relationshipId;
var view = new PropagationPropertyModal({ require(['views/graph/PropagationPropertyModal'], function(PropagationPropertyModal) {
edgeInfo: data, var view = new PropagationPropertyModal({
relationshipId: relationshipId, edgeInfo: data,
lineageData: that.lineageData, relationshipId: relationshipId,
apiGuid: that.apiGuid, lineageData: that.lineageData,
detailPageFetchCollection: that.fetchCollection apiGuid: that.apiGuid,
detailPageFetchCollection: that.fetchCollection
});
}); });
}); }
}) })
$('body').on('mouseover', '.d3-tip', function(el) { $('body').on('mouseover', '.d3-tip', function(el) {
that.activeTip = true; that.activeTip = true;
...@@ -818,18 +818,23 @@ define(['require', ...@@ -818,18 +818,23 @@ define(['require',
}).init(); }).init();
}, },
renderLineageTypeSearch: function() { renderLineageTypeSearch: function() {
var that = this; var that = this,
var lineageData = $.extend(true, {}, this.lineageData); lineageData = $.extend(true, {}, this.lineageData),
var data = []; data = [],
typeStr = '<option></option>';
var typeStr = '<option></option>';
if (!_.isEmpty(lineageData)) { if (!_.isEmpty(lineageData)) {
_.each(lineageData.guidEntityMap, function(obj, index) { _.each(lineageData.guidEntityMap, function(obj, index) {
var nodeData = that.fromToNodeData[obj.guid];
if (that.filterObj.isProcessHideCheck && nodeData && nodeData.isProcess) {
return;
} else if (that.filterObj.isDeletedEntityHideCheck && nodeData && nodeData.isDeleted) {
return
}
typeStr += '<option value="' + obj.guid + '">' + obj.attributes.name + '</option>'; typeStr += '<option value="' + obj.guid + '">' + obj.attributes.name + '</option>';
}); });
} }
that.ui.lineageTypeSearch.html(typeStr); that.ui.lineageTypeSearch.html(typeStr);
this.initilizelineageTypeSearch() this.initilizelineageTypeSearch();
}, },
initilizelineageTypeSearch: function() { initilizelineageTypeSearch: function() {
var that = this; var that = this;
...@@ -939,9 +944,10 @@ define(['require', ...@@ -939,9 +944,10 @@ define(['require',
scaleFactor = 1, scaleFactor = 1,
svgWidth = that.$('svg').width(), svgWidth = that.$('svg').width(),
svgHeight = that.$('svg').height(); svgHeight = that.$('svg').height();
svgClone.setAttribute('width', svgWidth); if (platform.name != "Chrome") {
svgClone.setAttribute('height', svgHeight); svgClone.setAttribute('width', svgWidth);
svgClone.setAttribute('height', svgHeight);
}
$('.hidden-svg').html(svgClone); $('.hidden-svg').html(svgClone);
$(svgClone).find('>g').attr("transform", "scale(" + scaleFactor + ")"); $(svgClone).find('>g').attr("transform", "scale(" + scaleFactor + ")");
var canvasOffset = { x: 150, y: 150 }, var canvasOffset = { x: 150, y: 150 },
...@@ -975,8 +981,9 @@ define(['require', ...@@ -975,8 +981,9 @@ define(['require',
img.onload = function() { img.onload = function() {
try { try {
var a = document.createElement("a"); var a = document.createElement("a"),
a.download = that.entityName + ".png"; entityAttributes = that.entity && that.entity.attributes;
a.download = ((entityAttributes && entityAttributes.qualifiedName) || "lineage_export") + ".png";
document.body.appendChild(a); document.body.appendChild(a);
ctx.drawImage(img, 50, 50, canvas.width, canvas.height); ctx.drawImage(img, 50, 50, canvas.width, canvas.height);
canvas.toBlob(function(blob) { canvas.toBlob(function(blob) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment