From ec169cbf9976e5bba346843f0550c58bc719dbcc Mon Sep 17 00:00:00 2001 From: Argiro Kokogiannaki Date: Thu, 18 Feb 2021 15:55:53 +0000 Subject: [PATCH] [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 --- src/app/utils/indicator-utils.ts | 23 +++++++++++++++++------ src/environments/environment.prod.ts | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/app/utils/indicator-utils.ts b/src/app/utils/indicator-utils.ts index b739dd4..048683b 100644 --- a/src/app/utils/indicator-utils.ts +++ b/src/app/utils/indicator-utils.ts @@ -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; diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index d0b8ff0..7ae5b15 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -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/",