You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by kb...@apache.org on 2019/04/26 10:07:11 UTC

[atlas] branch master updated: ATLAS-3174 : UI : Exclude process or deleted entity from search drop-down if respective options are chosen

This is an automated email from the ASF dual-hosted git repository.

kbhatt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
     new e050bc0  ATLAS-3174 : UI : Exclude process or deleted entity from search drop-down if respective options are chosen
e050bc0 is described below

commit e050bc06b43909aaf5bcf001d4b0d922487b89ab
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Fri Apr 26 15:05:28 2019 +0530

    ATLAS-3174 : UI : Exclude process or deleted entity from search drop-down if respective options are chosen
---
 .../public/js/views/graph/LineageLayoutView.js     | 55 ++++++++++++----------
 1 file changed, 31 insertions(+), 24 deletions(-)

diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index 810ec30..bc846dd 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -219,9 +219,6 @@ define(['require',
                             that.lineageData = $.extend(true, {}, data);
                             that.relationshipMap = that.crateLineageRelationshipHashMap(data);
                             that.guidEntityMap = $.extend(true, {}, data.guidEntityMap);
-                            if (that.lineageData) {
-                                that.renderLineageTypeSearch();
-                            }
                             that.generateData({ "relationshipMap": that.relationshipMap, "guidEntityMap": that.guidEntityMap });
                             that.toggleDisableState({
                                 "el": that.$(".graph-button-group button,select[data-id='selectDepth']")
@@ -442,6 +439,7 @@ define(['require',
                     this.fromToNodeData[this.guid]['isLineage'] = false;
                     this.findImpactNodeAndUpdateData({ "relationshipMap": filterRelationshipMap, "guid": this.guid, "getStyleObjStr": getStyleObjStr });
                 }
+                this.renderLineageTypeSearch();
                 this.createGraph();
             },
             findImpactNodeAndUpdateData: function(options) {
@@ -759,17 +757,19 @@ define(['require',
                     });
 
                 svgGroup.selectAll("g.edgePath path.path").on('click', function(d) {
-                    var data = { obj: _.find(that.lineageData.relations, { "fromEntityId": d.v, "toEntityId": d.w }) },
-                        relationshipId = data.obj.relationshipId;
-                    require(['views/graph/PropagationPropertyModal'], function(PropagationPropertyModal) {
-                        var view = new PropagationPropertyModal({
-                            edgeInfo: data,
-                            relationshipId: relationshipId,
-                            lineageData: that.lineageData,
-                            apiGuid: that.apiGuid,
-                            detailPageFetchCollection: that.fetchCollection
+                    var data = { obj: _.find(that.lineageData.relations, { "fromEntityId": d.v, "toEntityId": d.w }) };
+                    if (data.obj) {
+                        var relationshipId = data.obj.relationshipId;
+                        require(['views/graph/PropagationPropertyModal'], function(PropagationPropertyModal) {
+                            var view = new PropagationPropertyModal({
+                                edgeInfo: data,
+                                relationshipId: relationshipId,
+                                lineageData: that.lineageData,
+                                apiGuid: that.apiGuid,
+                                detailPageFetchCollection: that.fetchCollection
+                            });
                         });
-                    });
+                    }
                 })
                 $('body').on('mouseover', '.d3-tip', function(el) {
                     that.activeTip = true;
@@ -818,18 +818,23 @@ define(['require',
                 }).init();
             },
             renderLineageTypeSearch: function() {
-                var that = this;
-                var lineageData = $.extend(true, {}, this.lineageData);
-                var data = [];
-
-                var typeStr = '<option></option>';
+                var that = this,
+                    lineageData = $.extend(true, {}, this.lineageData),
+                    data = [],
+                    typeStr = '<option></option>';
                 if (!_.isEmpty(lineageData)) {
                     _.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>';
                     });
                 }
                 that.ui.lineageTypeSearch.html(typeStr);
-                this.initilizelineageTypeSearch()
+                this.initilizelineageTypeSearch();
             },
             initilizelineageTypeSearch: function() {
                 var that = this;
@@ -939,9 +944,10 @@ define(['require',
                         scaleFactor = 1,
                         svgWidth = that.$('svg').width(),
                         svgHeight = that.$('svg').height();
-                    svgClone.setAttribute('width', svgWidth);
-                    svgClone.setAttribute('height', svgHeight);
-
+                    if (platform.name != "Chrome") {
+                        svgClone.setAttribute('width', svgWidth);
+                        svgClone.setAttribute('height', svgHeight);
+                    }
                     $('.hidden-svg').html(svgClone);
                     $(svgClone).find('>g').attr("transform", "scale(" + scaleFactor + ")");
                     var canvasOffset = { x: 150, y: 150 },
@@ -975,8 +981,9 @@ define(['require',
 
                     img.onload = function() {
                         try {
-                            var a = document.createElement("a");
-                            a.download = that.entityName + ".png";
+                            var a = document.createElement("a"),
+                                entityAttributes = that.entity && that.entity.attributes;
+                            a.download = ((entityAttributes && entityAttributes.qualifiedName) || "lineage_export") + ".png";
                             document.body.appendChild(a);
                             ctx.drawImage(img, 50, 50, canvas.width, canvas.height);
                             canvas.toBlob(function(blob) {