diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 05f8e25..8d939fe 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -83,9 +83,9 @@ export class AppComponent { items: [] }, {rootItem: new MenuItem("search","Search","","",false,[],[],{}), - items: [new MenuItem("","Publications","","/search/find/publications",false,["publication"],["/search/find/publications"],{community: encodeURIComponent('"'+community.queryId+'"'), communityId: community.communityId}), - new MenuItem("","Research Data","","/search/find/datasets",false,["dataset"],["/search/find/datasets"],{community: encodeURIComponent('"'+community.queryId+'"'), communityId: community.communityId}), - new MenuItem("","Software","","/search/find/software",false,["software"],["/search/find/software"],{community: encodeURIComponent('"'+community.queryId+'"'), communityId: community.communityId}), + items: [new MenuItem("","Publications","","/search/find/publications",false,["publication"],["/search/find/publications"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), + new MenuItem("","Research Data","","/search/find/datasets",false,["dataset"],["/search/find/datasets"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), + new MenuItem("","Software","","/search/find/software",false,["software"],["/search/find/software"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), new MenuItem("","Projects","","/search/find/projects/",false,["project"],["/search/find/projects"],{communityId: community.communityId}), new MenuItem("","Content Providers","","/search/find/dataproviders",false,["datasource"],["/search/find/dataproviders"],{communityId: community.communityId}), // new MenuItem("","Organizations","","/search/find/organizations/",false,["organization"],["/search/find/organizations"],{community: community.communityId}), diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index 0c90f43..3e6043f 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -90,7 +90,7 @@ export class CommunityComponent { this._communityService.getCommunity(this.properties, this.properties.communityAPI+this.communityId).subscribe ( community => { this.community = community; - this.params = {community: encodeURIComponent('"'+community.queryId+'"')}; + this.params = {communityId: community.communityId}; this._meta.updateTag({content:community.description},"name='description'"); this._meta.updateTag({content:community.description},"property='og:description'"); this._meta.updateTag({content:community.title},"property='og:title'"); diff --git a/src/app/searchPages/simple/searchDatasets.component.ts b/src/app/searchPages/simple/searchDatasets.component.ts index 8cda89e..71e8b09 100644 --- a/src/app/searchPages/simple/searchDatasets.component.ts +++ b/src/app/searchPages/simple/searchDatasets.component.ts @@ -20,18 +20,21 @@ export class OpenaireSearchDatasetsComponent { connectCommunityId:string; piwikSiteId = null; constructor ( private route: ActivatedRoute) { + } + ngOnInit() { var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname); this.piwikSiteId = PiwikHelper.siteIDs[communityId]; - } - - ngOnInit() { - this.route.queryParams.subscribe(data => { + if(communityId){ + this.advancedSearchParameters = {community:communityId, co: "and"}; + this.connectCommunityId = communityId + }else{ + this.route.queryParams.subscribe(data => { - if(data['community'] && data['community']!=""){ - this.advancedSearchParameters = {community: data['community'], co: "and"}; - var id= decodeURIComponent(data['community']); - this.connectCommunityId = id.slice(1,id.length - 1); - } - }); + if(data['communityId'] && data['communityId']!=""){ + this.advancedSearchParameters = {community: data['community'], co: "and"}; + this.connectCommunityId = data['communityId']; + } + }); + } + } } -} diff --git a/src/app/searchPages/simple/searchPublications.component.ts b/src/app/searchPages/simple/searchPublications.component.ts index 3912859..cf2fa08 100644 --- a/src/app/searchPages/simple/searchPublications.component.ts +++ b/src/app/searchPages/simple/searchPublications.component.ts @@ -21,17 +21,21 @@ export class OpenaireSearchPublicationsComponent { connectCommunityId:string; piwikSiteId = null; constructor ( private route: ActivatedRoute) { - var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname); - this.piwikSiteId = PiwikHelper.siteIDs[communityId]; } ngOnInit() { - this.route.queryParams.subscribe(data => { + var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname); + this.piwikSiteId = PiwikHelper.siteIDs[communityId]; + if(communityId){ + this.advancedSearchParameters = {community:communityId, co: "and"}; + this.connectCommunityId = communityId + }else{ + this.route.queryParams.subscribe(data => { - if(data['community'] && data['community']!=""){ - this.advancedSearchParameters = {community: data['community'], co: "and"}; - var id= decodeURIComponent(data['community']); - this.connectCommunityId = id.slice(1,id.length - 1); - } - }); + if(data['communityId'] && data['communityId']!=""){ + this.advancedSearchParameters = {community: data['community'], co: "and"}; + this.connectCommunityId = data['communityId']; + } + }); + } } } diff --git a/src/app/searchPages/simple/searchSoftware.component.ts b/src/app/searchPages/simple/searchSoftware.component.ts index 3741ece..c00f0b0 100644 --- a/src/app/searchPages/simple/searchSoftware.component.ts +++ b/src/app/searchPages/simple/searchSoftware.component.ts @@ -20,17 +20,21 @@ export class OpenaireSearchSoftwareComponent { connectCommunityId:string; piwikSiteId = null; constructor ( private route: ActivatedRoute) { - var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname); - this.piwikSiteId = PiwikHelper.siteIDs[communityId]; } ngOnInit() { - this.route.queryParams.subscribe(data => { + var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname); + this.piwikSiteId = PiwikHelper.siteIDs[communityId]; + if(communityId){ + this.advancedSearchParameters = {community:communityId, co: "and"}; + this.connectCommunityId = communityId + }else{ + this.route.queryParams.subscribe(data => { - if(data['community'] && data['community']!=""){ - this.advancedSearchParameters = {community: data['community'], co: "and"}; - var id= decodeURIComponent(data['community']); - this.connectCommunityId = id.slice(1,id.length - 1); - } - }); + if(data['communityId'] && data['communityId']!=""){ + this.advancedSearchParameters = {community: data['community'], co: "and"}; + this.connectCommunityId = data['communityId']; + } + }); + } } } diff --git a/src/assets/home.jpg b/src/assets/home.jpg new file mode 100644 index 0000000..0762570 Binary files /dev/null and b/src/assets/home.jpg differ