Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
argirok 2024-07-19 11:14:06 +03:00
commit 40830c48df
4 changed files with 66 additions and 33 deletions

View File

@ -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: .alias;">
<div id="target" class="uk-section uk-padding-remove-top uk-margin-top" uk-height-match="target: .shortName;">
<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">
@ -145,10 +145,10 @@
</ng-template>
</div>
<div class="uk-padding-small uk-padding-remove-vertical uk-padding-remove-left uk-margin-medium-left">
<!-- alias -->
<div class="alias uk-text-uppercase uk-text-small uk-margin-top type">
<ng-container *ngIf="funder.alias">
{{funder.alias}}
<!-- shortName -->
<div class="shortName uk-text-uppercase uk-text-small uk-margin-top type">
<ng-container *ngIf="funder.shortName">
{{funder.shortName}}
</ng-container>
</div>
<div class="uk-flex">
@ -243,9 +243,9 @@
<ng-container *ngIf="funder.name">
<span>{{funder.name}}</span>
</ng-container>
<ng-container *ngIf="funder.alias" >
<ng-container *ngIf="funder.shortName" >
<span class="uk-text-uppercase">
({{funder.alias}})
({{funder.shortName}})
</span>
</ng-container>
</div>

View File

@ -54,6 +54,7 @@ export class FundersComponent implements OnInit {
fundersMap = new Map<string, {
"id": string,
"name": string,
"shortName": string,
"alias": string,
"researchProducts": number,
"openAccessResearchProducts": number,
@ -67,19 +68,19 @@ export class FundersComponent implements OnInit {
"registered": boolean
}>();
staticLogos: Map<string, string> = new Map<string, string>([
["arc_________::ARC", "ARC"],
["asap________::ASAP", "ASAP"],
["cihr________::CIHR", "CIHR"],
["euenvagency_::EEA", "EEA"],
["inca________::INCA", "INCa"],
["nhmrc_______::NHMRC", "NHMRC"],
["nih_________::NIH", "NIH"],
["nserc_______::NSERC", "NSERC"],
["nsf_________::NSF", "NSF"],
["sshrc_______::SSHRC", "SSHRC"],
["taraexp_____::tara", "TARA"],
["ukri________::UKRI", "UKRI"],
["wt__________::WT", "WT"]
["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"]
]);
constructor(private router: Router,
@ -160,6 +161,7 @@ export class FundersComponent implements OnInit {
let funder = {
"id": id,
"name": this.removePartAfterCharacters(queriedFunder.name, "||"),
"shortName": queriedFunder.shortName,
"alias": '',
"researchProducts": +queriedFunder.results,
"openAccessResearchProducts": +queriedFunder.openResults,
@ -180,6 +182,9 @@ export class FundersComponent implements OnInit {
if(queriedFunder.stakeholder) {
let stakeholder = queriedFunder.stakeholder;
funder.alias = stakeholder.alias;
if(!funder.shortName) {
funder.shortName = stakeholder.alias;
}
funder.monitorDashboard = stakeholder.alias;
funder.monitorDashboardStatus = stakeholder.visibility;
if(stakeholder.logoUrl) {

@ -1 +1 @@
Subproject commit 7a18b65b40c151cabbee93998f8ced4683ed0a90
Subproject commit dd4d785d966a040bbc3f8cbebb2374bdab6eebb9

View File

@ -234,51 +234,79 @@ app.get('/explore/funders', async function (req, res) {
let resultsFunders = dataResponses[0].data.refineResults.relfunder;
resultsFunders.forEach(queriedFunder => {
let id = queriedFunder.id.split("||")[0];
let id = queriedFunder.id;
let name = queriedFunder.name.split("||");
if (!fundersMap.has(id)) {
fundersMap.set(id,{name: queriedFunder.name.split("||")[0], id: id, results:queriedFunder.count, openResults: null, projects:null, stakeholder:null});
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});
}
});
let openResultsFunders = dataResponses[1].data.refineResults.relfunder;
openResultsFunders.forEach(queriedFunder => {
let id = queriedFunder.id.split("||")[0];
let id = queriedFunder.id;
let name = queriedFunder.name.split("||");
if (!fundersMap.has(id)) {
fundersMap.set(id,{name: queriedFunder.name.split("||")[0], id: id, results:null, openResults: queriedFunder.count, projects:null, stakeholder:null});
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});
}else{
fundersMap.get(id).openResults = queriedFunder.count;
}
});
let projectFunders = dataResponses[2].data.refineResults.funder;
projectFunders.forEach(queriedFunder => {
let id = queriedFunder.id.split("||")[0];
let id = queriedFunder.id;
let name = queriedFunder.name.split("||");
if (!fundersMap.has(id) ) {
fundersMap.set(id,{name: queriedFunder.name.split("||")[0], id: id, results:null, openResults: null, projects:queriedFunder.count, stakeholder:null});
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});
}else{
fundersMap.get(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)) {
let ministakeholder = {id:id, name:stakeholder.name, alias: stakeholder.alias, visibility: stakeholder.visibility,
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,
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[4].data;
funders.forEach(funder => {
if (fundersMap.has(funder.id)) {
let storedFunder = fundersMap.get(funder.id);
// 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:funder.id, name:storedStakeholder?.name, alias: storedStakeholder?.alias ? storedStakeholder.alias : funder.legalShortName,
id:storedFunder.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
};