@@ -37,7 +39,7 @@
{{resultsName}}
-
+
({{fetchPublications.searchUtils.totalResults | number}})
@@ -48,7 +50,7 @@
{{projectName}}
-
+
({{fetchProjects.searchUtils.totalResults | number}})
@@ -59,7 +61,7 @@
{{dataSourcesName}}
-
+
({{fetchDataproviders.searchUtils.totalResults | number}})
@@ -70,7 +72,7 @@
{{servicesName}}
-
+
({{fetchServices.searchUtils.totalResults | number}})
@@ -81,7 +83,7 @@
{{organizationsName}}
-
+
({{fetchOrganizations.searchUtils.totalResults | number}})
@@ -99,25 +101,25 @@
+ [simpleSearchLink]="properties.searchLinkToResults" [customFilter]="customFilter">
+ [simpleSearchLink]="properties.searchLinkToProjects" [customFilter]="customFilter">
+ [simpleSearchLink]="properties.searchLinkToOrganizations" [customFilter]="customFilter">
+ [simpleSearchLink]="properties.searchLinkToDataProviders" [customFilter]="customFilter">
diff --git a/searchPages/find/searchAll.component.ts b/searchPages/find/searchAll.component.ts
index 67b16706..990d5de7 100644
--- a/searchPages/find/searchAll.component.ts
+++ b/searchPages/find/searchAll.component.ts
@@ -32,12 +32,15 @@ import {SearchDataProvidersComponent} from "../searchDataProviders.component";
import {NewSearchPageComponent, SearchForm} from "../searchUtils/newSearchPage.component";
import {properties} from "../../../../environments/environment";
import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";
+import {LayoutService} from "../../dashboard/sharedComponents/sidebar/layout.service";
@Component({
selector: 'search-all',
templateUrl: 'searchAll.component.html'
})
export class SearchAllComponent {
+ isMobile: boolean = false;
+
reload:{result:boolean, projects:boolean, datasources: boolean, services: boolean, organizations:boolean} =
{result:true, projects:true, datasources: true, services: true, organizations:true};
public pageTitle = "Search in OpenAIRE"
@@ -78,14 +81,16 @@ export class SearchAllComponent {
showDataProviders: boolean = false;
showServices: boolean = false;
showOrganizations: boolean = false;
- advancedSearchLink: string = "/search/advanced/publications";
+ advancedSearchLink: string = properties.searchLinkToAdvancedResults;
properties: EnvProperties;
+ offset: number;
public openaireEntities = OpenaireEntities;
@Input() logoURL;
@Input() name;
@Input() customFilter: SearchCustomFilter = null;
@Input() piwikSiteId = null;
- @Input() formPlaceholderText = "Search for "+OpenaireEntities.RESULTS+", "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.DATASOURCES+" & "+OpenaireEntities.ORGANIZATIONS+" in OpenAIRE";
+ @Input() formPlaceholderText = "Search in Explore"
+ // @Input() formPlaceholderText = "Search for "+OpenaireEntities.RESULTS+", "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.DATASOURCES+" & "+OpenaireEntities.ORGANIZATIONS+" in OpenAIRE";
@Input() searchForm: SearchForm = {class: 'search-form', dark: true}
@Input() breadcrumbs: Breadcrumb[] = [];
@@ -125,6 +130,7 @@ export class SearchAllComponent {
private _title: Title,
private _piwikService: PiwikService,
private config: ConfigurationService,
+ private layoutService: LayoutService,
private seoService: SEOService, private router: Router, private cdr:ChangeDetectorRef) {
this.fetchPublications = new FetchResearchResults(this._searchResearchResultsService);
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
@@ -141,8 +147,7 @@ export class SearchAllComponent {
public ngOnInit() {
-
- var description = "Search for "+OpenaireEntities.RESULTS+" ("+OpenaireEntities.PUBLICATIONS+", "+OpenaireEntities.DATASETS+", "+OpenaireEntities.SOFTWARE+", "+OpenaireEntities.OTHER+"), "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.ORGANIZATIONS+", "+OpenaireEntities.DATASOURCES+" in the OpenAIRE Research Graph. ";
+ var description = "Search for "+OpenaireEntities.RESULTS+" ("+OpenaireEntities.PUBLICATIONS+", "+OpenaireEntities.DATASETS+", "+OpenaireEntities.SOFTWARE+", "+OpenaireEntities.OTHER+"), "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.ORGANIZATIONS+", "+OpenaireEntities.DATASOURCES+" in the OpenAIRE Graph. ";
var title = "OpenAIRE |Search for "+OpenaireEntities.RESULTS+", "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.DATASOURCES+" & "+OpenaireEntities.ORGANIZATIONS;
this.properties = properties;
var url = this.properties.domain + this.properties.baseLink + this._router.url;
@@ -195,46 +200,78 @@ export class SearchAllComponent {
this.showDataProviders = true;
this.showServices = false;
}
+ this.loadAll();
}
- this.loadAll();
+ this.subs.push(this.layoutService.isMobile.subscribe(isMobile => {
+ this.isMobile = isMobile;
+
+ if (typeof document !== 'undefined') {
+ if(!this.isMobile && document.getElementById("main-menu")) {
+ this.offset = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--header-height'));
+ this.cdr.detectChanges();
+ } else {
+ this.offset = 0;
+ this.cdr.detectChanges();
+ }
+ }
+ }))
}
loadAll() {
this.reloadTabs();
- this.subs.push(this.route.queryParams.subscribe(params => {
- this.parameters = Object.assign({}, params);
- this.keyword = (params['keyword']) ? params['keyword'] : (params["q"] ? params["q"] : (params["f0"] && params["f0"] == "q" && params["fv0"]?params["fv0"]:""));
+ this.subs.push(this.route.queryParams.subscribe(queryParams => {
+ this.parameters = Object.assign({}, queryParams);
+ this.keyword = (queryParams['keyword']) ? queryParams['keyword'] : (queryParams["q"] ? queryParams["q"] : (queryParams["f0"] && queryParams["f0"] == "q" && queryParams["fv0"]?queryParams["fv0"]:""));
this.selectedFields[0].value = StringUtils.URIDecode(this.keyword);
- this.quickFilter.selected = ((params['qf']== undefined || params["qf"] == "true") == true);
- if (params["type"] && params["type"].length > 0) {
- this.resultTypes['publication'] = (params["type"].split(",").indexOf("publications") != -1);
- this.resultTypes['dataset'] = (params["type"].split(",").indexOf("datasets") != -1);
- this.resultTypes['software'] = (params["type"].split(",").indexOf("software") != -1);
- this.resultTypes['other'] = (params["type"].split(",").indexOf("other") != -1);
+ this.quickFilter.selected = ((queryParams['qf']== undefined || queryParams["qf"] == "true") == true);
+ if (queryParams["type"] && queryParams["type"].length > 0) {
+ this.resultTypes['publication'] = (queryParams["type"].split(",").indexOf("publications") != -1);
+ this.resultTypes['dataset'] = (queryParams["type"].split(",").indexOf("datasets") != -1);
+ this.resultTypes['software'] = (queryParams["type"].split(",").indexOf("software") != -1);
+ this.resultTypes['other'] = (queryParams["type"].split(",").indexOf("other") != -1);
}
- if(this.activeEntity == null && (!params["active"] || params["active"].length ==0)){
- this.activeEntity = this.getDefaultEntityToShow();
- }else if(params["active"] && params["active"].length >0 ){
- this.activeEntity = ((["result","projects","organizations","datasources","services"]).indexOf(params["active"])!= -1)?params["active"]:this.getDefaultEntityToShow();
- }else if (this.activeEntity !=null && (!params["active"] || params["active"].length ==0)){
- this.parameters["active"]=this.activeEntity;
- if((typeof document !== 'undefined') && location.search && location.search.indexOf("active=") == -1){
- this.location.go(location.pathname, ((location.search)?(location.search+"&"):("?")) +"active=" + this.activeEntity);
+ let active = null;
+ if (queryParams["active"] && queryParams["active"].length > 0) {
+ active = ((["result","projects","organizations","datasources","services"]).indexOf(queryParams["active"])!= -1)?queryParams["active"]:null;
+ delete this.parameters['active'];
+ }
+ this.subs.push(this.route.params.subscribe(params => {
+ if(this.activeEntity == null && (!params["entity"] || params["entity"].length == 0)){
+ if (active) {
+ this.activeEntity = active;
+ if((typeof document !== 'undefined')){
+ if (active == "result") {
+ active = "research-outcomes";
+ }
+ let query = location.search.replace(/(active=)([^&]*)&?/, '');
+ this.location.go(location.pathname + '/' + active, query == '?' ? '' : query);
+ }
+ } else {
+ this.activeEntity = this.getDefaultEntityToShow();
+ }
+ } else if(params["entity"] && params["entity"].length > 0 ){
+ let entity = params["entity"];
+ if(entity == "research-outcomes") {
+ entity = "result";
+ } else if (entity == "dataproviders") {
+ entity = "datasources";
+ }
+ this.activeEntity = ((["result","projects","organizations","datasources","services"]).indexOf(entity)!= -1)?entity:this.getDefaultEntityToShow();
}
- }
- if (this.activeEntity == "result") {
- this.searchResults();
- } else if (this.activeEntity == "projects") {
- this.searchProjects();
- } else if (this.activeEntity == "datasources") {
- this.searchDataProviders();
- } else if (this.activeEntity == "services") {
- this.searchServices();
- } else if (this.activeEntity == "organizations") {
- this.searchOrganizations();
- }
- this.count();
+ if (this.activeEntity == "result") {
+ this.searchResults();
+ } else if (this.activeEntity == "projects") {
+ this.searchProjects();
+ } else if (this.activeEntity == "datasources") {
+ this.searchDataProviders();
+ } else if (this.activeEntity == "services") {
+ this.searchServices();
+ } else if (this.activeEntity == "organizations") {
+ this.searchOrganizations();
+ }
+ this.count();
+ }));
}));
}
@@ -265,7 +302,9 @@ export class SearchAllComponent {
}
public searchResults() {
- this.advancedSearchLink = this.properties.searchLinkToAdvancedPublications;//"/search/advanced/publications";
+ this.advancedSearchLink = this.properties.searchLinkToAdvancedResults;//"/search/advanced/research-outcomes";
+ this.formPlaceholderText = "Search by title, author, abstract, DOI, orcid...";
+
if (this.reload[this.activeEntity] &&
this.fetchPublications.searchUtils.status != this.errorCodes.NONE) {
this.reload[this.activeEntity] = false;
@@ -276,6 +315,8 @@ export class SearchAllComponent {
public searchProjects() {
this.advancedSearchLink = this.properties.searchLinkToAdvancedProjects;//"/search/advanced/projects";
+ this.formPlaceholderText = "Search by title, acronym, project code...";
+
if (this.reload[this.activeEntity] &&
this.fetchProjects.searchUtils.status != this.errorCodes.NONE ) {
this.reload[this.activeEntity] = false;
@@ -285,6 +326,8 @@ export class SearchAllComponent {
public searchDataProviders() {
this.advancedSearchLink = this.properties.searchLinkToAdvancedDataProviders;//"/search/advanced/dataproviders";
+ this.formPlaceholderText = "Search by name, description, subject...";
+
if ( this.reload[this.activeEntity] &&
this.fetchDataproviders.searchUtils.status != this.errorCodes.NONE) {
this.reload[this.activeEntity] = false;
@@ -294,6 +337,8 @@ export class SearchAllComponent {
public searchServices() {
this.advancedSearchLink = this.properties.searchLinkToAdvancedServices;//"/search/advanced/services";
+ this.formPlaceholderText = "Search by name, description, subject...";
+
if ( this.reload[this.activeEntity] &&
this.fetchServices.searchUtils.status != this.errorCodes.NONE) {
this.reload[this.activeEntity] = false;
@@ -303,6 +348,8 @@ export class SearchAllComponent {
public searchOrganizations() {
this.advancedSearchLink = this.properties.searchLinkToAdvancedOrganizations;//"/search/advanced/organizations";
+ this.formPlaceholderText = "Search by organization name...";
+
if (this.reload[this.activeEntity] &&
this.fetchOrganizations.searchUtils.status != this.errorCodes.NONE) {
this.reload[this.activeEntity] = false;
@@ -532,33 +579,38 @@ export class SearchAllComponent {
}
}
- entityChanged(entity){
- if(this.activeEntity == "result") {
- this.resultTypes = {publication: true, dataset: true, software: true, other: true};
- }
- if(this.activeEntity == "result" && this.searchResearchResultsComponent){
- this.searchResearchResultsComponent.ngOnDestroy();
- }else if(this.activeEntity == "projects" && this.searchProjectsComponent){
- this.searchProjectsComponent.ngOnDestroy();
- }else if(this.activeEntity == "datasources" && this.searchDataprovidersComponent){
- this.searchDataprovidersComponent.ngOnDestroy();
- }else if(this.activeEntity == "services" && this.searchDataprovidersComponent){
- this.searchDataprovidersComponent.ngOnDestroy();
- }else if(this.activeEntity == "organizations" && this.searchOrganizationsComponent){
- this.searchOrganizationsComponent.ngOnDestroy();
- }
- this.activeEntity = entity;
+ entityChanged(entity) {
+ if (this.activeEntity !== entity) {
+ if (this.activeEntity == "result") {
+ this.resultTypes = {publication: true, dataset: true, software: true, other: true};
+ }
+ if (this.activeEntity == "result" && this.searchResearchResultsComponent) {
+ this.searchResearchResultsComponent.ngOnDestroy();
+ } else if (this.activeEntity == "projects" && this.searchProjectsComponent) {
+ this.searchProjectsComponent.ngOnDestroy();
+ } else if (this.activeEntity == "datasources" && this.searchDataprovidersComponent) {
+ this.searchDataprovidersComponent.ngOnDestroy();
+ } else if (this.activeEntity == "services" && this.searchDataprovidersComponent) {
+ this.searchDataprovidersComponent.ngOnDestroy();
+ } else if (this.activeEntity == "organizations" && this.searchOrganizationsComponent) {
+ this.searchOrganizationsComponent.ngOnDestroy();
+ }
+ this.activeEntity = entity;
this.parameters = {};
- this.reload[entity]= true;
- this.parameters["active"] = entity;
- if ( this.keyword.length > 0) {
- this.parameters["fv0"] = this.keyword;
- this.parameters["f0"] = "q";
- }
- if(this.customFilter){
- this.parameters = this.customFilter.getParameters(this.parameters);
- }
- this.router.navigate(["/search/find"], {queryParams: this.parameters});
+ this.reload[entity] = true;
+ if (this.keyword.length > 0) {
+ this.parameters["fv0"] = this.keyword;
+ this.parameters["f0"] = "q";
+ }
+ if (this.customFilter) {
+ this.parameters = this.customFilter.getParameters(this.parameters);
+ }
+ if (entity == "result") {
+ entity = "research-outcomes";
+ this.parameters["resultbestaccessright"] = '"' + encodeURIComponent("Open Access") + '"';
+ }
+ this.router.navigate(["/search/find", entity], {queryParams: this.parameters});
}
+ }
}
diff --git a/searchPages/searchDataProviders.component.ts b/searchPages/searchDataProviders.component.ts
index 40dd7ca5..8dad1735 100644
--- a/searchPages/searchDataProviders.component.ts
+++ b/searchPages/searchDataProviders.component.ts
@@ -35,7 +35,7 @@ import {properties} from "../../../environments/environment";
[includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter"
[piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix"
[searchForm]="searchForm"
- [entitiesSelection]="type=='all' || type == 'services'" [showSwitchSearchLink]="showSwitchSearchLink"
+ [entitiesSelection]="false" [showSwitchSearchLink]="showSwitchSearchLink"
[filters]="filters"
[simpleView]="simpleView" formPlaceholderText="Search by name, description, subject..."
[showResultCount]="true" [showIndexInfo]="type!='deposit'"
diff --git a/searchPages/searchUtils/advancedSearchForm.component.html b/searchPages/searchUtils/advancedSearchForm.component.html
index 570cd7db..84d87fcb 100644
--- a/searchPages/searchUtils/advancedSearchForm.component.html
+++ b/searchPages/searchUtils/advancedSearchForm.component.html
@@ -82,7 +82,7 @@
[id]="'autocomplete-'+i">
-
+
Search
- = 2" class="uk-margin-xsmall-left">({{selectedFields.length}} Rules)
+
@@ -146,7 +146,8 @@
-
+ Advanced search
@@ -163,25 +164,29 @@
-
+
+
- -->
+
+
+
+
+ [searchInputClass]="'inner background'" [placeholder]="formPlaceholderText" (searchEmitter)="simpleKeywordChanged()">
+
+
+
+
-
-
-
+ [searchInputClass]="'inner background'" [placeholder]="formPlaceholderText" (searchEmitter)="simpleKeywordChanged()">
+
+
+
diff --git a/searchPages/searchUtils/advancedSearchForm.component.ts b/searchPages/searchUtils/advancedSearchForm.component.ts
index 1b1fc5ce..8a046930 100644
--- a/searchPages/searchUtils/advancedSearchForm.component.ts
+++ b/searchPages/searchUtils/advancedSearchForm.component.ts
@@ -116,7 +116,7 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges
simpleKeywordChanged() {
// this.selectedFields[0].value = $event.value;
- if (this.selectedEntity == this.entityType) {
+ if ((this.selectedEntity == this.entityType) || !this.entitiesSelection) {
this.queryChanged();
} else {
this.router.navigate([this.selectedEntitySimpleUrl], {queryParams: {q: this.selectedFields[0].value, op: "and"}});
diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html
index 385ff5c0..09d3b471 100644
--- a/searchPages/searchUtils/newSearchPage.component.html
+++ b/searchPages/searchUtils/newSearchPage.component.html
@@ -71,6 +71,15 @@
+
+
+
+
+
@@ -91,25 +100,43 @@
Filters temporarily unavailable. Please try again later.
- 0 && filters[0].values.length >0 && filters[0].filterId == 'resultbestaccessright'">
-
+ 0 && getFilterById('resultbestaccessright') && getFilterById('resultbestaccessright').values.length >0">
+
-
-
+ 0)">
+
+
-
- 0 && filter.filterId != 'resultbestaccessright'">
-
+ 0 && getFilterById('instancetypename') && getFilterById('instancetypename').values.length >0">
+
+
+
+
+
+
+ 0
+ && filter.filterId != 'resultbestaccessright' && filter.filterId != 'instancetypename' && filter.filterId != 'projectoamandatepublications'">
+
+
+
+
+
+
+
+
+
+
+
+
+ 0 && getFilterById('projectoamandatepublications') && getFilterById('projectoamandatepublications').values.length >0">
+
+
@@ -139,12 +166,23 @@
+
+
+
+
+
+
@@ -171,7 +209,7 @@
[advancedSearchLinkParameters]="this.routerHelper.createQueryParams(this.parameterNames, this.parameterValues)"
[simpleView]="simpleView" [formPlaceholderText]="formPlaceholderText" [isMobile]="mobile"
[resultTypes]="resultTypes" [quickFilter]="quickFilter" [entitiesSelection]="entitiesSelection"
- [showSwitchSearchLink]="showSwitchSearchLink" [customFilter]="customFilter" (filtersClicked)="showOffCanvas = $event"
+ [showSwitchSearchLink]="showSwitchSearchLink" [customFilter]="customFilter"
>
@@ -191,16 +229,16 @@
0"
[texts]="pageContents['top']">
-
-
-
-
+
+
+
+
+
-
+
@@ -252,14 +290,20 @@
[href]="openaireLink+this.routerHelper.createQueryParamsString(this.parameterNames, this.parameterValues)"
target="_blank"> OpenAIRE - Explore.
-
+
-
+
0">
{{searchUtils.totalResults|number}}
- {{type}}, page
- {{searchUtils.page | number}}
- of {{(totalPages(searchUtils.totalResults)|number)}}
+ {{type}}
+
+ for
+ {{searchTerm}}
+
+ 0">
+ ({{advancedSearchTerms}} rule{{advancedSearchTerms == 1 ? '' : 's'}} applied)
+
0 && searchUtils.status == errorCodes.LOADING">
{{oldTotalResults|number}}
@@ -267,9 +311,10 @@
{{searchUtils.page | number}}
of {{(totalPages(oldTotalResults)|number)}}
-
+
-
+
0)) {
fields.push(this.refineFields[i]);
}
}
@@ -1689,6 +1693,14 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
this.getRangeFiltersFromURL(params);
this.getRefineFiltersFromURL(params);
this.createAdvancedSearchSelectedFiltersFromURLParameters(params);
+ this.searchTerm = '';
+ if(params && params['fv0'] && params['f0'] && params['f0'] == 'q'){
+ let keyword = StringUtils.URIDecode(params['fv0']);
+ this.searchTerm = keyword;
+ }
+ if(params){
+ this.advancedSearchTerms = Object.keys(params).filter(key => key.includes('fv')).length;
+ }
}
removeResultType(type) {
@@ -1708,4 +1720,12 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
}
return totalPages;
}
-}
+
+ public getFilterById(filterId: string): Filter {
+ return this.filters.find(filter => filter.filterId == filterId);
+ }
+
+ detectChanges() {
+ this.cdr.detectChanges();
+ }
+ }
diff --git a/searchPages/searchUtils/quick-selections.component.ts b/searchPages/searchUtils/quick-selections.component.ts
index ad1cfb97..97e83847 100644
--- a/searchPages/searchUtils/quick-selections.component.ts
+++ b/searchPages/searchUtils/quick-selections.component.ts
@@ -11,27 +11,35 @@ import {OpenaireEntities} from "../../utils/properties/searchFields";
@Component({
selector: 'quick-selections',
template: `
-
-
- {{quickFilter.value}}
-
-
-
-
Include:
-
-
-
-
-
- {{value.name}}
-
-
+
+
+
+ {{quickFilter.value}}
+
+
+
+
Include:
+
+
+
+
+
+ {{value.name}}
+
+
+
+
+
+
+
`
})
export class QuickSelectionsComponent {
+ @Input() vertical: boolean=false;
@Input() resultTypes:Filter;
@Output() typeChange = new EventEmitter();
@Input() isDisabled;
diff --git a/searchPages/searchUtils/searchFilter.component.html b/searchPages/searchUtils/searchFilter.component.html
index 31b1831c..fe68a0fd 100644
--- a/searchPages/searchUtils/searchFilter.component.html
+++ b/searchPages/searchUtils/searchFilter.component.html
@@ -19,7 +19,7 @@
Top 100 values are shown in the filters
@@ -27,9 +27,13 @@
-
+ class="uk-animation-fade uk-text-small">
+
+
+
+
+
+ No filters available with that term
diff --git a/searchPages/searchUtils/searchFilter.component.ts b/searchPages/searchUtils/searchFilter.component.ts
index 9484c2c3..2f87417f 100644
--- a/searchPages/searchUtils/searchFilter.component.ts
+++ b/searchPages/searchUtils/searchFilter.component.ts
@@ -5,7 +5,8 @@ import {
EventEmitter,
OnInit,
OnChanges,
- SimpleChanges
+ SimpleChanges,
+ ChangeDetectorRef
} from '@angular/core';
import {Filter, Value} from './searchHelperClasses.class';
import {ActivatedRoute, Router} from "@angular/router";
@@ -42,7 +43,11 @@ export class SearchFilterComponent implements OnInit, OnChanges {
sub;
public isOpen: boolean = false;
sortedValues;
- constructor(private _router: Router, private route: ActivatedRoute) {
+ hasMatch: boolean = false;
+
+ constructor(private _router: Router,
+ private route: ActivatedRoute,
+ private cdr: ChangeDetectorRef) {
}
ngOnDestroy() {
@@ -115,6 +120,10 @@ export class SearchFilterComponent implements OnInit, OnChanges {
return false;
}
}
+ if(!this.hasMatch) {
+ this.hasMatch = true;
+ this.cdr.detectChanges();
+ }
return true;
}
@@ -246,9 +255,13 @@ export class SearchFilterComponent implements OnInit, OnChanges {
return 0;
}
});
- }
+ }
this.sortedValues = Object.assign(sorted);
+ }
+ initMatching() {
+ this.hasMatch = false;
+ this.cdr.detectChanges();
}
toggle(event) {
@@ -324,4 +337,4 @@ export class SearchFilterComponent implements OnInit, OnChanges {
return Object.entries(obj);
}
}
-}
+}
\ No newline at end of file
diff --git a/searchPages/searchUtils/searchResult.component.html b/searchPages/searchUtils/searchResult.component.html
index 899e19b9..e06fb724 100644
--- a/searchPages/searchUtils/searchResult.component.html
+++ b/searchPages/searchUtils/searchResult.component.html
@@ -1,9 +1,9 @@
-
+
+ [isCard]="true" [isMobile]="isMobile" [prevPath]="prevPath">
diff --git a/searchPages/searchUtils/searchResult.component.ts b/searchPages/searchUtils/searchResult.component.ts
index f0b6a3ff..4303238b 100644
--- a/searchPages/searchUtils/searchResult.component.ts
+++ b/searchPages/searchUtils/searchResult.component.ts
@@ -2,19 +2,20 @@ import {Component, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core'
import {SearchResult} from '../../utils/entities/searchResult';
import {EnvProperties} from '../../utils/properties/env-properties';
import {ResultPreview} from "../../utils/result-preview/result-preview";
-import {HttpClient} from "@angular/common/http";
import {OrcidService} from "../../orcid/orcid.service";
import {Session} from "../../login/utils/helper.class";
import {properties} from "../../../../environments/environment";
+import {LayoutService} from "../../dashboard/sharedComponents/sidebar/layout.service";
+import {Subscription} from "rxjs";
@Component({
selector: 'search-result',
templateUrl: 'searchResult.component.html'
})
-export class SearchResultComponent implements OnInit, OnChanges {
+export class SearchResultComponent implements OnInit, OnChanges {
@Input() prevPath: string = "";
@Input() results: SearchResult[];
- previewResults:ResultPreview[];
+ previewResults: ResultPreview[];
@Input() status: number;
@Input() type: string;
@Input() showLoading: boolean = false;
@@ -23,62 +24,72 @@ export class SearchResultComponent implements OnInit, OnChanges {
@Input() custom_class: string = "";
@Input() properties: EnvProperties;
@Input() showEnermaps: boolean;
+ public isMobile: boolean = false;
+ private subscriptions: any[] = [];
- constructor( private http: HttpClient/*ATHENA CODE*/
- , private orcidService: OrcidService) {
+ constructor(private orcidService: OrcidService,
+ private layoutService: LayoutService) {
}
-
- ngOnInit() {}
- sub;
+
+ ngOnInit() {
+ this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
+ this.isMobile = isMobile;
+ }));
+ }
+
ngOnDestroy() {
- if(this.sub){
- this.sub.unsubscribe();
- }
- }
- initialize(){
- this.previewResults = [];
- for(let result of this.results){
- this.previewResults.push(this.getResultPreview(result));
- }
-
- if((properties.adminToolsPortalType == "explore" || properties.adminToolsPortalType == "community" || properties.adminToolsPortalType == "aggregator")
- && Session.isLoggedIn() && this.results && this.results.length > 0
- && (this.type == "result" || this.type == "publication" || this.type == "dataset" || this.type == "software" || this.type == "other")
- ) {
- this.orcidService.getPutCodes(this.previewResults.map(
- previewResult => {
- if(previewResult.identifiers) {
- let pidsArray: string[] = [];
- for(let key of Array.from(previewResult.identifiers.keys())) {
- pidsArray = pidsArray.concat(previewResult.identifiers.get(key));
- }
- return pidsArray;//.join();
- }
- })).subscribe(
- putCodes => {
- for (let i = 0; i < this.previewResults.length; i++) {
- if(this.previewResults[i].identifiers) {
- this.previewResults[i].orcidPutCodes = putCodes[i];
- // console.debug(i, this.previewResults[i].orcidPutCodes);
- }
- }
- }, error => {
-
- }
- );
- }
+ this.subscriptions.forEach(subscription => {
+ if(subscription instanceof Subscription) {
+ subscription.unsubscribe();
+ }
+ })
}
ngOnChanges(changes: SimpleChanges): void {
- if (changes.results) {
+ if (changes.results) {
this.initialize();
}
}
- public getResultPreview(result: SearchResult): ResultPreview {
- return ResultPreview.searchResultConvert(result, (result.entityType)?result.entityType:this.type);
+
+ initialize() {
+ this.previewResults = [];
+ for (let result of this.results) {
+ this.previewResults.push(this.getResultPreview(result));
+ }
+
+ if ((properties.adminToolsPortalType == "explore" || properties.adminToolsPortalType == "community" || properties.adminToolsPortalType == "aggregator")
+ && Session.isLoggedIn() && this.results && this.results.length > 0
+ && (this.type == "result" || this.type == "publication" || this.type == "dataset" || this.type == "software" || this.type == "other")
+ ) {
+ this.subscriptions.push(this.orcidService.getPutCodes(this.previewResults.map(
+ previewResult => {
+ if (previewResult.identifiers) {
+ let pidsArray: string[] = [];
+ for (let key of Array.from(previewResult.identifiers.keys())) {
+ pidsArray = pidsArray.concat(previewResult.identifiers.get(key));
+ }
+ return pidsArray;//.join();
+ }
+ })).subscribe(
+ putCodes => {
+ for (let i = 0; i < this.previewResults.length; i++) {
+ if (this.previewResults[i].identifiers) {
+ this.previewResults[i].orcidPutCodes = putCodes[i];
+ // console.debug(i, this.previewResults[i].orcidPutCodes);
+ }
+ }
+ }, error => {
+
+ }
+ ));
+ }
}
-
-
+
+ public getResultPreview(result: SearchResult): ResultPreview {
+ return ResultPreview.searchResultConvert(result, (result.entityType) ? result.entityType : this.type);
+ }
+
+
public quote(params: string): string {
return '"' + params + '"';
}
diff --git a/services/searchDataproviders.service.ts b/services/searchDataproviders.service.ts
index 3160d7ee..91c4fd14 100644
--- a/services/searchDataproviders.service.ts
+++ b/services/searchDataproviders.service.ts
@@ -169,6 +169,8 @@ export class SearchDataprovidersService {
if(resData['pid']) {
result.identifiers = this.parsingFunctions.parseIdentifiers(resData['pid']);
}
+ // Measure
+ result.measure = this.parsingFunctions.parseMeasures(resData['measure']);
results.push(result);
}
diff --git a/services/searchProjects.service.ts b/services/searchProjects.service.ts
index e898dcda..2109666f 100644
--- a/services/searchProjects.service.ts
+++ b/services/searchProjects.service.ts
@@ -254,6 +254,8 @@ export class SearchProjectsService {
if(resData.hasOwnProperty("enddate")) {
result.endYear = resData.enddate.split('-')[0];
}
+ // Measure
+ result.measure = this.parsingFunctions.parseMeasures(resData['measure']);
results.push(result);
}
diff --git a/services/searchResearchResults.service.ts b/services/searchResearchResults.service.ts
index e026e951..d81981e1 100644
--- a/services/searchResearchResults.service.ts
+++ b/services/searchResearchResults.service.ts
@@ -7,20 +7,20 @@ import {ParsingFunctions} from '../landingPages/landing-utils/parsingFunctions.c
import {EnvProperties} from '../utils/properties/env-properties';
import {map} from "rxjs/operators";
import {properties} from "../../../environments/environment";
+import {HostedByCollectedFrom} from "../utils/result-preview/result-preview";
@Injectable()
export class SearchResearchResultsService {
- private sizeOfDescription: number = 270;
public parsingFunctions: ParsingFunctions = new ParsingFunctions();
- constructor(private http: HttpClient=null) {
+ constructor(private http: HttpClient = null) {
}
-
-
+
+
search(resultType: string, params: string, refineParams: string, page: number, size: number, sortBy: string, refineFields: string[], properties: EnvProperties): any {
let link = properties.searchAPIURLLAst + this.getEntityQueryName(resultType, true);
-
+
let url = link + "?";
if (params != null && params != '') {
url += params;
@@ -32,21 +32,21 @@ export class SearchResearchResultsService {
url += "&sortBy=" + sortBy;
}
url += "&page=" + (page - 1) + "&size=" + size + "&format=json";
-
+
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties), RefineResultsUtils.parse(res['refineResults'], refineFields, "publication")]));
+ .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties), RefineResultsUtils.parse(res['refineResults'], refineFields, "publication")]));
}
-
+
searchById(resultType: string, id: string, properties: EnvProperties): any {
let url = properties.searchAPIURLLAst + this.getEntityQueryName(resultType, true) + "/" + id + "?format=json";
-
+
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- .pipe(map(res => this.parseResults(resultType, res, properties)));
+ .pipe(map(res => this.parseResults(resultType, res, properties)));
}
-
+
searchAggregators(resultType: string, id: string, params: string, refineParams: string, page: number, size: number, properties: EnvProperties): any {
let link = properties.searchAPIURLLAst + this.getEntityQueryName(resultType, true);
-
+
let url = link + "?" + "&format=json";
if (params != null && params != '') {
url += params;
@@ -55,33 +55,33 @@ export class SearchResearchResultsService {
url += refineParams;
}
url += "&page=" + (page - 1) + "&size=" + size;
-
+
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- .pipe(map(res => this.parseRefineResults(id, res['refineResults'])));
+ .pipe(map(res => this.parseRefineResults(id, res['refineResults'])));
}
-
+
searchByListOfDOI(resultType: string, DOIs: string[], refineParams: string, page: number, size: number, refineFields: string[], properties: EnvProperties): any {
let link = properties.searchAPIURLLAst + this.getEntityQueryName(resultType, true);
-
+
let url = link + "?" + "&format=json&";
var doisParams = "";
-
+
for (var i = 0; i < DOIs.length; i++) {
doisParams += (doisParams.length > 0 ? "&" : "") + 'doi="' + DOIs[i] + '"';
}
if (doisParams.length > 0) {
url += "&" + doisParams;
-
+
}
if (refineParams != null && refineParams != '') {
url += refineParams;
}
url += "&page=" + (page - 1) + "&size=" + size;
-
+
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties), RefineResultsUtils.parse(res['refineResults'], refineFields, "publication")]));
+ .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties), RefineResultsUtils.parse(res['refineResults'], refineFields, "publication")]));
}
-
+
advancedSearch(resultType: string, params: string, page: number, size: number, sortBy: string, properties: EnvProperties, refineParams: string = null, refineFields: string[] = null, refineQuery: string = null): any {
let url = properties.searchResourcesAPIURL;
var basicQuery = "(oaftype exact result) and (resulttypeid exact " + this.getEntityQueryName(resultType, false) + ") ";
@@ -101,14 +101,14 @@ export class SearchResearchResultsService {
if (refineQuery) {
url += "&" + refineQuery;
}
-
+
url += "&page=" + (page - 1) + "&size=" + size;
url += "&format=json";
-
+
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties), RefineResultsUtils.parse(res['refineResults'], refineFields, "publication")]));
+ .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties), RefineResultsUtils.parse(res['refineResults'], refineFields, "publication")]));
}
-
+
advancedSearchResults(resultType: string, params: string, page: number, size: number, sortBy: string, properties: EnvProperties, refineParams: string = null, refineFields: string[] = null, refineQuery: string = null): any {
let url = properties.searchAPIURLLAst + "resources2/?format=json";
if (params != null && params != '') {
@@ -124,30 +124,30 @@ export class SearchResearchResultsService {
if (refineQuery) {
url += "&" + refineQuery;
}
-
+
url += "&page=" + (page - 1) + "&size=" + size;
// url += "&format=json";
-
+
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties), RefineResultsUtils.parse(res['refineResults'], refineFields, "publication")]));
+ .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties), RefineResultsUtils.parse(res['refineResults'], refineFields, "publication")]));
}
-
+
searchResultForEntity(resultType: string, params: string, page: number, size: number, properties: EnvProperties): any {
let link = properties.searchAPIURLLAst;
//let url = link+params+"/"+this.getEntityQueryName(resultType,true)+ "?format=json";
//url += "&page="+(page-1)+"&size="+size;
//url += "&sortBy=resultdateofacceptance,descending";
-
+
//let url = link+"/resources2?format=json&query="+params+" sortBy resultdateofacceptance/sort.descending&type="+this.getEntityQueryName(resultType,true);
-
+
let url = link + "/" + this.getEntityQueryName(resultType, true);
url += "?format=json";
url += "&fq=" + params;
url += "&sortBy=resultdateofacceptance,descending";
url += "&page=" + (page - 1) + "&size=" + size;
-
+
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties)]));
+ .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties)]));
}
//???? why different from above?
@@ -157,9 +157,9 @@ export class SearchResearchResultsService {
url += "&sortBy=resultdateofacceptance,descending";
url += "&page=" + (page - 1) + "&size=" + size + "&format=json";
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties)]));
+ .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties)]));
}
-
+
searchForMyOrcidLinks(resultType: string, orcidQuery: string, typeQuery: string, page: number, size: number): any {
let url = properties.searchAPIURLLAst + "resources2/?format=json";
if (orcidQuery != null && orcidQuery != '') {
@@ -167,14 +167,14 @@ export class SearchResearchResultsService {
}
url += typeQuery;
url += "&page=" + (page - 1) + "&size=" + size;
-
+
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties)]));
+ .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties)]));
}
-
+
parseResults(resultType: string, data: any, properties: EnvProperties): SearchResult[] {
let results: SearchResult[] = [];
- if(data == null) {
+ if (data == null) {
return results;
}
@@ -182,139 +182,16 @@ export class SearchResearchResultsService {
for (let i = 0; i < length; i++) {
let resData = Array.isArray(data) ? data[i]['result']['metadata']['oaf:entity']['oaf:result'] : data['result']['metadata']['oaf:entity']['oaf:result'];
-
+
var result: SearchResult = new SearchResult();
if (resData['resulttype']) {
result.entityType = resData['resulttype']['classname'];
} else {
result.entityType = resultType;
}
- result.types = new Array();
- let types = new Set();
-
- let instance;
- let length = Array.isArray(resData['children']['instance']) ? resData['children']['instance'].length : 1;
-
- for (let i = 0; i < length; i++) {
- instance = Array.isArray(resData['children']['instance']) ? resData['children']['instance'][i] : resData['children']['instance'];
- this.parsingFunctions.parseTypes(result.types, types, instance);
- }
- // Measure
- result.measure = new Array();
- if (resData['measure'] && Array.isArray(resData['measure'])) {
- for (let i = 0; i < resData['measure'].length; i++) {
- if (resData['measure'][i].id == 'influence') {
- result.measure[1] = resData['measure'][i].class;
- if (resData['measure'][i].class == 'C1') {
- result.measure[3] = 'Top 0.01% in';
- } else if (resData['measure'][i].class == 'C2') {
- result.measure[3] = 'Top 0.1% in';
- } else if (resData['measure'][i].class == 'C3') {
- result.measure[3] = 'Top 1% in';
- } else if (resData['measure'][i].class == 'C4') {
- result.measure[3] = 'Top 10% in';
- } else if (resData['measure'][i].class == 'C5') {
- result.measure[3] = 'Average/low';
- } else if (resData['measure'][i].class == 'A') {
- result.measure[3] = 'Exceptional';
- } else if (resData['measure'][i].class == 'B') {
- result.measure[3] = 'Substantial';
- } else {
- result.measure[3] = 'Average';
- }
- }
- if (resData['measure'][i].id == 'popularity') {
- result.measure[0] = resData['measure'][i].class;
- if (resData['measure'][i].class == 'C1') {
- result.measure[2] = 'Top 0.01% in';
- } else if (resData['measure'][i].class == 'C2') {
- result.measure[2] = 'Top 0.1% in';
- } else if (resData['measure'][i].class == 'C3') {
- result.measure[2] = 'Top 1% in';
- } else if (resData['measure'][i].class == 'C4') {
- result.measure[2] = 'Top 10% in';
- } else if (resData['measure'][i].class == 'C5') {
- result.measure[2] = 'Average/low';
- } else if (resData['measure'][i].class == 'A') {
- result.measure[2] = 'Exceptional';
- } else if (resData['measure'][i].class == 'B') {
- result.measure[2] = 'Substantial';
- } else {
- result.measure[2] = 'Average';
- }
- }
- }
- }
- /////////////////////////// Athena Code ///////////////////////////
- if (resData['pid']) {
- if (!Array.isArray(resData['pid'])) {
- if (resData['pid'].classid && resData['pid'].classid == 'doi') {
- if (resData['pid'].content != '' && resData['pid'].content != null) {
- result.DOIs.push((resData['pid'].content+"").replace("https://doi.org/", ""));
- }
- }
- } else {
- for (let i = 0; i < resData['pid'].length; i++) {
- if (resData['pid'][i].classid == 'doi') {
- if (resData['pid'][i].content != '' && resData['pid'][i].content != null && resData['pid'][i].content) {
- result.DOIs.push((resData['pid'][i].content+"").replace("https://doi.org/", ""));
- }
- }
- }
- }
- result.identifiers = this.parsingFunctions.parseIdentifiers(resData['pid']);
- }
- /////////////////////////// Athena Code ///////////////////////////
- if (resData['programmingLanguage'] && resData['programmingLanguage'] != null) {
- result.programmingLanguages = new Array();
-
- if (!Array.isArray(resData['programmingLanguage'])) {
- if (resData['programmingLanguage'].classname != "Undetermined" && resData['programmingLanguage'].classname) {
- result.programmingLanguages.push(resData['programmingLanguage'].classname);
- }
- } else {
- for (let i = 0; i < resData['programmingLanguage'].length; i++) {
- if (resData['programmingLanguage'][i].classname != "Undetermined" && resData['programmingLanguage'][i].classname) {
- result.programmingLanguages.push(resData['programmingLanguage'][i].classname);
- }
- }
- }
- }
-
- if (resData['language'] && resData['language'] != null) {
- result.languages = new Array();
-
- if (!Array.isArray(resData['language'])) {
- if (resData['language'].classname != "Undetermined" && resData['language'].classname) {
- result.languages.push(resData['language'].classname);
- }
- } else {
- for (let i = 0; i < resData['language'].length; i++) {
- if (resData['language'][i].classname != "Undetermined" && resData['language'][i].classname) {
- result.languages.push(resData['language'][i].classname);
- }
- }
- }
- }
-
- if (resData['country'] && resData['country'] != null) {
- result.countriesForResults = new Array();
-
- if (!Array.isArray(resData['country'])) {
- if (resData['country'].classname != "Undetermined" && resData['country'].classname) {
- result.countriesForResults.push(resData['country'].classname);
- }
- } else {
- for (let i = 0; i < resData['country'].length; i++) {
- if (resData['country'][i].classname != "Undetermined" && resData['country'][i].classname) {
- result.countriesForResults.push(resData['country'][i].classname);
- }
- }
- }
- }
-
+
result['title'] = {"name": '', "accessMode": ''};
-
+
if (Array.isArray(resData['title'])) {
for (let i = 0; i < resData['title'].length; i++) {
if (resData['title'][i] && resData['title'][i].content) {
@@ -333,7 +210,104 @@ export class SearchResearchResultsService {
} else {
result['title'].name = (resData['title'] && resData['title'].content) ? StringUtils.HTMLToString(String(resData['title'].content)) : "";
}
-
+
+ if (resData['bestaccessright'] && resData['bestaccessright'].hasOwnProperty("classname")) {
+ result['title'].accessMode = resData['bestaccessright'].classname;
+ }
+
+ result.types = new Array();
+ let types = new Set();
+
+ let instance;
+ let length = Array.isArray(resData['children']['instance']) ? resData['children']['instance'].length : 1;
+ result.hostedBy_collectedFrom = new Array();
+ for (let i = 0; i < length; i++) {
+ instance = Array.isArray(resData['children']['instance']) ? resData['children']['instance'][i] : resData['children']['instance'];
+ this.parsingFunctions.parseTypes(result.types, types, instance);
+ if(instance?.hasOwnProperty("hostedby")) {
+ if(instance.hasOwnProperty("webresource")) {
+ let url = Array.isArray(instance['webresource'])?instance['webresource'][0].url:instance['webresource'].url;
+ if(url.includes('&')) {
+ url = url.replace(/&/gmu, '&');
+ }
+ if(instance.hasOwnProperty("hostedby")) {
+ this.parsingFunctions.parseHostedBy_collectedFrom(result.hostedBy_collectedFrom, instance, url, result.title.accessMode);
+ }
+ }
+ }
+ }
+ result.hostedBy_collectedFrom.sort(this.parsingFunctions.compareHostedByCollectedFrom);
+
+ // Measure
+ result.measure = this.parsingFunctions.parseMeasures(resData['measure']);
+ /////////////////////////// Athena Code ///////////////////////////
+ if (resData['pid']) {
+ if (!Array.isArray(resData['pid'])) {
+ if (resData['pid'].classid && resData['pid'].classid == 'doi') {
+ if (resData['pid'].content != '' && resData['pid'].content != null) {
+ result.DOIs.push((resData['pid'].content + "").replace("https://doi.org/", ""));
+ }
+ }
+ } else {
+ for (let i = 0; i < resData['pid'].length; i++) {
+ if (resData['pid'][i].classid == 'doi') {
+ if (resData['pid'][i].content != '' && resData['pid'][i].content != null && resData['pid'][i].content) {
+ result.DOIs.push((resData['pid'][i].content + "").replace("https://doi.org/", ""));
+ }
+ }
+ }
+ }
+ result.identifiers = this.parsingFunctions.parseIdentifiers(resData['pid']);
+ }
+ /////////////////////////// Athena Code ///////////////////////////
+ if (resData['programmingLanguage'] && resData['programmingLanguage'] != null) {
+ result.programmingLanguages = new Array();
+
+ if (!Array.isArray(resData['programmingLanguage'])) {
+ if (resData['programmingLanguage'].classname != "Undetermined" && resData['programmingLanguage'].classname) {
+ result.programmingLanguages.push(resData['programmingLanguage'].classname);
+ }
+ } else {
+ for (let i = 0; i < resData['programmingLanguage'].length; i++) {
+ if (resData['programmingLanguage'][i].classname != "Undetermined" && resData['programmingLanguage'][i].classname) {
+ result.programmingLanguages.push(resData['programmingLanguage'][i].classname);
+ }
+ }
+ }
+ }
+
+ if (resData['language'] && resData['language'] != null) {
+ result.languages = new Array();
+
+ if (!Array.isArray(resData['language'])) {
+ if (resData['language'].classname != "Undetermined" && resData['language'].classname) {
+ result.languages.push(resData['language'].classname);
+ }
+ } else {
+ for (let i = 0; i < resData['language'].length; i++) {
+ if (resData['language'][i].classname != "Undetermined" && resData['language'][i].classname) {
+ result.languages.push(resData['language'][i].classname);
+ }
+ }
+ }
+ }
+
+ if (resData['country'] && resData['country'] != null) {
+ result.countriesForResults = new Array();
+
+ if (!Array.isArray(resData['country'])) {
+ if (resData['country'].classname != "Undetermined" && resData['country'].classname) {
+ result.countriesForResults.push(resData['country'].classname);
+ }
+ } else {
+ for (let i = 0; i < resData['country'].length; i++) {
+ if (resData['country'][i].classname != "Undetermined" && resData['country'][i].classname) {
+ result.countriesForResults.push(resData['country'][i].classname);
+ }
+ }
+ }
+ }
+
result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
result['objId'] = result['id'];
let canId = ParsingFunctions.parseRelCanonicalId(Array.isArray(data) ? data[i] : data, "result");
@@ -341,16 +315,13 @@ export class SearchResearchResultsService {
result['id'] = canId;
}
result['relcanId'] = result['id'];
-
- if (resData['bestaccessright'] && resData['bestaccessright'].hasOwnProperty("classname")) {
- result['title'].accessMode = resData['bestaccessright'].classname;
- }
+
if (resData['rels'].hasOwnProperty("rel")) {
let relLength = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'].length : 1;
-
+
for (let j = 0; j < relLength; j++) {
let relation = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'][j] : resData['rels']['rel'];
-
+
if (relation.hasOwnProperty("to")) {
if (relation['to'].class && relation['to'].class.toLowerCase() == "isproducedby") {
result['projects'] = this.parseProjects(result['projects'], relation);
@@ -358,22 +329,22 @@ export class SearchResearchResultsService {
}
}
}
-
+
if (resData.hasOwnProperty("creator") && resData['creator'] != null) {
if (result['authors'] == undefined) {
result['authors'] = new Array<{ "fullName": string, "orcid": string, "orcid_pending": string }>();
}
-
+
let authors = resData['creator'];
let length = Array.isArray(authors) ? authors.length : 1;
-
+
for (let i = 0; i < length; i++) {
let author = Array.isArray(authors) ? authors[i] : authors;
if (author) {
- if(author.orcid) {
+ if (author.orcid) {
author.orcid = author.orcid.toUpperCase();
}
- if(author.orcid_pending) {
+ if (author.orcid_pending) {
author.orcid_pending = author.orcid_pending.toUpperCase();
}
result['authors'][author.rank] = {
@@ -387,20 +358,20 @@ export class SearchResearchResultsService {
return (item != undefined && item.fullName != undefined);
});
}
-
+
var date: string = (resData.dateofacceptance ? resData.dateofacceptance : '') + ''; // transform to string in case it is an integer
result.year = (date && (date).indexOf('-') !== -1) ? date.split('-')[0] : date;
let abstracts = this.parsingFunctions.parseDescription(resData.description, true);
- result.description = abstracts;
+ result.description = abstracts;
// if (result.description && result.description.length > this.sizeOfDescription) {
// result.description = result.description.substring(0, this.sizeOfDescription) + "...";
// }
-
+
if (resData.embargoenddate && resData.embargoenddate != '') {
result.embargoEndDate = Dates.getDate(resData.embargoenddate);
}
-
+
if (!Array.isArray(resData.publisher)) {
result.publisher = resData.publisher;
} else {
@@ -412,14 +383,44 @@ export class SearchResearchResultsService {
}
}
}
- if(resData['context'] != null) {
+ if (resData['context'] != null) {
result.enermapsId = ParsingFunctions.getEnermapsConceptId(this.parsingFunctions.parseContexts(resData['context']));
}
+ if (resData.dateofacceptance && resData.dateofacceptance != null) {
+ let date: string = (resData.dateofacceptance ? resData.dateofacceptance : '') + ''; // transform to string in case it is an integer
+ result.date = (date && (date).indexOf('-') !== -1) ? date.split('-')[0] : date;
+ result.dateofacceptance = resData.dateofacceptance ? Dates.getDate(resData.dateofacceptance) : null;
+ }
+ if (resData.journal && resData.journal != null) {
+ result.journal = {
+ "journal": "",
+ "issn": "",
+ "lissn": "",
+ "eissn": "",
+ "issue": "",
+ "volume": "",
+ "start_page": "",
+ "end_page": ""
+ }
+ result.journal['journal'] = resData.journal.content;
+ result.journal['issn'] = resData.journal.issn;
+ result.journal['lissn'] = resData.journal.lissn;
+ result.journal['eissn'] = resData.journal.eissn;
+ result.journal['issue'] = resData.journal.iss;
+ result.journal['volume'] = resData.journal.vol;
+ result.journal['start_page'] = resData.journal.sp;
+ result.journal['end_page'] = resData.journal.ep;
+ }
+
+ result.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
+ result.hostedBy_collectedFrom, result.publisher,
+ result['journal']?result['journal'].journal:null, result.identifiers);
+
results.push(result);
}
return results;
}
-
+
parseProjects(projects: {
"id": string, "acronym": string, "title": string,
"funderShortname": string, "funderName": string,
@@ -436,15 +437,15 @@ export class SearchResearchResultsService {
"code": string
}>();
}
-
+
let countProjects = projects.length;
-
+
projects[countProjects] = {
"id": "", "acronym": "", "title": "",
"funderShortname": "", "funderName": "",
"code": ""
};
-
+
if (relation.title != 'unidentified') {
projects[countProjects]['id'] = relation['to'].content;
projects[countProjects]['acronym'] = relation.acronym;
@@ -456,36 +457,36 @@ export class SearchResearchResultsService {
projects[countProjects]['title'] = "";
projects[countProjects]['code'] = "";
}
-
+
if (relation.hasOwnProperty("funding")) {
let fundingLength = Array.isArray(relation['funding']) ? relation['funding'].length : 1;
-
+
for (let z = 0; z < fundingLength; z++) {
let fundingData = Array.isArray(relation['funding']) ? relation['funding'][z] : relation['funding'];
-
+
if (fundingData.hasOwnProperty("funder")) {
projects[countProjects]['funderShortname'] = fundingData['funder'].shortname;
projects[countProjects]['funderName'] = fundingData['funder'].name;
}
}
}
-
+
return projects;
}
-
+
parseRefineResults(id: string, data: any): any {
var results: any = [];
if (data.hasOwnProperty("resulthostingdatasource")) {
let length = Array.isArray(data['resulthostingdatasource']) ? data['resulthostingdatasource'].length : 1;
-
+
for (let i = 0; i < length; i++) {
let datasource = Array.isArray(data['resulthostingdatasource']) ? data['resulthostingdatasource'][i] : data['resulthostingdatasource'];
-
+
let result: { "name": string, "id": string, "count": number } = {"name": "", "id": "", "count": 0};
result['name'] = datasource.name;
result['id'] = datasource.id.split("||")[0];
result['count'] = datasource.count;
-
+
if (result['id'] != id && result['name'] != "Unknown Repository") {
results.push(result);
}
@@ -493,19 +494,19 @@ export class SearchResearchResultsService {
}
return results;
}
-
+
private numOfResults(url: string, properties: EnvProperties): any {
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- .pipe(map(res => res['total']));
+ .pipe(map(res => res['total']));
}
-
+
numOfEntityResults(resultType: string, id: string, entity: string, properties: EnvProperties): any {
var parameters: string = "";
parameters = this.getEntityQueryName(entity, true) + "/" + id + "/" + this.getEntityQueryName(resultType, true) + "/count";
let url = properties.searchAPIURLLAst + parameters + "?format=json";
return this.numOfResults(url, properties);
}
-
+
numOfResearchOutcomes(params: string, properties: EnvProperties, refineParams: string = null): any {
let url = properties.searchAPIURLLAst + "resources2/?format=json&size=0&type=results";
if (params.length > 0) {
@@ -522,20 +523,20 @@ export class SearchResearchResultsService {
// }
url += "&query=" + params;
}
-
+
if (refineParams != null && refineParams != '') {
url += refineParams;
}
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- .pipe(map(res => res['meta']['total']));
+ .pipe(map(res => res['meta']['total']));
}
-
+
numOfSearchResults(resultType: string, params: string, properties: EnvProperties, refineParams: string = null): any {
let url = properties.searchAPIURLLAst + this.getEntityQueryName(resultType, true) + "/count?format=json";
if (params.length > 0) {
var DOIs: string[] = DOI.getDOIsFromString(params);
var doisParams = "";
-
+
for (var i = 0; i < DOIs.length; i++) {
doisParams += (doisParams.length > 0 ? "&" : "") + 'doi="' + DOIs[i] + '"';
}
@@ -545,30 +546,30 @@ export class SearchResearchResultsService {
url += "&q=" + StringUtils.URIEncode(params);
}
}
-
+
if (refineParams != null && refineParams != '') {
url += refineParams;
}
return this.numOfResults(url, properties);
}
-
+
numOfSearchResultsLinkedToPub(resultType: string, properties: EnvProperties): any {
let url = properties.searchAPIURLLAst + "resources?query=" + encodeURIComponent("( (oaftype exact result) and (resulttypeid exact " + resultType + ") and (relresulttype=publication) )") + "&page=0&size=0&format=json";
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- .pipe(map(res => res['meta']['total']));
+ .pipe(map(res => res['meta']['total']));
}
-
+
countTotalResults(resultType: string, properties: EnvProperties, refineParams: string = null): any {
let url = properties.searchAPIURLLAst + this.getEntityQueryName(resultType, true) + "/count?format=json" + refineParams;
return this.numOfResults(url, properties);
}
-
+
/*
private quote(word: any): string {
return '"'+word+'"';
}
*/
-
+
private getEntityQueryName(entityType: string, plural: boolean) {
if (entityType == "publication" || entityType == "dataset" || entityType == "organization" || entityType == "datasource" || entityType == "project") {
if (plural) {
@@ -582,8 +583,8 @@ export class SearchResearchResultsService {
}
public countCollectedResultsWithFundingInfo(datasourceId: string) {
- let url = properties.searchAPIURLLAst + "resources?query=" + encodeURIComponent("(oaftype=result and collectedfromdatasourceid exact \""+datasourceId+"\" and relprojectid=*)") + "&page=0&size=0&format=json";
+ let url = properties.searchAPIURLLAst + "resources?query=" + encodeURIComponent("(oaftype=result and collectedfromdatasourceid exact \"" + datasourceId + "\" and relprojectid=*)") + "&page=0&size=0&format=json";
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- .pipe(map(res => res['meta']['total']));
+ .pipe(map(res => res['meta']['total']));
}
}
diff --git a/sharedComponents/advanced-search-input/advanced-search-input.component.ts b/sharedComponents/advanced-search-input/advanced-search-input.component.ts
index 8088a358..ee420334 100644
--- a/sharedComponents/advanced-search-input/advanced-search-input.component.ts
+++ b/sharedComponents/advanced-search-input/advanced-search-input.component.ts
@@ -22,7 +22,10 @@ import {EntitiesSelectionComponent} from "../../searchPages/searchUtils/entities
-
+
+
+
+
@@ -34,6 +37,7 @@ import {EntitiesSelectionComponent} from "../../searchPages/searchUtils/entities
export class AdvancedSearchInputComponent implements AfterContentInit, OnDestroy {
@ContentChildren(InputComponent) inputs: QueryList
;
@ContentChildren(EntitiesSelectionComponent) entities: QueryList;
+ @Input() iconPosition: 'left' | 'right' = 'right';
@Input() disabled: boolean = false;
@Input() searchInputClass: string = 'inner';
@Input() dark: boolean;
diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts
index 19c5040c..e1ec167a 100644
--- a/sharedComponents/input/input.component.ts
+++ b/sharedComponents/input/input.component.ts
@@ -381,6 +381,9 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
@HostListener('window:keydown.enter', ['$event'])
enter(event: KeyboardEvent) {
+ if (this.extendEnter) {
+ this.extendEnter();
+ }
if (this.opened && this.optionBox) {
event.preventDefault();
if (this.filteredOptions[this.selectedIndex]) {
@@ -391,9 +394,6 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
} else {
this.focus(false, event);
}
- if (this.extendEnter) {
- this.extendEnter();
- }
}
@HostListener('keydown', ['$event'])
@@ -642,7 +642,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
return (this.showOptionsOnEmpty) ? options : [];
}
const filterValue = value.toString().toLowerCase();
- options = options.filter(option => option.label.toLowerCase().indexOf(filterValue) != -1);
+ options = options.filter(option => (option.label && option.label.toLowerCase().indexOf(filterValue) != -1));
this.selectedIndex = options.findIndex(option => option.value === this.formControl.value);
if (this.selectedIndex === -1) {
this.selectedIndex = 0;
diff --git a/sharedComponents/navigationBar.component.html b/sharedComponents/navigationBar.component.html
index 5ce946ca..b0a6513f 100644
--- a/sharedComponents/navigationBar.component.html
+++ b/sharedComponents/navigationBar.component.html
@@ -170,12 +170,28 @@
+
+
+
+
+
@@ -183,7 +199,7 @@
-
+
Home
diff --git a/sharedComponents/navigationBar.component.ts b/sharedComponents/navigationBar.component.ts
index 4f3cf8e4..6fcd0125 100644
--- a/sharedComponents/navigationBar.component.ts
+++ b/sharedComponents/navigationBar.component.ts
@@ -1,4 +1,13 @@
-import {ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges} from '@angular/core';
+import {
+ ChangeDetectorRef,
+ Component, ElementRef,
+ Input,
+ OnChanges,
+ OnDestroy,
+ OnInit, QueryList,
+ SimpleChanges, ViewChild,
+ ViewChildren
+} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Session, User} from '../login/utils/helper.class';
import {ConfigurationService} from '../utils/configuration/configuration.service';
@@ -9,6 +18,9 @@ import {HelpContentService} from '../services/help-content.service';
import {properties} from "../../../environments/environment";
import {LayoutService} from "../dashboard/sharedComponents/sidebar/layout.service";
import {NotificationConfiguration} from "../notifications/notifications-sidebar/notifications-sidebar.component";
+import {SearchInputComponent} from "./search-input/search-input.component";
+import {Filter} from "../searchPages/searchUtils/searchHelperClasses.class";
+import {RouterHelper} from "../utils/routerHelper.class";
declare var UIkit;
@@ -57,6 +69,7 @@ export class NavigationBarComponent implements OnInit, OnDestroy, OnChanges {
subs: Subscription[] = [];
showEntity = {};
showPage = {};
+ public searchMode: boolean = false;
public additionalMenuItems: MenuItem[] = [];
public featuredMenuItems: MenuItem[] = [];
@@ -64,13 +77,28 @@ export class NavigationBarComponent implements OnInit, OnDestroy, OnChanges {
public isFeaturedMenuEnabled: boolean = false;
public featuredAlignment: string = MenuAlignment.CENTER.valueOf();
+ public hasSearchBar: boolean = false;
+ public resultsQuickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = {
+ filter: null,
+ selected: true,
+ filterId: "resultbestaccessright",
+ value: "Open Access"
+ };
+ @ViewChild('search_input') search_input: SearchInputComponent;
+ public routerHelper: RouterHelper = new RouterHelper();
+
constructor(private router: Router,
private route: ActivatedRoute,
private config: ConfigurationService,
private _helpContentService: HelpContentService,
- private layoutService: LayoutService) {}
+ private layoutService: LayoutService,
+ private cdr: ChangeDetectorRef) {}
ngOnInit() {
+ this.subs.push(this.route.queryParams.subscribe(params => {
+ this.searchMode = false;
+ this.keyword = "";
+ }));
this.initialize();
}
@@ -145,6 +173,9 @@ export class NavigationBarComponent implements OnInit, OnDestroy, OnChanges {
this.subs.push(this.layoutService.replaceHeader.subscribe(replaceHeader => {
this.setHeader(replaceHeader);
}));
+ this.subs.push(this.layoutService.hasMenuSearchBar.subscribe(hasSearchBar => {
+ this.hasSearchBar = hasSearchBar;
+ }));
}
setHeader(replaceHeader: boolean) {
@@ -204,4 +235,29 @@ export class NavigationBarComponent implements OnInit, OnDestroy, OnChanges {
// return MenuItem.isTheActiveMenu(item, this.currentRoute, this.layoutService.activeMenuItem);
// }
}
+
+ openSearch(event) {
+ event.stopPropagation();
+ this.searchMode = true;
+ this.cdr.detectChanges();
+ this.search_input.input.focus(true);
+ }
+
+ goTo() {
+ let parameterNames = [];
+ let parameterValues = [];
+
+ if (this.resultsQuickFilter && this.resultsQuickFilter.selected) {
+ parameterNames.push(this.resultsQuickFilter.filterId);
+ parameterValues.push('"' + encodeURIComponent(this.resultsQuickFilter.value) + '"');
+ }
+
+ if (this.keyword.length > 0) {
+ parameterNames.push("fv0");
+ parameterValues.push(this.keyword);
+ parameterNames.push("f0");
+ parameterValues.push("q");
+ }
+ this.router.navigate([this.properties.searchLinkToAll], {queryParams: this.routerHelper.createQueryParams(parameterNames, parameterValues)});
+ }
}
diff --git a/sharedComponents/navigationBar.module.ts b/sharedComponents/navigationBar.module.ts
index ba856688..3d4b481f 100644
--- a/sharedComponents/navigationBar.module.ts
+++ b/sharedComponents/navigationBar.module.ts
@@ -10,12 +10,13 @@ import { UserMiniModule} from '../login/userMiniModule.module';
import {SearchBarModule} from "./searchBar/searchBar.module";
import {HelpContentService} from '../services/help-content.service';
import {IconsModule} from "../utils/icons/icons.module";
+import {SearchInputModule} from "./search-input/search-input.module";
@NgModule({
imports: [
CommonModule, FormsModule,
RouterModule,
- UserMiniModule, IconsModule,
+ UserMiniModule, IconsModule, SearchInputModule,
// , SearchBarModule
],
declarations: [
diff --git a/sharedComponents/search-input/search-input.component.ts b/sharedComponents/search-input/search-input.component.ts
index 818da42a..ea7e87df 100644
--- a/sharedComponents/search-input/search-input.component.ts
+++ b/sharedComponents/search-input/search-input.component.ts
@@ -1,4 +1,5 @@
import {
+ AfterViewInit,
ChangeDetectorRef,
Component,
ElementRef,
@@ -10,7 +11,6 @@ import {
ViewChild
} from '@angular/core';
import {AbstractControl} from '@angular/forms';
-import {MatAutocompleteTrigger} from '@angular/material/autocomplete';
import {InputComponent} from "../input/input.component";
import {ClickEvent} from "../../utils/click/click-outside-or-esc.directive";
@@ -33,7 +33,7 @@ import {ClickEvent} from "../../utils/click/click-outside-or-esc.directive";
@@ -44,7 +44,7 @@ import {ClickEvent} from "../../utils/click/click-outside-or-esc.directive";
`
})
-export class SearchInputComponent implements OnInit {
+export class SearchInputComponent implements OnInit, AfterViewInit {
@Input() disabled: boolean = false;
@Input() searchInputClass: string = 'inner';
@Input() iconPosition: 'left' | 'right' = 'right';
@@ -59,6 +59,7 @@ export class SearchInputComponent implements OnInit {
@ViewChild('input') input: InputComponent;
public expanded: boolean = true;
public initialized: boolean = false;
+ public ratio: number = 1;
constructor(private cdr: ChangeDetectorRef) {
}
@@ -86,6 +87,12 @@ export class SearchInputComponent implements OnInit {
this.initialized = true;
}
+ ngAfterViewInit() {
+ if(typeof document !== 'undefined') {
+ this.ratio = Number.parseFloat(getComputedStyle(this.searchInput.nativeElement).getPropertyValue('--search-input-icon-ratio'));
+ }
+ }
+
expand(value: boolean) {
this.expanded = value;
this.cdr.detectChanges();
@@ -118,32 +125,4 @@ export class SearchInputComponent implements OnInit {
get hidden(): boolean {
return !this.expanded && (!this.searchControl?.value && !this.value);
}
-
- /** @deprecated all*/
- @Input()
- showSearch: boolean = true;
- @Input()
- control: AbstractControl;
- @Input()
- loading: boolean = false;
- @Input()
- selected: any;
- @Input()
- list: any = null;
- @Input()
- colorClass: string = 'portal-color';
- @Input()
- bordered: boolean = false;
- @Input()
- toggleTitle: string = 'search';
- @ViewChild(MatAutocompleteTrigger) trigger: MatAutocompleteTrigger;
- @Output()
- resetEmitter: EventEmitter
= new EventEmitter();
- @Output()
- closeEmitter: EventEmitter = new EventEmitter();
-
- /** @deprecated*/
- closeSearch() {
-
- }
}
diff --git a/utils/HelperFunctions.class.ts b/utils/HelperFunctions.class.ts
index 872009ce..4a4b0f6e 100644
--- a/utils/HelperFunctions.class.ts
+++ b/utils/HelperFunctions.class.ts
@@ -2,13 +2,21 @@ import {UrlMatcher, UrlSegment} from "@angular/router";
export class HelperFunctions {
- public static scroll() {
+ public static scroll(smooth: boolean = false) {
HelperFunctions.scrollTo(0,0);
}
- public static scrollTo(x,y) {
+ public static scrollTo(x,y, smooth: boolean = false) {
if (typeof document !== 'undefined') {
- window.scrollTo(x,y);
+ if(!smooth) {
+ window.scrollTo(x, y);
+ } else {
+ window.scrollTo({
+ top: 0,
+ left: 0,
+ behavior: "smooth"
+ })
+ }
}
}
diff --git a/utils/altmetrics.component.ts b/utils/altmetrics.component.ts
index 71104099..ceab92dd 100644
--- a/utils/altmetrics.component.ts
+++ b/utils/altmetrics.component.ts
@@ -6,12 +6,13 @@ declare var loadAltmetrics:any;
@Component({
selector: 'altmetrics',
template: `
-
+
`
})
export class AltMetricsComponent {
- @Input() id ;
+ @Input() id;
@Input() type = 'doi'; // doi or arxiv
+ @Input() size: string = 'donut';
// public doi="10.7717/peerj.1150";
public altmetrics:string;
@@ -26,9 +27,9 @@ export class AltMetricsComponent {
ngOnInit() {
this.sub = this.route.queryParams.subscribe(data => {
if(this.type == "doi"){
- this.altmetrics='
';
+ this.altmetrics='
';
}else{
- this.altmetrics='
';
+ this.altmetrics='
';
}
if (typeof document !== 'undefined') {
// let yourModule = require('../utils/altmetrics.js');
diff --git a/utils/authors/showAuthors.component.ts b/utils/authors/showAuthors.component.ts
index 27aa7e0c..e659763c 100644
--- a/utils/authors/showAuthors.component.ts
+++ b/utils/authors/showAuthors.component.ts
@@ -10,14 +10,15 @@ import {properties} from "../../../../environments/environment";
@Component({
selector: 'showAuthors',
template: `
-
-
+
+
{{author.fullName + ";"}}
-
+
{{author.fullName + ";"}}
@@ -78,39 +79,49 @@ import {properties} from "../../../../environments/environment";
-
+
-
authorsLimit" class="uk-text-meta">
- +{{authors.length-authorsLimit | number}} more
-
+
authorsLimit" class="uk-text-meta">
+ +{{authors.length-authorsLimit | number}} more
+
authorsLimit && !viewAll">
+{{authors.length-authorsLimit | number}} Authors
-
-
-
+
+
+
+
+
+
+
+
+
`
})
export class ShowAuthorsComponent {
+ @Input() isMobile: boolean = false;
@Input() authors: Author[];
@Input() isSticky: boolean = false;
@Input() authorsLimit: number = 7;
@Input() showAll: boolean = true;
@Input() modal: AlertModal;
@Input() viewAll: boolean = false;
+ @Input() showInline: boolean = false; // do not open modal for "view more" when this is true
public lessBtn: boolean = false;
@ViewChild('authorsModal') authorsModal;
@@ -133,7 +144,7 @@ export class ShowAuthorsComponent {
}
public viewAllClick() {
- if(this.authors.length <= this.authorsLimit*2) {
+ if(this.authors.length <= this.authorsLimit*2 || this.showInline) {
this.viewAll = true;
this.lessBtn = true;
} else {
@@ -142,10 +153,16 @@ export class ShowAuthorsComponent {
}
public openAuthorsModal() {
- this.authorsModal.cancelButton = false;
- this.authorsModal.okButton = false;
- this.authorsModal.alertTitle = "Authors";
- this.authorsModal.open();
+ if (this.isMobile) {
+ this.authorsModal.okButton = false;
+ this.authorsModal.title = "Authors";
+ this.authorsModal.open();
+ } else {
+ this.authorsModal.cancelButton = false;
+ this.authorsModal.okButton = false;
+ this.authorsModal.alertTitle = "Authors";
+ this.authorsModal.open();
+ }
}
copyToClipboard(element: HTMLInputElement) {
diff --git a/utils/authors/showAuthors.module.ts b/utils/authors/showAuthors.module.ts
index a9cd2e12..f98f42e5 100644
--- a/utils/authors/showAuthors.module.ts
+++ b/utils/authors/showAuthors.module.ts
@@ -5,10 +5,11 @@ import {RouterModule} from '@angular/router';
import {ShowAuthorsComponent} from './showAuthors.component';
import {AlertModalModule} from "../modal/alertModal.module";
+import {FullScreenModalModule} from "../modal/full-screen-modal/full-screen-modal.module";
@NgModule({
imports: [
- CommonModule, FormsModule, RouterModule, AlertModalModule
+ CommonModule, FormsModule, RouterModule, AlertModalModule, FullScreenModalModule
],
declarations: [
ShowAuthorsComponent
diff --git a/utils/dataTransfer/transferData.component.html b/utils/dataTransfer/transferData.component.html
index 86317a20..f6b84902 100644
--- a/utils/dataTransfer/transferData.component.html
+++ b/utils/dataTransfer/transferData.component.html
@@ -1,11 +1,10 @@
-
-
-
-
-
+
+
+ Transfer
+
diff --git a/utils/dataTransfer/transferData.module.ts b/utils/dataTransfer/transferData.module.ts
index 9267d368..23483160 100644
--- a/utils/dataTransfer/transferData.module.ts
+++ b/utils/dataTransfer/transferData.module.ts
@@ -5,18 +5,18 @@ import {EGIDataTransferComponent} from "./transferData.component";
import {InputModule} from "../../sharedComponents/input/input.module";
import {AlertModalModule} from "../modal/alertModal.module";
import {FullScreenModalModule} from "../modal/full-screen-modal/full-screen-modal.module";
+import {IconsModule} from '../icons/icons.module';
@NgModule({
imports: [
- CommonModule, FormsModule, InputModule, AlertModalModule, FullScreenModalModule
-
+ CommonModule, FormsModule, InputModule, AlertModalModule, FullScreenModalModule, IconsModule
],
declarations: [
EGIDataTransferComponent
- ],
+ ],
exports: [
EGIDataTransferComponent
- ]
+ ]
})
export class EGIDataTransferModule { }
diff --git a/utils/email/composer.ts b/utils/email/composer.ts
index 82f3d5f3..6fead2f0 100644
--- a/utils/email/composer.ts
+++ b/utils/email/composer.ts
@@ -1,10 +1,6 @@
import {Email} from "./email";
import {Body} from "./body";
-import {FormArray} from "@angular/forms";
import {properties} from "../../../../environments/environment";
-import {Stakeholder} from "../../monitor/entities/stakeholder";
-import {Report} from "../../../../cache-indicators";
-import {error} from "protractor";
export class Composer {
private static noteBodySize = "14px";
@@ -140,6 +136,31 @@ export class Composer {
email.recipients = recipients;
return email;
}
+
+ public static composeEmailForSdgsSuggestion(info: {name: string, url: string, email: string, subjects: any[]}, recipients: string[], subjectType: "sdg" | "fos"): Email {
+ let typeName: string = "";
+ if(subjectType == "sdg") {
+ typeName = "Sustainable Development Goals (SDGs)";
+ } else {
+ typeName = "Fields of Science (FoS)";
+ }
+
+ let email: Email = new Email();
+ email.subject = 'Feedback report for ' + info.name;
+ email.body = ""
+ + "
A user" + ((info.email)?(" with email " + info.email):"") + " has reported the following "+typeName+" for "
+ + "" + info.name + "
";
+ if(info.subjects && info.subjects.length > 0) {
+ info.subjects.forEach((subject, index) => {
+ email.body += "" + subject + " ";
+ });
+ } else {
+ email.body += "No "+typeName+" selected ";
+ }
+ email.body += " ";
+ email.recipients = recipients;
+ return email;
+ }
public static composeEmailForUserAfterFeedback(recipients: string[]): Email {
let email: Email = new Email();
@@ -188,7 +209,7 @@ export class Composer {
return email;
}
- public static composeEmailToReportCachingProcess(report: Report) {
+ public static composeEmailToReportCachingProcess(report: any) {
let email: Email = new Email();
email.recipients = [report.creator];
email.subject = 'OpenAIRE | Monitor Dashboard - ' + report.name + '\'s caching process has been finished';
diff --git a/utils/entities/dataProviderInfo.ts b/utils/entities/dataProviderInfo.ts
index 47cabf6c..449bcc64 100644
--- a/utils/entities/dataProviderInfo.ts
+++ b/utils/entities/dataProviderInfo.ts
@@ -1,4 +1,5 @@
import {properties} from "../../../../environments/environment";
+import {Measure} from "./resultLandingInfo";
export class DataproviderProvenance {
provenance: Map;
@@ -36,6 +37,7 @@ export class DataProviderInfo {
identifiers: Map; //key is the classname
fundedContent: string; // search query
+ measure: Measure;
//collected from datasource api
// aggregationStatus: {"fundedContent": string, "indexRecords": string, "fulltexts": string, "lastUpdateDate": string};
diff --git a/utils/entities/projectInfo.ts b/utils/entities/projectInfo.ts
index 84d0f47b..e66736fe 100644
--- a/utils/entities/projectInfo.ts
+++ b/utils/entities/projectInfo.ts
@@ -1,25 +1,26 @@
+import {Measure} from "./resultLandingInfo";
+
export class ProjectInfo {
- id:string;
- acronym: string;
- title: string;
-
- funding: {funderName: string, funderShortName: string, code: string, callIdentifier: string,
- fundingStream: string, budget: string, contribution: string, currency: string};
- startDate: number;
- endDate: number;
- currentDate: number;
- status: string;
- openAccessMandatePublications: string;
- openAccessMandateDatasets: string;
- // specialClause39: string;
- organizations: { "acronym": string, "name": string, "id": string }[];//Map;
- url: string;
- urlInfo: string;
- description: string;
- //publications: any;
- researchData: any;
-
- totalPublications: number;
- totalDatasets: number;
- publicationsStatus: any;
+ id:string;
+ acronym: string;
+ title: string;
+ funding: {funderName: string, funderShortName: string, code: string, callIdentifier: string,
+ fundingStream: string, budget: string, contribution: string, currency: string};
+ startDate: number;
+ endDate: number;
+ currentDate: number;
+ status: string;
+ openAccessMandatePublications: string;
+ openAccessMandateDatasets: string;
+ // specialClause39: string;
+ organizations: { "acronym": string, "name": string, "id": string }[];//Map;
+ url: string;
+ urlInfo: string;
+ description: string;
+ //publications: any;
+ researchData: any;
+ totalPublications: number;
+ totalDatasets: number;
+ publicationsStatus: any;
+ measure: Measure;
}
diff --git a/utils/entities/resultLandingInfo.ts b/utils/entities/resultLandingInfo.ts
index c531307d..0ae3866f 100644
--- a/utils/entities/resultLandingInfo.ts
+++ b/utils/entities/resultLandingInfo.ts
@@ -29,6 +29,30 @@ export interface Context {
logo?: string;
}
+export interface Measure {
+ /** @deprecated*/
+ downloads?: string;
+ /** @deprecated*/
+ views?: string;
+ /** @deprecated*/
+ influence?: string;
+ /** @deprecated*/
+ popularity?: string;
+ /** @deprecated*/
+ citations?: string;
+ /** @deprecated*/
+ impulse?: string;
+ bip?: Metric[]
+ counts?: Metric[]
+}
+
+export interface Metric {
+ name: string,
+ order: number,
+ icon: string,
+ value: any
+}
+
export class ResultLandingInfo {
relcanId;
objIdentifier: string;
@@ -60,7 +84,7 @@ export class ResultLandingInfo {
subjects: string[];
otherSubjects: Map;
classifiedSubjects: Map; //
- fos: string[];
+ fos: {"id": string, "label": string}[] = [];
sdg: string[];
eoscSubjects: any[];
@@ -140,4 +164,6 @@ export class ResultLandingInfo {
// SOFTWARE
programmingLanguages: string[];
+
+ measure: Measure;
}
diff --git a/utils/entities/searchResult.ts b/utils/entities/searchResult.ts
index 63bb5054..c8221930 100644
--- a/utils/entities/searchResult.ts
+++ b/utils/entities/searchResult.ts
@@ -1,36 +1,41 @@
-import {Author, Organization, Project, ResultTitle} from "../result-preview/result-preview";
+import {Author, HostedByCollectedFrom, Journal, Organization, Project, ResultTitle} from "../result-preview/result-preview";
+import {Measure, Metric} from "./resultLandingInfo";
export class SearchResult {
title: ResultTitle;
id: string;
relcanId: string;
objId: string;
- DOIs: string[]=[];
+ DOIs: string[] = [];
identifiers: Map;
- measure: Array;
+ measure: Measure;
+ date: string;
+ dateofacceptance: Date;
+ journal: Journal;
//publications & datasets & orp & software & projects & dataproviders:
description: string;
//publications & datasets & orp & software & organizations:
projects: Project[];
-
+
//datasets & orp & publications & software
year: string;
embargoEndDate: Date | string;
authors: Author[];
countriesForResults: string[];
languages: string[];
-
+ hostedBy_collectedFrom: HostedByCollectedFrom[];
+
//datasets & orp & software:
publisher: string;
-
+
//software
programmingLanguages: string[];
-
+
//dataproviders & projects:
organizations: Organization[];
-
+
//projects:
acronym: string;
code: string;
@@ -43,10 +48,10 @@ export class SearchResult {
endYear: number;
openAccessMandatePublications: boolean;
openAccessMandateDatasets: boolean;
-
+
//organizations:
country: string;
-
+
//dataproviders:
englishname: string;
type: string;
@@ -56,11 +61,12 @@ export class SearchResult {
compatibilityUNKNOWN: boolean;
countries: string[];
subjects: string[];
-
+
entityType: string;
types: string[];
- enermapsId:string;
+ enermapsId: string;
+
constructor() {
}
-
+
}
diff --git a/utils/entity-actions/entity-actions.component.ts b/utils/entity-actions/entity-actions.component.ts
new file mode 100644
index 00000000..dc80ae29
--- /dev/null
+++ b/utils/entity-actions/entity-actions.component.ts
@@ -0,0 +1,188 @@
+import {Component, Input, OnInit, ViewChild} from "@angular/core";
+import {StringUtils} from "../string-utils.class";
+import {RouterHelper} from "../routerHelper.class";
+import {properties} from "../../../../environments/environment";
+import {Router} from "@angular/router";
+import {Option} from "../../sharedComponents/input/input.component";
+import {OpenaireEntities} from "../properties/searchFields";
+import {EnvProperties} from "../properties/env-properties";
+
+@Component({
+ selector: 'entity-actions',
+ template: `
+
+
+
+
+
+
+
+
+
+
+ `
+})
+export class EntityActionsComponent implements OnInit {
+ @Input() result: any;
+ @Input() type: string;
+ @Input() id: string;
+ @Input() linking: boolean = false;
+ @Input() share: boolean = false;
+ @Input() cite: boolean = false;
+ @Input() deposit: boolean = false;
+ @Input() embed: boolean = false;
+ @Input() url: string;
+ @Input() isMobile: boolean = false;
+ public citeThisClicked: boolean;
+ public routerHelper: RouterHelper = new RouterHelper();
+ @ViewChild('citeModal') citeModal;
+ @ViewChild('embedResultsModal') embedResultsModal;
+ @ViewChild('downloadReportModal') downloadReportModal;
+ @ViewChild('addThisModal') addThisModal;
+ properties: EnvProperties = properties;
+ openaireEntities = OpenaireEntities;
+
+
+ /* Embed */
+ public embed_research_results_type: string = "result";
+ public clipboard;
+ public resultTypesForEmbedding: Option[]=[
+ {label: "All "+OpenaireEntities.RESULTS, value: "result"},
+ {label: OpenaireEntities.PUBLICATIONS, value: "publication"},
+ {label: OpenaireEntities.DATASETS, value: "dataset"},
+ {label: OpenaireEntities.SOFTWARE, value: "software"},
+ {label: OpenaireEntities.OTHER, value: "other"}];
+
+ constructor(private router: Router) {
+ }
+
+ ngOnInit() {
+ this.createClipboard();
+ }
+
+ get linkTo():string {
+ return this.type === 'project'?'result':'project';
+ }
+
+ public getTypeName(): string {
+ return StringUtils.getEntityName(this.type, false);
+ }
+
+ public openCiteModal() {
+ this.citeThisClicked = true;
+ this.citeModal.cancelButton = false;
+ this.citeModal.okButton = false;
+ this.citeModal.alertTitle = "Cite this " + this.getTypeName();
+ this.citeModal.open();
+ }
+
+ public openAddThisModal() {
+ this.addThisModal.cancelButton = false;
+ this.addThisModal.okButton = false;
+ this.addThisModal.alertTitle = "Share this " + this.getTypeName() + " in your social networks";
+ this.addThisModal.open();
+ }
+
+ public openEmbedResultsModal() {
+ this.embedResultsModal.cancelButton = false;
+ this.embedResultsModal.okButton = false;
+ this.embedResultsModal.alertTitle = "Embed results";
+ this.embedResultsModal.open();
+ }
+
+ private createClipboard() {
+ if (typeof window !== 'undefined') {
+ delete this.clipboard;
+ let Clipboard;
+ Clipboard = require('clipboard');
+ this.clipboard = new Clipboard('.clipboard_btn');
+ }
+ }
+
+ getDynamicContent(type: string) {
+ return "');"
+ + "\n-->"
+ + "\n";
+ }
+
+ isRouteAvailable(routeToCheck: string) {
+ for (let i = 0; i < this.router.config.length; i++) {
+ let routePath: string = this.router.config[i].path;
+ if (routePath == routeToCheck) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/utils/entity-actions/entity-actions.module.ts b/utils/entity-actions/entity-actions.module.ts
new file mode 100644
index 00000000..b90cd9b3
--- /dev/null
+++ b/utils/entity-actions/entity-actions.module.ts
@@ -0,0 +1,18 @@
+import {NgModule} from "@angular/core";
+import {CommonModule} from "@angular/common";
+import {EntityActionsComponent} from "./entity-actions.component";
+import {RouterModule} from "@angular/router";
+import {IconsModule} from "../icons/icons.module";
+import {AlertModalModule} from "../modal/alertModal.module";
+import {CiteThisModule} from "../../landingPages/landing-utils/citeThis/citeThis.module";
+import {LandingModule} from "../../landingPages/landing-utils/landing.module";
+import {InputModule} from "../../sharedComponents/input/input.module";
+
+@NgModule({
+ imports: [CommonModule, IconsModule, AlertModalModule, CiteThisModule, LandingModule, RouterModule, InputModule],
+ declarations: [EntityActionsComponent],
+ exports: [EntityActionsComponent]
+})
+export class EntityActionsModule {
+
+}
diff --git a/utils/icons/icons.ts b/utils/icons/icons.ts
index fb4fab03..28491418 100644
--- a/utils/icons/icons.ts
+++ b/utils/icons/icons.ts
@@ -112,4 +112,53 @@ export const login = {
name: 'login',
data: ' '
}
+
+export const cite = {
+ name: 'cite',
+ data: ' '
+}
+
+export const link_to = {
+ name: 'link_to',
+ data: ' '
+}
+
+export const versions = {
+ name: 'versions',
+ data: ' '
+}
+
+export const rocket = {
+ name: 'rocket',
+ data: ' '
+}
+
+export const fire = {
+ name: 'fire',
+ data: ' '
+}
+
+export const landmark = {
+ name: 'landmark',
+ data: ' '
+}
+
+export const open_access = {
+ name: 'open_access',
+ data: ' image/svg+xml art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos Open Access logo, converted into svg, designed by PLoS. This version with transparent background. http://commons.wikimedia.org/wiki/File:Open_Access_logo_PLoS_white.svg art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos http://www.plos.org/ '
+}
+
+export const closed_access = {
+ name: 'closed_access',
+ data: ' image/svg+xml Jakob Voss, based on art designer at PLoS, modified by Wikipedia users Nina and Beao Closed Access logo, derived from PLoS Open Access logo. This version with transparent background. http://commons.wikimedia.org/wiki/File:Closed_Access_logo_transparent.svg Jakob Voss, based on art designer at PLoS, modified by Wikipedia users Nina and Beao '
+}
/** Add new icon under this line to be sure that it will be added on preview */
+
+export const unknown_access = {
+ name: 'unknown_access',
+ data: '\n' +
+ ' \n' +
+ ' \n' +
+ ' \n' +
+ ' '
+}
\ No newline at end of file
diff --git a/utils/modal/alert.ts b/utils/modal/alert.ts
index 2c79afbb..4173ae39 100644
--- a/utils/modal/alert.ts
+++ b/utils/modal/alert.ts
@@ -25,7 +25,7 @@ declare var UIkit: any;
-
@@ -37,15 +37,21 @@ declare var UIkit: any;
Don't show this message again
-
-
- {{okButtonText}}
-
-
+
+
{{cancelButtonText}}
-
+ (click)="previous()">{{previousButtonText}}
+
+
+
+ {{okButtonText}}
+
+
+ {{cancelButtonText}}
+
+
@@ -66,6 +72,7 @@ export class AlertModal implements OnInit, AfterViewInit, OnDestroy {
@Input() classBody: string = "";
@Input() large: boolean = false;
@Input() overflowBody: boolean = true;
+ @ViewChild("bodyElement") bodyElement: ElementRef;
/**
* Caption for the title.
*/
@@ -95,6 +102,17 @@ export class AlertModal implements OnInit, AfterViewInit, OnDestroy {
/**
* if the alertMessage is true it will show the contentString inside alert body.
*/
+ /**
+ * Describes if the alert contains Previous Button.
+ * The default Previous button will emit the callback.
+ * Defaults to false.
+ */
+ public previousButton: boolean = false;
+ /**
+ * Caption for the Previous button.
+ * Default: Previous
+ */
+ public previousButtonText: string = 'Previous';
public alertMessage: boolean = true;
/**
* Some message/content can be set in message which will be shown in alert body.
@@ -215,4 +233,12 @@ export class AlertModal implements OnInit, AfterViewInit, OnDestroy {
UIkit.modal(this.element.nativeElement).hide();
}
}
+
+ previous() {
+ this.cancelOutput.emit();
+ }
+
+ get bodyHeight() {
+ return (this.bodyElement) ? this.bodyElement.nativeElement.offsetHeight : 0;
+ }
}
diff --git a/utils/modal/full-screen-modal/full-screen-modal.component.ts b/utils/modal/full-screen-modal/full-screen-modal.component.ts
index 4dbc5033..ea8ec891 100644
--- a/utils/modal/full-screen-modal/full-screen-modal.component.ts
+++ b/utils/modal/full-screen-modal/full-screen-modal.component.ts
@@ -1,17 +1,18 @@
import {
- AfterViewInit, ChangeDetectorRef,
+ AfterViewInit,
+ ChangeDetectorRef,
Component,
ElementRef,
- EventEmitter, HostListener,
+ EventEmitter,
+ HostListener,
Input,
OnDestroy,
- OnInit,
Output,
ViewChild
} from "@angular/core";
-import {fromEvent, Subscription} from 'rxjs';
-import {delay} from "rxjs/operators";
+import {Subscription} from 'rxjs';
import {HelperFunctions} from "../../HelperFunctions.class";
+import {LayoutService} from "../../../dashboard/sharedComponents/sidebar/layout.service";
declare var UIkit;
declare var ResizeObserver;
@@ -23,13 +24,14 @@ declare var ResizeObserver;
-
+
@@ -58,10 +60,15 @@ export class FullScreenModalComponent implements AfterViewInit, OnDestroy {
@Input() classTitle: string = "uk-background-primary uk-light";
@Input() classBody: string = 'uk-container-large';
back: boolean = false;
+ /**
+ * if the value is true then on ok clicked, modal will stay open.
+ */
+ public stayOpenInBack: boolean = false;
title: string;
cancelButton: boolean = true;
okButton: boolean = false;
okButtonText = 'OK';
+ isMobile: boolean = false;
@Input()
okButtonDisabled = false;
@Output()
@@ -71,11 +78,10 @@ export class FullScreenModalComponent implements AfterViewInit, OnDestroy {
@ViewChild('modal') modal: ElementRef;
@ViewChild('header') header: ElementRef;
@ViewChild('body') body: ElementRef;
- observer: any;
- headerHeight: number;
bodyHeight: number;
+ private subscriptions: any[] = [];
- constructor(private cdr: ChangeDetectorRef) {
+ constructor(private cdr: ChangeDetectorRef, private layoutService: LayoutService) {
}
@HostListener('window:resize', ['$event'])
@@ -86,31 +92,32 @@ export class FullScreenModalComponent implements AfterViewInit, OnDestroy {
ngOnInit() {
FullScreenModalComponent.FS_MODAL_COUNTER++;
this.id = 'fs-modal-' + FullScreenModalComponent.FS_MODAL_COUNTER;
+ this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
+ this.isMobile = isMobile;
+ }))
}
ngAfterViewInit() {
if(typeof window !== "undefined") {
- this.observer = new ResizeObserver(entries => {
+ let observer = new ResizeObserver(entries => {
for (let entry of entries) {
this.changeHeight();
}
});
- this.observer.observe(this.header.nativeElement);
+ observer.observe(this.header.nativeElement);
+ this.subscriptions.push(observer);
}
}
/* Height = Viewport - header - (Body padding) */
changeHeight() {
if(typeof window !== "undefined" && this.header) {
- this.bodyHeight = window.innerHeight - this.header.nativeElement.clientHeight - 80;
+ this.bodyHeight = window.innerHeight - this.header.nativeElement.offsetHeight;
this.cdr.detectChanges();
}
}
ngOnDestroy() {
- if(this.observer && this.observer instanceof ResizeObserver) {
- this.observer.disconnect();
- }
if(typeof document !== "undefined") {
const element = document.getElementById("modal-container");
for (let i = element.childNodes.length - 1; i >= 0; --i) {
@@ -120,7 +127,13 @@ export class FullScreenModalComponent implements AfterViewInit, OnDestroy {
}
}
}
-
+ this.subscriptions.forEach(subscription => {
+ if(subscription instanceof Subscription) {
+ subscription.unsubscribe();
+ } else if(typeof ResizeObserver != 'undefined' && subscription instanceof ResizeObserver) {
+ subscription.disconnect();
+ }
+ });
}
get isOpen() {
@@ -131,12 +144,21 @@ export class FullScreenModalComponent implements AfterViewInit, OnDestroy {
UIkit.modal(this.modal.nativeElement).show();
HelperFunctions.scroll();
}
-
+
cancel() {
UIkit.modal(this.modal.nativeElement).hide();
HelperFunctions.scroll();
this.cancelEmitter.emit();
}
+
+ backClicked() {
+ if(this.stayOpenInBack) {
+ HelperFunctions.scroll();
+ this.cancelEmitter.emit();
+ } else {
+ this.cancel();
+ }
+ }
ok() {
UIkit.modal(this.modal.nativeElement).hide();
diff --git a/utils/modal/loading.component.ts b/utils/modal/loading.component.ts
index 7dcd3ed9..114961ff 100644
--- a/utils/modal/loading.component.ts
+++ b/utils/modal/loading.component.ts
@@ -15,7 +15,7 @@ declare var UIkit: any;
template: `
-
+
@@ -23,9 +23,7 @@ declare var UIkit: any;
@@ -34,6 +32,24 @@ declare var UIkit: any;
+
+
@@ -66,8 +82,11 @@ export class ModalLoading{
private static MODAL_LOADING_COUNTER: number = 0;
id: string = "modal-loading";
+ title: string;
-@Input() public message:string ="Loading";
+ @Input() isMobile: boolean = false;
+ @Input() classTitle: string = "uk-background-primary uk-light";
+ @Input() public message:string ="Loading";
@ViewChild('loading_element') element: ElementRef;
/**
diff --git a/utils/modal/loadingModal.module.ts b/utils/modal/loadingModal.module.ts
index 6edf5c4a..d552964d 100644
--- a/utils/modal/loadingModal.module.ts
+++ b/utils/modal/loadingModal.module.ts
@@ -4,11 +4,12 @@ import { FormsModule } from '@angular/forms';
import {ModalLoading} from './loading.component';
import {ModalModule} from './modal.module';
+import {LoadingModule} from "../loading/loading.module";
//helpers
@NgModule({
- imports: [ CommonModule, FormsModule,ModalModule ],
+ imports: [CommonModule, FormsModule, ModalModule, LoadingModule],
declarations: [
ModalLoading
],
diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts
index 4b1279bf..74d01ddf 100644
--- a/utils/properties/env-properties.ts
+++ b/utils/properties/env-properties.ts
@@ -17,6 +17,7 @@ export interface EnvProperties {
framesAPIURL?: string;
statisticsFrameAPIURL?: string;
statisticsFrameNewAPIURL?: string;
+ bipFrameAPIURL?: string;
useNewStatistisTool?: boolean;
useOldStatisticsSchema?: boolean;
monitorStatsFrameUrl?:string;
@@ -96,6 +97,7 @@ export interface EnvProperties {
searchLinkToOrp?: string;
searchLinkToOrganization?: string;
//Search pages
+ searchLinkToAll?: string;
searchLinkToCommunities?: string;
searchLinkToStakeholders?: string;
searchLinkToPublications?: string;
diff --git a/utils/properties/searchFields.ts b/utils/properties/searchFields.ts
index 97ab07f4..02183b1c 100644
--- a/utils/properties/searchFields.ts
+++ b/utils/properties/searchFields.ts
@@ -265,7 +265,7 @@ export class SearchFields {
["projectendyear", "projectstartyear"]
];
public PROJECT_REFINE_FIELDS: string[] = ["funder", "fundinglevel0_id", "fundinglevel1_id",
- "fundinglevel2_id", "projectstartyear", "projectendyear", "projectoamandatepublications"];
+ "fundinglevel2_id", "projectoamandatepublications", "projectstartyear", "projectendyear"];
public PROJECT_ADVANCED_FIELDS: string[] = ["q", "projectacronym", "projecttitle", "projectkeywords",
"funder", "fundinglevel0_id", "fundinglevel1_id", "fundinglevel2_id",
"projectstartdate", "projectenddate",
@@ -694,7 +694,7 @@ export class SearchFields {
//add project field depending on funder
public HIDDEN_FIELDS: string[] = ["fundinglevel0_id", "fundinglevel1_id", "fundinglevel2_id",
- "relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id", "relproject"];
+ "relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id", "relproject", "instancetypename"];
public DEPENDENT_FIELDS: { [key: string]: string } = {
["relproject"]: "relfunder",
@@ -703,7 +703,8 @@ export class SearchFields {
["fundinglevel2_id"]: "fundinglevel1_id",
["relfundinglevel0_id"]: "relfunder",
["relfundinglevel1_id"]: "relfundinglevel0_id",
- ["relfundinglevel2_id"]: "relfundinglevel1_id"
+ ["relfundinglevel2_id"]: "relfundinglevel1_id",
+ ["instancetypename"]: "type"
};
diff --git a/utils/rangeFilter/rangeFilter.component.html b/utils/rangeFilter/rangeFilter.component.html
index 5159299d..6db97076 100644
--- a/utils/rangeFilter/rangeFilter.component.html
+++ b/utils/rangeFilter/rangeFilter.component.html
@@ -8,47 +8,20 @@