Badge add rotated badge in admin pages

Set _id null when create a profile from default one
Set sidebar default option to open





git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@57818 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Argiro Kokogiannaki 2019-12-05 12:01:27 +00:00
parent 9fcb627f30
commit e852d4302c
8 changed files with 37 additions and 19 deletions

View File

@ -1,6 +1,9 @@
<!--disable_transitions -->
<div class="sidebar_main_swipe" [class.sidebar_main_active]="open && hasSidebar">
<div *ngIf="hasHeader" id="header_main" [class.header_full]="!hasSidebar">
<img class="badge small-badge right-badge"
src="assets/theme-assets/prototype_flag.svg"
alt="BETA">
<div class="uk-light">
<a *ngIf="hasSidebar" id="sidebar_main_toggle" (click)="toggleOpen()" class="sSwitch sSwitch_left">
<span class="sSwitchIcon"></span>

View File

@ -10,7 +10,7 @@ export class LayoutService {
/**
* Set this to true when sidebar items are ready.
*/
private openSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
private openSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);
/**
* Add hasSidebar: false on data of route config, if sidebar is not needed.

View File

@ -5,10 +5,10 @@
<nav class="uk-navbar">
<div class="uk-navbar-left">
<img class="large-badge"
<img class="badge "
src="assets/theme-assets/prototype_flag.svg"
alt="BETA">
<a *ngIf="stakeholder" class="uk-logo uk-navbar-item ng-star-inserted uk-link uk-margin-small-top"
<a *ngIf="stakeholder" class="uk-logo uk-navbar-item ng-star-inserted uk-link uk-margin-small-top uk-margin-medium-left"
routerlink="/"
routerlinkactive="uk-link" href="/">
<img *ngIf="stakeholder.logoUrl" [src]="stakeholder.logoUrl" class="uk-responsive-height">

View File

@ -81,25 +81,25 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
this.route.params.subscribe(params => {
this.properties = data.envSpecific;
var url = data.envSpecific.baseLink + this._router.url;
if (!this.stakeholder || this.stakeholder.index_id !== params['stakeholder']) {
if (!this.stakeholder || this.stakeholder.alias !== params['stakeholder']) {
this.status = this.errorCodes.LOADING;
this.numberResults = new Map<number, number>();
this.chartsActiveType = new Map<number, IndicatorPath>();
// this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
let stakeholder: Stakeholder = null;
if (params['stakeholder'] == "fwf") {
stakeholder = new Stakeholder("fwf", "funder", "fwf_________::FWF", "Austrian Science Fund (FWF)", "FWF",
stakeholder = new Stakeholder(null, "funder", "fwf_________::FWF", "Austrian Science Fund (FWF)", "FWF",
false, "fwf", true, true, null);
stakeholder = this.stakeholderUtils.createFunderFromDefaultProfile(stakeholder, StakeholderCreator.createFunderDefaultProfile().topics);
stakeholder.logoUrl = "./assets/fwf.png";
} else if (params['stakeholder'] == "arc") {
stakeholder = new Stakeholder("arc", "funder", "arc_________::ARC",
stakeholder = new Stakeholder(null, "funder", "arc_________::ARC",
"Australian Research Council (ARC)", "ARC",
false, "arc", true, true, null);
false, null, true, true, null);
stakeholder = this.stakeholderUtils.createFunderFromDefaultProfile(stakeholder, StakeholderCreator.createFunderDefaultProfile().topics);
stakeholder.logoUrl = "./assets/arc1.gif";
} else {
stakeholder = new Stakeholder("ec", "funder", "ec__________::EC",
stakeholder = new Stakeholder(null, "funder", "ec__________::EC",
"European Commission", "EC",
false, "ec", true, true, null);
stakeholder = this.stakeholderUtils.createFunderFromDefaultProfile(stakeholder, StakeholderCreator.createFunderDefaultProfile().topics);

View File

@ -42,7 +42,7 @@ export class Stakeholder {
}
static createECStakeholder(): Stakeholder {
let ec: Stakeholder = new Stakeholder("ec", "funder", "ec__________::EC", "European Commission", "EC", false, "ec", true, true, null);
let ec: Stakeholder = new Stakeholder(null, "funder", "ec__________::EC", "European Commission", "EC", false, "ec", true, true, null);
// new Stakeholder('wt','funder','wt__________::WT','Wellcome Trust','WT',false, 'wt',true,true);
ec.topics.push(ec.createOSTopic(ec));
ec.topics.push(ec.createImpactTopic());

View File

@ -50,9 +50,9 @@ export class StakeholderCreator {
let softwareCategory:Category = new Category("Software","","software",true,true);
topic.categories.push(softwareCategory);
softwareCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Software", "Software","software", "datasets",0));
softwareCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Software", "Software","software", "datasets",1));
softwareCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Software", "Software","software", "datasets",2));
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));
let otherCategory:Category = new Category("Other research products","","other",true,true);
topic.categories.push(otherCategory);
@ -72,7 +72,7 @@ export class StakeholderCreator {
let chartTitle=["","FP7 ","H2020 "];
let pubDefSub = new SubCategory(categoryTitle[index], null,categoryTitle[index].toLowerCase(),true, true);
if(index!=0){
pubDefSub.recommendedFor.push("ec");
pubDefSub.recommendedFor.push("ec__________::EC");
}
if(index==0) {
let n_total = new Indicator("Total " + typePlural, null, "number", "small", true, true, [new IndicatorPath(null, "search",
@ -116,14 +116,14 @@ export class StakeholderCreator {
'{"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 + 'funder_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);
res_sci_area.recommendedFor = ["ec"];
res_sci_area.recommendedFor = ["ec__________::EC"];
pubDefSub.charts.push(res_sci_area);
let res_programmes = 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 2","aggregate":null}],"filters":[{"groupFilters":[{"field":"' + dbType + '.project.funder","type":"=","values":["' + ChartHelper.prefix + 'funder_name' + ChartHelper.suffix + '"]}],"op":"AND"},{"groupFilters":[{"field":"' + dbType + '.project.funding level 2","type":"!=","values":[" "]}],"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":"Programmes"}},"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_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"];
res_programmes.recommendedFor = ["ec__________::EC"];
pubDefSub.charts.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"}}}

View File

@ -33,15 +33,19 @@ export class StakeholderUtils {
public createFunderFromDefaultProfile(funder: Stakeholder, defaultTopics: Topic[]): Stakeholder {
funder.topics = defaultTopics;
for (let topic of funder.topics) {
topic._id = null;
for (let category of topic.categories) {
category._id = null;
let subTokeep: SubCategory[] = [];
for (let subCategory of category.subCategories) {
subCategory._id = null;
let chartsTokeep: Indicator[] = [];
if (subCategory.recommendedFor.length == 0 || subCategory.recommendedFor.indexOf(funder._id) != -1) {
if (subCategory.recommendedFor.length == 0 || subCategory.recommendedFor.indexOf(funder.index_id) != -1) {
subTokeep.push(subCategory);
}
for (let indicator of subCategory.charts) {
if (indicator.recommendedFor.length == 0 || indicator.recommendedFor.indexOf(funder._id) != -1) {
indicator._id = null;
if (indicator.recommendedFor.length == 0 || indicator.recommendedFor.indexOf(funder.index_id) != -1) {
chartsTokeep.push(indicator);
}
for (let indicatorPath of indicator.indicatorPaths) {
@ -59,6 +63,7 @@ export class StakeholderUtils {
}
subCategory.charts = chartsTokeep;
for (let indicator of subCategory.numbers) {
indicator._id = null;
for (let indicatorPath of indicator.indicatorPaths) {
indicatorPath.url = indicatorPath.url.replace("_funder_id_", funder.index_id);
// if(indicatorPath.parameters) {

View File

@ -207,10 +207,20 @@ body.dashboard {
padding: 5px 10px;
}
.large-badge {
height: 104px;
.badge {
height: 100px;
position: absolute;
top: 0;
left: 0;
z-index: 1;
}
.small-badge {
height: 70px;
}
.right-badge{
top: 0;
left: auto;
transform: rotate(90deg);
right: 0;
}