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:08:32 UTC

[atlas] branch branch-1.0 updated (8cd9d0a -> 89064e5)

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

kbhatt pushed a change to branch branch-1.0
in repository https://gitbox.apache.org/repos/asf/atlas.git.


    from 8cd9d0a  ATLAS-3129 Fix SSL Truststore reloader leak from AtlasBaseClient
     new 1ec6118  ATLAS-3155 : UI - IE-11 - Name entry not clickable
     new 89064e5  ATLAS-3174 : UI : Exclude process or deleted entity from search drop-down if respective options are chosen

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 dashboardv2/public/css/scss/form.scss              |  2 +-
 .../glossary/GlossaryDetailLayoutView_tmpl.html    |  2 +-
 .../search/SearchResultLayoutView_tmpl.html        |  2 +-
 dashboardv2/public/js/utils/CommonViewFunction.js  | 63 +++++++++++-----------
 dashboardv2/public/js/utils/Helper.js              |  2 +-
 .../js/views/detail_page/DetailPageLayoutView.js   |  1 -
 .../public/js/views/graph/LineageLayoutView.js     | 61 ++++++++++++---------
 .../public/js/views/search/SearchLayoutView.js     | 40 +++++++-------
 .../js/views/search/SearchResultLayoutView.js      |  1 +
 .../js/views/tag/TagDetailTableLayoutView.js       |  3 +-
 .../atlas/web/security/AtlasSecurityConfig.java    |  6 ++-
 11 files changed, 100 insertions(+), 83 deletions(-)


[atlas] 01/02: ATLAS-3155 : UI - IE-11 - Name entry not clickable

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1ec611899db125db9588e4c1a7d647124e31b8ff
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Thu Apr 25 18:50:30 2019 +0530

    ATLAS-3155 : UI - IE-11 - Name entry not clickable
    
    Signed-off-by: nixonrodrigues <ni...@apache.org>
    (cherry picked from commit 2cb36b90d0c1fa550e5459e1f87294ecd5a505be)
---
 dashboardv2/public/css/scss/form.scss              |  2 +-
 .../glossary/GlossaryDetailLayoutView_tmpl.html    |  2 +-
 .../search/SearchResultLayoutView_tmpl.html        |  2 +-
 dashboardv2/public/js/utils/CommonViewFunction.js  | 63 +++++++++++-----------
 dashboardv2/public/js/utils/Helper.js              |  2 +-
 .../js/views/detail_page/DetailPageLayoutView.js   |  1 -
 .../public/js/views/graph/LineageLayoutView.js     |  6 ++-
 .../public/js/views/search/SearchLayoutView.js     | 40 +++++++-------
 .../js/views/search/SearchResultLayoutView.js      |  1 +
 .../js/views/tag/TagDetailTableLayoutView.js       |  3 +-
 .../atlas/web/security/AtlasSecurityConfig.java    |  6 ++-
 11 files changed, 69 insertions(+), 59 deletions(-)

