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 2020/10/08 09:52:14 UTC

[atlas] branch branch-2.0 updated (92b7071 -> 58d630b)

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

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


    from 92b7071  ATLAS-3971 :- Move authorization check for Business Metadata before type exist check.
     new ba8b490  ATLAS-3981: UI: Create Entity button is shown for a user without create entity permission in ranger
     new 58d630b  ATLAS-3979: Beta UI : Removing one of the filters with an attribute name removes all of the filters with that attribute name.

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/js/router/Router.js                             | 2 +-
 .../public/js/templates/search/SearchResultLayoutView_tmpl.html    | 7 ++++---
 dashboardv2/public/js/views/glossary/GlossaryLayoutView.js         | 6 ++++--
 dashboardv2/public/js/views/search/SearchResultLayoutView.js       | 4 ++--
 .../public/js/templates/search/SearchDefaultLayoutView_tmpl.html   | 4 ++--
 .../public/js/templates/search/SearchResultLayoutView_tmpl.html    | 2 ++
 dashboardv3/public/js/utils/CommonViewFunction.js                  | 4 ++--
 dashboardv3/public/js/views/search/SearchDefaultLayoutView.js      | 2 +-
 dashboardv3/public/js/views/search/SearchResultLayoutView.js       | 4 ++--
 9 files changed, 20 insertions(+), 15 deletions(-)


[atlas] 01/02: ATLAS-3981: UI: Create Entity button is shown for a user without create entity permission in ranger

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

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

commit ba8b490cd192b497d3bc4996f68e016814a92fbb
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Tue Oct 6 19:56:49 2020 +0530

    ATLAS-3981: UI: Create Entity button is shown for a user without create entity permission in ranger
    
    (cherry picked from commit f5ffd06486f6ef3c28236c6c70e74561542d30c1)
---
 dashboardv2/public/js/router/Router.js                             | 2 +-
 .../public/js/templates/search/SearchResultLayoutView_tmpl.html    | 7 ++++---
 dashboardv2/public/js/views/glossary/GlossaryLayoutView.js         | 6 ++++--
 dashboardv2/public/js/views/search/SearchResultLayoutView.js       | 4 ++--
 .../public/js/templates/search/SearchDefaultLayoutView_tmpl.html   | 4 ++--
 .../public/js/templates/search/SearchResultLayoutView_tmpl.html    | 2 ++
 dashboardv3/public/js/views/search/SearchResultLayoutView.js       | 4 ++--
 7 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/dashboardv2/public/js/router/Router.js b/dashboardv2/public/js/router/Router.js
index 8e3afa0..97635b9 100644
--- a/dashboardv2/public/js/router/Router.js
+++ b/dashboardv2/public/js/router/Router.js
@@ -384,7 +384,7 @@ define([
                     }
                 });
 
