[Trunk|Connect]: Search Communities: Remove status and role filters when user logged out

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@55352 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2019-04-15 09:16:29 +00:00
parent 00a1d831ac
commit 77f285703f
1 changed files with 14 additions and 10 deletions

View File

@ -240,20 +240,24 @@ export class SearchCommunitiesComponent {
*/
private checkFilters(params: Map<string, string>) {
let typeResults: CommunityInfo[] = this.applyFilter('type', params);
let statusResults: CommunityInfo[] = this.applyFilter('status' , params);
let roleResults: CommunityInfo[] = this.applyFilter('role', params);
this.resetFilterNumbers('status');
this.updateFilterNumbers(typeResults.filter(value => {
return roleResults.includes(value);
}), 'status');
let statusResults: CommunityInfo[] = this.results;
let roleResults: CommunityInfo[] = this.results;
if(Session.isLoggedIn()) {
statusResults = this.applyFilter('status', params);
roleResults = this.applyFilter('role', params);
this.resetFilterNumbers('status');
this.updateFilterNumbers(typeResults.filter(value => {
return roleResults.includes(value);
}), 'status');
this.resetFilterNumbers('role');
this.updateFilterNumbers(statusResults.filter(value => {
return typeResults.includes(value);
}), 'role');
}
this.resetFilterNumbers('type');
this.updateFilterNumbers(statusResults.filter(value => {
return roleResults.includes(value);
}), 'type');
this.resetFilterNumbers('role');
this.updateFilterNumbers(statusResults.filter(value => {
return typeResults.includes(value);
}), 'role');
this.results = statusResults.filter(value => {
return typeResults.includes(value);
})