Commit 6677c80d by kevalbhatt

ATLAS-3365.patch : Expose image names on lineage page

parent fdbc36e8
...@@ -571,13 +571,7 @@ define(['require', ...@@ -571,13 +571,7 @@ define(['require',
.attr("href", function(d) { .attr("href", function(d) {
var that = this; var that = this;
if (node) { if (node) {
// to check for IE-10 var imageIconPath = Utils.getEntityIconPath({ entityData: node });
var originLink = window.location.origin;
if (platform.name === "IE") {
originLink = window.location.protocol + "//" + window.location.host;
}
var imageIconPath = Utils.getEntityIconPath({ entityData: node }),
imagePath = ((originLink + Utils.getBaseUrl(window.location.pathname)) + imageIconPath);
var getImageData = function(options) { var getImageData = function(options) {
var imagePath = options.imagePath, var imagePath = options.imagePath,
...@@ -590,12 +584,12 @@ define(['require', ...@@ -590,12 +584,12 @@ define(['require',
if (platform.name !== "IE") { if (platform.name !== "IE") {
ajaxOptions["mimeType"] = "text/plain; charset=x-user-defined"; ajaxOptions["mimeType"] = "text/plain; charset=x-user-defined";
} }
shapeSvg.attr("data-iconpath", imagePath);
$.ajax(ajaxOptions) $.ajax(ajaxOptions)
.always(function(data, status, xhr) { .always(function(data, status, xhr) {
if (data.status == 404) { if (data.status == 404) {
getImageData({ getImageData({
"imagePath": Utils.getEntityIconPath({ entityData: node, errorUrl: imagePath }), "imagePath": Utils.getEntityIconPath({ entityData: node, errorUrl: imagePath })
"imageIconPath": imageIconPath
}); });
} else if (data) { } else if (data) {
if (platform.name !== "IE") { if (platform.name !== "IE") {
...@@ -608,8 +602,7 @@ define(['require', ...@@ -608,8 +602,7 @@ define(['require',
} }
if (_.keys(imageObject).indexOf(imageIconPath) === -1) { if (_.keys(imageObject).indexOf(imageIconPath) === -1) {
getImageData({ getImageData({
"imagePath": imagePath, "imagePath": imageIconPath
"imageIconPath": imageIconPath
}); });
} }
...@@ -621,6 +614,9 @@ define(['require', ...@@ -621,6 +614,9 @@ define(['require',
imageObject[imageIconPath].push(d3.select(that)); imageObject[imageIconPath].push(d3.select(that));
} else { } else {
d3.select(that).attr("xlink:href", imageObject[imageIconPath]); d3.select(that).attr("xlink:href", imageObject[imageIconPath]);
if (imageIconPath !== shapeSvg.attr("data-iconpath")) {
shapeSvg.attr("data-iconpathorigin", imageIconPath);
}
return imageObject[imageIconPath]; return imageObject[imageIconPath];
} }
} }
......
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