diff --git a/searchPages/advanced/advancedSearchDatasets.component.ts b/searchPages/advanced/advancedSearchDatasets.component.ts index d54038a3..84b4304d 100644 --- a/searchPages/advanced/advancedSearchDatasets.component.ts +++ b/searchPages/advanced/advancedSearchDatasets.component.ts @@ -23,7 +23,7 @@ import{EnvProperties} from '../../utils/properties/env-properties'; [csvParams]="csvParams" csvPath="datasets" simpleSearchLink="/search/find/datasets" [disableForms]="disableForms" [loadPaging]="loadPaging" - [oldTotalResults]="oldTotalResults" [piwikSiteId]=piwikSiteId > + [oldTotalResults]="oldTotalResults" [(connectCommunityId)]=connectCommunityId [piwikSiteId]=piwikSiteId > ` @@ -33,6 +33,7 @@ export class AdvancedSearchDatasetsComponent { private errorCodes: ErrorCodes; properties:EnvProperties; @Input() piwikSiteId = null; +@Input() connectCommunityId: string; public results =[]; public filters =[]; @@ -82,6 +83,7 @@ export class AdvancedSearchDatasetsComponent { this.selectedFields =[]; this.searchPage.selectedFields = this.selectedFields; this.searchPage.fieldIdsMap = this.fieldIdsMap; + this.searchPage.connectCommunityId = this.connectCommunityId; this.searchPage.getSelectedFiltersFromUrl(params); this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size); diff --git a/searchPages/advanced/advancedSearchPublications.component.ts b/searchPages/advanced/advancedSearchPublications.component.ts index 36b8d00d..66649c38 100644 --- a/searchPages/advanced/advancedSearchPublications.component.ts +++ b/searchPages/advanced/advancedSearchPublications.component.ts @@ -48,7 +48,7 @@ export class AdvancedSearchPublicationsComponent { public loadPaging: boolean = true; public oldTotalResults: number = 0; @Input() openaireLink: string ; - @Input() connectCommunityId: string = "egi||EGI Federation"; + @Input() connectCommunityId: string; public pagingLimit: number = 0; public isPiwikEnabled; properties:EnvProperties; @@ -88,7 +88,7 @@ export class AdvancedSearchPublicationsComponent { this.selectedFields =[]; this.searchPage.selectedFields = this.selectedFields; this.searchPage.fieldIdsMap = this.fieldIdsMap; - + this.searchPage.connectCommunityId = this.connectCommunityId; this.searchPage.getSelectedFiltersFromUrl(params); this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size); }); diff --git a/searchPages/advanced/advancedSearchSoftware.component.ts b/searchPages/advanced/advancedSearchSoftware.component.ts index b49cbd7d..ef036a2f 100644 --- a/searchPages/advanced/advancedSearchSoftware.component.ts +++ b/searchPages/advanced/advancedSearchSoftware.component.ts @@ -23,7 +23,7 @@ import{EnvProperties} from '../../utils/properties/env-properties'; [csvParams]="csvParams" csvPath="software" simpleSearchLink="/search/find/software" [disableForms]="disableForms" [loadPaging]="loadPaging" - [oldTotalResults]="oldTotalResults" [piwikSiteId]=piwikSiteId> + [oldTotalResults]="oldTotalResults" [(connectCommunityId)]=connectCommunityId [piwikSiteId]=piwikSiteId> ` @@ -32,6 +32,7 @@ import{EnvProperties} from '../../utils/properties/env-properties'; export class AdvancedSearchSoftwareComponent { private errorCodes: ErrorCodes; @Input() piwikSiteId = null; +@Input() connectCommunityId: string; public results =[]; public filters =[]; @@ -83,6 +84,7 @@ export class AdvancedSearchSoftwareComponent { this.selectedFields =[]; this.searchPage.selectedFields = this.selectedFields; this.searchPage.fieldIdsMap = this.fieldIdsMap; + this.searchPage.connectCommunityId = this.connectCommunityId; this.searchPage.getSelectedFiltersFromUrl(params); this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size); diff --git a/searchPages/searchUtils/advancedSearchPage.component.ts b/searchPages/searchUtils/advancedSearchPage.component.ts index 38791caf..f05dac8b 100644 --- a/searchPages/searchUtils/advancedSearchPage.component.ts +++ b/searchPages/searchUtils/advancedSearchPage.component.ts @@ -147,11 +147,9 @@ export class AdvancedSearchPageComponent { this.selectedFields.push(dateField); } - }else{ - console.log(" "+this.connectCommunityId+" "+values[j]+" "+ fieldId) - if(!(this.connectCommunityId && fieldId == "community" && this.connectCommunityId == values[j] )){ + } + else{ this.selectedFields.push(new AdvancedField(fieldId,fieldparam,this.fieldIdsMap[fieldId].name,this.fieldIdsMap[fieldId].type,StringUtils.unquote(values[j]),operators[j]) ); - } } } } @@ -197,7 +195,6 @@ export class AdvancedSearchPageComponent { this.parameterValues.push(fields[this.fieldIds[i]].operators.join()); } } - //TODO -- if(includePage && this.searchUtils.page != 1){ params += "&page="+this.searchUtils.page; } @@ -229,7 +226,11 @@ export class AdvancedSearchPageComponent { countParams++; } } - //TODO -- + + //community + if(this.connectCommunityId ){ + params += (countParams == 0 ? "" : " and " ) + "communityId exact "+'"' + this.connectCommunityId +'"' + " "; + } return params; }