Commit 6435223d by kevalbhatt

ATLAS-3537 : UI: Allow users to search for deleted & shell entities from statistics popup

parent e202e9e4
......@@ -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>
......
......@@ -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>
......
......@@ -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);
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment