[umbrella]: Add journal in indicators utils cases.

This commit is contained in:
Konstantinos Triantafyllou 2024-06-03 09:53:13 +03:00
parent 041e9d8478
commit dfe92d4555
1 changed files with 17 additions and 17 deletions

View File

@ -622,7 +622,7 @@ export class IndicatorUtils {
indicatorPath.chartObject = decodeURIComponent(url.indexOf("json=") != -1 ? url.split("json=")[1] : "");
let chart = JSON.parse(indicatorPath.chartObject);
this.parameterizeDefaultQuery(chart, indicatorPath, stakeholder);
this.extractStakeHolders(chart, indicatorPath, stakeholder);
this.extractStakeHolders(chart, stakeholder);
this.addProfile(indicatorPath);
indicatorPath.chartObject = JSON.stringify(chart);
if (!jsonPath || jsonPath.length == 0 || (jsonPath.length == 1 && jsonPath[0] == "")) {
@ -680,7 +680,7 @@ export class IndicatorUtils {
// common for tables and other chart types
this.extractDataTitle(chart, indicatorPath);
this.parameterizeDefaultQuery(chart, indicatorPath, stakeholder);
this.extractStakeHolders(chart, indicatorPath, stakeholder);
this.extractStakeHolders(chart, stakeholder);
this.extractStartYear(chart, indicatorPath);
this.extractEndYear(chart, indicatorPath);
this.addProfile(indicatorPath);
@ -741,16 +741,16 @@ export class IndicatorUtils {
return type;
}
private extractStakeHolders(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
this.extractFunder(obj, indicatorPath, stakeholder);
this.extractRI(obj, indicatorPath, stakeholder);
this.extractOrganization(obj, indicatorPath, stakeholder);
this.extractDatasource(obj, indicatorPath, stakeholder);
this.extractResearcher(obj, indicatorPath, stakeholder);
private extractStakeHolders(obj, stakeholder: Stakeholder) {
this.extractFunder(obj, stakeholder);
this.extractRI(obj, stakeholder);
this.extractOrganization(obj, stakeholder);
this.extractDatasource(obj, stakeholder);
this.extractResearcher(obj, stakeholder);
}
private extractFunder(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
if (stakeholder.type != "funder") {
private extractFunder(obj, stakeholder: Stakeholder) {
if (stakeholder.type != 'funder') {
return;
}
for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) {
@ -776,8 +776,8 @@ export class IndicatorUtils {
}
}
private extractRI(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
if (stakeholder.type != "ri") {
private extractRI(obj, stakeholder: Stakeholder) {
if (stakeholder.type != 'ri') {
return;
}
for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) {
@ -801,10 +801,10 @@ export class IndicatorUtils {
}
}
private extractOrganization(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
private extractOrganization(obj, stakeholder: Stakeholder) {
// works for publication.project.organization.name
// and publication.organization.name
if (stakeholder.type != "organization") {
if (stakeholder.type != 'organization') {
return;
}
for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) {
@ -828,10 +828,10 @@ export class IndicatorUtils {
}
}
private extractDatasource(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
private extractDatasource(obj, stakeholder: Stakeholder) {
// works for .datasource.name and .HostedBy datasource
// and .datasource.id
if (stakeholder.type != "datasource") {
if (stakeholder.type != 'datasource' && stakeholder.type != 'journal') {
return;
}
for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) {
@ -855,7 +855,7 @@ export class IndicatorUtils {
}
}
private extractResearcher(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
private extractResearcher(obj, stakeholder: Stakeholder) {
// works for .orcid
if (stakeholder.type != "researcher") {
return;