Commit 6435223d by kevalbhatt

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

parent e202e9e4
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<tbody> <tbody>
{{#each data}} {{#each data}}
<tr> <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}} {{#if this.active}}
<td> <td>
<a title="Search for active entities of type '{{@key}}'" class="linkClicked" href="#!/search/searchResult?searchType=basic&type={{@key}}">{{this.active}}</a> <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 @@ ...@@ -36,14 +36,14 @@
{{/if}} {{/if}}
{{#if this.deleted}} {{#if this.deleted}}
<td class="readOnlyLink"> <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> </td>
{{else}} {{else}}
<td>0</td> <td>0</td>
{{/if}} {{/if}}
{{#if this.shell}} {{#if this.shell}}
<td> <td class="readOnlyLink">
{{this.shell}} <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> </td>
{{else}} {{else}}
<td>0</td> <td>0</td>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<tbody> <tbody>
{{#each data}} {{#each data}}
<tr> <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}} {{#if this.active}}
<td> <td>
<a title="Search for active entities of type '{{@key}}'" class="linkClicked" href="#!/search/searchResult?searchType=basic&type={{@key}}">{{this.active}}</a> <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 @@ ...@@ -36,14 +36,14 @@
{{/if}} {{/if}}
{{#if this.deleted}} {{#if this.deleted}}
<td class="readOnlyLink"> <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> </td>
{{else}} {{else}}
<td>0</td> <td>0</td>
{{/if}} {{/if}}
{{#if this.shell}} {{#if this.shell}}
<td> <td class="readOnlyLink">
{{this.shell}} <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> </td>
{{else}} {{else}}
<td>0</td> <td>0</td>
......
...@@ -215,6 +215,17 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa ...@@ -215,6 +215,17 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
that.RSearchResultLayoutView.show(new SearchResultLayoutView(that.options)); 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) { onClickAttrFilter: function(filterType) {
var that = this, var that = this,
obj = { obj = {
...@@ -223,7 +234,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa ...@@ -223,7 +234,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
entityDefCollection: that.options.entityDefCollection, entityDefCollection: that.options.entityDefCollection,
enumDefCollection: that.options.enumDefCollection, enumDefCollection: that.options.enumDefCollection,
classificationDefCollection: that.options.classificationDefCollection, 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.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); 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 ...@@ -438,4 +449,4 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
} }
); );
return SearchDefaultlLayoutView; return SearchDefaultlLayoutView;
}); });
\ No newline at end of file
...@@ -227,12 +227,12 @@ define(['require', ...@@ -227,12 +227,12 @@ define(['require',
_.extend(this.query[this.type], temp); _.extend(this.query[this.type], temp);
} else if (isBasicSearch) { } else if (isBasicSearch) {
// Initial loading handle. // Initial loading handle.
if (filterType) { // if (filterType) {
var filterObj = this.searchTableFilters[filterType]; // var filterObj = this.searchTableFilters[filterType];
if (filterObj && this.value[key]) { // if (filterObj && this.value[key]) {
this.searchTableFilters[filterType][this.value[key]] = this.value[filterType] ? this.value[filterType] : null; // this.searchTableFilters[filterType][this.value[key]] = this.value[filterType] ? this.value[filterType] : null;
} // }
} // }
if (this.value.type) { if (this.value.type) {
if (this.value.attributes) { if (this.value.attributes) {
...@@ -748,4 +748,4 @@ define(['require', ...@@ -748,4 +748,4 @@ define(['require',
} }
}); });
return SearchLayoutView; return SearchLayoutView;
}); });
\ No newline at end of file
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