Compare commits
No commits in common. "master" and "production-release-march-2024" have entirely different histories.
master
...
production
|
@ -14,56 +14,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||
- *Fixed (for any bug fixes)*
|
||||
- *Security (in case of vulnerabilities)*
|
||||
|
||||
## [production-release-august-2024] - 2024/08/01
|
||||
### Changed
|
||||
* Hide L3 & L4 from FoS (Fields of Science page, Detailed page, Advanced search page)
|
||||
* Search page: Reordered buttons - moved compact results button before download button
|
||||
|
||||
## [production-release-july-2024] - 2024/07/11
|
||||
### Changed
|
||||
* Parse instances new info (to delete deletedbyinference records)
|
||||
* Detailed page: Remove subjects by vocabulary section and show all subjects under keywords
|
||||
|
||||
### Fixed
|
||||
* Updated vocabulary for Fields of Science level 4
|
||||
* Linking: Do not add unidentified code in queries - missing irish funders
|
||||
|
||||
### Added
|
||||
* Funders page: More information in cards (i.e. country, registered)
|
||||
* Funders page: New sorting options by research products & projects
|
||||
* Links between Research products and Data sources
|
||||
* Design of compact search results
|
||||
|
||||
## [production-release-june-2024] - 2024/06/04
|
||||
### Changed
|
||||
* Filter out unidentified projects from the search page and related tabs in detailed pages
|
||||
* Updated link functionality for funding: search either by selecting funder or directly for projects
|
||||
|
||||
### Fixed
|
||||
* Search results: adjust message when >= 1000 relations in the metadata line
|
||||
* Fixed message on "Related Data Sources" tab of Data source detailed page
|
||||
* Query 100 top values when a value of the filter is selected (bug when selected not in top 7 values)
|
||||
|
||||
## [production-release-may-2024] - 2024/05/23
|
||||
### Changed
|
||||
* Restored in search pages: number of results & selected keyword
|
||||
* Performance improvements: onPush Strategy for checking when there are content changes in search results
|
||||
* Updated color of filter labels & set color of "x" on filter labels same as the text
|
||||
* Updated cards in funders page
|
||||
|
||||
### Fixed
|
||||
* Filters in claims (projects) always loading
|
||||
* z-index issue in dropdown (ORCID) inside modal (authors)
|
||||
* Close dropdown of ORCID author when clicking on the search button
|
||||
* Replaced /projects search endpoint with /resources2?type=projects in project claims
|
||||
|
||||
### Added
|
||||
* Link directly with funding (unidentified projects)
|
||||
* Display organization persistent identifiers (search results & detailed page)
|
||||
* Search & Advanced search organizations by pid
|
||||
* Display full organization names in search organizations page
|
||||
* Added level4 FoS in fos.json vocabulary
|
||||
|
||||
## [production-release-march-2024] - 2024/03/04
|
||||
### Changed
|
||||
* Performance improvements
|
||||
|
@ -79,7 +29,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||
### Fixed
|
||||
* z-index issue in dropdowns inside modals
|
||||
* Change search tab from menu
|
||||
* Requests in bulk DOIs upload in linking
|
||||
* Requests in bulk DOIs upload in linkinh
|
||||
* View all for search filters
|
||||
* Research products detailed page: Provenance label in funded by
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
"clipboard": "^1.5.16",
|
||||
"core-js": "^2.5.4",
|
||||
"express": "^4.15.2",
|
||||
"flag-icons": "^7.2.1",
|
||||
"jquery": "^3.4.1",
|
||||
"ng-recaptcha": "^12.0.2",
|
||||
"prom-client": "^11.3.0",
|
||||
|
|
|
@ -21,7 +21,6 @@ import {AlertModal} from './openaireLibrary/utils/modal/alert';
|
|||
import {NotificationHandler} from "./openaireLibrary/utils/notification-handler";
|
||||
import {QuickContactService} from './openaireLibrary/sharedComponents/quick-contact/quick-contact.service';
|
||||
import {LayoutService} from './openaireLibrary/dashboard/sharedComponents/sidebar/layout.service';
|
||||
import {ISVocabulariesService} from "./openaireLibrary/utils/staticAutoComplete/ISVocabularies.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
|
@ -39,12 +38,6 @@ import {ISVocabulariesService} from "./openaireLibrary/utils/staticAutoComplete/
|
|||
description="OpenAIRE Explore: Over 100M of research deduplicated, 170K research software, 11M research data. One of the largest open scholarly records collection worldwide."></schema2jsonld>
|
||||
<div [class.uk-hidden]="loading" [ngClass]="rootClass">
|
||||
<div id="modal-container"></div>
|
||||
<!-- <span class="js-upload" uk-form-custom>-->
|
||||
<!-- <input id="exampleInputFile" class="uk-width-medium" type="file" (change)="fileChangeEvent($event)"/>-->
|
||||
<!-- <span class="uk-link " style="text-decoration: underline;">Parse NEW FOS</span>-->
|
||||
<!-- </span>-->
|
||||
|
||||
<!-- <a (click)="checkDifferences()" class="uk-margin-left uk-link ">Check if different FOS codes/labels</a>-->
|
||||
<main>
|
||||
<router-outlet></router-outlet>
|
||||
</main>
|
||||
|
@ -91,224 +84,9 @@ export class AppComponent implements AfterViewInit {
|
|||
private router: Router, private userManagementService: UserManagementService, private smoothScroll: SmoothScroll,
|
||||
private configurationService: ConfigurationService, private _meta: Meta, private seoService: SEOService,
|
||||
private emailService: EmailService, private fb: FormBuilder, private quickContactService: QuickContactService,
|
||||
private layoutService: LayoutService, private cdr: ChangeDetectorRef,
|
||||
private ISVocabulariesService: ISVocabulariesService) {
|
||||
private layoutService: LayoutService, private cdr: ChangeDetectorRef) {
|
||||
}
|
||||
|
||||
// fileChangeEvent(fileInput: any) {
|
||||
// let file = <Array<File>>fileInput.target.files;
|
||||
// this.parseNewFos(file);
|
||||
// }
|
||||
//
|
||||
// makeFileRequest(url: string, params: Array<string>, files: Array<File>) {
|
||||
// return new Promise<void>((resolve, reject) => {
|
||||
// const formData: any = new FormData();
|
||||
// const xhr = new XMLHttpRequest();
|
||||
// for (let i = 0; i < files.length; i++) {
|
||||
// formData.append("uploads[]", files[i], files[i].name);
|
||||
// }
|
||||
// xhr.onreadystatechange = function () {
|
||||
// if (xhr.readyState == 4) {
|
||||
// if (xhr.status == 200) {
|
||||
// resolve(xhr.response);
|
||||
// } else {
|
||||
// reject(xhr.response);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// xhr.open("POST", url, true);
|
||||
// xhr.send(formData);
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// parseNewFos(file: Array<File>) {
|
||||
// let fos = null;
|
||||
// this.makeFileRequest(this.properties.utilsService + '/upload', [], file).then((result) => {
|
||||
// this.ISVocabulariesService.getFos(properties).subscribe(fosRes => {
|
||||
// fos = fosRes['fos'];
|
||||
// for(let fieldL1 of fos) {
|
||||
// if(fieldL1.children != null) {
|
||||
// for (let fieldL2 of fieldL1.children) {
|
||||
// if(fieldL2.children != null) {
|
||||
// for (let fieldL3 of fieldL2.children) {
|
||||
// if(fieldL3.children != null)
|
||||
// fieldL3.children = [];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // console.log(fos);
|
||||
// let setOfCodes: Set<string> = new Set<string>();
|
||||
// let duplicates = new Map<string, string[]>;
|
||||
// const rows = (result as any).split('\n'); // I have used space, you can use any thing.
|
||||
// let added = false;
|
||||
// for (let i = 0; i < (rows.length); i++) {
|
||||
// if (rows[i] && rows[i] != null && rows[i] != "") {
|
||||
// added = false;
|
||||
// let code = rows[i].split(' ')[0];
|
||||
// if(setOfCodes.has(code)) {
|
||||
// console.log("SAME CODE!!!!!!!!");
|
||||
// } else {
|
||||
// setOfCodes.add(code);
|
||||
// }
|
||||
// let label = rows[i].substring(code.length+1, rows[i].length);
|
||||
// // console.log(rows[i]);
|
||||
// let firstLevel = rows[i].substring(0, 2);
|
||||
// let secondLevel = rows[i].substring(0, 4);
|
||||
// let thirdLevel = rows[i].substring(0, 6);
|
||||
// for(let fieldL1 of fos) {
|
||||
// if(fieldL1.code == firstLevel) {
|
||||
// for(let fieldL2 of fieldL1.children) {
|
||||
// if(fieldL2.code == secondLevel) {
|
||||
// for(let fieldL3 of fieldL2.children) {
|
||||
// if(fieldL3.code == thirdLevel) {
|
||||
// if(fieldL3.children == null) {
|
||||
// fieldL3.children = [];
|
||||
// }
|
||||
// fieldL3.children.push({
|
||||
// "code": code,
|
||||
// "id": rows[i],
|
||||
// "label": label,
|
||||
// "level": 4
|
||||
// })
|
||||
// added = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if(!added && (!fieldL2.children || fieldL2.children.filter(field => field.code == thirdLevel).length == 0)) {
|
||||
// console.log("Level 3 not found for "+rows[i]);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if(!added && (!fieldL1.children || fieldL1.children.filter(field => field.code == secondLevel).length == 0)) {
|
||||
// console.log("Level 2 not found for "+rows[i]);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if(!added && fos.filter(field => field.code == firstLevel).length == 0) {
|
||||
// console.log("Level 1 not found for |"+rows[i]+"|");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for(let l1 of fos) {
|
||||
// if(duplicates.has(l1.label)) {
|
||||
// duplicates.get(l1.label).push(l1.id);
|
||||
// } else {
|
||||
// duplicates.set(l1.label, [l1.id]);
|
||||
// }
|
||||
// if(l1.children) {
|
||||
// for (let l2 of l1.children) {
|
||||
// if(duplicates.has(l2.label)) {
|
||||
// duplicates.get(l2.label).push(l2.id);
|
||||
// } else {
|
||||
// duplicates.set(l2.label, [l2.id]);
|
||||
// }
|
||||
//
|
||||
// if(l2.children) {
|
||||
// for(let l3 of l2.children) {
|
||||
// if(duplicates.has(l3.label)) {
|
||||
// duplicates.get(l3.label).push(l3.id);
|
||||
// } else {
|
||||
// duplicates.set(l3.label, [l3.id]);
|
||||
// }
|
||||
//
|
||||
// if(l3.children) {
|
||||
// for(let l4 of l3.children) {
|
||||
// if(duplicates.has(l4.label)) {
|
||||
// duplicates.get(l4.label).push(l4.id);
|
||||
// } else {
|
||||
// duplicates.set(l4.label, [l4.id]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for(let label of duplicates.keys()) {
|
||||
// if(duplicates.get(label).length > 1) {
|
||||
// console.log(label, duplicates.get(label));
|
||||
// }
|
||||
// }
|
||||
// var url = window.URL.createObjectURL(new Blob([JSON.stringify(fos)]));
|
||||
// var a = window.document.createElement('a');
|
||||
// window.document.body.appendChild(a);
|
||||
// a.setAttribute('style', 'display: none');
|
||||
// a.href = url;
|
||||
// a.download = "fosNewL4.json";
|
||||
// a.click();
|
||||
// window.URL.revokeObjectURL(url);
|
||||
// a.remove(); // remove the element
|
||||
//
|
||||
// // var theJSON = JSON.stringify(fos);
|
||||
// // var uri = this.sanitizer.bypassSecurityTrustUrl("data:text/json;charset=UTF-8," + encodeURIComponent(theJSON));
|
||||
// // this.downloadJsonHref = uri;
|
||||
// // console.log(fos);
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// checkDifferences() {
|
||||
// this.ISVocabulariesService.getIndexedFosL4(properties).subscribe(fosRes => {
|
||||
// console.log(fosRes);
|
||||
// this.ISVocabulariesService.getFos(properties).subscribe(currentFos => {
|
||||
// console.log(currentFos);
|
||||
// let currentSet: Map<string, string> = new Map<string, string>();
|
||||
// for(let currentL1 of currentFos['fos']) {
|
||||
// if(currentL1.children?.length > 0) {
|
||||
// for(let currentL2 of currentL1.children) {
|
||||
// if(currentL2.children?.length > 0) {
|
||||
// for(let currentL3 of currentL2.children) {
|
||||
// if(currentL3.children?.length > 0) {
|
||||
// for(let currentL4 of currentL3.children) {
|
||||
// if(currentSet.has(currentL4.code)) {
|
||||
// console.log("ALREADY HERE ",currentL4.code);
|
||||
// }
|
||||
// currentSet.set(currentL4.code, currentL4.label);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// console.log(currentSet);
|
||||
// for (let fos of fosRes) {
|
||||
// if(!currentSet.has(fos.l4code)) {
|
||||
// console.log(fos.l4code + " does not exist in current voc");
|
||||
// } else {
|
||||
// if(currentSet.get(fos.l4code) != fos.l4label) {
|
||||
// console.log(fos.l4code + " different label");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for(let code of currentSet.keys()) {
|
||||
// let found = false;
|
||||
// for(let fos of fosRes) {
|
||||
// if(fos.l4code == code) {
|
||||
// found = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if(!found) {
|
||||
// console.log("current code "+code+" not indexed");
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
if (typeof document !== 'undefined') {
|
||||
this.isClient = true;
|
||||
|
|
|
@ -58,6 +58,7 @@ export class ContactComponent implements OnInit {
|
|||
ngOnInit() {
|
||||
this._title.setTitle('OpenAIRE - Explore | Contact Us');
|
||||
|
||||
this.properties = properties;
|
||||
this.email = {body: '', subject: '', recipients: []};
|
||||
this.subscriptions.push( this._piwikService.trackView(this.properties, this.pageTitle).subscribe());
|
||||
this.url = this.properties.domain + this._router.url;
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="uk-width-1-2@m uk-width-1-1 uk-text-center" uk-scrollspy-class>
|
||||
<img src="assets/explore-assets/funders/funders.png" alt="Funders advertisement image">
|
||||
<img src="assets/explore-assets/funders/funders.png" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -75,7 +75,7 @@
|
|||
</ng-container>
|
||||
<ng-container *ngIf="!showLoading && funders?.length">
|
||||
<div class="uk-container uk-container-large">
|
||||
<div id="target" class="uk-section uk-padding-remove-top uk-margin-top" uk-height-match="target: .shortName;">
|
||||
<div id="target" class="uk-section uk-padding-remove-top uk-margin-top" uk-height-match="target: .alias;">
|
||||
<div>
|
||||
<div *ngIf="funders" class="uk-padding-small uk-padding-remove-vertical uk-margin-medium-bottom uk-flex uk-flex-wrap uk-flex-middle uk-flex-between">
|
||||
<div class="uk-flex uk-flex-wrap uk-flex-middle uk-flex-between uk-width-auto@m uk-width-1-1 uk-margin-top">
|
||||
|
@ -121,123 +121,88 @@
|
|||
No funders available
|
||||
</div>
|
||||
<div class="uk-grid uk-grid-match uk-padding-small" [ngClass]="gridView ? 'uk-child-width-1-2@m uk-child-width-1-3@l' : 'uk-child-width-1-1'"
|
||||
uk-grid uk-height-match="target: .data;">
|
||||
uk-grid uk-height-match="target: .info;">
|
||||
<div *ngFor="let funder of displayedFunders.slice((currentPage-1)*pageSize, currentPage*pageSize)">
|
||||
<!-- funder's card for GRID view -->
|
||||
<ng-container *ngIf="gridView || isMobile; else elseBlock">
|
||||
<div class="uk-card uk-card-default uk-card-hover funder-grid">
|
||||
<div class="uk-position-top-left uk-padding-small">
|
||||
<!-- <span class="uk-text-xsmall">flag</span>-->
|
||||
<span class="fi" [ngClass]="'fi-'+funder.country | lowercase"></span>
|
||||
</div>
|
||||
<div *ngIf="funder.registered" class="uk-position-top-right uk-padding-small">
|
||||
<div class="uk-flex uk-flex-middle uk-text-xsmall uk-text-meta">
|
||||
<div class="uk-icon-bg uk-icon-bg-small">
|
||||
<icon name="done" [flex]="true"></icon>
|
||||
<!-- OA % -->
|
||||
<!-- <div class="percentage uk-flex uk-flex-right uk-margin-bottom">-->
|
||||
<div class="uk-position-top-right uk-padding-small">
|
||||
<div *ngIf="funder.openAccessResearchProducts && funder.researchProducts" class="uk-text-center">
|
||||
<div class="uk-flex uk-flex-middle uk-flex-center">
|
||||
<span class="uk-margin-xsmall-right open-access">
|
||||
<icon name="open_access" [flex]="true" [ratio]="1"></icon>
|
||||
</span>
|
||||
<h6 class="uk-margin-remove">{{funder.openAccessPercentage}}%</h6>
|
||||
</div>
|
||||
<span class="uk-margin-xsmall-left">Registered</span>
|
||||
<span class="uk-h6 uk-text-small">Open Access</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-card-media-top uk-margin-medium-top uk-padding-large uk-padding-remove-vertical uk-flex uk-flex-center uk-flex-middle uk-height-xsmall">
|
||||
<img *ngIf="funder.logoUrl; else elseBlock" [src]="funder | logoUrl" [alt]="funder.name + ' logo'" class="uk-height-max-xsmall uk-blend-multiply" loading="lazy">
|
||||
<ng-template #elseBlock>
|
||||
<img src="assets/common-assets/placeholder.png" alt="OpenAIRE placeholder logo" class="uk-height-max-xsmall uk-blend-multiply" loading="lazy">
|
||||
</ng-template>
|
||||
</div>
|
||||
<div class="uk-padding-small uk-padding-remove-vertical uk-padding-remove-left uk-margin-medium-left">
|
||||
<!-- shortName -->
|
||||
<div class="shortName uk-text-uppercase uk-text-small uk-margin-top type">
|
||||
<ng-container *ngIf="funder.shortName">
|
||||
{{funder.shortName}}
|
||||
<div class="uk-card-body">
|
||||
<!-- funder logo -->
|
||||
<div class="uk-card-media-top uk-margin-medium-top uk-padding-large uk-padding-remove-vertical uk-flex uk-flex-center uk-flex-middle uk-height-xsmall">
|
||||
<img *ngIf="funder.logoUrl; else elseBlock" [src]="funder | logoUrl" [alt]="funder.name + ' logo'" class="uk-height-max-xsmall uk-blend-multiply" loading="lazy">
|
||||
<ng-template #elseBlock>
|
||||
<img src="assets/common-assets/placeholder.png" alt="OpenAIRE placeholder logo" class="uk-height-max-xsmall uk-blend-multiply" loading="lazy">
|
||||
</ng-template>
|
||||
</div>
|
||||
<!-- funder alias -->
|
||||
<div class="alias uk-text-uppercase uk-text-small uk-margin-top type">
|
||||
<ng-container *ngIf="funder.alias">
|
||||
{{funder.alias}}
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="uk-flex">
|
||||
<div class="uk-width-expand name uk-h6 uk-margin-remove multi-line-ellipsis lines-2">
|
||||
<ng-container *ngIf="funder.name" >
|
||||
<span>{{funder.name}}</span>
|
||||
</ng-container>
|
||||
<!-- funder name -->
|
||||
<div class="name uk-h6 uk-margin-remove multi-line-ellipsis lines-2">
|
||||
<ng-container *ngIf="funder.name" >
|
||||
{{funder.name}}
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="info uk-margin-medium-top">
|
||||
<!-- Monitor dashboard -->
|
||||
<div class="monitor-dashboard">
|
||||
<!-- PUBLIC status -->
|
||||
<a *ngIf="funder.monitorDashboard && funder.monitorDashboardStatus != 'PRIVATE' && funder.monitorDashboardStatus != 'RESTRICTED'"
|
||||
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text"
|
||||
target="_blank" [href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'monitor.openaire.eu/dashboard/'+funder.alias">
|
||||
<span class="uk-flex uk-flex-middle">
|
||||
<img src="assets/common-assets/common/Symbol.png" alt="OpenAIRE logo"
|
||||
class="uk-margin-xsmall-right" style="width: 17px; height: 17px;" loading="lazy">
|
||||
<span class="monitor-dashboard-link uk-text-uppercase">Monitor Dashboard</span>
|
||||
</span>
|
||||
</a>
|
||||
<!-- RESTRICTED status -->
|
||||
<span *ngIf="funder.monitorDashboard && funder.monitorDashboardStatus == 'RESTRICTED'"
|
||||
class="uk-flex uk-flex-middle">
|
||||
<img src="assets/common-assets/common/Symbol.png" alt="OpenAIRE logo"
|
||||
class="uk-margin-xsmall-right" style="width: 17px; height: 17px;" loading="lazy">
|
||||
<span class="monitor-dashboard-link uk-text-uppercase uk-text-bold uk-text-small">Monitor Dashboard</span>
|
||||
<icon class="uk-margin-xsmall-left" name="closed_access" [flex]="true" [ratio]="1"></icon>
|
||||
</span>
|
||||
</div>
|
||||
<div *ngIf="funder.websiteUrl" class="uk-width-auto uk-margin-left">
|
||||
<a [href]="funder.websiteUrl" target="_blank" class="uk-flex-inline uk-flex-middle uk-text-uppercase uk-button uk-button-text custom-external">
|
||||
<icon name="payment" [flex]="true"></icon>
|
||||
<!-- Projects -->
|
||||
<div>
|
||||
<a *ngIf="funder.projects"
|
||||
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text"
|
||||
[routerLink]="properties.searchLinkToProjects" [queryParams]="{'funder': urlEncodeAndQuote(funder.id)}">
|
||||
<span class="uk-flex uk-flex-middle">
|
||||
<span>Projects ({{funder.projects | number}})</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- Research products -->
|
||||
<div>
|
||||
<a *ngIf="funder.researchProducts"
|
||||
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text"
|
||||
[routerLink]="properties.searchLinkToResults" [queryParams]="{'relfunder': urlEncodeAndQuote(funder.id)}">
|
||||
<span class="uk-flex uk-flex-middle">
|
||||
<span>Research Products ({{funder.researchProducts | number}})</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="data uk-background-muted uk-flex uk-flex-middle uk-padding-small uk-padding-remove-left uk-margin-top">
|
||||
<div class="uk-flex uk-flex-middle uk-width-1-1 uk-child-width-1-2 uk-margin-medium-left">
|
||||
<div>
|
||||
<!-- Projects -->
|
||||
<div *ngIf="funder.projects" class="uk-flex uk-flex-column" [class.uk-margin-small-bottom]="funder.researchProducts">
|
||||
<span class="uk-text-meta uk-text-xsmall">
|
||||
Projects
|
||||
</span>
|
||||
<a
|
||||
class="uk-link-text uk-text-large uk-text-bold"
|
||||
[routerLink]="properties.searchLinkToProjects" [queryParams]="{'funder': urlEncodeAndQuote(funder.id)}">
|
||||
<span>
|
||||
{{funder.projects | number}}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- Research products -->
|
||||
<div *ngIf="funder.researchProducts" class="uk-flex uk-flex-column">
|
||||
<span class="uk-text-meta uk-text-xsmall">
|
||||
Research Products
|
||||
</span>
|
||||
<a
|
||||
class="uk-link-text uk-text-large uk-text-bold"
|
||||
[routerLink]="properties.searchLinkToResults" [queryParams]="{'relfunder': urlEncodeAndQuote(funder.id)}">
|
||||
<span>
|
||||
{{funder.researchProducts | number}}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-flex uk-flex-column uk-flex-middle uk-flex-center">
|
||||
<div class="uk-progress-semicircle uk-progress-semicircle-small" [attr.percentage]="funder.openAccessPercentage" [style]="'--percentage:' + funder.openAccessPercentage"></div>
|
||||
<div class="uk-flex uk-flex-middle uk-margin-top">
|
||||
<icon class="open-access" [name]="'open_access'" [flex]="true" [ratio]="0.8"></icon>
|
||||
<span class="uk-text-xsmall uk-margin-xsmall-left">Open Access</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="monitor-dashboard uk-padding-small uk-padding-remove-left uk-margin-medium-left">
|
||||
<a *ngIf="funder.monitorDashboard && funder.monitorDashboardStatus && funder.monitorDashboardStatus != 'PRIVATE' && funder.monitorDashboardStatus != 'RESTRICTED'"
|
||||
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text"
|
||||
target="_blank" [href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'monitor.openaire.eu/dashboard/'+funder.monitorDashboard">
|
||||
<span class="uk-flex uk-flex-middle">
|
||||
<img src="assets/common-assets/common/Symbol.png" alt="OpenAIRE logo"
|
||||
class="uk-margin-xsmall-right" style="width: 17px; height: 17px;" loading="lazy">
|
||||
<span class="monitor-dashboard-link uk-text-uppercase">Monitor Dashboard</span>
|
||||
</span>
|
||||
</a>
|
||||
<span *ngIf="funder.monitorDashboard && funder.monitorDashboardStatus == 'RESTRICTED'"
|
||||
class="uk-flex uk-flex-middle">
|
||||
<img src="assets/common-assets/common/Symbol.png" alt="OpenAIRE logo"
|
||||
class="uk-margin-xsmall-right" style="width: 17px; height: 17px;" loading="lazy">
|
||||
<span class="monitor-dashboard-link uk-text-uppercase uk-text-bold uk-text-small">Monitor Dashboard</span>
|
||||
<icon class="uk-margin-xsmall-left" name="closed_access" [flex]="true" [ratio]="1"></icon>
|
||||
</span>
|
||||
|
||||
<a *ngIf="funder.irishDashboard && funder.irishDashboardStatus && funder.irishDashboardStatus != 'PRIVATE' && funder.irishDashboardStatus != 'RESTRICTED' && properties.environment != 'beta'"
|
||||
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text"
|
||||
target="_blank" [href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'oamonitor.ireland.openaire.eu/rfo/'+funder.irishDashboard">
|
||||
<span class="uk-flex uk-flex-middle">
|
||||
<img src="assets/common-assets/common/small_irish.svg" alt="Irish logo"
|
||||
class="uk-margin-xsmall-right" style="width: 17px; height: 17px;" loading="lazy">
|
||||
<span class="irish-dashboard-link uk-text-uppercase">RFO Dashboard</span>
|
||||
</span>
|
||||
</a>
|
||||
<span *ngIf="funder.irishDashboard && funder.irishDashboardStatus && (funder.irishDashboardStatus == 'RESTRICTED' || properties.environment =='beta')"
|
||||
class="uk-flex uk-flex-middle">
|
||||
<img src="assets/common-assets/common/small_irish.svg" alt="Irish logo"
|
||||
class="uk-margin-xsmall-right" style="width: 17px; height: 17px;" loading="lazy">
|
||||
<span class="irish-dashboard-link uk-text-uppercase uk-text-bold uk-text-small">RFO Dashboard</span>
|
||||
<icon class="uk-margin-xsmall-left" name="closed_access" [flex]="true" [ratio]="1"></icon>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
<!-- funder's card for LIST view -->
|
||||
|
@ -251,26 +216,22 @@
|
|||
<img src="assets/common-assets/placeholder.png" alt="OpenAIRE placeholder logo" class="uk-height-max-xsmall uk-blend-multiply" loading="lazy">
|
||||
</ng-template>
|
||||
</div>
|
||||
<div class="uk-width-expand uk-grid uk-grid-divider uk-child-width-1-2 uk-margin-left" uk-grid>
|
||||
<div class="uk-flex uk-flex-column uk-flex-center">
|
||||
<div class="uk-flex uk-flex-middle">
|
||||
<!-- <span class="uk-text-xsmall uk-margin-small-right">flag</span> -->
|
||||
<span *ngIf="funder.country" class="fi uk-text-xsmall uk-margin-small-right" [ngClass]="'fi-'+funder.country | lowercase"></span>
|
||||
<div class="uk-h6 uk-margin-remove uk-text-truncate">
|
||||
<ng-container *ngIf="funder.name">
|
||||
<span>{{funder.name}}</span>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="funder.shortName" >
|
||||
<span class="uk-text-uppercase">
|
||||
({{funder.shortName}})
|
||||
</span>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="funder.monitorDashboard || funder.irishDashboard" class="uk-margin-top">
|
||||
<a *ngIf="funder.monitorDashboard && funder.monitorDashboardStatus && funder.monitorDashboardStatus != 'PRIVATE' && funder.monitorDashboardStatus != 'RESTRICTED'"
|
||||
<div class="uk-width-expand uk-margin-medium-left">
|
||||
<div class="name uk-h6 uk-text-truncate">
|
||||
<ng-container *ngIf="funder.name">
|
||||
{{funder.name}}
|
||||
</ng-container>
|
||||
<ng-container *ngIf="funder.alias" >
|
||||
<span class="uk-text-uppercase">
|
||||
({{funder.alias}})
|
||||
</span>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="uk-grid uk-grid-divider uk-flex-nowrap" uk-grid>
|
||||
<div *ngIf="funder.monitorDashboard">
|
||||
<a *ngIf="funder.monitorDashboard && funder.monitorDashboardStatus != 'PRIVATE' && funder.monitorDashboardStatus != 'RESTRICTED'"
|
||||
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text"
|
||||
target="_blank" [href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'monitor.openaire.eu/dashboard/'+funder.monitorDashboard">
|
||||
target="_blank" [href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'monitor.openaire.eu/dashboard/'+funder.alias">
|
||||
<span class="uk-flex uk-flex-middle">
|
||||
<img src="assets/common-assets/common/Symbol.png" alt="OpenAIRE logo"
|
||||
class="uk-margin-xsmall-right" style="width: 17px; height: 17px;" loading="lazy">
|
||||
|
@ -284,79 +245,37 @@
|
|||
<span class="monitor-dashboard-link uk-text-uppercase uk-text-bold uk-text-small">Monitor Dashboard</span>
|
||||
<icon class="uk-margin-xsmall-left" name="closed_access" [flex]="true" [ratio]="1"></icon>
|
||||
</span>
|
||||
|
||||
<a *ngIf="funder.irishDashboard && funder.irishDashboardStatus && funder.irishDashboardStatus != 'PRIVATE' && funder.irishDashboardStatus != 'RESTRICTED' && properties.environment != 'beta'"
|
||||
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text"
|
||||
target="_blank" [href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'monitor.openaire.eu/dashboard/'+funder.irishDashboard">
|
||||
</div>
|
||||
<div>
|
||||
<a *ngIf="funder.projects"
|
||||
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text"
|
||||
[routerLink]="properties.searchLinkToProjects" [queryParams]="{'funder': urlEncodeAndQuote(funder.id)}">
|
||||
<span class="uk-flex uk-flex-middle">
|
||||
<img src="assets/common-assets/common/small_irish.svg" alt="Irish logo"
|
||||
class="uk-margin-xsmall-right" style="width: 17px; height: 17px;" loading="lazy">
|
||||
<span class="irish-dashboard-link uk-text-uppercase">RFO Dashboard</span>
|
||||
<span>Projects ({{funder.projects | number}})</span>
|
||||
</span>
|
||||
</a>
|
||||
<span *ngIf="funder.irishDashboard && funder.irishDashboardStatus && (funder.irishDashboardStatus == 'RESTRICTED' || properties.environment == 'beta')"
|
||||
class="uk-flex uk-flex-middle">
|
||||
<img src="assets/common-assets/common/small_irish.svg" alt="Irish logo"
|
||||
class="uk-margin-xsmall-right" style="width: 17px; height: 17px;" loading="lazy">
|
||||
<span class="irish-dashboard-link uk-text-uppercase uk-text-bold uk-text-small">RFO Dashboard</span>
|
||||
<icon class="uk-margin-xsmall-left" name="closed_access" [flex]="true" [ratio]="1"></icon>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-flex uk-flex-middle uk-child-width-1-3">
|
||||
<div>
|
||||
<div *ngIf="funder.projects" class="uk-flex uk-flex-column">
|
||||
<span class="uk-text-meta uk-text-xsmall">
|
||||
Projects
|
||||
<a *ngIf="funder.researchProducts"
|
||||
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text"
|
||||
[routerLink]="properties.searchLinkToResults" [queryParams]="{'relfunder': urlEncodeAndQuote(funder.id)}">
|
||||
<span class="uk-flex uk-flex-middle">
|
||||
<span>Research Products ({{funder.researchProducts | number}})</span>
|
||||
</span>
|
||||
<a
|
||||
class="uk-link-text uk-text-large uk-text-bold"
|
||||
[routerLink]="properties.searchLinkToProjects" [queryParams]="{'funder': urlEncodeAndQuote(funder.id)}">
|
||||
<span>
|
||||
{{funder.projects | number}}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div *ngIf="funder.researchProducts" class="uk-flex uk-flex-column">
|
||||
<span class="uk-text-meta uk-text-xsmall">
|
||||
Research Products
|
||||
</span>
|
||||
<a
|
||||
class="uk-link-text uk-text-large uk-text-bold"
|
||||
[routerLink]="properties.searchLinkToResults" [queryParams]="{'relfunder': urlEncodeAndQuote(funder.id)}">
|
||||
<span>
|
||||
{{funder.researchProducts | number}}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div *ngIf="funder.openAccessResearchProducts && funder.researchProducts" class="uk-flex uk-flex-column">
|
||||
<span class="uk-text-meta uk-text-xsmall">Open Access</span>
|
||||
<div class="uk-flex uk-flex-middle">
|
||||
<span class="uk-margin-xsmall-right open-access">
|
||||
<icon name="open_access" [flex]="true" [ratio]="0.8"></icon>
|
||||
</span>
|
||||
<span class="uk-text-large uk-text-bold">{{funder.openAccessPercentage}}%</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="funder.registered || funder.websiteUrl" class="uk-width-auto uk-flex uk-flex-column uk-flex-center uk-margin-right">
|
||||
<div *ngIf="funder.registered" class="uk-flex uk-flex-middle uk-text-xsmall uk-text-meta uk-margin-bottom">
|
||||
<div class="uk-icon-bg uk-icon-bg-small">
|
||||
<icon name="done" [flex]="true"></icon>
|
||||
<div class="uk-width-auto uk-flex uk-flex-middle uk-flex-center">
|
||||
<div *ngIf="funder.openAccessResearchProducts && funder.researchProducts" class="uk-text-center">
|
||||
<div class="uk-flex uk-flex-middle uk-flex-center">
|
||||
<span class="uk-margin-xsmall-right open-access">
|
||||
<icon name="open_access" [flex]="true" [ratio]="1"></icon>
|
||||
</span>
|
||||
<h6 class="uk-margin-remove">{{funder.openAccessPercentage}}%</h6>
|
||||
</div>
|
||||
<span class="uk-margin-xsmall-left">Registered</span>
|
||||
</div>
|
||||
<div *ngIf="funder.websiteUrl">
|
||||
<a [href]="funder.websiteUrl" target="_blank" class="uk-flex-inline uk-flex-middle uk-text-uppercase uk-button uk-button-text custom-external">
|
||||
<icon name="payment" [flex]="true"></icon>
|
||||
</a>
|
||||
<span class="uk-h6 uk-text-small">Open Access</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -365,7 +284,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<paging-no-load *ngIf="displayedFunders.length > pageSize"
|
||||
(pageChange)="updateCurrentPage($event)"
|
||||
[currentPage]="currentPage" [size]="pageSize"
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
@import (reference) "~src/assets/openaire-theme/less/color.less";
|
||||
@import "flag-icons/css/flag-icons.min.css";
|
||||
|
||||
@irish-color: #FF7901;
|
||||
|
||||
.irish-dashboard-link {
|
||||
color: @irish-color;
|
||||
}
|
||||
|
||||
.custom-coins-dot:after {
|
||||
content: "";
|
||||
|
@ -27,28 +21,28 @@
|
|||
margin-left: 10px;
|
||||
}
|
||||
|
||||
//.custom-view-button {
|
||||
// padding: 4px;
|
||||
// background: @light-color;
|
||||
// border: 1px solid @disable-color;
|
||||
// border-radius: 4px;
|
||||
// icon {
|
||||
// color: @disable-color;
|
||||
// }
|
||||
//
|
||||
// &.active {
|
||||
// background: transparent linear-gradient(315deg, @primary-light-color 0%, @primary-dark-color 100%) 0% 0% no-repeat padding-box;
|
||||
// icon {
|
||||
// color: @light-color;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
.custom-view-button {
|
||||
padding: 4px;
|
||||
background: @light-color;
|
||||
border: 1px solid @disable-color;
|
||||
border-radius: 4px;
|
||||
icon {
|
||||
color: @disable-color;
|
||||
}
|
||||
|
||||
// .uk-card {
|
||||
// &.funder-grid {
|
||||
// border-bottom: 4px solid fade(@funder-color, 30%);
|
||||
// }
|
||||
// &.funder-list {
|
||||
// border-left: 4px solid fade(@funder-color, 30%);
|
||||
// }
|
||||
// }
|
||||
&.active {
|
||||
background: transparent linear-gradient(315deg, @primary-light-color 0%, @primary-dark-color 100%) 0% 0% no-repeat padding-box;
|
||||
icon {
|
||||
color: @light-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.uk-card {
|
||||
&.funder-grid {
|
||||
border-bottom: 4px solid fade(@funder-color, 30%);
|
||||
}
|
||||
&.funder-list {
|
||||
border-left: 4px solid fade(@funder-color, 30%);
|
||||
}
|
||||
}
|
|
@ -18,7 +18,6 @@ import {LayoutService} from '../openaireLibrary/dashboard/sharedComponents/sideb
|
|||
import {FormBuilder, FormControl} from '@angular/forms';
|
||||
import {debounceTime, distinctUntilChanged} from 'rxjs/operators';
|
||||
import {GroupedRequestsService} from "../openaireLibrary/services/groupedRequests.service";
|
||||
import {OpenaireEntities} from "../openaireLibrary/utils/properties/searchFields";
|
||||
|
||||
@Component({
|
||||
selector: 'funders',
|
||||
|
@ -32,7 +31,6 @@ export class FundersComponent implements OnInit {
|
|||
pageTitle: string = "OpenAIRE - Explore | Funders";
|
||||
pageDescription: string = "Funders | Be an integral part of the open R&I ecosystem";
|
||||
properties: EnvProperties = properties;
|
||||
public openaireEntities = OpenaireEntities;
|
||||
breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'funders'}];
|
||||
showLoading: boolean = true;
|
||||
isMobile: boolean = false;
|
||||
|
@ -54,36 +52,29 @@ export class FundersComponent implements OnInit {
|
|||
fundersMap = new Map<string, {
|
||||
"id": string,
|
||||
"name": string,
|
||||
"shortName": string,
|
||||
// "alias": string,
|
||||
// "irishAlias": string,
|
||||
"researchProducts": number,
|
||||
"alias": string,
|
||||
"researchProducts": number,
|
||||
"openAccessResearchProducts": number,
|
||||
"openAccessPercentage": number,
|
||||
"projects": number,
|
||||
"monitorDashboard": string,
|
||||
"monitorDashboardStatus": string,
|
||||
"irishDashboard": string,
|
||||
"irishDashboardStatus": string,
|
||||
"logoUrl": string,
|
||||
"websiteUrl": string,
|
||||
"country": string,
|
||||
"registered": boolean
|
||||
"monitorDashboardStatus": string,
|
||||
"logoUrl": string
|
||||
}>();
|
||||
staticLogos: Map<string, string> = new Map<string, string>([
|
||||
["arc_________::ARC||Australian Research Council (ARC)||ARC", "ARC"],
|
||||
["asap________::ASAP||Aligning Science Across Parkinson's||ASAP", "ASAP"],
|
||||
["cihr________::CIHR||Canadian Institutes of Health Research||CIHR", "CIHR"],
|
||||
["euenvagency_::EEA||European Environment Agency||EEA", "EEA"],
|
||||
["inca________::INCA||Institut National du Cancer||INCa", "INCa"],
|
||||
["nhmrc_______::NHMRC||National Health and Medical Research Council (NHMRC)||NHMRC", "NHMRC"],
|
||||
["nih_________::NIH||National Institutes of Health||NIH", "NIH"],
|
||||
["nserc_______::NSERC||Natural Sciences and Engineering Research Council of Canada||NSERC", "NSERC"],
|
||||
["nsf_________::NSF||National Science Foundation||NSF", "NSF"],
|
||||
["sshrc_______::SSHRC||Social Sciences and Humanities Research Council||SSHRC", "SSHRC"],
|
||||
["taraexp_____::tara||Tara Expeditions Foundation||TARA", "TARA"],
|
||||
["ukri________::UKRI||UK Research and Innovation||UKRI", "UKRI"],
|
||||
["wt__________::WT||Wellcome Trust||WT", "WT"]
|
||||
staticLogos: Set<string> = new Set<string>([
|
||||
"arc_________::ARC||Australian Research Council (ARC)||ARC",
|
||||
"asap________::ASAP||Aligning Science Across Parkinson's||ASAP",
|
||||
"cihr________::CIHR||Canadian Institutes of Health Research||CIHR",
|
||||
"euenvagency_::EEA||European Environment Agency||EEA",
|
||||
"inca________::INCA||Institut National du Cancer||INCa",
|
||||
"nhmrc_______::NHMRC||National Health and Medical Research Council (NHMRC)||NHMRC",
|
||||
"nih_________::NIH||National Institutes of Health||NIH",
|
||||
"nserc_______::NSERC||Natural Sciences and Engineering Research Council of Canada||NSERC",
|
||||
"nsf_________::NSF||National Science Foundation||NSF",
|
||||
"sshrc_______::SSHRC||Social Sciences and Humanities Research Council||SSHRC",
|
||||
"taraexp_____::tara||Tara Expeditions Foundation||TARA",
|
||||
"ukri________::UKRI||UK Research and Innovation||UKRI",
|
||||
"wt__________::WT||Wellcome Trust||WT"
|
||||
]);
|
||||
|
||||
constructor(private router: Router,
|
||||
|
@ -102,6 +93,7 @@ export class FundersComponent implements OnInit {
|
|||
ngOnInit() {
|
||||
this.layoutService.setRootClass('funders');
|
||||
this.title.setTitle('OpenAIRE - Explore | Funders');
|
||||
this.properties = properties;
|
||||
this.subscriptions.push( this.piwikService.trackView(this.properties, this.pageTitle).subscribe());
|
||||
this.url = this.properties.domain + this.router.url;
|
||||
this.seoService.createLinkForCanonicalURL(this.url);
|
||||
|
@ -114,16 +106,12 @@ export class FundersComponent implements OnInit {
|
|||
}));
|
||||
this.showOptions = [
|
||||
{value: 'all', label: 'All funders'},
|
||||
{value: 'monitor', label: 'Funders with Monitor dashboard'},
|
||||
{value: 'rfo', label: 'Funders with RFO dashboard'}
|
||||
{value: 'dashboard', label: 'Funders with dashboard'}
|
||||
];
|
||||
this.sortOptions = [
|
||||
{value: 'alphAsc', label: 'Alphabetically asc. (A-Z)'},
|
||||
{value: 'alphDsc', label: 'Alphabetically desc. (Z-A)'},
|
||||
{value: 'oaDsc', label: 'Open Access % desc.'},
|
||||
{value: 'countryAsc', label: 'Country desc. (A-Z)'},
|
||||
{value: 'researcProductsDsc', label: this.openaireEntities.RESULTS+' desc.'},
|
||||
{value: 'projectsDsc', label: this.openaireEntities.PROJECTS+' desc.'}
|
||||
{value: 'alphAsc', label: 'Alphabetically Asc. (A-Z)'},
|
||||
{value: 'alphDsc', label: 'Alphabetically Dsc. (Z-A)'},
|
||||
{value: 'oaDsc', label: '"Open Access %" Dsc.'}
|
||||
];
|
||||
this.getFunders();
|
||||
this.keywordControl = this.fb.control('');
|
||||
|
@ -165,21 +153,14 @@ export class FundersComponent implements OnInit {
|
|||
let funder = {
|
||||
"id": id,
|
||||
"name": this.removePartAfterCharacters(queriedFunder.name, "||"),
|
||||
"shortName": queriedFunder.shortName,
|
||||
// "alias": '',
|
||||
// "irishAlias": '',
|
||||
"alias": '',
|
||||
"researchProducts": +queriedFunder.results,
|
||||
"openAccessResearchProducts": +queriedFunder.openResults,
|
||||
"openAccessPercentage": 0,
|
||||
"projects": +queriedFunder.projects,
|
||||
"monitorDashboard": '',
|
||||
"monitorDashboardStatus": '',
|
||||
"irishDashboard": '',
|
||||
"irishDashboardStatus": '',
|
||||
"logoUrl": '',
|
||||
"websiteUrl": '',
|
||||
"country": queriedFunder.country,
|
||||
"registered": queriedFunder.registered
|
||||
"logoUrl": ''
|
||||
};
|
||||
|
||||
if((!funder.researchProducts || funder.researchProducts == 0) && (!funder.projects || funder.projects == 0)) {
|
||||
|
@ -188,19 +169,10 @@ export class FundersComponent implements OnInit {
|
|||
|
||||
if(queriedFunder.stakeholder) {
|
||||
let stakeholder = queriedFunder.stakeholder;
|
||||
// funder.alias = stakeholder.alias;
|
||||
// funder.irishAlias = stakeholder.irishAlias;
|
||||
// if(!funder.shortName) {
|
||||
// funder.shortName = stakeholder.alias;
|
||||
// }
|
||||
funder.alias = stakeholder.alias;
|
||||
funder.monitorDashboard = stakeholder.alias;
|
||||
funder.monitorDashboardStatus = stakeholder.visibility;
|
||||
funder.irishDashboard = stakeholder.irishAlias;
|
||||
funder.irishDashboardStatus = stakeholder.irishVisibility;
|
||||
if(stakeholder.logoUrl) {
|
||||
funder.logoUrl = (stakeholder.isUpload ? properties.utilsService + "/download/" : "") + (stakeholder.logoUrl);
|
||||
}
|
||||
funder.websiteUrl = stakeholder.websiteUrl;
|
||||
funder.logoUrl = (stakeholder.isUpload ? properties.utilsService + "/download/" : "")+ (stakeholder.logoUrl);
|
||||
}
|
||||
|
||||
if(funder.openAccessResearchProducts && funder.researchProducts) {
|
||||
|
@ -208,7 +180,9 @@ export class FundersComponent implements OnInit {
|
|||
}
|
||||
|
||||
if(!funder.logoUrl && this.staticLogos.has(funder.id)) {
|
||||
funder.logoUrl = "assets/explore-assets/funders/logos/"+this.staticLogos.get(funder.id)+".png";
|
||||
let split = funder.id.split("||");
|
||||
let shortname = (split && split.length==3) ? funder.id.split("||")[2] : funder.id;
|
||||
funder.logoUrl = "assets/explore-assets/funders/logos/"+shortname+".png";
|
||||
}
|
||||
|
||||
this.fundersMap.set(queriedFunder.id, funder);
|
||||
|
@ -361,25 +335,6 @@ export class FundersComponent implements OnInit {
|
|||
case 'oaDsc':
|
||||
this.funders = this.funders.sort((a, b) => b['openAccessPercentage'] - a['openAccessPercentage']);
|
||||
break;
|
||||
case 'countryAsc':
|
||||
this.funders = this.funders.sort((a, b) => {
|
||||
if(a['country'] && b['country']) {
|
||||
return a['country'].localeCompare(b['country'])
|
||||
} else if(!a['country'] && !b['country']) {
|
||||
return 0;
|
||||
} else if(!a['country']) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "researcProductsDsc":
|
||||
this.funders = this.funders.sort((a, b) => b['researchProducts'] - a['researchProducts']);
|
||||
break;
|
||||
case "projectsDsc":
|
||||
this.funders = this.funders.sort((a, b) => b['projects'] - a['projects']);
|
||||
break;
|
||||
}
|
||||
this.filtering();
|
||||
}
|
||||
|
@ -395,16 +350,10 @@ export class FundersComponent implements OnInit {
|
|||
this.keyword = '';
|
||||
}
|
||||
if(this.funders.length) {
|
||||
displayedFunders = displayedFunders.filter(item => (item['name'] && item['name'].toLowerCase().includes(this.keyword.toLowerCase()))
|
||||
|| (item['monitorDashboard'] && item['monitorDashboard'].toLowerCase().includes(this.keyword.toLowerCase())
|
||||
|| (item['irishDashboard'] && item['irishDashboard'].toLowerCase().includes(this.keyword.toLowerCase()))));
|
||||
displayedFunders = displayedFunders.filter(item => (item['name'] && item['name'].toLowerCase().includes(this.keyword.toLowerCase())) || (item['alias'] && item['alias'].toLowerCase().includes(this.keyword.toLowerCase())));
|
||||
}
|
||||
if(this.show == 'monitor') {
|
||||
displayedFunders = displayedFunders.filter(funder => funder.monitorDashboard && funder.monitorDashboard?.length > 0 && ((funder.monitorDashboardStatus && funder.monitorDashboardStatus != 'PRIVATE')));
|
||||
}
|
||||
|
||||
if(this.show == 'rfo') {
|
||||
displayedFunders = displayedFunders.filter(funder => funder.monitorDashboard && funder.monitorDashboard?.length > 0 && ((funder.irishDashboardStatus && funder.irishDashboardStatus != 'PRIVATE')));
|
||||
if(this.show == 'dashboard') {
|
||||
displayedFunders = displayedFunders.filter(funder => funder.monitorDashboard && funder.monitorDashboard?.length > 0 && funder.monitorDashboardStatus != 'PRIVATE');
|
||||
}
|
||||
|
||||
this.displayedFunders = displayedFunders;
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
<ng-container *ngFor="let type of getKeys(logos)">
|
||||
<li *ngFor="let range of createRange(logos[type].length) let j=index"
|
||||
class="uk-width-1-1 home-logo">
|
||||
<h2 class="uk-text-center uk-margin-bottom uk-text-primary uk-h4">
|
||||
<h1 class="uk-text-center uk-margin-bottom uk-text-primary uk-h4">
|
||||
<span *ngIf="type=='publication' && numbersComponent.showPublications && numbers?.publicationsSize">
|
||||
<span
|
||||
class="uk-text-bold">{{numbers.publicationsSize.number|number}}{{numbers.publicationsSize.size}}
|
||||
|
@ -119,7 +119,7 @@
|
|||
funded grants</span>
|
||||
</span>
|
||||
|
||||
</h2>
|
||||
</h1>
|
||||
<div class="uk-text-center uk-flex uk-flex-center uk-margin-medium-left uk-margin-medium-right">
|
||||
<ng-container *ngTemplateOutlet="_logos; context: { logo: logos[type][j], class: ' '}"></ng-container>
|
||||
<!-- <div-->
|
||||
|
@ -173,9 +173,9 @@
|
|||
</slider-column>
|
||||
<slider-column type="nav" class="slider-nav">
|
||||
<slider-nav-item [start]="0">
|
||||
<h3 class="uk-h6">
|
||||
<h6>
|
||||
<i class="uk-text-primary">Deposit</i> your research<span class="uk-text-primary">.</span>
|
||||
</h3>
|
||||
</h6>
|
||||
<div class="uk-margin-bottom">
|
||||
Whether it’s publications, data or software,
|
||||
select an OpenAIRE compatible repository and
|
||||
|
@ -190,9 +190,9 @@
|
|||
</div>
|
||||
</slider-nav-item>
|
||||
<slider-nav-item [start]="1">
|
||||
<h3 class="uk-h6">
|
||||
<h6>
|
||||
<i class="uk-text-primary">Link</i> your work<span class="uk-text-primary">.</span>
|
||||
</h3>
|
||||
</h6>
|
||||
<div class="uk-margin-bottom">
|
||||
Connect all your research. If you can't find your research
|
||||
results in OpenAIRE, don't worry! Use our Link service,
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit f1fd1ef60c5a964e283ced7840876dc5896af9be
|
||||
Subproject commit 6ab50b04cc8abbd617e6636cc86414241589d444
|
|
@ -1 +1 @@
|
|||
Subproject commit a4d8923b82a59ac1cc41e9c0574f1d64a61c0c1b
|
||||
Subproject commit 3baf82e861ef770e43f86983087141b1988ce7a6
|
|
@ -48,5 +48,3 @@
|
|||
color: @secondary-color;
|
||||
}
|
||||
}
|
||||
|
||||
@uk-label-secondary: @explore-color;
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 55765bf0829910661a55337e0e7ca7b1262b7298
|
||||
Subproject commit e721fef20399f15c9dc9bee28b3d7e9b92db2021
|
|
@ -43,10 +43,6 @@
|
|||
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<title>Search OpenAIRE</title>
|
||||
<!-- <link-->
|
||||
<!-- rel="stylesheet"-->
|
||||
<!-- href="https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.0.0/css/flag-icons.min.css"-->
|
||||
<!-- />-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="uk-offcanvas-content uk-height-viewport">
|
||||
|
|
|
@ -6,17 +6,14 @@ const { LRUCache } = require('lru-cache');
|
|||
const request = require('superagent');
|
||||
const prom = require('prom-client');
|
||||
const URL = require('url');
|
||||
let compression = require("compression");
|
||||
const PropertiesReader = require('properties-reader');
|
||||
const properties = PropertiesReader('./properties.file');
|
||||
const environment = properties.get("environment");
|
||||
const preloadRequests = properties.get("preloadRequests").split(',');;
|
||||
var accesslog = require('access-log');
|
||||
|
||||
const cacheMaxSize = 1000;
|
||||
let cors = require('cors');
|
||||
app.use(cors());
|
||||
app.use(compression());
|
||||
const lruCache = new LRUCache({ max: cacheMaxSize });
|
||||
const register = new prom.Registry();
|
||||
prom.collectDefaultMetrics({register: register});
|
||||
|
@ -45,25 +42,18 @@ const histogram = new prom.Histogram({
|
|||
let cache = () => {
|
||||
return (req, res, next) => {
|
||||
if (req.query.url) {
|
||||
let key = req.query.url;
|
||||
let key = '__express__' + req.query.url;
|
||||
const url = new URL.parse(req.query.url);
|
||||
// console.log(req.headers.origin, req.headers.referrer, req.headers.origin)
|
||||
const cacheControlHeader = req.headers['cache-control'];
|
||||
// Log the Cache-Control header
|
||||
// console.log('Cache-Control header sent by client:', cacheControlHeader);
|
||||
let forceReload = req.query.forceReload && req.query.forceReload == 'true'?true:false;
|
||||
forceReload = forceReload || (cacheControlHeader && (cacheControlHeader.indexOf("no-cache") || cacheControlHeader.indexOf("no-store") || cacheControlHeader.indexOf("must-revalidate")))?true:false;
|
||||
|
||||
const target = url.host + '/' + url.pathname.split('/')[1];
|
||||
const scheme = url.protocol.replace(':', '');
|
||||
if (lruCache.has(key) && !forceReload) {
|
||||
// console.log( key, "hit")
|
||||
if (lruCache.has(key)) {
|
||||
// console.log( key, "hit")
|
||||
const end = histogram.startTimer({scheme: scheme, target: target, cache: 'hit'});
|
||||
res.send(JSON.parse(lruCache.get(key)));
|
||||
responses.inc({scheme: scheme, target: target, code: res.statusCode});
|
||||
end();
|
||||
} else {
|
||||
// console.log( key, "miss", forceReload)
|
||||
// console.log( key, "miss")
|
||||
const end = histogram.startTimer({scheme: scheme, target: target, cache: 'miss'});
|
||||
res.sendResponse = res.send;
|
||||
res.send = (body) => {
|
||||
|
@ -85,20 +75,19 @@ let cache = () => {
|
|||
}
|
||||
|
||||
};
|
||||
accesslogCustomFormat(req, res);
|
||||
|
||||
next();
|
||||
}
|
||||
} else {
|
||||
accesslogCustomFormat(req, res);
|
||||
next();
|
||||
}
|
||||
};
|
||||
};
|
||||
function isAllowedToBeCached(scheme, target){
|
||||
if(environment != "development"){
|
||||
return scheme.indexOf("https")!=-1 && ( target.indexOf(".openaire.eu/") !=-1 || target.indexOf("zenodo.org/api") !=-1 || target.indexOf("lab.idiap.ch/enermaps" != -1))
|
||||
return scheme.indexOf("https")!=-1 && ( target.indexOf(".openaire.eu/") !=-1 || target.indexOf(".zenodo.org/api/") !=-1 || target.indexOf("lab.idiap.ch/enermaps" != -1))
|
||||
} else if(environment == "development"){
|
||||
return target.indexOf(".openaire.eu/") !=-1 || target.indexOf(".di.uoa.gr") !=-1 || target.indexOf("zenodo.org/api") !=-1 || target.indexOf("dev-openaire.d4science.org") !=-1 || target.indexOf("lab.idiap.ch/enermaps") != -1
|
||||
return target.indexOf(".openaire.eu/") !=-1 || target.indexOf(".di.uoa.gr") !=-1 || target.indexOf("dev-openaire.d4science.org") !=-1 || target.indexOf("lab.idiap.ch/enermaps") != -1
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -107,7 +96,7 @@ app.get('/clear', (req, res) => {
|
|||
const url = req.query.url;
|
||||
let message = "";
|
||||
if (url) {
|
||||
let key = req.query.url;
|
||||
let key = '__express__' + req.query.url;
|
||||
lruCache.delete(key);
|
||||
message = "Delete entry with key " + url;
|
||||
entries.set(lruCache.size);
|
||||
|
@ -119,18 +108,15 @@ app.get('/clear', (req, res) => {
|
|||
res.header("Access-Control-Allow-Methods", "GET, OPTIONS");
|
||||
res.header("Access-Control-Allow-Methods", "GET, OPTIONS");
|
||||
res.header("Content-Type", "application/json");
|
||||
accesslogCustomFormat(req, res);
|
||||
res.status(200).send(getResponse(200, message));
|
||||
|
||||
});
|
||||
app.get('/metrics', (req, res) => {
|
||||
res.set('Content-Type', register.contentType);
|
||||
accesslogCustomFormat(req, res);
|
||||
res.end(register.metrics());
|
||||
});
|
||||
|
||||
app.get('/info', (req, res) => {
|
||||
accesslogCustomFormat(req, res);
|
||||
res.status(200).send(getResponse(200, {size:lruCache.size, keys: Array.from(lruCache.keys())}));
|
||||
});
|
||||
|
||||
|
@ -215,19 +201,3 @@ function resetAtMidnight() {
|
|||
resetAtMidnight(); // Then, reset again next midnight.
|
||||
}, msToMidnight);
|
||||
}
|
||||
|
||||
function accesslogCustomFormat(req, res){
|
||||
// default format
|
||||
accesslog(req, res);
|
||||
// ::ffff:195.134.66.178 - - [15/Jul/2024:11:24:35 +0300] "GET /clear HTTP/1.1" 200 59 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0"
|
||||
|
||||
//custom format
|
||||
/*
|
||||
accesslog(req, res,
|
||||
{
|
||||
userID: function (req) { return req.user; },
|
||||
format : 'url=":url" method=":method" statusCode=":statusCode" delta=":delta" ip=":ip"'
|
||||
});
|
||||
*/
|
||||
// url="/clear" method="GET" statusCode="200" delta="2" ip="::ffff:195.134.66.178"
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "memcache-cache",
|
||||
"version": "2.0.0",
|
||||
"version": "1.0.0",
|
||||
"description": "Caching in memory",
|
||||
"main": "cache.js",
|
||||
"scripts": {
|
||||
|
@ -10,9 +10,7 @@
|
|||
"prepare-prod": " npm run prepare-dist; cp production-properties.file ./dist/properties.file"
|
||||
},
|
||||
"dependencies": {
|
||||
"access-log": "^0.4.1",
|
||||
"axios": "^1.6.7",
|
||||
"compression": "^1.7.4",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.18.2",
|
||||
"lru-cache": "^10.2.0",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
userInfoUrl = https://beta.services.openaire.eu/login-service/userInfo
|
||||
searchServiceAPIUrl = https://beta.services.openaire.eu/search/v2/api/
|
||||
monitorAPIUrl = https://beta.services.openaire.eu/uoa-monitor-service/
|
||||
irishMonitorAPIUrl = https://beta.services.openaire.eu/irish-monitor-service/
|
||||
fundersServiceAPIUrl = https://beta.services.openaire.eu/openaire/funders/
|
||||
ssl = true
|
||||
localPath = false
|
||||
# photo size in KB
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
userInfoUrl = https://services.openaire.eu/login-service/userInfo
|
||||
searchServiceAPIUrl = https://services.openaire.eu/search/v2/api/
|
||||
monitorAPIUrl = https://services.openaire.eu/uoa-monitor-service/
|
||||
irishMonitorAPIUrl = https://services.openaire.eu/irish-monitor-service/
|
||||
fundersServiceAPIUrl = https://services.openaire.eu/openaire/funders/
|
||||
ssl = true
|
||||
localPath = false
|
||||
# photo size in KB
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
userInfoUrl = http://mpagasas.di.uoa.gr:19080/login-service/userInfo
|
||||
searchServiceAPIUrl = https://beta.services.openaire.eu/search/v2/api/
|
||||
monitorAPIUrl = http://duffy.di.uoa.gr:19380/uoa-monitor-service/
|
||||
irishMonitorAPIUrl = http://mpagasas.di.uoa.gr:19780/irish-monitor-service/
|
||||
fundersServiceAPIUrl = https://dev-openaire.d4science.org/openaire/funders/
|
||||
ssl = false
|
||||
localPath = true
|
||||
# photo size in KB
|
||||
|
|
|
@ -15,8 +15,6 @@ if (properties.get('ssl')) {
|
|||
}
|
||||
var searchServiceAPIUrl = properties.get('searchServiceAPIUrl');
|
||||
var monitorServiceAPIUrl = properties.get('monitorAPIUrl');
|
||||
var irishMonitorServiceAPIUrl = properties.get('irishMonitorAPIUrl');
|
||||
var fundersServiceAPIUrl = properties.get('fundersServiceAPIUrl');
|
||||
var auth = properties.get('userInfoUrl');
|
||||
/** @deprecated*/
|
||||
var authDeprecated = auth.includes("accessToken");
|
||||
|
@ -131,8 +129,7 @@ app.get('/explore/home', async function (req, res) {
|
|||
funders: parseNoOfFunders(dataResponses[1].data, dataResponses[4].data),
|
||||
datasetsInterlinked:dataResponses[5].data.meta.total,
|
||||
softwareInterlinked:dataResponses[6].data.meta.total,
|
||||
success:allRequestsSuccessful,
|
||||
calculated_at: (new Date()).toUTCString()
|
||||
success:allRequestsSuccessful
|
||||
|
||||
};
|
||||
// Send the aggregated data as the response
|
||||
|
@ -151,7 +148,7 @@ app.get('/explore/search', async function (req, res) {
|
|||
searchServiceAPIUrl +'resources2/?format=json&size=0&type=results',
|
||||
searchServiceAPIUrl + 'datasources/count?format=json',
|
||||
searchServiceAPIUrl + 'resources2/?format=json&size=0&type=organizations&fq=(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or reldatasourcecompatibilityid exact openaire-cris_1.1 or reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*)',
|
||||
searchServiceAPIUrl + 'projects/count?format=json&fq=projectcode<>"unidentified"'
|
||||
searchServiceAPIUrl + 'projects/count?format=json'
|
||||
]
|
||||
const dataPromises = requests.map((url) => axios.get( url));
|
||||
const dataResponses = await Promise.all(dataPromises);
|
||||
|
@ -163,8 +160,7 @@ app.get('/explore/search', async function (req, res) {
|
|||
datasources: dataResponses[1].data.total,
|
||||
organizations: dataResponses[2].data.meta.total,
|
||||
projects:dataResponses[3].data.total,
|
||||
success:allRequestsSuccessful,
|
||||
calculated_at: (new Date()).toUTCString()
|
||||
success:allRequestsSuccessful
|
||||
|
||||
};
|
||||
|
||||
|
@ -206,8 +202,7 @@ app.get('/portals/countResults', async function (req, res) {
|
|||
datasets: dataResponses[1].data.total,
|
||||
software: dataResponses[2].data.total,
|
||||
other:dataResponses[3].data.total,
|
||||
success:allRequestsSuccessful,
|
||||
calculated_at: (new Date()).toUTCString()
|
||||
success:allRequestsSuccessful
|
||||
|
||||
};
|
||||
|
||||
|
@ -226,10 +221,9 @@ app.get('/explore/funders', async function (req, res) {
|
|||
let requests= [
|
||||
searchServiceAPIUrl + 'resources2/?format=json&type=results&fq=relfunder=*&refine=true&fields=relfunder&sf=relfunder&page=0&size=0',
|
||||
searchServiceAPIUrl + 'resources2/?format=json&type=results&fq=relfunder=*&refine=true&fields=relfunder&sf=relfunder&page=0&size=0&fq=resultbestaccessright%20exact%20%22Open%20Access%22',
|
||||
searchServiceAPIUrl + 'resources2/?format=json&type=projects&fq=funder=*&fq=projectcode<>"unidentified"&refine=true&fields=funder&sf=funder&page=0&size=0',
|
||||
searchServiceAPIUrl + 'resources2/?format=json&type=projects&fq=funder=*&fq=projecttitle<>"unidentified"&refine=true&fields=funder&sf=funder&page=0&size=0',
|
||||
monitorServiceAPIUrl + 'stakeholder?type=funder',
|
||||
irishMonitorServiceAPIUrl + 'stakeholder?type=funder',
|
||||
fundersServiceAPIUrl
|
||||
|
||||
]
|
||||
const dataPromises = requests.map((url) => axios.get( url));
|
||||
const dataResponses = await Promise.all(dataPromises);
|
||||
|
@ -239,118 +233,37 @@ app.get('/explore/funders', async function (req, res) {
|
|||
|
||||
let resultsFunders = dataResponses[0].data.refineResults.relfunder;
|
||||
resultsFunders.forEach(queriedFunder => {
|
||||
let id = queriedFunder.id;
|
||||
let name = queriedFunder.name.split("||");
|
||||
if (!fundersMap.has(id)) {
|
||||
fundersMap.set(id,{name: name?.length>0 ? name[0] : "", shortName: name?.length>1 ? name[1] : "", id: id, results:queriedFunder.count, openResults: null, projects:null, stakeholder:null});
|
||||
if (!fundersMap.has(queriedFunder.id)) {
|
||||
fundersMap.set(queriedFunder.id,{name: queriedFunder.name.split("||")[0], id: queriedFunder.id, results:queriedFunder.count, openResults: null, projects:null, stakeholder:null});
|
||||
}
|
||||
});
|
||||
let openResultsFunders = dataResponses[1].data.refineResults.relfunder;
|
||||
openResultsFunders.forEach(queriedFunder => {
|
||||
let id = queriedFunder.id;
|
||||
let name = queriedFunder.name.split("||");
|
||||
if (!fundersMap.has(id)) {
|
||||
fundersMap.set(id,{name: name?.length>0 ? name[0] : "", shortName: name?.length>1 ? name[1] : "", id: id, results:null, openResults: queriedFunder.count, projects:null, stakeholder:null});
|
||||
if (!fundersMap.has(queriedFunder.id)) {
|
||||
fundersMap.set(queriedFunder.id,{name: queriedFunder.name.split("||")[0], id: queriedFunder.id, results:null, openResults: queriedFunder.count, projects:null, stakeholder:null});
|
||||
}else{
|
||||
fundersMap.get(id).openResults = queriedFunder.count;
|
||||
fundersMap.get(queriedFunder.id).openResults = queriedFunder.count;
|
||||
}
|
||||
});
|
||||
let projectFunders = dataResponses[2].data.refineResults.funder;
|
||||
projectFunders.forEach(queriedFunder => {
|
||||
let id = queriedFunder.id;
|
||||
let name = queriedFunder.name.split("||");
|
||||
if (!fundersMap.has(id) ) {
|
||||
fundersMap.set(id,{name: name?.length>0 ? name[0] : "", shortName: name?.length>1 ? name[1] : "", id: id, results:null, openResults: null, projects:queriedFunder.count, stakeholder:null});
|
||||
if (!fundersMap.has(queriedFunder.id) ) {
|
||||
fundersMap.set(queriedFunder.id,{name: queriedFunder.name.split("||")[0], id: queriedFunder.id, results:null, openResults: null, projects:queriedFunder.count, stakeholder:null});
|
||||
}else{
|
||||
fundersMap.get(id).projects = queriedFunder.count;
|
||||
fundersMap.get(queriedFunder.id).projects = queriedFunder.count;
|
||||
}
|
||||
});
|
||||
let stakeholders = dataResponses[3].data;
|
||||
stakeholders.forEach(stakeholder => {
|
||||
let id = stakeholder.index_id + "||" + stakeholder.index_name + "||" + stakeholder.index_shortName;
|
||||
if (fundersMap.has(id) && (!fundersMap.get(id).stakeholder || (fundersMap.get(id).name === stakeholder.name) || (fundersMap.get(id).shortName === stakeholder.index_shortName))) {
|
||||
let ministakeholder = {
|
||||
id:id, name:stakeholder.name,
|
||||
alias: stakeholder.alias, visibility: stakeholder.visibility,
|
||||
irishAlias: '', irishVisibility: '',
|
||||
logoUrl:stakeholder.logoUrl, isUpload: stakeholder.isUpload, websiteUrl: null}
|
||||
fundersMap.get(id).stakeholder = ministakeholder;
|
||||
|
||||
if(!fundersMap.get(id).shortName) {
|
||||
fundersMap.get(id).shortName = stakeholder.index_shortName;
|
||||
}
|
||||
// console.log(id);
|
||||
if (fundersMap.has(id)) {
|
||||
let ministakeholder = {id:id, name:stakeholder.name, alias: stakeholder.alias, visibility: stakeholder.visibility,
|
||||
logoUrl:stakeholder.logoUrl, isUpload: stakeholder.isUpload}
|
||||
fundersMap.get(id).stakeholder = ministakeholder;
|
||||
}
|
||||
});
|
||||
|
||||
let irishStakeholders = dataResponses[4].data;
|
||||
irishStakeholders.forEach(stakeholder => {
|
||||
let id = stakeholder.index_id + "||" + stakeholder.index_name + "||" + stakeholder.index_shortName;
|
||||
if (fundersMap.has(id) && (!fundersMap.get(id).stakeholder || (fundersMap.get(id).name === stakeholder.name) || (fundersMap.get(id).shortName === stakeholder.index_shortName))) {
|
||||
let ministakeholder = {
|
||||
id:id, name:stakeholder.name,
|
||||
alias: fundersMap.get(id).stakeholder ? fundersMap.get(id).stakeholder.alias : '',
|
||||
visibility: fundersMap.get(id).stakeholder ? fundersMap.get(id).stakeholder.visibility : '',
|
||||
irishAlias: stakeholder.alias, irishVisibility: stakeholder.visibility,
|
||||
logoUrl:stakeholder.logoUrl, isUpload: stakeholder.isUpload, websiteUrl: null}
|
||||
fundersMap.get(id).stakeholder = ministakeholder;
|
||||
|
||||
if(!fundersMap.get(id).shortName) {
|
||||
fundersMap.get(id).shortName = stakeholder.index_shortName;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let funders = dataResponses[5].data;
|
||||
funders.forEach(funder => {
|
||||
// let id = funder.id + "||" + (funder.legalName ? (funder.legalName + "||" + (funder.legalShortName ? funder.legalShortName : "")) : "");
|
||||
// if (fundersMap.has(id)) {
|
||||
// let storedFunder = fundersMap.get(id);
|
||||
let storedFunder = null;
|
||||
fundersMap.forEach((value, key, map) => {
|
||||
if(key.split("||")[0] === funder.id) {
|
||||
storedFunder = value;
|
||||
}
|
||||
})
|
||||
if (storedFunder) {
|
||||
// if(funder.legalName && storedFunder.name && funder.legalName != storedFunder.name) {
|
||||
// console.log("Diffrent name!!! index: "+storedFunder.name + " vs funders API: "+funder.legalName);
|
||||
// }
|
||||
if(funder.legalName) {
|
||||
storedFunder.name = funder.legalName;
|
||||
}
|
||||
storedFunder.country = funder.country;
|
||||
storedFunder.registered = funder.registered;
|
||||
if(!storedFunder.shortName) {
|
||||
storedFunder.shortName = funder.legalShortName;
|
||||
}
|
||||
let storedStakeholder = storedFunder.stakeholder;
|
||||
|
||||
// if(funder.legalShortName && storedFunder.shortName && funder.legalShortName != storedFunder.shortName) {
|
||||
// console.log("Diffrent short name!!! index: "+storedFunder.shortName + " vs funders API: "+funder.legalShortName);
|
||||
// }
|
||||
|
||||
let ministakeholder = {
|
||||
id:storedFunder.id, name:storedStakeholder?.name,
|
||||
alias: storedStakeholder?.alias ? storedStakeholder.alias : funder.legalShortName,
|
||||
visibility: storedStakeholder?.visibility,
|
||||
irishAlias: storedStakeholder?.irishAlias ? storedStakeholder.irishAlias : funder.legalShortName,
|
||||
irishVisibility: storedStakeholder?.irishVisibility,
|
||||
websiteUrl: funder.websiteUrl, logoUrl: storedStakeholder?.logoUrl ? storedStakeholder.logoUrl : funder.logoUrl,
|
||||
isUpload: storedStakeholder?.isUpload
|
||||
};
|
||||
storedFunder.stakeholder = ministakeholder;
|
||||
// } else {
|
||||
// console.log(funder.id);
|
||||
}
|
||||
});
|
||||
|
||||
// console.log("")
|
||||
// for(let f of fundersMap.keys()) {
|
||||
// if(!fundersMap.get(f).stakeholder || (!fundersMap.get(f).stakeholder.websiteUrl && !fundersMap.get(f).country && !fundersMap.get(f).registered)) {
|
||||
// console.log(f);
|
||||
// }
|
||||
// }
|
||||
|
||||
// Combine the data
|
||||
|
||||
// Send the aggregated data as the response
|
||||
|
@ -360,8 +273,7 @@ app.get('/explore/funders', async function (req, res) {
|
|||
results: dataResponses[0].data.meta.total,
|
||||
projects: dataResponses[2].data.meta.total,
|
||||
funders: Array.from(fundersMap.values()),
|
||||
success:allRequestsSuccessful,
|
||||
calculated_at: (new Date()).toUTCString()
|
||||
success:allRequestsSuccessful
|
||||
|
||||
};
|
||||
res.status(allRequestsSuccessful?200:207).json(aggregatedData);
|
||||
|
|
Loading…
Reference in New Issue