[Monitor Dashboard|Trunk]

StakeholderCreator:

	Update method  StakeholderCreator.updateECProfile with proper values

	update method that creates default profile to add only common things

Monitor Component:
	update section layout






git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@57967 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Argiro Kokogiannaki 2020-01-10 13:31:53 +00:00
parent e44d0a6392
commit 3b8075b6b9
5 changed files with 45 additions and 26 deletions

View File

@ -215,7 +215,7 @@ export class ManageStakeholdersComponent implements OnInit, OnDestroy {
/* this.stakeholderFb.setValue(this.stakeholderUtils.createFunderFromDefaultProfile(this.stakeholderFb.value,
StakeholderCreator.createFunderDefaultProfile().topics));*/
} else {
this.stakeholderFb.setValue(StakeholderCreator.createFunderDefaultProfile());
this.stakeholderFb.setValue(StakeholderCreator.createFunderDefaultProfile(this.stakeholderFb.value));
}
this.stakeholderService.buildStakeholder(this.properties.monitorServiceAPIURL, this.stakeholderFb.value).subscribe(stakeholder => {
if (stakeholder.defaultId === null) {

View File

@ -125,17 +125,19 @@
</div>
</div>
</div>
<div *ngIf="activeSubCategory" class="uk-grid uk-grid-medium uk-margin-bottom uk-flex uk-flex-bottom "
uk-height-match="target: div > div > .chartTitle">
<ng-template ngFor [ngForOf]="activeSubCategory.charts" let-chart let-i="index">
<h4 class="uk-width-1-1">{{chart.title}}</h4>
<div *ngIf="activeSubCategory"
>
<div *ngFor="let chart of activeSubCategory.charts; let i = index;" class="uk-grid uk-grid-medium uk-margin-bottom uk-flex uk-flex-bottom "
uk-height-match="target: div > div > .chartTitle">
<h3 *ngIf="chart.title && chart.title.length > 0" class="uk-width-1-1 uk-margin-top">{{chart.title}}</h3>
<ng-template ngFor [ngForOf]="chart.indicators" let-indicator let-j="index">
<div *ngIf="indicator.isActive && indicator.isPublic && chartsActiveType.get(i + '-' + j)"
[class.uk-width-1-3@m]="indicator.width === 'small'"
[class.uk-width-1-2@m]="indicator.width === 'medium'"
[class.uk-width-1-1]="indicator.width === 'large'">
<div class="indicatorBox">
<h4 class="uk-margin-bottom uk-margin-top chartTitle uk-flex uk-flex-bottom ">
<h4 class="uk-margin-bottom chartTitle uk-flex uk-flex-bottom ">
<div>{{indicator.name + " "}}</div>
</h4>
<div class="md-card" [attr.uk-tooltip]="indicator.description">
@ -161,7 +163,7 @@
</div>
</div>
</ng-template>
</ng-template>
</div>
</div>
</div>
</div>

View File

@ -116,8 +116,6 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
// stakeholder.logoUrl = "./assets/ec.png";
// }
if (stakeholder) {
console.info(stakeholder);
// StakeholderCreator.updateECProfile(stakeholder);
this.stakeholder = stakeholder;
console.info(this.stakeholder);

View File

@ -1,10 +1,10 @@
import {Stakeholder,Topic,Category,SubCategory,Indicator, IndicatorPath, ChartHelper} from "./stakeholder";
import {Stakeholder, Topic, Category, SubCategory, Indicator, IndicatorPath, ChartHelper, Section} from "./stakeholder";
import {IndicatorUtils} from "../indicator-utils";
export class StakeholderCreator {
static createFunderDefaultProfile():Stakeholder{
let funder:Stakeholder = new Stakeholder(null,"funder","dfid","Default Funder Profile","dfsn","default_funder",true,true, null);
static createFunderDefaultProfile(funder:Stakeholder):Stakeholder{
// let funder:Stakeholder = new Stakeholder(null,"funder","dfid","Default Funder Profile","dfsn","default_funder",true,true, null);
funder['isDefault'] = true;
funder.topics.push(StakeholderCreator.createResearchProductionTopic(funder));
funder.topics.push(StakeholderCreator.createOSTopic(funder));
@ -40,6 +40,26 @@ export class StakeholderCreator {
funder.topics[0].categories[3].subCategories.push(StakeholderCreator.createResearchProductionPerType(funder,"Other research products", "Other research product","other", "other",1));
funder.topics[0].categories[3].subCategories.push(StakeholderCreator.createResearchProductionPerType(funder,"Other research products", "Other research product","other", "other",2));
funder.topics[1].categories[0].subCategories[0].charts.push(new Section("chart","FP7 Section" ));
funder.topics[1].categories[0].subCategories[0].charts[1].indicators = this.createOAPerType(funder,"Publications","Publication","publication","publications", 1 );
funder.topics[1].categories[0].subCategories[0].charts.push(new Section("chart","H2020" ));
funder.topics[1].categories[0].subCategories[0].charts[2].indicators = this.createOAPerType(funder,"Publications","Publication","publication","publications", 2 );
funder.topics[1].categories[0].subCategories[1].charts.push(new Section("chart","FP7 Section" ));
funder.topics[1].categories[0].subCategories[1].charts[1].indicators = this.createOAPerType(funder,"Research data", "Research data","dataset", "datasets", 1 );
funder.topics[1].categories[0].subCategories[1].charts.push(new Section("chart","H2020" ));
funder.topics[1].categories[0].subCategories[1].charts[2].indicators = this.createOAPerType(funder,"Research data", "Research data","dataset", "datasets", 2 );
funder.topics[1].categories[0].subCategories[2].charts.push(new Section("chart","FP7 Section" ));
funder.topics[1].categories[0].subCategories[2].charts[1].indicators = this.createOAPerType(funder,"Software", "Software","software", "software", 1 );
funder.topics[1].categories[0].subCategories[2].charts.push(new Section("chart","H2020" ));
funder.topics[1].categories[0].subCategories[2].charts[2].indicators = this.createOAPerType(funder,"Software", "Software","software", "software", 2 );
funder.topics[1].categories[0].subCategories[3].charts.push(new Section("chart","FP7 Section" ));
funder.topics[1].categories[0].subCategories[3].charts[1].indicators = this.createOAPerType(funder,"Other research products", "Other research product","other", "other", 1 );
funder.topics[1].categories[0].subCategories[3].charts.push(new Section("chart","H2020" ));
funder.topics[1].categories[0].subCategories[3].charts[2].indicators = this.createOAPerType(funder,"Other research products", "Other research product","other", "other", 2 );
return funder;
}
@ -61,25 +81,25 @@ export class StakeholderCreator {
topic.categories.push(pubCategory);
// let pubDefSub = StakeholderCreator.createResearchProductionPerType(stakeholder,"Publications", "Publication","publication", "publications");
pubCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Publications", "Publication","publication", "publications",0));
pubCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Publications", "Publication","publication", "publications",1));
pubCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Publications", "Publication","publication", "publications",2));
// pubCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Publications", "Publication","publication", "publications",1));
// pubCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Publications", "Publication","publication", "publications",2));
let dataCategory:Category = new Category("Research data","","data",true,true);
topic.categories.push(dataCategory);
dataCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Research data", "Research data","dataset", "datasets",0));
dataCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Research data", "Research data","dataset", "datasets",1));
dataCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Research data", "Research data","dataset", "datasets",2));
// dataCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Research data", "Research data","dataset", "datasets",1));
// dataCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Research data", "Research data","dataset", "datasets",2));
let softwareCategory:Category = new Category("Software","","software",true,true);
topic.categories.push(softwareCategory);
softwareCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Software", "Software","software", "software",0));
softwareCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Software", "Software","software", "software",1));
softwareCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Software", "Software","software", "software",2));
// softwareCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Software", "Software","software", "software",1));
// softwareCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Software", "Software","software", "software",2));
let otherCategory:Category = new Category("Other research products","","other",true,true);
topic.categories.push(otherCategory);
otherCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Other research products", "Other research product","other", "other",0));
otherCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Other research products", "Other research product","other", "other",1));
otherCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Other research products", "Other research product","other", "other",2));
// otherCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Other research products", "Other research product","other", "other",1));
// otherCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Other research products", "Other research product","other", "other",2));
return topic;
@ -133,7 +153,7 @@ export class StakeholderCreator {
pubDefSub.charts[0].indicators.push(res_access_mode);
let res_sci_area = new Indicator("", null, "chart", "small", true, true, [new IndicatorPath("bar", "stats-tool", "chart?json=",
/* let res_sci_area = new Indicator("", null, "chart", "small", true, true, [new IndicatorPath("bar", "stats-tool", "chart?json=",
'{"library":"HighCharts","chartDescription":{"queries":[{"name":"' + typePlural + '","type":"' + ChartHelper.prefix + 'type' + ChartHelper.suffix + '","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"' + dbType + '.project.funder","type":"=","values":["' + ChartHelper.prefix + 'index_name' + ChartHelper.suffix + '"]}],"op":"AND"}'+fundingFilter[index]+'],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + ChartHelper.prefix + 'title' + ChartHelper.suffix + '"},"subtitle":{},"yAxis":{"title":{"text":"' + typePlural + '"}},"xAxis":{"title":{"text":"Scientific area"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}', null)]);
res_sci_area.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, chartTitle[index] + typeSingl + " scientific area", "bar");
res_sci_area.indicatorPaths[0].filters = IndicatorPath.createResultFilters(dbType);
@ -145,7 +165,7 @@ export class StakeholderCreator {
res_programmes.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, chartTitle[index] + typeSingl + " programmes", "bar");
res_programmes.indicatorPaths[0].filters = IndicatorPath.createResultFilters(dbType);
res_programmes.recommendedFor = ["ec__________::EC"];
pubDefSub.charts[0].indicators.push(res_programmes);
pubDefSub.charts[0].indicators.push(res_programmes);*/
//{"library":"HighCharts","chartDescription":{"queries":[{"name":"Research Data","type":"bar","query":{"select":[{"field":"dataset","aggregate":"count"},{"field":"dataset.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"dataset.project.funder","type":"=","values":["European Commission"]}],"op":"AND"}],"entity":"dataset","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Scientific Area"},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}
let datasource = new Indicator("",null, "chart","small",true, true,[new IndicatorPath("bar", "stats-tool", "chart?json=",
@ -211,8 +231,8 @@ export class StakeholderCreator {
static createOASub(stakeholder:Stakeholder,typePlural, typeSingl, dbType, dbTypePlural ):SubCategory {
let sub:SubCategory = new SubCategory(typePlural, null, dbTypePlural, true, true);
sub.charts[0].indicators = sub.charts[0].indicators.concat( this.createOAPerType(stakeholder,typePlural, typeSingl, dbType, dbTypePlural, 0 ));
sub.charts[0].indicators = sub.charts[0].indicators.concat( this.createOAPerType(stakeholder,typePlural, typeSingl, dbType, dbTypePlural, 1 ));
sub.charts[0].indicators = sub.charts[0].indicators.concat( this.createOAPerType(stakeholder,typePlural, typeSingl, dbType, dbTypePlural, 2 ));
// sub.charts[0].indicators = sub.charts[0].indicators.concat( this.createOAPerType(stakeholder,typePlural, typeSingl, dbType, dbTypePlural, 1 ));
// sub.charts[0].indicators = sub.charts[0].indicators.concat( this.createOAPerType(stakeholder,typePlural, typeSingl, dbType, dbTypePlural, 2 ));
return sub;
}
static createOAPerType(stakeholder:Stakeholder,typePlural, typeSingl, dbType, dbTypePlural, index:number):Indicator[] {
@ -227,7 +247,7 @@ export class StakeholderCreator {
let open_non_url = "http://88.197.53.71:8080/stats-api/chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Data","type":"pie","color":"#e62020ee","query":{"name":"monitor.' + ChartHelper.prefix + 'id' + ChartHelper.suffix +(index==2?".h2020":(index==1?".fp7":""))+ '.' + dbTypePlural+'.oavsnonoa"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"'+chartTitle[index]+' Open Access vs Non Open Access"},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');
encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Data","type":"pie","query":{"name":"monitor.' + ChartHelper.prefix + 'id' + ChartHelper.suffix +(index==2?".h2020":(index==1?".fp7":""))+ '.' + dbTypePlural+'.greenvsgold"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');
let open_non_ind:Indicator = new Indicator(chartTitle[index]+" Overview", "", "chart", "small", true, true, [utils.generateIndicatorByChartUrl("stats-tool", open_non_url, "pie",stakeholder)])
let open_non_ind:Indicator = new Indicator("", "", "chart", "small", true, true, [utils.generateIndicatorByChartUrl("stats-tool", open_non_url, "pie",stakeholder)])
open_non_ind.indicatorPaths[0].parameters["index_id"] = stakeholder.index_shortName.toLowerCase();
if(index!=0){
open_non_ind.recommendedFor.push("ec__________::EC");

View File

@ -36,7 +36,6 @@ export class StakeholderUtils {
isActiveIcon: string = 'brightness_1';
public createFunderFromDefaultProfile(funder: Stakeholder, defaultTopics: Topic[]): Stakeholder {
console.log(funder);
funder.topics = defaultTopics;
for (let topic of funder.topics) {
// console.log('id:' + topic._id);