Revision 56071
Added by Argiro Kokogiannaki almost 5 years ago
advancedSearchSoftware.component.ts | ||
---|---|---|
2 | 2 |
import {ActivatedRoute} from '@angular/router'; |
3 | 3 |
import {PiwikHelper} from '../../utils/piwikHelper'; |
4 | 4 |
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper'; |
5 |
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; |
|
5 | 6 |
|
6 | 7 |
@Component({ |
7 | 8 |
selector: 'openaire-advanced-search-software', |
8 | 9 |
template: ` |
9 |
<advanced-search-software [(connectCommunityId)]=connectCommunityId>
|
|
10 |
<advanced-search-software [customFilter]=customFilter [piwikSiteId]="piwikSiteId">
|
|
10 | 11 |
</advanced-search-software> |
11 | 12 |
|
12 | 13 |
` |
... | ... | |
15 | 16 |
export class OpenaireAdvancedSearchSoftwareComponent { |
16 | 17 |
connectCommunityId:string; |
17 | 18 |
piwikSiteId = null; |
19 |
customFilter: SearchCustomFilter = null; |
|
18 | 20 |
constructor ( private route: ActivatedRoute) { |
19 | 21 |
} |
20 | 22 |
ngOnInit() { |
... | ... | |
25 | 27 |
|
26 | 28 |
this.piwikSiteId = PiwikHelper.siteIDs[communityId]; |
27 | 29 |
if(communityId){ |
28 |
this.connectCommunityId = communityId |
|
30 |
this.connectCommunityId = communityId; |
|
31 |
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, ""); |
|
29 | 32 |
}else{ |
30 | 33 |
this.route.queryParams.subscribe(data => { |
31 | 34 |
|
32 | 35 |
if(data['communityId'] && data['communityId']!=""){ |
33 | 36 |
this.connectCommunityId = data['communityId']; |
34 | 37 |
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId]; |
38 |
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, ""); |
|
35 | 39 |
} |
36 | 40 |
}); |
37 | 41 |
} |
Also available in: Unified diff
[Connect |Trunk]
For connect search pages: replace community Id with customFilter