Search results:
add properly the piwik id Search/find pass communityId to filter the results and piwik id git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@53927 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
87be3ca01c
commit
e02f4ce6f3
|
@ -1,19 +1,33 @@
|
|||
import {Component, ViewChild, ElementRef} from '@angular/core';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
import {PiwikHelper} from '../../utils/piwikHelper';
|
||||
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
||||
|
||||
@Component({
|
||||
selector: 'openaire-search-find',
|
||||
template: `
|
||||
<search-find></search-find>
|
||||
template: `
|
||||
<search-find [(connectCommunityId)]=connectCommunityId [piwikSiteId]="piwikSiteId"></search-find>
|
||||
`,
|
||||
})
|
||||
export class OpenaireSearchComponent{
|
||||
constructor ( ) {
|
||||
|
||||
connectCommunityId:string;
|
||||
piwikSiteId = null;
|
||||
constructor ( private route: ActivatedRoute) {
|
||||
}
|
||||
ngOnInit() {
|
||||
var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname);
|
||||
if(communityId){
|
||||
this.connectCommunityId = communityId
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
|
||||
}else{
|
||||
this.route.queryParams.subscribe(data => {
|
||||
if(data['communityId'] && data['communityId']!=""){
|
||||
this.connectCommunityId = data['communityId'];
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
|||
|
||||
<search-datasets
|
||||
openaireLink="https://beta.explore.openaire.eu/search/find/datasets"
|
||||
[(connectCommunityId)]=connectCommunityId>
|
||||
[(connectCommunityId)]=connectCommunityId [piwikSiteId]="piwikSiteId">
|
||||
</search-datasets>
|
||||
`
|
||||
})
|
||||
|
@ -22,14 +22,14 @@ export class OpenaireSearchDatasetsComponent {
|
|||
}
|
||||
ngOnInit() {
|
||||
var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname);
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
||||
if(communityId){
|
||||
this.connectCommunityId = communityId
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
|
||||
}else{
|
||||
this.route.queryParams.subscribe(data => {
|
||||
|
||||
if(data['communityId'] && data['communityId']!=""){
|
||||
this.connectCommunityId = data['communityId'];
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
|||
|
||||
<search-orps openaireLink="https://beta.explore.openaire.eu/search/find/other"
|
||||
|
||||
[(connectCommunityId)]=connectCommunityId>
|
||||
[(connectCommunityId)]=connectCommunityId [piwikSiteId]="piwikSiteId">
|
||||
</search-orps>
|
||||
|
||||
`
|
||||
|
@ -24,13 +24,14 @@ export class OpenaireSearchOrpsComponent {
|
|||
}
|
||||
ngOnInit() {
|
||||
var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname);
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
||||
if(communityId){
|
||||
this.connectCommunityId = communityId
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
|
||||
}else{
|
||||
this.route.queryParams.subscribe(data => {
|
||||
if(data['communityId'] && data['communityId']!=""){
|
||||
this.connectCommunityId = data['communityId'];
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
|||
|
||||
<search-publications openaireLink="https://beta.explore.openaire.eu/search/find/publications"
|
||||
|
||||
[(connectCommunityId)]=connectCommunityId>
|
||||
[(connectCommunityId)]=connectCommunityId [piwikSiteId]="piwikSiteId">
|
||||
</search-publications>
|
||||
|
||||
`
|
||||
|
@ -24,13 +24,14 @@ export class OpenaireSearchPublicationsComponent {
|
|||
}
|
||||
ngOnInit() {
|
||||
var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname);
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
||||
if(communityId){
|
||||
this.connectCommunityId = communityId
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
|
||||
}else{
|
||||
this.route.queryParams.subscribe(data => {
|
||||
if(data['communityId'] && data['communityId']!=""){
|
||||
this.connectCommunityId = data['communityId'];
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
|||
|
||||
<search-software
|
||||
openaireLink="https://beta.explore.openaire.eu/search/find/software"
|
||||
[(connectCommunityId)]=connectCommunityId>
|
||||
[(connectCommunityId)]=connectCommunityId [piwikSiteId]="piwikSiteId">
|
||||
</search-software>
|
||||
`
|
||||
})
|
||||
|
@ -22,14 +22,14 @@ export class OpenaireSearchSoftwareComponent {
|
|||
}
|
||||
ngOnInit() {
|
||||
var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname);
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
||||
if(communityId){
|
||||
this.connectCommunityId = communityId
|
||||
this.connectCommunityId = communityId
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
|
||||
}else{
|
||||
this.route.queryParams.subscribe(data => {
|
||||
|
||||
if(data['communityId'] && data['communityId']!=""){
|
||||
this.connectCommunityId = data['communityId'];
|
||||
this.connectCommunityId = data['communityId'];
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue