ATLAS-3537 : UI: Allow users to search for deleted & shell entities from statistics popup
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 @@
                     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 @@
                         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 @@
         }
     );
     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 @@
                                 _.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 @@
             }
         });
     return SearchLayoutView;
-});
\ No newline at end of file
+});