diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 8e5e50f..3edeabb 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -115,13 +115,11 @@ export class AppComponent { } ]; let params = {}; - params[this.agg.queryFieldName] = this.agg.valueId; - this.menuItems[1].items.push(new MenuItem("", "Research outcomes", "", "/search/find/research-outcomes", false, [], ["/search/find/research-outcomes"], params)) - - this.menuItems[1].items.push(new MenuItem("", "Projects", "", "/search/find/projects", false, ["project"], ["/search/find/projects"], - {cf: true})); - this.menuItems[1].items.push(new MenuItem("", "Content Providers", "", "/search/find/dataproviders", false, ["datasource"], ["/search/find/dataproviders"], params)) - this.menuItems[1].items.push(new MenuItem("", "Organizations", "", "/search/find/organizations", false, ["organization"], ["/search/find/organizations"], params)) + // params[this.agg.queryFieldName] = this.agg.valueId; + this.menuItems[1].items.push(new MenuItem("", "Research outcomes", "", "/search/find/research-outcomes", false, [], ["/search/find/research-outcomes"], params)); + this.menuItems[1].items.push(new MenuItem("", "Projects", "", "/search/find/projects", false, ["project"], ["/search/find/projects"], params)); + this.menuItems[1].items.push(new MenuItem("", "Content Providers", "", "/search/find/dataproviders", false, ["datasource"], ["/search/find/dataproviders"], params)); + this.menuItems[1].items.push(new MenuItem("", "Organizations", "", "/search/find/organizations", false, ["organization"], ["/search/find/organizations"], params)); } } diff --git a/src/app/searchPages/advanced/advancedSearchDataProviders.component.ts b/src/app/searchPages/advanced/advancedSearchDataProviders.component.ts index 1a04219..5a50719 100644 --- a/src/app/searchPages/advanced/advancedSearchDataProviders.component.ts +++ b/src/app/searchPages/advanced/advancedSearchDataProviders.component.ts @@ -1,15 +1,15 @@ import {Component} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {ActivatedRoute} from "@angular/router"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; +import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @Component({ selector: 'openaire-advanced-search-dataprovider', template: ` - + ` @@ -18,12 +18,10 @@ import {properties} from "../../../environments/environment"; export class OpenaireAdvancedSearchDataProvidersComponent { customFilter: SearchCustomFilter = null; - - constructor(private route: ActivatedRoute) { - - } - + properties: EnvProperties; + constructor ( ) {} ngOnInit() { + this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); diff --git a/src/app/searchPages/advanced/advancedSearchOrganizations.component.ts b/src/app/searchPages/advanced/advancedSearchOrganizations.component.ts index bc4f011..b3ee6e0 100644 --- a/src/app/searchPages/advanced/advancedSearchOrganizations.component.ts +++ b/src/app/searchPages/advanced/advancedSearchOrganizations.component.ts @@ -1,15 +1,15 @@ import {Component} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {ActivatedRoute} from "@angular/router"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; +import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @Component({ selector: 'openaire-advanced-search-organizations', template: ` - + ` @@ -18,11 +18,10 @@ import {properties} from "../../../environments/environment"; export class OpenaireAdvancedSearchOrganizationsComponent { customFilter:SearchCustomFilter= null; - constructor(private route: ActivatedRoute) { - - } - + properties: EnvProperties; + constructor ( ) {} ngOnInit() { + this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); diff --git a/src/app/searchPages/advanced/advancedSearchProjects.component.ts b/src/app/searchPages/advanced/advancedSearchProjects.component.ts index 45a14a4..f8f3982 100644 --- a/src/app/searchPages/advanced/advancedSearchProjects.component.ts +++ b/src/app/searchPages/advanced/advancedSearchProjects.component.ts @@ -1,14 +1,14 @@ import {Component} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {ActivatedRoute} from "@angular/router"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; +import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @Component({ selector: 'openaire-advanced-search-projects', template: ` - + ` @@ -17,11 +17,10 @@ import {properties} from "../../../environments/environment"; export class OpenaireAdvancedSearchProjectsComponent { customFilter:SearchCustomFilter= null; - constructor(private route: ActivatedRoute) { - - } - + properties: EnvProperties; + constructor ( ) {} ngOnInit() { + this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); diff --git a/src/app/searchPages/advanced/searchResearchResults.component.ts b/src/app/searchPages/advanced/searchResearchResults.component.ts index 8709483..c43ed56 100644 --- a/src/app/searchPages/advanced/searchResearchResults.component.ts +++ b/src/app/searchPages/advanced/searchResearchResults.component.ts @@ -1,23 +1,24 @@ import {Component, Input} from '@angular/core'; import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {ActivatedRoute} from "@angular/router"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; +import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @Component({ selector: 'openaire-search-results', template: ` - + ` }) export class OpenaireSearchResearchResultsComponent { @Input() searchLink: string = "/search/advanced/research-results"; customFilter:SearchCustomFilter= null; - constructor(private route: ActivatedRoute) { - } + properties: EnvProperties; + constructor ( ) {} ngOnInit() { + this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); diff --git a/src/app/searchPages/find/search.component.ts b/src/app/searchPages/find/search.component.ts index 4920fe6..c076977 100644 --- a/src/app/searchPages/find/search.component.ts +++ b/src/app/searchPages/find/search.component.ts @@ -1,6 +1,5 @@ import {Component} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {ActivatedRoute} from "@angular/router"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; @@ -13,11 +12,7 @@ import {properties} from "../../../environments/environment"; }) export class OpenaireSearchComponent{ customFilter:SearchCustomFilter= null; - constructor ( private route: ActivatedRoute ) { - - - } - + constructor ( ) {} ngOnInit() { let id = ConnectHelper.getCommunityFromDomain(properties.domain); let agg:FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); diff --git a/src/app/searchPages/simple/searchDataproviders.component.ts b/src/app/searchPages/simple/searchDataproviders.component.ts index 87024b5..08e90c1 100644 --- a/src/app/searchPages/simple/searchDataproviders.component.ts +++ b/src/app/searchPages/simple/searchDataproviders.component.ts @@ -1,27 +1,25 @@ import {Component} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {ActivatedRoute} from "@angular/router"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; +import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @Component({ selector: 'openaire-search-dataproviders', template: ` - + ` }) export class OpenaireSearchDataprovidersComponent { customFilter: SearchCustomFilter = null; - - constructor(private route: ActivatedRoute) { - - } - + properties: EnvProperties; + constructor ( ) {} ngOnInit() { + this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); diff --git a/src/app/searchPages/simple/searchOrganizations.component.ts b/src/app/searchPages/simple/searchOrganizations.component.ts index 03002ab..08c5aad 100644 --- a/src/app/searchPages/simple/searchOrganizations.component.ts +++ b/src/app/searchPages/simple/searchOrganizations.component.ts @@ -1,15 +1,15 @@ import {Component} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {ActivatedRoute} from "@angular/router"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; +import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @Component({ selector: 'openaire-search-organizations', template: ` - + ` @@ -17,10 +17,10 @@ import {properties} from "../../../environments/environment"; }) export class OpenaireSearchOrganizationsComponent { customFilter:SearchCustomFilter= null; - constructor ( private route: ActivatedRoute ) { - - } + properties: EnvProperties; + constructor ( ) {} ngOnInit() { + this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); let agg:FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); diff --git a/src/app/searchPages/simple/searchProjects.component.ts b/src/app/searchPages/simple/searchProjects.component.ts index d1e05bc..f5397a6 100644 --- a/src/app/searchPages/simple/searchProjects.component.ts +++ b/src/app/searchPages/simple/searchProjects.component.ts @@ -1,27 +1,25 @@ import {Component} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {ActivatedRoute} from "@angular/router"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; +import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @Component({ selector: 'openaire-search-projects', template: ` - + ` }) export class OpenaireSearchProjectsComponent { customFilter: SearchCustomFilter = null; - - constructor(private route: ActivatedRoute) { - - } - + properties: EnvProperties; + constructor ( ) {} ngOnInit() { + this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); diff --git a/src/app/searchPages/simple/searchResearchResults.component.ts b/src/app/searchPages/simple/searchResearchResults.component.ts index b1fd218..4a8bdfd 100644 --- a/src/app/searchPages/simple/searchResearchResults.component.ts +++ b/src/app/searchPages/simple/searchResearchResults.component.ts @@ -1,24 +1,24 @@ import {Component, Input} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {ActivatedRoute} from "@angular/router"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; +import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @Component({ selector: 'openaire-search-results', template: ` - + ` }) export class OpenaireSearchResearchResultsComponent { @Input() searchLink: string = "/search/research-results"; customFilter:SearchCustomFilter= null; - constructor ( private route: ActivatedRoute ) { - - } + properties: EnvProperties; + constructor ( ) {} ngOnInit() { + this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); let agg:FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); diff --git a/src/app/utils/aggregators.ts b/src/app/utils/aggregators.ts index 8db3a88..0167a1e 100644 --- a/src/app/utils/aggregators.ts +++ b/src/app/utils/aggregators.ts @@ -52,8 +52,8 @@ export class PortalAggregators { let filter:SearchCustomFilter = null; if(agg) { filter = new SearchCustomFilter(agg.fieldName, agg.queryFieldName, agg.valueId, agg.valueName); - filter.promptToAddFilter = true; - filter.isHiddenFilter = false; + filter.promptToAddFilter = false; + filter.isHiddenFilter = true; } return filter; }