[Aggregator| Trunk]

- update aggregator custom filter
- add link to explore for search pages
- remove aggregator parameters from menu links



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-aggregator-portal/trunk@59973 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2020-11-26 15:03:13 +00:00
parent fcf246099e
commit 570ce5e570
11 changed files with 48 additions and 62 deletions

View File

@ -115,13 +115,11 @@ export class AppComponent {
} }
]; ];
let params = {}; let params = {};
params[this.agg.queryFieldName] = this.agg.valueId; // 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("", "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("", "Projects", "", "/search/find/projects", false, ["project"], ["/search/find/projects"], this.menuItems[1].items.push(new MenuItem("", "Content Providers", "", "/search/find/dataproviders", false, ["datasource"], ["/search/find/dataproviders"], params));
{cf: true})); this.menuItems[1].items.push(new MenuItem("", "Organizations", "", "/search/find/organizations", false, ["organization"], ["/search/find/organizations"], 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))
} }
} }

View File

@ -1,15 +1,15 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute} from "@angular/router";
import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators";
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
@Component({ @Component({
selector: 'openaire-advanced-search-dataprovider', selector: 'openaire-advanced-search-dataprovider',
template: ` template: `
<search-dataproviders [customFilter]="customFilter" [simpleView]="false"> <search-dataproviders [customFilter]="customFilter" [simpleView]="false" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/dataproviders'">
</search-dataproviders> </search-dataproviders>
` `
@ -18,12 +18,10 @@ import {properties} from "../../../environments/environment";
export class OpenaireAdvancedSearchDataProvidersComponent { export class OpenaireAdvancedSearchDataProvidersComponent {
customFilter: SearchCustomFilter = null; customFilter: SearchCustomFilter = null;
properties: EnvProperties;
constructor(private route: ActivatedRoute) { constructor ( ) {}
}
ngOnInit() { ngOnInit() {
this.properties = properties;
let id = ConnectHelper.getCommunityFromDomain(properties.domain); let id = ConnectHelper.getCommunityFromDomain(properties.domain);
let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id);
this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg);

View File

@ -1,15 +1,15 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute} from "@angular/router";
import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators";
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
@Component({ @Component({
selector: 'openaire-advanced-search-organizations', selector: 'openaire-advanced-search-organizations',
template: ` template: `
<search-organizations [customFilter]="customFilter" [simpleView]="false"> <search-organizations [customFilter]="customFilter" [simpleView]="false" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/organizations'">
</search-organizations> </search-organizations>
` `
@ -18,11 +18,10 @@ import {properties} from "../../../environments/environment";
export class OpenaireAdvancedSearchOrganizationsComponent { export class OpenaireAdvancedSearchOrganizationsComponent {
customFilter:SearchCustomFilter= null; customFilter:SearchCustomFilter= null;
constructor(private route: ActivatedRoute) { properties: EnvProperties;
constructor ( ) {}
}
ngOnInit() { ngOnInit() {
this.properties = properties;
let id = ConnectHelper.getCommunityFromDomain(properties.domain); let id = ConnectHelper.getCommunityFromDomain(properties.domain);
let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id);
this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg);

View File

@ -1,14 +1,14 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute} from "@angular/router";
import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators";
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
@Component({ @Component({
selector: 'openaire-advanced-search-projects', selector: 'openaire-advanced-search-projects',
template: ` template: `
<search-projects [customFilter]="customFilter" [simpleView]="false"> <search-projects [customFilter]="customFilter" [simpleView]="false" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/projects'">
</search-projects> </search-projects>
` `
@ -17,11 +17,10 @@ import {properties} from "../../../environments/environment";
export class OpenaireAdvancedSearchProjectsComponent { export class OpenaireAdvancedSearchProjectsComponent {
customFilter:SearchCustomFilter= null; customFilter:SearchCustomFilter= null;
constructor(private route: ActivatedRoute) { properties: EnvProperties;
constructor ( ) {}
}
ngOnInit() { ngOnInit() {
this.properties = properties;
let id = ConnectHelper.getCommunityFromDomain(properties.domain); let id = ConnectHelper.getCommunityFromDomain(properties.domain);
let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id);
this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg);

View File

@ -1,23 +1,24 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators";
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute} from "@angular/router";
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
@Component({ @Component({
selector: 'openaire-search-results', selector: 'openaire-search-results',
template: ` template: `
<search-research-results resultType="result" [simpleView]="false" [customFilter]="customFilter"></search-research-results> <search-research-results resultType="result" [simpleView]="false" [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/research-outcomes'"></search-research-results>
` `
}) })
export class OpenaireSearchResearchResultsComponent { export class OpenaireSearchResearchResultsComponent {
@Input() searchLink: string = "/search/advanced/research-results"; @Input() searchLink: string = "/search/advanced/research-results";
customFilter:SearchCustomFilter= null; customFilter:SearchCustomFilter= null;
constructor(private route: ActivatedRoute) { properties: EnvProperties;
} constructor ( ) {}
ngOnInit() { ngOnInit() {
this.properties = properties;
let id = ConnectHelper.getCommunityFromDomain(properties.domain); let id = ConnectHelper.getCommunityFromDomain(properties.domain);
let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id);
this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg);

View File

@ -1,6 +1,5 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute} from "@angular/router";
import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators";
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
@ -13,11 +12,7 @@ import {properties} from "../../../environments/environment";
}) })
export class OpenaireSearchComponent{ export class OpenaireSearchComponent{
customFilter:SearchCustomFilter= null; customFilter:SearchCustomFilter= null;
constructor ( private route: ActivatedRoute ) { constructor ( ) {}
}
ngOnInit() { ngOnInit() {
let id = ConnectHelper.getCommunityFromDomain(properties.domain); let id = ConnectHelper.getCommunityFromDomain(properties.domain);
let agg:FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); let agg:FilterInfo = PortalAggregators.getFilterInfoByMenuId(id);

View File

@ -1,27 +1,25 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute} from "@angular/router";
import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators";
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
@Component({ @Component({
selector: 'openaire-search-dataproviders', selector: 'openaire-search-dataproviders',
template: ` template: `
<search-dataproviders [customFilter]="customFilter"> <search-dataproviders [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/dataproviders'">
</search-dataproviders> </search-dataproviders>
` `
}) })
export class OpenaireSearchDataprovidersComponent { export class OpenaireSearchDataprovidersComponent {
customFilter: SearchCustomFilter = null; customFilter: SearchCustomFilter = null;
properties: EnvProperties;
constructor(private route: ActivatedRoute) { constructor ( ) {}
}
ngOnInit() { ngOnInit() {
this.properties = properties;
let id = ConnectHelper.getCommunityFromDomain(properties.domain); let id = ConnectHelper.getCommunityFromDomain(properties.domain);
let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id);
this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg);

View File

@ -1,15 +1,15 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute} from "@angular/router";
import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators";
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
@Component({ @Component({
selector: 'openaire-search-organizations', selector: 'openaire-search-organizations',
template: ` template: `
<search-organizations [customFilter]="customFilter"> <search-organizations [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/organizations'">
</search-organizations> </search-organizations>
` `
@ -17,10 +17,10 @@ import {properties} from "../../../environments/environment";
}) })
export class OpenaireSearchOrganizationsComponent { export class OpenaireSearchOrganizationsComponent {
customFilter:SearchCustomFilter= null; customFilter:SearchCustomFilter= null;
constructor ( private route: ActivatedRoute ) { properties: EnvProperties;
constructor ( ) {}
}
ngOnInit() { ngOnInit() {
this.properties = properties;
let id = ConnectHelper.getCommunityFromDomain(properties.domain); let id = ConnectHelper.getCommunityFromDomain(properties.domain);
let agg:FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); let agg:FilterInfo = PortalAggregators.getFilterInfoByMenuId(id);
this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg);

View File

@ -1,27 +1,25 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute} from "@angular/router";
import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators";
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
@Component({ @Component({
selector: 'openaire-search-projects', selector: 'openaire-search-projects',
template: ` template: `
<search-projects [customFilter]="customFilter"> <search-projects [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/projects'">
</search-projects> </search-projects>
` `
}) })
export class OpenaireSearchProjectsComponent { export class OpenaireSearchProjectsComponent {
customFilter: SearchCustomFilter = null; customFilter: SearchCustomFilter = null;
properties: EnvProperties;
constructor(private route: ActivatedRoute) { constructor ( ) {}
}
ngOnInit() { ngOnInit() {
this.properties = properties;
let id = ConnectHelper.getCommunityFromDomain(properties.domain); let id = ConnectHelper.getCommunityFromDomain(properties.domain);
let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id);
this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg);

View File

@ -1,24 +1,24 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute} from "@angular/router";
import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; import {FilterInfo, PortalAggregators} from "../../utils/aggregators";
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
@Component({ @Component({
selector: 'openaire-search-results', selector: 'openaire-search-results',
template: ` template: `
<search-research-results resultType="result" [stickyForm]="false" [customFilter]="customFilter"></search-research-results> <search-research-results resultType="result" [stickyForm]="false" [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/research-outcomes'" ></search-research-results>
` `
}) })
export class OpenaireSearchResearchResultsComponent { export class OpenaireSearchResearchResultsComponent {
@Input() searchLink: string = "/search/research-results"; @Input() searchLink: string = "/search/research-results";
customFilter:SearchCustomFilter= null; customFilter:SearchCustomFilter= null;
constructor ( private route: ActivatedRoute ) { properties: EnvProperties;
constructor ( ) {}
}
ngOnInit() { ngOnInit() {
this.properties = properties;
let id = ConnectHelper.getCommunityFromDomain(properties.domain); let id = ConnectHelper.getCommunityFromDomain(properties.domain);
let agg:FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); let agg:FilterInfo = PortalAggregators.getFilterInfoByMenuId(id);
this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg);

View File

@ -52,8 +52,8 @@ export class PortalAggregators {
let filter:SearchCustomFilter = null; let filter:SearchCustomFilter = null;
if(agg) { if(agg) {
filter = new SearchCustomFilter(agg.fieldName, agg.queryFieldName, agg.valueId, agg.valueName); filter = new SearchCustomFilter(agg.fieldName, agg.queryFieldName, agg.valueId, agg.valueName);
filter.promptToAddFilter = true; filter.promptToAddFilter = false;
filter.isHiddenFilter = false; filter.isHiddenFilter = true;
} }
return filter; return filter;
} }