Production release February 2024 [CONNECT] #34
|
@ -764,6 +764,7 @@ export class IndicatorUtils {
|
|||
this.extractFunder(obj, indicatorPath, stakeholder);
|
||||
this.extractRI(obj, indicatorPath, stakeholder);
|
||||
this.extractOrganization(obj, indicatorPath, stakeholder);
|
||||
this.extractDatasource(obj, indicatorPath, stakeholder);
|
||||
}
|
||||
|
||||
private extractFunder(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
|
||||
|
@ -839,7 +840,30 @@ export class IndicatorUtils {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private extractDatasource(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
|
||||
// works for publication.project.organization.name
|
||||
// and publication.organization.name
|
||||
if (stakeholder.type != "datasource") {
|
||||
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"]) {
|
||||
if (gfilter["field"].indexOf(".datasource.name") != -1 || gfilter["field"].indexOf(".HostedBy datasource") != -1) {
|
||||
gfilter["values"][0] = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters)
|
||||
} else if (gfilter["field"].indexOf(".datasource.id") != -1) {
|
||||
gfilter["values"][0] = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private replaceIndexValues(currentValue, stakeholder, parameters ){
|
||||
if(currentValue == stakeholder.index_name){
|
||||
parameters["index_name"] = stakeholder.index_name;
|
||||
|
|
Loading…
Reference in New Issue