Production release March 2024 [EXPLORE] #35
|
@ -322,6 +322,9 @@ export class IndicatorUtils {
|
|||
} else if (stakeholder.statsProfile) {
|
||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile)
|
||||
}
|
||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_id' + ChartHelper.suffix).join(stakeholder.index_id);
|
||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix).join(stakeholder.index_shortName);
|
||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_name' + ChartHelper.suffix).join(stakeholder.index_name);
|
||||
if (indicatorPath.parameters) {
|
||||
Object.keys(indicatorPath.parameters).forEach(key => {
|
||||
let replacedValue = indicatorPath.parameters[key];
|
||||
|
@ -331,16 +334,6 @@ export class IndicatorUtils {
|
|||
if (endYear && key == "end_year" && indicatorPath.filters["end_year"]) {
|
||||
replacedValue = (replacedValue > endYear) ? endYear : replacedValue;
|
||||
}
|
||||
if (key == "index_id") {
|
||||
replacedValue = stakeholder.index_id;
|
||||
}
|
||||
if (key == "index_name") {
|
||||
replacedValue = stakeholder.index_name;
|
||||
}
|
||||
if (key == "index_shortName") {
|
||||
replacedValue = stakeholder.index_shortName.toLowerCase();
|
||||
}
|
||||
|
||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue)
|
||||
});
|
||||
}
|
||||
|
@ -403,6 +396,9 @@ export class IndicatorUtils {
|
|||
} else if (stakeholder.statsProfile) {
|
||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile)
|
||||
}
|
||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_id' + ChartHelper.suffix).join(stakeholder.index_id);
|
||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix).join(stakeholder.index_shortName);
|
||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_name' + ChartHelper.suffix).join(stakeholder.index_name);
|
||||
if (fundingL0) {
|
||||
if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) {
|
||||
let filterResults = this.addFilter(replacedUrl, 'fundingL0', fundingL0);
|
||||
|
@ -474,15 +470,6 @@ export class IndicatorUtils {
|
|||
//if there is a parameter that is filtered and the value of the parameter changes, count the filter as applied
|
||||
indicatorPath.filtersApplied++;
|
||||
}
|
||||
if (key == "index_id") {
|
||||
replacedValue = stakeholder.index_id;
|
||||
}
|
||||
if (key == "index_name") {
|
||||
replacedValue = stakeholder.index_name;
|
||||
}
|
||||
if (key == "index_shortName") {
|
||||
replacedValue = stakeholder.index_shortName.toLowerCase();
|
||||
}
|
||||
if (key == "subtitle" && filterSubtitleText.length > 0) {
|
||||
replacedValue = replacedValue + (replacedValue.length > 0 ? ' - ' : '') + ' Active filters: (' + filterSubtitleText.join(", ") + ')';
|
||||
}
|
||||
|
@ -805,7 +792,7 @@ export class IndicatorUtils {
|
|||
for (let filter of query["query"]["filters"]) {
|
||||
for (let gfilter of filter["groupFilters"]) {
|
||||
//ignore field No Of Funders
|
||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters);
|
||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
|
||||
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
||||
if ((gfilter["field"].indexOf(" funder") != -1 && gfilter["field"].indexOf(" funders") == -1) ||
|
||||
(gfilter["field"].indexOf(".funder") != -1) ||
|
||||
|
@ -831,7 +818,7 @@ export class IndicatorUtils {
|
|||
}
|
||||
for (let filter of query["query"]["filters"]) {
|
||||
for (let gfilter of filter["groupFilters"]) {
|
||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters);
|
||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
|
||||
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
||||
if ((gfilter["field"].indexOf(".context.name") != -1)
|
||||
|| (gfilter["field"].indexOf(".context.id") != -1)) {
|
||||
|
@ -858,7 +845,7 @@ export class IndicatorUtils {
|
|||
}
|
||||
for (let filter of query["query"]["filters"]) {
|
||||
for (let gfilter of filter["groupFilters"]) {
|
||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters);
|
||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
|
||||
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
||||
if ((gfilter["field"].indexOf(".organization.name") != -1) ||
|
||||
(gfilter["field"].indexOf(".organization.id") != -1)) {
|
||||
|
@ -885,7 +872,7 @@ export class IndicatorUtils {
|
|||
}
|
||||
for (let filter of query["query"]["filters"]) {
|
||||
for (let gfilter of filter["groupFilters"]) {
|
||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters);
|
||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
|
||||
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
||||
if ((gfilter["field"].indexOf(".datasource.name") != -1 || gfilter["field"].indexOf(".HostedBy datasource") != -1) ||
|
||||
(gfilter["field"].indexOf(".datasource.id") != -1) || (gfilter["field"].indexOf(".hostedby") != -1)) {
|
||||
|
@ -911,7 +898,7 @@ export class IndicatorUtils {
|
|||
}
|
||||
for (let filter of query["query"]["filters"]) {
|
||||
for (let gfilter of filter["groupFilters"]) {
|
||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters);
|
||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
|
||||
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
||||
if ((gfilter["field"].indexOf(".orcid") != -1)) {
|
||||
gfilter["values"][0] = replacedValue;
|
||||
|
@ -922,15 +909,12 @@ export class IndicatorUtils {
|
|||
}
|
||||
}
|
||||
|
||||
private replaceIndexValues(currentValue, stakeholder, parameters) {
|
||||
private replaceIndexValues(currentValue, stakeholder) {
|
||||
if (currentValue == stakeholder.index_name) {
|
||||
parameters["index_name"] = stakeholder.index_name;
|
||||
return ChartHelper.prefix + "index_name" + ChartHelper.suffix;
|
||||
} else if (currentValue == stakeholder.index_id) {
|
||||
parameters["index_id"] = stakeholder.index_id;
|
||||
return ChartHelper.prefix + "index_id" + ChartHelper.suffix;
|
||||
} else if (currentValue == stakeholder.index_shortName) {
|
||||
parameters["index_shortName"] = stakeholder.index_shortName;
|
||||
return ChartHelper.prefix + "index_shortName" + ChartHelper.suffix;
|
||||
}
|
||||
|
||||
|
@ -1002,13 +986,10 @@ export class IndicatorUtils {
|
|||
for (let i of index) {
|
||||
if (name.split('.').length > 3 && name.split('.')[3] == "id") {
|
||||
parameters[i] = ChartHelper.prefix + "index_id" + ChartHelper.suffix;
|
||||
indicatorPath.parameters["index_id"] = stakeholder.index_id;
|
||||
} else if (name.split('.').length > 3 && name.split('.')[3] == "shortname") {
|
||||
parameters[i] = ChartHelper.prefix + "index_shortName" + ChartHelper.suffix;
|
||||
indicatorPath.parameters["index_shortName"] = stakeholder.index_shortName.toLowerCase();
|
||||
} else if (name.split('.').length > 3 && name.split('.')[3] == "name") {
|
||||
parameters[i] = ChartHelper.prefix + "index_name" + ChartHelper.suffix;
|
||||
indicatorPath.parameters["index_name"] = stakeholder.index_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue