Production release February 2024 [CONNECT] #34

Merged
konstantina.galouni merged 168 commits from develop into master 2024-02-15 11:04:20 +01:00
1 changed files with 29 additions and 2 deletions
Showing only changes of commit 9a96851e70 - Show all commits

View File

@ -25,6 +25,7 @@ class Entities {
project = 'Project';
country = 'National';
datasource = 'Repository';
researcher = 'Researcher';
stakeholders = 'Dashboards';
funders = 'Funders';
@ -32,6 +33,7 @@ class Entities {
organizations = 'Research Institutions';
projects = 'Projects';
datasources = 'Repositories';
researchers = 'Researchers';
}
export class StakeholderConfiguration {
@ -765,6 +767,7 @@ export class IndicatorUtils {
this.extractRI(obj, indicatorPath, stakeholder);
this.extractOrganization(obj, indicatorPath, stakeholder);
this.extractDatasource(obj, indicatorPath, stakeholder);
this.extractResearcher(obj, indicatorPath, stakeholder);
}
private extractFunder(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
@ -846,8 +849,8 @@ export class IndicatorUtils {
}
}
private extractDatasource(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
// works for publication.project.organization.name
// and publication.organization.name
// works for .datasource.name and .HostedBy datasource
// and .datasource.id
if (stakeholder.type != "datasource") {
return;
}
@ -871,6 +874,30 @@ export class IndicatorUtils {
}
}
}
private extractResearcher(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
// works for .orcid
if (stakeholder.type != "researcher") {
return;
}
for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) {
if (query["query"]["profile"]) {
query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix;
}
if (!query["query"]["filters"]) {
return;
}
for (let filter of query["query"]["filters"]) {
for (let gfilter of filter["groupFilters"]) {
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters);
if(replacedValue) { // don't proceed in replacement if no replaced value matches
if ((gfilter["field"].indexOf(".orcid") != -1 )) {
gfilter["values"][0] = replacedValue;
}
}
}
}
}
}
private replaceIndexValues(currentValue, stakeholder, parameters ){
if(currentValue == stakeholder.index_name){
parameters["index_name"] = stakeholder.index_name;