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/12/06 11:59:45 UTC

[atlas] 02/02: ATLAS-3537 : UI: Allow users to search for deleted & shell entities from statistics popup

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

commit 6435223d8687423d8e6ff1c35248a368c9720879
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Tue Dec 3 14:24:31 2019 +0530

    ATLAS-3537 : UI: Allow users to search for deleted & shell entities from statistics popup
---
 dashboardv2/public/js/templates/site/entity_tmpl.html     |  8 ++++----
 dashboardv3/public/js/templates/site/entity_tmpl.html     |  8 ++++----
 .../public/js/views/search/SearchDefaultLayoutView.js     | 15 +++++++++++++--
 dashboardv3/public/js/views/search/SearchLayoutView.js    | 14 +++++++-------
 4 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/dashboardv2/public/js/templates/site/entity_tmpl.html b/dashboardv2/public/js/templates/site/entity_tmpl.html
index 974006a..ec88fd1 100644
--- a/dashboardv2/public/js/templates/site/entity_tmpl.html
+++ b/dashboardv2/public/js/templates/site/entity_tmpl.html
@@ -26,7 +26,7 @@
 <tbody>
     {{#each data}}
     <tr>
-        <td><a class="linkClicked" href="#!/search/searchResult?searchType=basic&type={{@key}}&includeDE=true">{{@key}}&nbsp;({{arithmetic this.active '+' this.deleted}})</a></td>
+        <td><span>{{@key}}&nbsp;({{arithmetic this.active '+' this.deleted}})</span></td>
         {{#if this.active}}
         <td>
             <a title="Search for active entities of type '{{@key}}'" class="linkClicked" href="#!/search/searchResult?searchType=basic&type={{@key}}">{{this.active}}</a>
@@ -36,14 +36,14 @@
         {{/if}}
         {{#if this.deleted}}
         <td class="readOnlyLink">
-            <a title="Search for deleted entities of type '{{@key}}'" class="linkClicked" href="#!/search/searchResult?searchType=basic&type={{@key}}&includeDE=true">{{this.deleted}}</a>
+            <a title="Search for deleted entities of type '{{@key}}'" class="linkClicked" href="#!/search/searchResult?type={{@key}}&attributes=__state%2Cdescription%2Cname%2Cowner%2Cselected%2Ctag%2CtypeName&entityFilters=AND(__state%3A%3A%3D%3A%3ADELETED%3A%3Astring)&includeDE=true&searchType=basic">{{this.deleted}}</a>
         </td>
         {{else}}
         <td>0</td>
         {{/if}}
         {{#if this.shell}}
-        <td>
-            {{this.shell}}
+        <td class="readOnlyLink">
+            <a title="Search for shell entities of type '{{@key}}'" class="linkClicked" href="#!/search/searchResult?type={{@key}}&attributes=__isIncomplete%2Cdescription%2Cname%2Cowner%2Cselected%2Ctag%2CtypeName&entityFilters=AND(__isIncomplete%3A%3A%3D%3A%3A1%3A%3Ainteger)&searchType=basic">{{this.shell}}</a>
         </td>
         {{else}}
         <td>0</td>
diff --git a/dashboardv3/public/js/templates/site/entity_tmpl.html b/dashboardv3/public/js/templates/site/entity_tmpl.html
index 974006a..ec88fd1 100644
--- a/dashboardv3/public/js/templates/site/entity_tmpl.html
+++ b/dashboardv3/public/js/templates/site/entity_tmpl.html
@@ -26,7 +26,7 @@
 <tbody>
     {{#each data}}
     <tr>
-        <td><a class="linkClicked" href="#!/search/searchResult?searchType=basic&type={{@key}}&includeDE=true">{{@key}}&nbsp;({{arithmetic this.active '+' this.deleted}})</a></td>
+        <td><span>{{@key}}&nbsp;({{arithmetic this.active '+' this.deleted}})</span></td>
         {{#if this.active}}
         <td>
             <a title="Search for active entities of type '{{@key}}'" class="linkClicked" href="#!/search/searchResult?searchType=basic&type={{@key}}">{{this.active}}</a>
@@ -36,14 +36,14 @@
         {{/if}}
         {{#if this.deleted}}
         <td class="readOnlyLink">
-            <a title="Search for deleted entities of type '{{@key}}'" class="linkClicked" href="#!/search/searchResult?searchType=basic&type={{@key}}&includeDE=true">{{this.deleted}}</a>
+            <a title="Search for deleted entities of type '{{@key}}'" class="linkClicked" href="#!/search/searchResult?type={{@key}}&attributes=__state%2Cdescription%2Cname%2Cowner%2Cselected%2Ctag%2CtypeName&entityFilters=AND(__state%3A%3A%3D%3A%3ADELETED%3A%3Astring)&includeDE=true&searchType=basic">{{this.deleted}}</a>
         </td>
         {{else}}
         <td>0</td>
         {{/if}}
         {{#if this.shell}}
-        <td>
-            {{this.shell}}
+        <td class="readOnlyLink">
+            <a title="Search for shell entities of type '{{@key}}'" class="linkClicked" href="#!/search/searchResult?type={{@key}}&attributes=__isIncomplete%2Cdescription%2Cname%2Cowner%2Cselected%2Ctag%2CtypeName&entityFilters=AND(__isIncomplete%3A%3A%3D%3A%3A1%3A%3Ainteger)&searchType=basic">{{this.shell}}</a>
         </td>
         {{else}}
         <td>0</td>
diff --git a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
index 3946cff..3716edc 100644
--- a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
@@ -215,6 +215,17 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
                     that.RSearchResultLayoutView.show(new SearchResultLayoutView(that.options));
                 });
             },
+            checkEntityFilter: function(options) {
+                if (options && options.value) {
+                    if (options.value.type && options.value.entityFilters) {
+                        options.searchTableFilters.entityFilters[options.value.type] = options.value.entityFilters;
+                    }
+                    if (options.value.tag && options.value.tagFilters) {
+                        options.searchTableFilters.tagFilters[options.value.tag] = options.value.tagFilters;
+                    }
+                }
+                return options.searchTableFilters;
+            },
             onClickAttrFilter: function(filterType) {
                 var that = this,
                     obj = {
@@ -223,7 +234,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
                         entityDefCollection: that.options.entityDefCollection,
                         enumDefCollection: that.options.enumDefCollection,
                         classificationDefCollection: that.options.classificationDefCollection,
-                        searchTableFilters: that.options.searchTableFilters
+                        searchTableFilters: that.checkEntityFilter(that.options)
                     };
                 this.ui.checkDeletedEntity.prop('checked', this.options.value.includeDE ? this.options.value.includeDE : false);
                 this.ui.checkSubClassification.prop('checked', this.options.value.excludeSC ? this.options.value.excludeSC : false);
@@ -438,4 +449,4 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
         }
     );
     return SearchDefaultlLayoutView;
-});
+});
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/search/SearchLayoutView.js b/dashboardv3/public/js/views/search/SearchLayoutView.js
index f1f2fc2..fc1e8ba 100644
--- a/dashboardv3/public/js/views/search/SearchLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchLayoutView.js
@@ -227,12 +227,12 @@ define(['require',
                                 _.extend(this.query[this.type], temp);
                             } else if (isBasicSearch) {
                                 // Initial loading handle.
-                                if (filterType) {
-                                    var filterObj = this.searchTableFilters[filterType];
-                                    if (filterObj && this.value[key]) {
-                                        this.searchTableFilters[filterType][this.value[key]] = this.value[filterType] ? this.value[filterType] : null;
-                                    }
-                                }
+                                // if (filterType) {
+                                //     var filterObj = this.searchTableFilters[filterType];
+                                //     if (filterObj && this.value[key]) {
+                                //         this.searchTableFilters[filterType][this.value[key]] = this.value[filterType] ? this.value[filterType] : null;
+                                //     }
+                                // }
 
                                 if (this.value.type) {
                                     if (this.value.attributes) {
@@ -748,4 +748,4 @@ define(['require',
             }
         });
     return SearchLayoutView;
-});
\ No newline at end of file
+});