Merge remote-tracking branch 'origin/develop'

This commit is contained in:
Konstantina Galouni 2024-07-12 11:29:46 +03:00
commit 4fc4182696
10 changed files with 150 additions and 69 deletions

View File

@ -14,6 +14,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- *Fixed (for any bug fixes)* - *Fixed (for any bug fixes)*
- *Security (in case of vulnerabilities)* - *Security (in case of vulnerabilities)*
## [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 ## [production-release-june-2024] - 2024/06/04
### Changed ### Changed
* Filter out unidentified projects from the search page and related tabs in detailed pages * Filter out unidentified projects from the search page and related tabs in detailed pages

View File

@ -39,6 +39,7 @@
"clipboard": "^1.5.16", "clipboard": "^1.5.16",
"core-js": "^2.5.4", "core-js": "^2.5.4",
"express": "^4.15.2", "express": "^4.15.2",
"flag-icons": "^7.2.1",
"jquery": "^3.4.1", "jquery": "^3.4.1",
"ng-recaptcha": "^12.0.2", "ng-recaptcha": "^12.0.2",
"prom-client": "^11.3.0", "prom-client": "^11.3.0",

View File

@ -58,7 +58,6 @@ export class ContactComponent implements OnInit {
ngOnInit() { ngOnInit() {
this._title.setTitle('OpenAIRE - Explore | Contact Us'); this._title.setTitle('OpenAIRE - Explore | Contact Us');
this.properties = properties;
this.email = {body: '', subject: '', recipients: []}; this.email = {body: '', subject: '', recipients: []};
this.subscriptions.push( this._piwikService.trackView(this.properties, this.pageTitle).subscribe()); this.subscriptions.push( this._piwikService.trackView(this.properties, this.pageTitle).subscribe());
this.url = this.properties.domain + this._router.url; this.url = this.properties.domain + this._router.url;

View File

@ -126,17 +126,18 @@
<!-- funder's card for GRID view --> <!-- funder's card for GRID view -->
<ng-container *ngIf="gridView || isMobile; else elseBlock"> <ng-container *ngIf="gridView || isMobile; else elseBlock">
<div class="uk-card uk-card-default uk-card-hover funder-grid"> <div class="uk-card uk-card-default uk-card-hover funder-grid">
<!-- <div class="uk-position-top-left uk-padding-small"> <div class="uk-position-top-left uk-padding-small">
<span class="uk-text-xsmall">flag</span> <!-- <span class="uk-text-xsmall">flag</span>-->
</div> --> <span class="fi" [ngClass]="'fi-'+funder.country | lowercase"></span>
<!-- <div class="uk-position-top-right uk-padding-small"> </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-flex uk-flex-middle uk-text-xsmall uk-text-meta">
<div class="uk-icon-bg uk-icon-bg-small"> <div class="uk-icon-bg uk-icon-bg-small">
<icon name="done" [flex]="true"></icon> <icon name="done" [flex]="true"></icon>
</div> </div>
<span class="uk-margin-xsmall-left">Registered</span> <span class="uk-margin-xsmall-left">Registered</span>
</div> </div>
</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"> <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"> <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> <ng-template #elseBlock>
@ -156,11 +157,11 @@
<span>{{funder.name}}</span> <span>{{funder.name}}</span>
</ng-container> </ng-container>
</div> </div>
<!-- <div class="uk-width-auto uk-margin-left"> <div *ngIf="funder.websiteUrl" class="uk-width-auto uk-margin-left">
<a href="" class="uk-flex-inline uk-flex-middle uk-text-uppercase uk-button uk-button-text custom-external"> <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> <icon name="payment" [flex]="true"></icon>
</a> </a>
</div> --> </div>
</div> </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="data uk-background-muted uk-flex uk-flex-middle uk-padding-small uk-padding-remove-left uk-margin-top">
@ -237,6 +238,7 @@
<div class="uk-flex uk-flex-column uk-flex-center"> <div class="uk-flex uk-flex-column uk-flex-center">
<div class="uk-flex uk-flex-middle"> <div class="uk-flex uk-flex-middle">
<!-- <span class="uk-text-xsmall uk-margin-small-right">flag</span> --> <!-- <span class="uk-text-xsmall uk-margin-small-right">flag</span> -->
<span 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"> <div class="uk-h6 uk-margin-remove uk-text-truncate">
<ng-container *ngIf="funder.name"> <ng-container *ngIf="funder.name">
<span>{{funder.name}}</span> <span>{{funder.name}}</span>
@ -310,19 +312,19 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <div class="uk-width-auto uk-flex uk-flex-column uk-flex-center uk-margin-right"> <div *ngIf="funder.registered || funder.websiteUrl" class="uk-width-auto uk-flex uk-flex-column uk-flex-center uk-margin-right">
<div class="uk-flex uk-flex-middle uk-text-xsmall uk-text-meta uk-margin-bottom"> <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"> <div class="uk-icon-bg uk-icon-bg-small">
<icon name="done" [flex]="true"></icon> <icon name="done" [flex]="true"></icon>
</div> </div>
<span class="uk-margin-xsmall-left">Registered</span> <span class="uk-margin-xsmall-left">Registered</span>
</div> </div>
<div> <div *ngIf="funder.websiteUrl">
<a href="" class="uk-flex-inline uk-flex-middle uk-text-uppercase uk-button uk-button-text custom-external"> <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> <icon name="payment" [flex]="true"></icon>
</a> </a>
</div> </div>
</div> --> </div>
</div> </div>
</div> </div>
</ng-template> </ng-template>

View File

@ -1,5 +1,5 @@
@import (reference) "~src/assets/openaire-theme/less/color.less"; @import (reference) "~src/assets/openaire-theme/less/color.less";
@import "flag-icons/css/flag-icons.min.css";
.custom-coins-dot:after { .custom-coins-dot:after {
content: ""; content: "";
@ -21,22 +21,22 @@
margin-left: 10px; margin-left: 10px;
} }
.custom-view-button { //.custom-view-button {
padding: 4px; // padding: 4px;
background: @light-color; // background: @light-color;
border: 1px solid @disable-color; // border: 1px solid @disable-color;
border-radius: 4px; // border-radius: 4px;
icon { // icon {
color: @disable-color; // color: @disable-color;
} // }
//
&.active { // &.active {
background: transparent linear-gradient(315deg, @primary-light-color 0%, @primary-dark-color 100%) 0% 0% no-repeat padding-box; // background: transparent linear-gradient(315deg, @primary-light-color 0%, @primary-dark-color 100%) 0% 0% no-repeat padding-box;
icon { // icon {
color: @light-color; // color: @light-color;
} // }
} // }
} //}
// .uk-card { // .uk-card {
// &.funder-grid { // &.funder-grid {

View File

@ -18,6 +18,7 @@ import {LayoutService} from '../openaireLibrary/dashboard/sharedComponents/sideb
import {FormBuilder, FormControl} from '@angular/forms'; import {FormBuilder, FormControl} from '@angular/forms';
import {debounceTime, distinctUntilChanged} from 'rxjs/operators'; import {debounceTime, distinctUntilChanged} from 'rxjs/operators';
import {GroupedRequestsService} from "../openaireLibrary/services/groupedRequests.service"; import {GroupedRequestsService} from "../openaireLibrary/services/groupedRequests.service";
import {OpenaireEntities} from "../openaireLibrary/utils/properties/searchFields";
@Component({ @Component({
selector: 'funders', selector: 'funders',
@ -31,6 +32,7 @@ export class FundersComponent implements OnInit {
pageTitle: string = "OpenAIRE - Explore | Funders"; pageTitle: string = "OpenAIRE - Explore | Funders";
pageDescription: string = "Funders | Be an integral part of the open R&I ecosystem"; pageDescription: string = "Funders | Be an integral part of the open R&I ecosystem";
properties: EnvProperties = properties; properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'funders'}]; breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'funders'}];
showLoading: boolean = true; showLoading: boolean = true;
isMobile: boolean = false; isMobile: boolean = false;
@ -59,22 +61,25 @@ export class FundersComponent implements OnInit {
"projects": number, "projects": number,
"monitorDashboard": string, "monitorDashboard": string,
"monitorDashboardStatus": string, "monitorDashboardStatus": string,
"logoUrl": string "logoUrl": string,
"websiteUrl": string,
"country": string,
"registered": boolean
}>(); }>();
staticLogos: Set<string> = new Set<string>([ staticLogos: Map<string, string> = new Map<string, string>([
"arc_________::ARC||Australian Research Council (ARC)||ARC", ["arc_________::ARC", "ARC"],
"asap________::ASAP||Aligning Science Across Parkinson's||ASAP", ["asap________::ASAP", "ASAP"],
"cihr________::CIHR||Canadian Institutes of Health Research||CIHR", ["cihr________::CIHR", "CIHR"],
"euenvagency_::EEA||European Environment Agency||EEA", ["euenvagency_::EEA", "EEA"],
"inca________::INCA||Institut National du Cancer||INCa", ["inca________::INCA", "INCa"],
"nhmrc_______::NHMRC||National Health and Medical Research Council (NHMRC)||NHMRC", ["nhmrc_______::NHMRC", "NHMRC"],
"nih_________::NIH||National Institutes of Health||NIH", ["nih_________::NIH", "NIH"],
"nserc_______::NSERC||Natural Sciences and Engineering Research Council of Canada||NSERC", ["nserc_______::NSERC", "NSERC"],
"nsf_________::NSF||National Science Foundation||NSF", ["nsf_________::NSF", "NSF"],
"sshrc_______::SSHRC||Social Sciences and Humanities Research Council||SSHRC", ["sshrc_______::SSHRC", "SSHRC"],
"taraexp_____::tara||Tara Expeditions Foundation||TARA", ["taraexp_____::tara", "TARA"],
"ukri________::UKRI||UK Research and Innovation||UKRI", ["ukri________::UKRI", "UKRI"],
"wt__________::WT||Wellcome Trust||WT" ["wt__________::WT", "WT"]
]); ]);
constructor(private router: Router, constructor(private router: Router,
@ -93,7 +98,6 @@ export class FundersComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.layoutService.setRootClass('funders'); this.layoutService.setRootClass('funders');
this.title.setTitle('OpenAIRE - Explore | Funders'); this.title.setTitle('OpenAIRE - Explore | Funders');
this.properties = properties;
this.subscriptions.push( this.piwikService.trackView(this.properties, this.pageTitle).subscribe()); this.subscriptions.push( this.piwikService.trackView(this.properties, this.pageTitle).subscribe());
this.url = this.properties.domain + this.router.url; this.url = this.properties.domain + this.router.url;
this.seoService.createLinkForCanonicalURL(this.url); this.seoService.createLinkForCanonicalURL(this.url);
@ -109,9 +113,12 @@ export class FundersComponent implements OnInit {
{value: 'dashboard', label: 'Funders with dashboard'} {value: 'dashboard', label: 'Funders with dashboard'}
]; ];
this.sortOptions = [ this.sortOptions = [
{value: 'alphAsc', label: 'Alphabetically Asc. (A-Z)'}, {value: 'alphAsc', label: 'Alphabetically asc. (A-Z)'},
{value: 'alphDsc', label: 'Alphabetically Dsc. (Z-A)'}, {value: 'alphDsc', label: 'Alphabetically desc. (Z-A)'},
{value: 'oaDsc', label: '"Open Access %" Dsc.'} {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.'}
]; ];
this.getFunders(); this.getFunders();
this.keywordControl = this.fb.control(''); this.keywordControl = this.fb.control('');
@ -160,7 +167,10 @@ export class FundersComponent implements OnInit {
"projects": +queriedFunder.projects, "projects": +queriedFunder.projects,
"monitorDashboard": '', "monitorDashboard": '',
"monitorDashboardStatus": '', "monitorDashboardStatus": '',
"logoUrl": '' "logoUrl": '',
"websiteUrl": '',
"country": queriedFunder.country,
"registered": queriedFunder.registered
}; };
if((!funder.researchProducts || funder.researchProducts == 0) && (!funder.projects || funder.projects == 0)) { if((!funder.researchProducts || funder.researchProducts == 0) && (!funder.projects || funder.projects == 0)) {
@ -172,7 +182,10 @@ export class FundersComponent implements OnInit {
funder.alias = stakeholder.alias; funder.alias = stakeholder.alias;
funder.monitorDashboard = stakeholder.alias; funder.monitorDashboard = stakeholder.alias;
funder.monitorDashboardStatus = stakeholder.visibility; funder.monitorDashboardStatus = stakeholder.visibility;
funder.logoUrl = (stakeholder.isUpload ? properties.utilsService + "/download/" : "")+ (stakeholder.logoUrl); if(stakeholder.logoUrl) {
funder.logoUrl = (stakeholder.isUpload ? properties.utilsService + "/download/" : "") + (stakeholder.logoUrl);
}
funder.websiteUrl = stakeholder.websiteUrl;
} }
if(funder.openAccessResearchProducts && funder.researchProducts) { if(funder.openAccessResearchProducts && funder.researchProducts) {
@ -180,9 +193,7 @@ export class FundersComponent implements OnInit {
} }
if(!funder.logoUrl && this.staticLogos.has(funder.id)) { if(!funder.logoUrl && this.staticLogos.has(funder.id)) {
let split = funder.id.split("||"); funder.logoUrl = "assets/explore-assets/funders/logos/"+this.staticLogos.get(funder.id)+".png";
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); this.fundersMap.set(queriedFunder.id, funder);
@ -335,6 +346,25 @@ export class FundersComponent implements OnInit {
case 'oaDsc': case 'oaDsc':
this.funders = this.funders.sort((a, b) => b['openAccessPercentage'] - a['openAccessPercentage']); this.funders = this.funders.sort((a, b) => b['openAccessPercentage'] - a['openAccessPercentage']);
break; 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(); this.filtering();
} }

View File

@ -1,6 +1,7 @@
userInfoUrl = https://beta.services.openaire.eu/login-service/userInfo userInfoUrl = https://beta.services.openaire.eu/login-service/userInfo
searchServiceAPIUrl = https://beta.services.openaire.eu/search/v2/api/ searchServiceAPIUrl = https://beta.services.openaire.eu/search/v2/api/
monitorAPIUrl = https://beta.services.openaire.eu/uoa-monitor-service/ monitorAPIUrl = https://beta.services.openaire.eu/uoa-monitor-service/
fundersServiceAPIUrl = https://beta.services.openaire.eu/openaire/funders/
ssl = true ssl = true
localPath = false localPath = false
# photo size in KB # photo size in KB

View File

@ -1,6 +1,7 @@
userInfoUrl = https://services.openaire.eu/login-service/userInfo userInfoUrl = https://services.openaire.eu/login-service/userInfo
searchServiceAPIUrl = https://services.openaire.eu/search/v2/api/ searchServiceAPIUrl = https://services.openaire.eu/search/v2/api/
monitorAPIUrl = https://services.openaire.eu/uoa-monitor-service/ monitorAPIUrl = https://services.openaire.eu/uoa-monitor-service/
fundersServiceAPIUrl = https://services.openaire.eu/openaire/funders/
ssl = true ssl = true
localPath = false localPath = false
# photo size in KB # photo size in KB

View File

@ -1,6 +1,7 @@
userInfoUrl = http://mpagasas.di.uoa.gr:19080/login-service/userInfo userInfoUrl = http://mpagasas.di.uoa.gr:19080/login-service/userInfo
searchServiceAPIUrl = https://beta.services.openaire.eu/search/v2/api/ searchServiceAPIUrl = https://beta.services.openaire.eu/search/v2/api/
monitorAPIUrl = http://duffy.di.uoa.gr:19380/uoa-monitor-service/ monitorAPIUrl = http://duffy.di.uoa.gr:19380/uoa-monitor-service/
fundersServiceAPIUrl = https://beta.services.openaire.eu/openaire/funders/
ssl = false ssl = false
localPath = true localPath = true
# photo size in KB # photo size in KB

View File

@ -15,6 +15,7 @@ if (properties.get('ssl')) {
} }
var searchServiceAPIUrl = properties.get('searchServiceAPIUrl'); var searchServiceAPIUrl = properties.get('searchServiceAPIUrl');
var monitorServiceAPIUrl = properties.get('monitorAPIUrl'); var monitorServiceAPIUrl = properties.get('monitorAPIUrl');
var fundersServiceAPIUrl = properties.get('fundersServiceAPIUrl');
var auth = properties.get('userInfoUrl'); var auth = properties.get('userInfoUrl');
/** @deprecated*/ /** @deprecated*/
var authDeprecated = auth.includes("accessToken"); var authDeprecated = auth.includes("accessToken");
@ -223,7 +224,7 @@ app.get('/explore/funders', async function (req, res) {
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=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=projectcode<>"unidentified"&refine=true&fields=funder&sf=funder&page=0&size=0',
monitorServiceAPIUrl + 'stakeholder?type=funder', monitorServiceAPIUrl + 'stakeholder?type=funder',
fundersServiceAPIUrl
] ]
const dataPromises = requests.map((url) => axios.get( url)); const dataPromises = requests.map((url) => axios.get( url));
const dataResponses = await Promise.all(dataPromises); const dataResponses = await Promise.all(dataPromises);
@ -233,37 +234,67 @@ app.get('/explore/funders', async function (req, res) {
let resultsFunders = dataResponses[0].data.refineResults.relfunder; let resultsFunders = dataResponses[0].data.refineResults.relfunder;
resultsFunders.forEach(queriedFunder => { resultsFunders.forEach(queriedFunder => {
if (!fundersMap.has(queriedFunder.id)) { let id = queriedFunder.id.split("||")[0];
fundersMap.set(queriedFunder.id,{name: queriedFunder.name.split("||")[0], id: queriedFunder.id, results:queriedFunder.count, openResults: null, projects:null, stakeholder:null}); if (!fundersMap.has(id)) {
fundersMap.set(id,{name: queriedFunder.name.split("||")[0], id: id, results:queriedFunder.count, openResults: null, projects:null, stakeholder:null});
} }
}); });
let openResultsFunders = dataResponses[1].data.refineResults.relfunder; let openResultsFunders = dataResponses[1].data.refineResults.relfunder;
openResultsFunders.forEach(queriedFunder => { openResultsFunders.forEach(queriedFunder => {
if (!fundersMap.has(queriedFunder.id)) { let id = queriedFunder.id.split("||")[0];
fundersMap.set(queriedFunder.id,{name: queriedFunder.name.split("||")[0], id: queriedFunder.id, results:null, openResults: queriedFunder.count, projects:null, stakeholder:null}); if (!fundersMap.has(id)) {
fundersMap.set(id,{name: queriedFunder.name.split("||")[0], id: id, results:null, openResults: queriedFunder.count, projects:null, stakeholder:null});
}else{ }else{
fundersMap.get(queriedFunder.id).openResults = queriedFunder.count; fundersMap.get(id).openResults = queriedFunder.count;
} }
}); });
let projectFunders = dataResponses[2].data.refineResults.funder; let projectFunders = dataResponses[2].data.refineResults.funder;
projectFunders.forEach(queriedFunder => { projectFunders.forEach(queriedFunder => {
if (!fundersMap.has(queriedFunder.id) ) { let id = queriedFunder.id.split("||")[0];
fundersMap.set(queriedFunder.id,{name: queriedFunder.name.split("||")[0], id: queriedFunder.id, results:null, openResults: null, projects:queriedFunder.count, stakeholder:null}); if (!fundersMap.has(id) ) {
fundersMap.set(id,{name: queriedFunder.name.split("||")[0], id: id, results:null, openResults: null, projects:queriedFunder.count, stakeholder:null});
}else{ }else{
fundersMap.get(queriedFunder.id).projects = queriedFunder.count; fundersMap.get(id).projects = queriedFunder.count;
} }
}); });
let stakeholders = dataResponses[3].data; let stakeholders = dataResponses[3].data;
stakeholders.forEach(stakeholder => { stakeholders.forEach(stakeholder => {
let id = stakeholder.index_id + "||" + stakeholder.index_name + "||" + stakeholder.index_shortName; let id = stakeholder.index_id;// + "||" + stakeholder.index_name + "||" + stakeholder.index_shortName;
// console.log(id);
if (fundersMap.has(id)) { if (fundersMap.has(id)) {
let ministakeholder = {id:id, name:stakeholder.name, alias: stakeholder.alias, visibility: stakeholder.visibility, let ministakeholder = {id:id, name:stakeholder.name, alias: stakeholder.alias, visibility: stakeholder.visibility,
logoUrl:stakeholder.logoUrl, isUpload: stakeholder.isUpload} logoUrl:stakeholder.logoUrl, isUpload: stakeholder.isUpload, websiteUrl: null}
fundersMap.get(id).stakeholder = ministakeholder; fundersMap.get(id).stakeholder = ministakeholder;
} }
}); });
let funders = dataResponses[4].data;
funders.forEach(funder => {
if (fundersMap.has(funder.id)) {
let storedFunder = fundersMap.get(funder.id);
if(funder.legalName) {
storedFunder.name = funder.legalName;
}
storedFunder.country = funder.country;
storedFunder.registered = funder.registered;
let storedStakeholder = storedFunder.stakeholder;
let ministakeholder = {
id:funder.id, name:storedStakeholder?.name, alias: storedStakeholder?.alias ? storedStakeholder.alias : funder.legalShortName,
websiteUrl: funder.websiteUrl, logoUrl: storedStakeholder?.logoUrl ? storedStakeholder.logoUrl : funder.logoUrl,
visibility: storedStakeholder?.visibility, 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 // Combine the data
// Send the aggregated data as the response // Send the aggregated data as the response