[Monitor dashboard|Trunk]

- indicator utils: indicator enhancements - update profile




git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@60451 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Argiro Kokogiannaki 2021-02-18 15:55:53 +00:00
parent 4c6518d55b
commit ec169cbf99
2 changed files with 18 additions and 7 deletions

View File

@ -916,14 +916,25 @@ export class IndicatorUtils {
[".datasource.type",".HostedBy datasource type"]
];
let changes = "";
for (let field of resultEnhancements) {
for (let type of ["publication", "software", "dataset", "other", "result"]) {
if (url.indexOf(encodeURIComponent(type + field[0])) != -1) {
changes += "Changed " + type + field[0] + " to " + type + field[1] + "\n";
url = url.split(encodeURIComponent(type + field[0])).join(encodeURIComponent(type + field[1]));
for (let field of resultEnhancements) {
for (let type of ["publication", "software", "dataset", "other", "result"]) {
if (url.indexOf(encodeURIComponent(type + field[0])) != -1) {
changes += "Changed " + type + field[0] + " to " + type + field[1] + "\n";
url = url.split(encodeURIComponent(type + field[0])).join(encodeURIComponent(type + field[1]));
}
}
}
}
if(url.split('json=').length > 1) {
let obj = JSON.parse(decodeURIComponent(url.split('json=')[1]));
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"] != 'monitor') {
changes += (query["query"]["profile"] ? ( "Changed profile \"" + query["query"]["profile"] + "\" to " ):"Added profile ") + " \"monitor\"";
query["query"]["profile"] = 'monitor';
}
}
url = url.split('json=')[0] + "json=" + encodeURIComponent(JSON.stringify(obj));
}
console.debug(changes);
console.debug(url);
return url;

View File

@ -13,7 +13,7 @@ export let properties: EnvProperties = {
statisticsFrameAPIURL: "https://www.openaire.eu/stats/",
statisticsFrameNewAPIURL: "https://services.openaire.eu/stats-tool/",
useNewStatistisTool: true,
monitorStatsFrameUrl:"https://stats.madgik.di.uoa.gr/stats-api/",
monitorStatsFrameUrl:"https://services.openaire.eu/monitor-stats-tool/",
useOldStatisticsSchema: false,
claimsAPIURL: "https://services.openaire.eu/claims/rest/claimsService/",
searchAPIURLLAst: "https://services.openaire.eu/search/v2/api/",