@@ -280,56 +280,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/app/topic/topic.component.ts b/src/app/topic/topic.component.ts
index 9936db3..75fbf0c 100644
--- a/src/app/topic/topic.component.ts
+++ b/src/app/topic/topic.component.ts
@@ -2,9 +2,6 @@ import {Component, OnDestroy, OnInit} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title} from '@angular/platform-browser';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
-
-import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
-import {ErrorMessagesComponent} from '../openaireLibrary/utils/errorMessages.component';
import {Category, Stakeholder, SubCategory, Topic} from "../utils/entities/stakeholder";
import {SideBarService} from "../library/sharedComponents/sidebar/sideBar.service";
import {StakeholderService} from "../services/stakeholder.service";
@@ -17,26 +14,19 @@ declare var UIkit;
templateUrl: './topic.component.html',
})
export class TopicComponent implements OnInit, OnDestroy {
- public status: number;
+ public properties: EnvProperties;
public loading: boolean = true;
- public errorCodes: ErrorCodes;
public stakeholder: Stakeholder;
- private errorMessages: ErrorMessagesComponent;
public topicIndex: number = -1;
public topic: Topic = null;
public categoryIndex: number = -1;
+ public selectedCategoryIndex: number = -1;
public copyCategory: Category = null;
public subCategoryIndex: number = -1;
public copySubCategory: SubCategory = null;
public valid = true;
public edit: boolean = false;
public toggle: boolean = false;
- public unsaved: boolean = false;
- public properties: EnvProperties;
- public chartType: string = null;
- public isPublic: boolean = null;
- public isActive: boolean = null;
- grid: boolean = true;
constructor(
private route: ActivatedRoute,
@@ -44,9 +34,6 @@ export class TopicComponent implements OnInit, OnDestroy {
private title: Title,
private sideBarService: SideBarService,
private stakeholderService: StakeholderService) {
- this.errorCodes = new ErrorCodes();
- this.errorMessages = new ErrorMessagesComponent();
- this.status = this.errorCodes.LOADING;
}
public ngOnInit() {
@@ -63,6 +50,10 @@ export class TopicComponent implements OnInit, OnDestroy {
this.navigateToError();
} else {
this.title.setTitle(stakeholder.index_name);
+ this.categoryIndex = 0;
+ this.selectedCategoryIndex = 0;
+ this.subCategoryIndex = 0;
+ this.toggle = true;
}
}
});
@@ -83,21 +74,9 @@ export class TopicComponent implements OnInit, OnDestroy {
UIkit.drop(element).show();
}
- get open(): boolean {
- return this.sideBarService.open;
- }
-
- public toggleOpen(event = null) {
- if (!event) {
- this.sideBarService.setOpen(!this.open);
- } else if (event && event['value'] === true) {
- this.sideBarService.setOpen(false);
- }
- }
-
public toggleCategory(index: number) {
- if(this.categoryIndex !== index) {
- this.categoryIndex = index;
+ if(this.selectedCategoryIndex !== index) {
+ this.selectedCategoryIndex = index;
this.toggle = true;
} else {
this.toggle = !this.toggle;
@@ -127,22 +106,11 @@ export class TopicComponent implements OnInit, OnDestroy {
this.stakeholder.topics[this.topicIndex].categories[index] = Tools.copy(this.copyCategory);
}
this.hide(element);
- this.unsaved = true;
} else {
this.valid = false;
}
}
- public editTopicOpen(element) {
- if(element.className.indexOf('uk-open') !== -1) {
- this.hide(element);
- } else {
- this.topic = Tools.copy(this.stakeholder.topics[this.topicIndex]);
- this.valid = true;
- this.show(element);
- }
- }
-
public editSubCategoryOpen(index:number = -1, element = null) {
if(index === -1) {
this.copySubCategory = new SubCategory(null, null, null, true, true);
@@ -162,25 +130,33 @@ export class TopicComponent implements OnInit, OnDestroy {
if(this.copySubCategory.name && this.copySubCategory.name !== '') {
this.copySubCategory.alias = this.copySubCategory.name.toLowerCase();
if(index === -1) {
- this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].
+ this.stakeholder.topics[this.topicIndex].categories[this.selectedCategoryIndex].
subCategories.push(this.copySubCategory);
} else {
- this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].
+ this.stakeholder.topics[this.topicIndex].categories[this.selectedCategoryIndex].
subCategories[index] = Tools.copy(this.copySubCategory);
}
this.hide(element);
- this.unsaved = true;
} else {
this.valid = false;
}
}
+ public editTopicOpen(element) {
+ if(element.className.indexOf('uk-open') !== -1) {
+ this.hide(element);
+ } else {
+ this.topic = Tools.copy(this.stakeholder.topics[this.topicIndex]);
+ this.valid = true;
+ this.show(element);
+ }
+ }
+
public saveTopic(element) {
if(this.topic.name && this.topic.name !== '') {
this.topic.alias = this.topic.name.toLowerCase();
this.stakeholder.topics[this.topicIndex] = Tools.copy(this.topic);
this.hide(element);
- this.unsaved = true;
} else {
this.valid = false;
}
@@ -192,17 +168,26 @@ export class TopicComponent implements OnInit, OnDestroy {
this.back();*/
}
- public changeGrid(value) {
- this.grid = value;
- }
-
private navigateToError() {
this.router.navigate(['/error'], {queryParams: {'page': this.router.url}});
}
+ public getDefaultSubcategoryIndex(categoryIndex: number) {
+ return this.stakeholder.topics[this.topicIndex].categories[categoryIndex].
+ subCategories.findIndex(subcategory => subcategory.alias === null);
+ }
+
back() {
this.router.navigate(['../'], {
relativeTo: this.route
});
}
+
+ chooseSubcategory(categoryIndex: number, subcategoryIndex: number) {
+ /*let topic: Topic = this.stakeholder.topics[this.topicIndex];
+ let category: Category = topic.categories[this.categoryIndex];
+ let subCatetegory: SubCategory = category.subCategories[index];*/
+ this.categoryIndex = categoryIndex;
+ this.subCategoryIndex = subcategoryIndex;
+ }
}
diff --git a/src/app/topic/topic.module.ts b/src/app/topic/topic.module.ts
index 35ad26b..bcd731e 100644
--- a/src/app/topic/topic.module.ts
+++ b/src/app/topic/topic.module.ts
@@ -10,13 +10,14 @@ import {TopicRoutingModule} from "./topic-routing.module";
import {ModalModule} from "../openaireLibrary/utils/modal/modal.module";
import {RouterModule} from "@angular/router";
import {FormsModule} from "@angular/forms";
+import {IndicatorsComponent} from "./indicators.component";
@NgModule({
imports: [
CommonModule, TopicRoutingModule, ModalModule, RouterModule, FormsModule
],
declarations: [
- TopicComponent
+ TopicComponent, IndicatorsComponent
],
providers: [
FreeGuard, PreviousRouteRecorder,
diff --git a/src/app/utils/Tools.ts b/src/app/utils/Tools.ts
index b989574..7e82d48 100644
--- a/src/app/utils/Tools.ts
+++ b/src/app/utils/Tools.ts
@@ -1,3 +1,22 @@
+export class IndicatorUtils {
+
+ chartTypes: Map
= new Map([
+ ['pie', 'pie_chart'],
+ ['table', 'table_chart'],
+ ['line', 'show_chart'],
+ ['column', 'bar_chart'],
+ ['bar', 'bar_chart'],
+ ['image', 'perm_media']
+ ]);
+
+ isPublicIcon: Map = new Map([
+ [true, 'public'],
+ [false, 'lock']
+ ]);
+
+ isActiveIcon: string = 'brightness_1';
+}
+
export class Tools {
public static copy(element: any): any {
diff --git a/src/app/utils/entities/stakeholder.ts b/src/app/utils/entities/stakeholder.ts
index 41517ea..2f50126 100644
--- a/src/app/utils/entities/stakeholder.ts
+++ b/src/app/utils/entities/stakeholder.ts
@@ -94,8 +94,8 @@ export class Stakeholder {
//Numbers
- let n_total_pubs = new Indicator("Publications",null, "number","small",true, true, [new IndicatorPath(null, "statistics","/funders/"+stakeholder.id, null, ["statistics","publications"])]);
- let n_open_pubs = new Indicator("OA Publications",null, "number","small",true, true, [new IndicatorPath(null, "statistics","/funders/"+stakeholder.id, null,["statistics","open_access"])]);
+ let n_total_pubs = new Indicator("Publications",'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...', "number","small",true, true, [new IndicatorPath(null, "statistics","/funders/"+stakeholder.id, null, ["statistics","publications"])]);
+ let n_open_pubs = new Indicator("OA Publications",'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...', "number","small",true, true, [new IndicatorPath(null, "statistics","/funders/"+stakeholder.id, null,["statistics","open_access"])]);
let n_total_projects = new Indicator("Projects",null, "number","small",true, true, [new IndicatorPath(null, "statistics","/funders/"+stakeholder.id, null, ["statistics","total_projects"])]);
let n_total_data = new Indicator("Reserach data",null, "number","small",true, true, [new IndicatorPath(null, "search",
"/datasets/count?fq="+(encodeURIComponent("relfunderid exact "+stakeholder.index_id))+"&format=json", null, ["total"])]);
@@ -121,7 +121,7 @@ export class Stakeholder {
//Charts
- let c_pubs_per_project = new Indicator("Which are the top "+stakeholder.index_shortName+" projects?",null, "chart","large",true, true, [
+ let c_pubs_per_project = new Indicator("Which are the top "+stakeholder.index_shortName+" projects?",'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...', "chart","large",true, true, [
new IndicatorPath("bar", "old","chart.php?com=query&data=",'{"table":"result","fields":[{"fld":"number","agg":"count","type":"'+ChartHelper.prefix+'type'+ChartHelper.suffix+'","yaxis":1,"c":false}],"xaxis":{"name":"result_projects-project-acronym","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"count-number","yaxisheaders":[""],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"result_projects-project-funder","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"}],"having":[],"xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"title":"'+ChartHelper.prefix+'title'+ChartHelper.suffix+'","subtitle":"","xaxistitle":"project","order":"d"}', null )]);
c_pubs_per_project.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name,"Publications per project (top 30)","bar");
pubDefSub.charts.push(c_pubs_per_project);
diff --git a/src/assets/monitor-custom.css b/src/assets/monitor-custom.css
index 199483d..9c85306 100644
--- a/src/assets/monitor-custom.css
+++ b/src/assets/monitor-custom.css
@@ -16,16 +16,45 @@
--monitor-portal-lower-tone: #7c9144;
--connect-portal-lower-tone: #b48536;
--develop-portal-lower-tone: #9f4e7e;
+
+ --sidebar-width: 300px;
+ --header-height: 60px;
}
-html {
- color: black !important;
-}
-
-li>a .uk-button {
+/* On link hover, his items with this class will be displayed*/
+li>a .onHover {
display: none;
}
-li>a:hover .uk-button {
+li>a:hover .onHover {
display: block;
}
+/*---*/
+
+
+/* Custom width of sidebar, change var: sidebar-width*/
+#sidebar_main {
+ width: var(--sidebar-width) !important;
+ -webkit-transform: translate3d(calc(-1 * var(--sidebar-width)),0,0) !important;
+ transform: translate3d(calc(-1 * var(--sidebar-width)),0,0) !important;
+}
+
+.sidebar_main_active #sidebar_main {
+ -webkit-transform: translate3d(0,0,0) !important;
+ transform: translate3d(0,0,0) !important;
+}
+
+@media only screen and (min-width: 1220px) {
+ .sidebar_main_active #header_main, .sidebar_main_active #page_content, .sidebar_main_active #top_bar {
+ margin-left: var(--sidebar-width) !important;
+ }
+}
+/* Custom width of sidebar, change var: sidebar-width*/
+body {
+ padding-top: var(--header-height) !important;
+}
+
+#header_main {
+ padding: calc((var(--header-height) - 48px)/2) 25px !important;
+}
+/*---*/