[Monitor|Dashboard]
Indicator utils: - enable named query numbers - fix adding filter in named query with default year range - when chart has year filter by default apply user year range if the range is stricter, else keep the default git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@59511 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
f36cba5d4c
commit
98ced85b37
|
@ -400,9 +400,9 @@ export class IndicatorUtils {
|
|||
filterApplied = true;
|
||||
}
|
||||
} else {
|
||||
if((paramFields.length*2) == queries["query"]["parameters"].length){
|
||||
queries["query"]["parameters"].splice(paramFields.length, 0, filterValue);
|
||||
}
|
||||
// if((paramFields.length*2) == queries["query"]["parameters"].length){
|
||||
// queries["query"]["parameters"].splice(paramFields.length, 0, filterValue);
|
||||
// }
|
||||
if((paramFields.length*2 + 4) == queries["query"]["parameters"].length){
|
||||
queries["query"]["parameters"].splice(paramFields.length + 1, 0, filterValue);
|
||||
}
|
||||
|
@ -418,19 +418,19 @@ export class IndicatorUtils {
|
|||
console.debug("Parameters length:" + queries["query"]["parameters"].length)
|
||||
|
||||
if((paramFields.length + 2) == queries["query"]["parameters"].length || (paramFields.length*2 + 4) == queries["query"]["parameters"].length){
|
||||
console.debug("update param position 0,1" )
|
||||
filterApplied = true;
|
||||
if(filterType == "start_year"){
|
||||
queries["query"]["parameters"][0]=filterValue;
|
||||
queries["query"]["parameters"][0] = parseInt(filterValue);
|
||||
}else if(filterType == "end_year"){
|
||||
queries["query"]["parameters"][1]=filterValue;
|
||||
queries["query"]["parameters"][1] = parseInt(filterValue);
|
||||
}
|
||||
}
|
||||
if((paramFields.length*2 + 4) == queries["query"]["parameters"].length){
|
||||
console.debug("update param position "+(paramFields.length + 2) + "," +(paramFields.length + 3) )
|
||||
filterApplied = true;
|
||||
if(filterType == "start_year"){
|
||||
queries["query"]["parameters"][paramFields.length + 2]=filterValue;
|
||||
queries["query"]["parameters"][paramFields.length + 2] = parseInt(filterValue);
|
||||
}else if(filterType == "end_year"){
|
||||
queries["query"]["parameters"][paramFields.length + 3]=filterValue;
|
||||
queries["query"]["parameters"][paramFields.length + 3] = parseInt(filterValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -463,6 +463,14 @@ export class IndicatorUtils {
|
|||
}
|
||||
newJsonObject[this.getDescriptionObjectName(newJsonObject)]["colors"][queryIndex] = inActiveColors[queryIndex];
|
||||
filterApplied = true;
|
||||
}else if (filterType == "start_year" || filterType == "end_year") {
|
||||
//if has date filter already
|
||||
if(filterType == "start_year" && parseInt(filterValue) > parseInt(queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0])){
|
||||
queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0] = filterValue;
|
||||
}else if(filterType == "end_year" && parseInt(filterValue) < parseInt(queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0])) {
|
||||
queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0] = filterValue;
|
||||
}
|
||||
filterApplied = true;
|
||||
}
|
||||
}else{
|
||||
filterApplied = true;
|
||||
|
@ -518,6 +526,7 @@ export class IndicatorUtils {
|
|||
indicatorPath.url = indicatorPath.url.split("/")[indicatorPath.url.split("/").length - 1];
|
||||
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);
|
||||
indicatorPath.chartObject = JSON.stringify(chart);
|
||||
// this.addResultFilters(chart, indicatorPath);
|
||||
|
@ -729,7 +738,7 @@ export class IndicatorUtils {
|
|||
|
||||
private parameterizeDefaultQuery(obj, indicatorPath: IndicatorPath, stakeholder:Stakeholder) {
|
||||
let name = "";
|
||||
for (let query of obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)]) {
|
||||
for (let query of this.getQueryObjectName(obj)?obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)]:obj[this.getDescriptionObjectName(obj)]) {
|
||||
//monitor.{{stakeholderType}}.{{queryname}}
|
||||
//parameters: stakeholderId*, type
|
||||
if (query["query"]["name"]) {
|
||||
|
|
|
@ -47,7 +47,7 @@ export let properties: EnvProperties = {
|
|||
piwikBaseUrl: "https://analytics.openaire.eu/piwik.php?idsite=",
|
||||
piwikSiteId: "104",
|
||||
loginUrl: "https://services.openaire.eu/monitor-dashboard-login/openid_connect_login",
|
||||
|
||||
userInfoUrl: " https://services.openaire.eu/uoa-user-management/api/users/getUserInfo?accessToken=",
|
||||
logoutUrl: "https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
|
||||
|
||||
cookieDomain: ".openaire.eu",
|
||||
|
|
Loading…
Reference in New Issue