-                if (Globals.entityCreate && Utils.getUrlState.isSearchTab()) {
+                if (Utils.getUrlState.isSearchTab()) {
                     App.rNContent.show(new SearchDetailLayoutView(_.extend({ 'value': paramObj, 'initialView': true }, options)));
                 } else {
                     if (App.rNContent.currentView) {
diff --git a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
index fc780d8..9b71d28 100644
--- a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
@@ -69,13 +69,14 @@
             </div>
             <div id="r_searchResultTableLayoutView">
                 {{#if isSearchTab}}<h1><b>{{searchType}}</b></h1>{{/if}}
-                {{#if entityCreate}}
                 <div class="entityLink" style="display:none">
-                    <p class="entityLink">Search Atlas for existing entities or
+                    <p class="entityLink">Search Atlas for existing entities
+                        {{#if entityCreate}}
+                        or
                         <a href="javascript:void(0)" data-id='createEntity'> create new entity </a>
+                        {{/if}}
                     </p>
                 </div>
-                {{/if}}
             </div>
             <div class="pagination-box searach-result-pagination row" style="display: none">
                 <div class="col-sm-4">
diff --git a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
index 1ed8d76..a5d0e70 100644
--- a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
+++ b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
@@ -221,8 +221,10 @@ define(['require',
                             $tree.jstree('activate_node', obj.guid);
                         }
                     } else {
-                        setDefaultSelector();
-                        $tree.jstree('activate_node', that.glossary.selectedItem.guid);
+                        if (that.glossaryCollection.fullCollection.length) {
+                            setDefaultSelector();
+                            $tree.jstree('activate_node', that.glossary.selectedItem.guid);
+                        }
                     }
                     this.query[this.viewType] = _.extend(obj, _.pick(this.glossary.selectedItem, 'model', 'guid', 'gType', 'type'), { "viewType": this.viewType, "isNodeNotFoundAtLoad": this.query[this.viewType].isNodeNotFoundAtLoad });
                     var url = _.isEmpty(this.glossary.selectedItem) ? '#!/glossary' : '#!/glossary/' + this.glossary.selectedItem.guid;
diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
index 8fb100f..08d8781 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -668,7 +668,7 @@ define(['require',
                             var obj = model.toJSON(),
                                 nameHtml = "",
                                 name = Utils.getName(obj);
-                            if (obj.attributes.serviceType === undefined) {
+                            if (!obj.attributes || obj.attributes.serviceType === undefined) {
                                 if (Globals.serviceTypeMap[obj.typeName] === undefined && that.entityDefCollection) {
                                     var defObj = that.entityDefCollection.fullCollection.find({ name: obj.typeName });
                                     if (defObj) {
@@ -676,7 +676,7 @@ define(['require',
                                     }
                                 }
                             } else if (Globals.serviceTypeMap[obj.typeName] === undefined) {
-                                Globals.serviceTypeMap[obj.typeName] = obj.attributes.serviceType;
+                                Globals.serviceTypeMap[obj.typeName] = obj.attributes ? obj.attributes.serviceType : null;
                             }
                             obj.serviceType = Globals.serviceTypeMap[obj.typeName];
                             if (obj.guid) {
diff --git a/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html b/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html
index 1ce1218..cbac4eb 100644
--- a/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html
@@ -16,11 +16,11 @@
 -->
 <div class="f-right clearfix" data-id="resizable" style="transition: width ease 0.2s;padding-bottom: 41px;">
     <div class="search-container center">
+        {{#if entityCreate}}
         <div class="create-entity">
-            {{#if entityCreate}}
             <div class="inline"><button style="margin-top: 10px" class="btn btn-action btn-sm" data-id="createNewEntity"><i class="fa fa-plus"></i>&nbsp;Create Entity</button></div>
-            {{/if}}
         </div>
+        {{/if}}
         <div class="default-global-search row group-box">
             <div id="r_globalSearchLayoutView" class="global-search-container col-sm-12"></div>
         </div>
diff --git a/dashboardv3/public/js/templates/search/SearchResultLayoutView_tmpl.html b/dashboardv3/public/js/templates/search/SearchResultLayoutView_tmpl.html
index fc57e37..b16a4d2 100644
--- a/dashboardv3/public/js/templates/search/SearchResultLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/search/SearchResultLayoutView_tmpl.html
@@ -40,7 +40,9 @@
                 <div class="pull-right inline-content-fr no-padding-left">
                     {{#if isSearchTab}}
                     <div class="inline" data-id="colManager"></div>
+                    {{#if entityCreate}}
                     <div class="inline"><button class="btn btn-action btn-sm" data-id="createEntity"><i class="fa fa-plus"></i>&nbsp;Create Entity</button></div>
+                    {{/if}}
                     <div class="inline"><button title="Save as custom filter" class="btn btn-action btn-sm" data-id="saveFilter"><i class="fa fa-save"></i>&nbsp;Save Filter</button></div>
                     {{/if}}
                     <div class="inline">
diff --git a/dashboardv3/public/js/views/search/SearchResultLayoutView.js b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
index 1a47727..02d63aa 100644
--- a/dashboardv3/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
@@ -680,7 +680,7 @@ define(['require',
                             var obj = model.toJSON(),
                                 nameHtml = "",
                                 name = Utils.getName(obj);
-                            if (obj.attributes.serviceType === undefined) {
+                            if (!obj.attributes || obj.attributes.serviceType === undefined) {
                                 if (Globals.serviceTypeMap[obj.typeName] === undefined && that.entityDefCollection) {
                                     var defObj = that.entityDefCollection.fullCollection.find({ name: obj.typeName });
                                     if (defObj) {
@@ -688,7 +688,7 @@ define(['require',
                                     }
                                 }
                             } else if (Globals.serviceTypeMap[obj.typeName] === undefined) {
-                                Globals.serviceTypeMap[obj.typeName] = obj.attributes.serviceType;
+                                Globals.serviceTypeMap[obj.typeName] = obj.attributes ? obj.attributes.serviceType : null;
                             }
                             obj.serviceType = Globals.serviceTypeMap[obj.typeName];
                             if (obj.guid) {


[atlas] 02/02: ATLAS-3979: Beta UI : Removing one of the filters with an attribute name removes all of the filters with that attribute name.

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

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

commit 58d630bf19540710a36ec47ee9fdfd771aafa5b7
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Tue Oct 6 20:20:11 2020 +0530

    ATLAS-3979: Beta UI : Removing one of the filters with an attribute name removes all of the filters with that attribute name.
    
    (cherry picked from commit 70c1087a121feb3fe88cc67681b470109443ff81)
---
 dashboardv3/public/js/utils/CommonViewFunction.js             | 4 ++--
 dashboardv3/public/js/views/search/SearchDefaultLayoutView.js | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dashboardv3/public/js/utils/CommonViewFunction.js b/dashboardv3/public/js/utils/CommonViewFunction.js
index 0eafa9e..40d489e 100644
--- a/dashboardv3/public/js/utils/CommonViewFunction.js
+++ b/dashboardv3/public/js/utils/CommonViewFunction.js
@@ -405,9 +405,9 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
                                 obj.value = obj.value + " (" + moment.tz(moment.tz.guess()).zoneAbbr() + ")";
                             }
                         }
-                        return '<div class="capsuleView"><span class="key">' + (Enums.systemAttributes[obj.id] ? Enums.systemAttributes[obj.id] : _.escape(obj.id)) + '</span><span class="operator">' + _.escape(obj.operator) + '</span><span class="value">' + (Enums[obj.id] ? Enums[obj.id][obj.value] : _.escape(obj.value)) + "</span><div class='fa fa-close clear-attr' data-type=" + type + " data-id=" + _.escape(obj.id) + "></div></div>";
+                        return '<div class="capsuleView"><span class="key">' + (Enums.systemAttributes[obj.id] ? Enums.systemAttributes[obj.id] : _.escape(obj.id)) + '</span><span class="operator">' + _.escape(obj.operator) + '</span><span class="value">' + (Enums[obj.id] ? Enums[obj.id][obj.value] : _.escape(obj.value)) + '</span><div class="fa fa-close clear-attr" data-type=' + type + ' data-id="' + _.escape(obj.id) + key + '"></div></div>';
                     }
-                    return '<span class="key">' + (Enums.systemAttributes[obj.id] ? Enums.systemAttributes[obj.id] : _.escape(obj.id)) + '</span><span class="operator">' + _.escape(obj.operator) + '</span><span class="value">' + (Enums[obj.id] ? Enums[obj.id][obj.value] : _.escape(obj.value)) + "</span>";
+                    return '<span class="key">' + (Enums.systemAttributes[obj.id] ? Enums.systemAttributes[obj.id] : _.escape(obj.id)) + '</span><span class="operator">' + _.escape(obj.operator) + '</span><span class="value">' + (Enums[obj.id] ? Enums[obj.id][obj.value] : _.escape(obj.value)) + '</span>';
                 }
             });
             return generatedQuery;
diff --git a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
index bae01bf..468e83a 100644
--- a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
@@ -152,7 +152,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
                     that = this;
 
                 filters.rules = _.filter(rules, function(obj, key) {
-                    return obj.id != $(e.currentTarget).data("id");
+                    return (obj.id + key) != $(e.currentTarget).data("id");
                 });
                 if (filters) {
                     that.updateFilterOptions(filters, filtertype, isTag);