diff --git a/dashboardv2/public/css/scss/form.scss b/dashboardv2/public/css/scss/form.scss
index 388713e..8381f3a 100644
--- a/dashboardv2/public/css/scss/form.scss
+++ b/dashboardv2/public/css/scss/form.scss
@@ -472,7 +472,7 @@ button:focus {
         border-radius: 12px;
         border-color: #cbcbcb;
         position: relative;
-        padding: 0px 10px;
+        padding: 18px 10px 0px 10px;
         margin-top: 25px;
 
         span.required:after {
diff --git a/dashboardv2/public/js/templates/glossary/GlossaryDetailLayoutView_tmpl.html b/dashboardv2/public/js/templates/glossary/GlossaryDetailLayoutView_tmpl.html
index 7720196..05f6af9 100644
--- a/dashboardv2/public/js/templates/glossary/GlossaryDetailLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/glossary/GlossaryDetailLayoutView_tmpl.html
@@ -72,7 +72,7 @@
         {{/if}}
     </div>
 </div>
-<div class="container-fluid gray-bg">
+<div class="container-fluid">
     {{#if isTermView}}
     <div class="tab-content">
         <div id="tab-entities" role="entities" class="tab-pane active animated fadeIn">
diff --git a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
index b10a0b8..81cddf5 100644
--- a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
@@ -23,7 +23,7 @@
     <div class="ellipsis" style="display: none;"><span class="searchResult" style=" font-size: 16px;"></span>
     </div>
     <div class="searchTable">
-        <div class="row well" style="padding-top: 0px;">
+        <div class="{{#unless isGlossaryView}}row well{{/unless}}" style="padding-top: 0px;">
             <div class="row form-group pagination-box filter-box" style="display: none;">
                 <div class="col-sm-4">
                     <span class="labelShowRecord pull-left" data-id="pageRecordText"> </span>
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js
index 5088b4a..6741e3b 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -545,11 +545,34 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
                 urlObj = options.value,
                 formatDate = options.formatDate,
                 spliter = 1,
-                apiObj = options.apiObj; //if apiObj then create object for API call else for QueryBuilder.
-            if (urlObj && urlObj.length) {
-                attrObj = createObject(urlObj);
-
-                function createObject(urlObj) {
+                apiObj = options.apiObj,
+                mapUiOperatorToAPI = function(oper) {
+                    if (oper == "=") {
+                        return "eq";
+                    } else if (oper == "!=") {
+                        return "neq";
+                    } else if (oper == "<") {
+                        return "lt";
+                    } else if (oper == "<=") {
+                        return "lte";
+                    } else if (oper == ">") {
+                        return "gt";
+                    } else if (oper == ">=") {
+                        return "gte";
+                    } else if (oper == "begins_with") {
+                        return "startsWith";
+                    } else if (oper == "ends_with") {
+                        return "endsWith";
+                    } else if (oper == "contains") {
+                        return "contains";
+                    } else if (oper == "not_null") {
+                        return "notNull";
+                    } else if (oper == "is_null") {
+                        return "isNull";
+                    }
+                    return oper;
+                },
+                createObject = function(urlObj) {
                     var finalObj = {};
                     finalObj['condition'] = /^AND\(/.test(urlObj) ? "AND" : "OR";
                     urlObj = finalObj.condition === "AND" ? urlObj.substr(4).slice(0, -1) : urlObj.substr(3).slice(0, -1);
@@ -579,37 +602,13 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
                     });
                     return finalObj;
                 }
+            //if apiObj then create object for API call else for QueryBuilder.
+            if (urlObj && urlObj.length) {
+                attrObj = createObject(urlObj);
             } else {
                 return null;
             }
             return attrObj;
-
-            function mapUiOperatorToAPI(oper) {
-                if (oper == "=") {
-                    return "eq";
-                } else if (oper == "!=") {
-                    return "neq";
-                } else if (oper == "<") {
-                    return "lt";
-                } else if (oper == "<=") {
-                    return "lte";
-                } else if (oper == ">") {
-                    return "gt";
-                } else if (oper == ">=") {
-                    return "gte";
-                } else if (oper == "begins_with") {
-                    return "startsWith";
-                } else if (oper == "ends_with") {
-                    return "endsWith";
-                } else if (oper == "contains") {
-                    return "contains";
-                } else if (oper == "not_null") {
-                    return "notNull";
-                } else if (oper == "is_null") {
-                    return "isNull";
-                }
-                return oper;
-            }
         },
         generateAPIObj: function(url) {
             if (url && url.length) {
diff --git a/dashboardv2/public/js/utils/Helper.js b/dashboardv2/public/js/utils/Helper.js
index 8a7a521..9886b9b 100644
--- a/dashboardv2/public/js/utils/Helper.js
+++ b/dashboardv2/public/js/utils/Helper.js
@@ -137,7 +137,7 @@ define(['require',
                     '<div class="col-md-10"><input class="select2-search__field" placeholder="' + placeholder + '" type="search"' +
                     ' tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off"' +
                     ' spellcheck="false" role="textbox" /></div>' +
-                    '<div class="col-md-2"><button type="button" style="margin-left: -20px" class="btn btn-action btn-sm filter " title="Entity Attribute Filter"><i class="fa fa-filter"></i></button></div>' +
+                    '<div class="col-md-2"><button type="button" style="margin-left: -20px" class="btn btn-action btn-sm filter " title="Type Filter"><i class="fa fa-filter"></i></button></div>' +
                     '</div></span>'
                 );
                 if (!this.options.options.getFilterBox) {
diff --git a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
index f02161b..aa6dc5b 100644
--- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
@@ -355,7 +355,6 @@ define(['require',
                     showLoader: that.showLoader.bind(that),
                     hideLoader: that.hideLoader.bind(that),
                     tagName: tagName,
-                    guid: that.id,
                     callback: function() {
                         that.fetchCollection();
                     }
diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index 1135353..810ec30 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -535,8 +535,11 @@ define(['require',
                         .attr('fill', 'url(#img_' + node.id + ')')
                         .attr('r', '24px')
                         .attr('data-stroke', node.id)
+                        .attr('stroke-width', "2px")
                         .attr("class", "nodeImage " + (currentNode ? "currentNode" : (node.isProcess ? "process" : "node")));
-
+                    if (currentNode) {
+                        shapeSvg.attr("stroke", "#fb4200")
+                    }
                     parent.insert("defs")
                         .append("pattern")
                         .attr("x", "0%")
@@ -1004,6 +1007,7 @@ define(['require',
 
                     };
                     img.src = url;
+
                 }, 0)
             },
             toggleLoader: function(element) {
diff --git a/dashboardv2/public/js/views/search/SearchLayoutView.js b/dashboardv2/public/js/views/search/SearchLayoutView.js
index e050215..76edd58 100644
--- a/dashboardv2/public/js/views/search/SearchLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchLayoutView.js
@@ -62,6 +62,7 @@ define(['require',
                 events["keyup " + this.ui.searchInput] = function(e) {
                     var code = e.which;
                     this.value.query = e.currentTarget.value;
+                    this.query[this.type].query = this.value.query;
                     if (code == 13) {
                         that.findSearchResult();
                     }
@@ -253,8 +254,9 @@ define(['require',
                 });
             },
             checkForButtonVisiblity: function(e, options) {
-                var that = this;
-                if (this.type == "basic" && e && e.currentTarget) {
+                var that = this,
+                    isBasicSearch = (this.type == "basic");
+                if (e && e.currentTarget) {
                     var $el = $(e.currentTarget),
                         isTagEl = $el.data('id') == "tagLOV",
                         isTermEl = $el.data('id') == "termLOV",
@@ -263,11 +265,13 @@ define(['require',
                     if (e.type == "change" && select2Data) {
                         var value = (_.isEmpty(select2Data) ? select2Data : _.first(select2Data).id),
                             key = "tag",
-                            filterType = 'tagFilters',
+                            filterType = isBasicSearch ? 'tagFilters' : null,
                             value = value && value.length ? value : null;
                         if (!isTagEl) {
                             key = (isTermEl ? "term" : "type");
-                            filterType = (isTypeEl ? "entityFilters" : null);
+                            if (isBasicSearch) {
+                                filterType = (isTypeEl ? "entityFilters" : null);
+                            }
                         }
                         if (this.value) {
                             //On Change handle
@@ -280,7 +284,7 @@ define(['require',
                                     this.value.pageOffset = 0;
                                 }
                                 _.extend(this.query[this.type], temp);
-                            } else {
+                            } else if (isBasicSearch) {
                                 // Initial loading handle.
                                 if (filterType) {
                                     var filterObj = this.searchTableFilters[filterType];
@@ -303,10 +307,10 @@ define(['require',
                                     }
                                 }
                             }
-                            if (filterType) {
+                            if (isBasicSearch && filterType) {
                                 this.makeFilterButtonActive(filterType);
                             }
-                        } else {
+                        } else if (isBasicSearch) {
                             this.ui.tagAttrFilter.prop('disabled', true);
                             this.ui.typeAttrFilter.prop('disabled', true);
                         }
@@ -407,6 +411,17 @@ define(['require',
                     filtertype = isTag ? 'tagFilters' : 'entityFilters',
                     queryBuilderRef = this.attrModal.RQueryBuilder.currentView.ui.builder,
                     col = [];
+
+                function getIdFromRuleObject(rule) {
+                    _.map(rule.rules, function(obj, key) {
+                        if (_.has(obj, 'condition')) {
+                            return getIdFromRuleObject(obj);
+                        } else {
+                            return col.push(obj.id)
+                        }
+                    });
+                    return col;
+                }
                 if (queryBuilderRef.data('queryBuilder')) {
                     var rule = queryBuilderRef.queryBuilder('getRules');
                 }
@@ -424,17 +439,6 @@ define(['require',
                     if ($(e.currentTarget).hasClass('search')) {
                         this.findSearchResult();
                     }
-
-                    function getIdFromRuleObject(rule) {
-                        _.map(rule.rules, function(obj, key) {
-                            if (_.has(obj, 'condition')) {
-                                return getIdFromRuleObject(obj);
-                            } else {
-                                return col.push(obj.id)
-                            }
-                        });
-                        return col;
-                    }
                 }
             },
             manualRender: function(paramObj) {
diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
index 2c7f15e..4667925 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -76,6 +76,7 @@ define(['require',
                     entityCreate: Globals.entityCreate,
                     searchType: this.searchType,
                     fromView: this.fromView,
+                    isGlossaryView: this.fromView == "glossary",
                     isSearchTab: Utils.getUrlState.isSearchTab()
                 };
             },
diff --git a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
index 73d8dfb..7140a8d 100644
--- a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
@@ -61,7 +61,7 @@ define(['require',
                 };
                 events["click " + this.ui.propagatedFromClick] = function(e) {
                     Utils.setUrl({
-                        url: '#!/detailPage/' + e.currentTarget.dataset.guid,
+                        url: '#!/detailPage/' + $(e.currentTarget).data("guid"),
                         mergeBrowserUrl: false,
                         trigger: true
                     });
@@ -84,7 +84,6 @@ define(['require',
                     collection: this.tagCollection,
                     includeFilter: false,
                     includePagination: true,
-                    includePageSize: false,
                     includeFooterRecords: true,
                     includePageSize: true,
                     includeGotoPage: true,
diff --git a/webapp/src/main/java/org/apache/atlas/web/security/AtlasSecurityConfig.java b/webapp/src/main/java/org/apache/atlas/web/security/AtlasSecurityConfig.java
index 64c9520..286f85c 100644
--- a/webapp/src/main/java/org/apache/atlas/web/security/AtlasSecurityConfig.java
+++ b/webapp/src/main/java/org/apache/atlas/web/security/AtlasSecurityConfig.java
@@ -41,6 +41,7 @@ import org.springframework.security.web.authentication.www.BasicAuthenticationFi
 import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter;
 import org.springframework.security.web.util.matcher.RequestHeaderRequestMatcher;
 import org.springframework.security.web.util.matcher.RequestMatcher;
+import org.springframework.security.web.header.writers.StaticHeadersWriter;
 
 import javax.inject.Inject;
 import java.util.LinkedHashMap;
@@ -126,7 +127,10 @@ public class AtlasSecurityConfig extends WebSecurityConfigurerAdapter {
         httpSecurity
                 .authorizeRequests().anyRequest().authenticated()
                 .and()
-                    .headers().disable()
+                    .headers()
+                        .addHeaderWriter(new StaticHeadersWriter("Content-Security-Policy","script-src 'self' 'unsafe-inline' 'unsafe-eval'"))
+                        .addHeaderWriter(new StaticHeadersWriter("Server","Apache Atlas"))
+                .and()
                     .servletApi()
                 .and()
                     .csrf().disable()


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

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 89064e5ecc2d3b8904d60a2395d0550f89c9dc0f
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
    
    (cherry picked from commit e050bc06b43909aaf5bcf001d4b0d922487b89ab)
---
 .../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) {