Revision 57555
Added by Konstantinos Triantafyllou over 4 years ago
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/services/stakeholder.service.ts | ||
---|---|---|
15 | 15 |
} |
16 | 16 |
|
17 | 17 |
getStakeholder(url: string, alias:string): Observable<Stakeholder> { |
18 |
// return new BehaviorSubject<Stakeholder>(Stakeholder.createECStakeholder()).asObservable(); |
|
18 | 19 |
return this.http.get<Stakeholder>(url + '/stakeholder/' + alias); |
19 | 20 |
} |
20 | 21 |
|
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/app.component.html | ||
---|---|---|
1 | 1 |
<!--disable_transitions --> |
2 | 2 |
<div class="sidebar_main_swipe" [class.sidebar_main_active]="open && hasSidebar"> |
3 |
<div id="header_main" [class.header_full]="!hasSidebar">
|
|
3 |
<div id="header_main"[class.header_full]="!hasSidebar"> |
|
4 | 4 |
<nav class="uk-light"> |
5 | 5 |
<a *ngIf="hasSidebar" id="sidebar_main_toggle" (click)="toggleOpen()" class="sSwitch sSwitch_left"> |
6 | 6 |
<span class="sSwitchIcon"></span> |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/home/home.component.html | ||
---|---|---|
37 | 37 |
<div class="md-card"> |
38 | 38 |
<div class="md-card-content uk-position-relative"> |
39 | 39 |
<a [routerLink]="" class="uk-position-top-right"> |
40 |
<i (click)="close(newTopic)" class="material-icons">close</i>
|
|
40 |
<i (click)="hide(newTopic)" class="material-icons">close</i>
|
|
41 | 41 |
</a> |
42 | 42 |
<div class="uk-grid-small" uk-grid> |
43 | 43 |
<div class="uk-width-1-1"> |
... | ... | |
61 | 61 |
<hr> |
62 | 62 |
<div class="uk-grid-small uk-child-width-1-2" uk-grid> |
63 | 63 |
<div> |
64 |
<button class="md-btn md-btn-small" (click)="close(newTopic)">Cancel</button>
|
|
64 |
<button class="md-btn md-btn-small" (click)="hide(newTopic)">Cancel</button>
|
|
65 | 65 |
</div> |
66 | 66 |
<div> |
67 | 67 |
<button class="md-btn md-btn-small md-btn-primary uk-float-right" (click)="createTopic(newTopic)">Create</button> |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/home/home.component.ts | ||
---|---|---|
61 | 61 |
this.valid = true; |
62 | 62 |
} |
63 | 63 |
|
64 |
public close(element) {
|
|
64 |
public hide(element) {
|
|
65 | 65 |
UIkit.drop(element).hide(); |
66 | 66 |
} |
67 | 67 |
|
... | ... | |
81 | 81 |
if(this.topic.name && this.topic.name !== '') { |
82 | 82 |
this.topic.alias = this.topic.name.toLowerCase(); |
83 | 83 |
this.stakeholder.topics.push(this.topic); |
84 |
this.close(element);
|
|
84 |
this.hide(element);
|
|
85 | 85 |
} else { |
86 | 86 |
this.valid = false; |
87 | 87 |
} |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/utils/entities/stakeholder.ts | ||
---|---|---|
94 | 94 |
|
95 | 95 |
//Numbers |
96 | 96 |
|
97 |
let n_total_pubs = new Indicator("Publications",null, "number","small",true, true, [new IndicatorPath(null, "statistics","/funders/"+stakeholder.id, null, ["statistics","publications"])]);
|
|
98 |
let n_open_pubs = new Indicator("OA Publications",null, "number","small",true, true, [new IndicatorPath(null, "statistics","/funders/"+stakeholder.id, null,["statistics","open_access"])]);
|
|
97 |
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"])]);
|
|
98 |
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"])]);
|
|
99 | 99 |
let n_total_projects = new Indicator("Projects",null, "number","small",true, true, [new IndicatorPath(null, "statistics","/funders/"+stakeholder.id, null, ["statistics","total_projects"])]); |
100 | 100 |
let n_total_data = new Indicator("Reserach data",null, "number","small",true, true, [new IndicatorPath(null, "search", |
101 | 101 |
"/datasets/count?fq="+(encodeURIComponent("relfunderid exact "+stakeholder.index_id))+"&format=json", null, ["total"])]); |
... | ... | |
121 | 121 |
|
122 | 122 |
//Charts |
123 | 123 |
|
124 |
let c_pubs_per_project = new Indicator("Which are the top "+stakeholder.index_shortName+" projects?",null, "chart","large",true, true, [
|
|
124 |
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, [
|
|
125 | 125 |
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 )]); |
126 | 126 |
c_pubs_per_project.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name,"Publications per project (top 30)","bar"); |
127 | 127 |
pubDefSub.charts.push(c_pubs_per_project); |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/utils/Tools.ts | ||
---|---|---|
1 |
export class IndicatorUtils { |
|
2 |
|
|
3 |
chartTypes: Map<string, string> = new Map([ |
|
4 |
['pie', 'pie_chart'], |
|
5 |
['table', 'table_chart'], |
|
6 |
['line', 'show_chart'], |
|
7 |
['column', 'bar_chart'], |
|
8 |
['bar', 'bar_chart'], |
|
9 |
['image', 'perm_media'] |
|
10 |
]); |
|
11 |
|
|
12 |
isPublicIcon: Map<boolean, string> = new Map([ |
|
13 |
[true, 'public'], |
|
14 |
[false, 'lock'] |
|
15 |
]); |
|
16 |
|
|
17 |
isActiveIcon: string = 'brightness_1'; |
|
18 |
} |
|
19 |
|
|
1 | 20 |
export class Tools { |
2 | 21 |
|
3 | 22 |
public static copy(element: any): any { |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/library/sharedComponents/loading/loading.component.ts | ||
---|---|---|
1 |
import {Component, Input} from "@angular/core"; |
|
2 |
|
|
3 |
@Component({ |
|
4 |
selector: 'loading', |
|
5 |
template: ` |
|
6 |
<div *ngIf="loading" class="uk-flex uk-flex-center uk-margin-small-top"> |
|
7 |
<div class="md-preloader" [ngClass]="'md-preloader-' + color"> |
|
8 |
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="48" width="48" viewBox="0 0 75 75"> |
|
9 |
<circle cx="37.5" cy="37.5" r="33.5" stroke-width="4"></circle> |
|
10 |
</svg> |
|
11 |
</div> |
|
12 |
</div>` |
|
13 |
}) |
|
14 |
export class LoadingComponent { |
|
15 |
@Input() |
|
16 |
public loading: boolean = false; |
|
17 |
|
|
18 |
/** |
|
19 |
* Possible values '': blue, 'success': green, 'warning': orange and 'danger': red |
|
20 |
*/ |
|
21 |
@Input() color: string = ''; |
|
22 |
|
|
23 |
constructor() { |
|
24 |
} |
|
25 |
} |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/library/sharedComponents/loading/loading.module.ts | ||
---|---|---|
1 |
import {NgModule} from '@angular/core'; |
|
2 |
import {CommonModule} from '@angular/common'; |
|
3 |
import {LoadingComponent} from "./loading.component"; |
|
4 |
|
|
5 |
@NgModule({ |
|
6 |
imports: [ |
|
7 |
CommonModule, |
|
8 |
], |
|
9 |
declarations: [ |
|
10 |
LoadingComponent |
|
11 |
], |
|
12 |
providers: [], |
|
13 |
exports: [ |
|
14 |
LoadingComponent |
|
15 |
] |
|
16 |
}) |
|
17 |
export class LoadingModule { |
|
18 |
} |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/login/user.component.ts | ||
---|---|---|
38 | 38 |
|
39 | 39 |
</div> |
40 | 40 |
</div> |
41 |
<!--<subscribe [communityId]="communityId" [showTemplate]= false class="" (subscribeEvent)="afterSubscibeEvent($event)">--></subscribe>
|
|
41 |
<subscribe [communityId]="communityId" [showTemplate]= false class="" (subscribeEvent)="afterSubscibeEvent($event)"></subscribe>
|
|
42 | 42 |
` |
43 | 43 |
}) |
44 | 44 |
|
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/login/libUser.module.ts | ||
---|---|---|
9 | 9 |
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
10 | 10 |
import { SubscribeService } from '../openaireLibrary/utils/subscribe/subscribe.service'; |
11 | 11 |
import {EmailService} from "../openaireLibrary/utils/email/email.service"; |
12 |
import {SubscribeModule} from "../utils/subscribe/subscribe.module"; |
|
12 | 13 |
|
13 | 14 |
@NgModule({ |
14 | 15 |
imports: [ |
15 | 16 |
CommonModule, FormsModule, |
16 |
UserRoutingModule, UserModule |
|
17 |
UserRoutingModule, UserModule, SubscribeModule
|
|
17 | 18 |
], |
18 | 19 |
providers:[PreviousRouteRecorder, SubscribeService, EmailService], |
19 | 20 |
declarations: [ |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/topic/topic.component.html | ||
---|---|---|
9 | 9 |
<div *ngIf="stakeholder" class="menu_section"> |
10 | 10 |
<ul> |
11 | 11 |
<li class="uk-margin-bottom md-bg-blue-700 uk-padding-small"> |
12 |
<a class="md-color-white" (click)="back()"> |
|
12 |
<a class="md-color-white uk-flex uk-flex-middle" (click)="back()">
|
|
13 | 13 |
<span class="menu_icon"><i class="material-icons md-color-white">arrow_back</i></span> |
14 | 14 |
<div class="menu_title uk-inline"> |
15 | 15 |
{{stakeholder.topics[topicIndex].name.toUpperCase()}} |
16 |
<button class="uk-position-center-right-out uk-margin-right uk-button uk-button-link" |
|
16 |
<button class="uk-position-center-right-out uk-margin-right uk-button uk-button-link onHover"
|
|
17 | 17 |
(click)="$event.stopPropagation();editTopicOpen(editTopic)"> |
18 | 18 |
<i class="material-icons md-color-white">more_horiz</i> |
19 | 19 |
</button> |
... | ... | |
64 | 64 |
</li> |
65 | 65 |
<ng-template ngFor [ngForOf]="stakeholder.topics[topicIndex].categories" let-category let-i="index"> |
66 | 66 |
<li [class.current_section]="categoryIndex === i" |
67 |
[class.act_section]="categoryIndex === i && toggle"
|
|
67 |
[class.act_section]="selectedCategoryIndex === i && toggle"
|
|
68 | 68 |
[title]="category.name" |
69 | 69 |
class="submenu_trigger"> |
70 | 70 |
<a (click)="toggleCategory(i);hide(editCategory)"> |
... | ... | |
72 | 72 |
class="material-icons">{{category.icon}}</i></span> |
73 | 73 |
<div class="menu_title uk-inline"> |
74 | 74 |
{{category.name}} |
75 |
<button class="uk-position-center-right-out uk-margin-right uk-button uk-button-link" |
|
75 |
<button class="uk-position-center-right-out uk-margin-right uk-button uk-button-link onHover"
|
|
76 | 76 |
(click)="$event.stopPropagation();editCategoryOpen(i, editCategory)"> |
77 | 77 |
<i class="material-icons">more_horiz</i> |
78 | 78 |
</button> |
... | ... | |
120 | 120 |
</div> |
121 | 121 |
</div> |
122 | 122 |
</div> |
123 |
<ul [style.display]="((categoryIndex === i && toggle)?'block':'none')">
|
|
123 |
<ul [style.display]="((selectedCategoryIndex === i && toggle)?'block':'none')">
|
|
124 | 124 |
<ng-template ngFor [ngForOf]="stakeholder.topics[topicIndex].categories[i].subCategories" |
125 | 125 |
let-subcategory let-j="index"> |
126 |
<li> |
|
127 |
<a (click)="editSubCategoryOpen(j, editSubCategory)">
|
|
126 |
<li [class.act_item]="categoryIndex === i && subCategoryIndex === j">
|
|
127 |
<a (click)="chooseSubcategory(i, j)">
|
|
128 | 128 |
<span *ngIf="subcategory.icon" class="menu_icon uk-margin-small-right"><i |
129 | 129 |
class="material-icons">{{subcategory.icon}}</i></span> |
130 | 130 |
<div class="menu_title uk-inline"> |
131 | 131 |
{{subcategory.name}} |
132 |
<button class="uk-position-center-right-out uk-margin-right uk-button uk-button-link" |
|
132 |
<button class="uk-position-center-right-out uk-margin-right uk-button uk-button-link onHover"
|
|
133 | 133 |
(click)="$event.stopPropagation();editSubCategoryOpen(j, editSubCategory)"> |
134 | 134 |
<i class="material-icons">more_horiz</i> |
135 | 135 |
</button> |
136 | 136 |
</div> |
137 | 137 |
</a> |
138 |
<div uk-drop="mode: click; offset: -2; delay-hide: 0" #editSubCategory
|
|
138 |
<div uk-drop="mode: none; offset: -2; delay-hide: 0" #editSubCategory
|
|
139 | 139 |
class="uk-padding-large uk-padding-remove-vertical uk-padding-remove-right uk-drop"> |
140 | 140 |
<div *ngIf="copySubCategory"> |
141 | 141 |
<div class="md-card"> |
... | ... | |
280 | 280 |
</li> |
281 | 281 |
</ul> |
282 | 282 |
</div> |
283 |
<hr class="uk-hr"> |
|
284 |
<div class="uk-padding-small uk-padding-remove-vertical"> |
|
285 |
<button [class.md-btn-primary]="unsaved" [class.disabled]="!unsaved" |
|
286 |
class="md-btn md-btn-small uk-float-right">Save</button> |
|
287 |
</div> |
|
288 | 283 |
</aside> |
289 |
<div id="page_content" click-outside-or-esc targetId="page_content" (clickOutside)="toggleOpen($event)"> |
|
290 |
<div class="uk-padding-small md-bg-white" uk-grid> |
|
291 |
<div class="uk-width-2-3@m uk-width-1-1 uk-child-width-1-3@m uk-child-width-1-1" uk-grid> |
|
292 |
<div class="uk-flex uk-flex-middle"> |
|
293 |
<label>Chart Type:</label> |
|
294 |
<select class="uk-select uk-form-small uk-margin-small-left" [(ngModel)]="chartType"> |
|
295 |
<option [value]="null">all</option> |
|
296 |
<option [value]="'pie'">Pie</option> |
|
297 |
<option [value]="'table'">Table</option> |
|
298 |
<option [value]="'line'">Line</option> |
|
299 |
<option [value]="'column'">Column</option> |
|
300 |
<option [value]="'bar'">Bar</option> |
|
301 |
</select> |
|
302 |
</div> |
|
303 |
<div class="uk-flex uk-flex-middle"> |
|
304 |
<label>Privacy:</label> |
|
305 |
<select class="uk-select uk-form-small uk-margin-small-left" [(ngModel)]="isPublic"> |
|
306 |
<option [value]="null">all</option> |
|
307 |
<option [value]="true">Public</option> |
|
308 |
<option [value]="false">Private</option> |
|
309 |
</select> |
|
310 |
</div> |
|
311 |
<div class="uk-flex uk-flex-middle"> |
|
312 |
<label>Status:</label> |
|
313 |
<select class="uk-select uk-form-small uk-margin-small-left" [(ngModel)]="isActive"> |
|
314 |
<option [value]="null">all</option> |
|
315 |
<option [value]="true">Active</option> |
|
316 |
<option [value]="false">Inactive</option> |
|
317 |
</select> |
|
318 |
</div> |
|
319 |
</div> |
|
320 |
<div class="uk-width-expand uk-flex uk-flex-middle uk-flex-right"> |
|
321 |
<div class="uk-inline"> |
|
322 |
<span class="uk-form-icon uk-form-icon-flip"><i class="material-icons">search</i></span> |
|
323 |
<input class="uk-input uk-form-small" placeholder="Locate indicator.."> |
|
324 |
</div> |
|
325 |
<div [class.uk-active]="grid" class="uk-margin-small-left"> |
|
326 |
<a [routerLink]="" class="uk-icon-button" (click)="changeGrid(true)"><i class="material-icons">view_module</i></a> |
|
327 |
</div> |
|
328 |
<div [class.uk-active]="!grid" class="uk-margin-small-left"> |
|
329 |
<a [routerLink]="" class="uk-icon-button" (click)="changeGrid(false)"><i class="material-icons">list</i></a> |
|
330 |
</div> |
|
331 |
</div> |
|
332 |
</div> |
|
333 |
<div id="page_content_inner"> |
|
334 |
</div> |
|
335 |
</div> |
|
284 |
<indicators [stakeholder]="stakeholder" |
|
285 |
[topicIndex]="topicIndex" |
|
286 |
[categoryIndex]="categoryIndex" |
|
287 |
[subcategoryIndex]="subCategoryIndex"></indicators> |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/topic/indicators.component.html | ||
---|---|---|
1 |
<div id="page_content" click-outside-or-esc targetId="page_content" (clickOutside)="toggleOpen($event)"> |
|
2 |
<div class="uk-padding-small md-bg-white" uk-grid> |
|
3 |
<div class="uk-width-2-3@m uk-width-1-1 uk-child-width-1-3@m uk-child-width-1-1" uk-grid> |
|
4 |
<div class="uk-flex uk-flex-middle"> |
|
5 |
<label>Chart Type:</label> |
|
6 |
<select class="uk-select uk-form-small uk-margin-small-left" |
|
7 |
(ngModelChange)="onChartTypeChange($event)" |
|
8 |
[(ngModel)]="chartType"> |
|
9 |
<option [value]="'all'">All</option> |
|
10 |
<option [value]="'pie'">Pie</option> |
|
11 |
<option [value]="'table'">Table</option> |
|
12 |
<option [value]="'line'">Line</option> |
|
13 |
<option [value]="'column'">Column</option> |
|
14 |
<option [value]="'bar'">Bar</option> |
|
15 |
</select> |
|
16 |
</div> |
|
17 |
<div class="uk-flex uk-flex-middle"> |
|
18 |
<label>Privacy:</label> |
|
19 |
<select class="uk-select uk-form-small uk-margin-small-left" |
|
20 |
(ngModelChange)="onPrivacyChange($event)" |
|
21 |
[(ngModel)]="isPublic"> |
|
22 |
<option [value]="'all'">All</option> |
|
23 |
<option [value]="'public'">Public</option> |
|
24 |
<option [value]="'private'">Private</option> |
|
25 |
</select> |
|
26 |
</div> |
|
27 |
<div class="uk-flex uk-flex-middle"> |
|
28 |
<label>Status:</label> |
|
29 |
<select class="uk-select uk-form-small uk-margin-small-left" |
|
30 |
(ngModelChange)="onStatusChange($event)" |
|
31 |
[(ngModel)]="isActive"> |
|
32 |
<option [value]="'all'">All</option> |
|
33 |
<option [value]="'active'">Active</option> |
|
34 |
<option [value]="'inactive'">Inactive</option> |
|
35 |
</select> |
|
36 |
</div> |
|
37 |
</div> |
|
38 |
<div class="uk-width-expand@m uk-width-1-1 uk-flex uk-flex-middle uk-flex-right"> |
|
39 |
<div class="uk-inline"> |
|
40 |
<span class="uk-form-icon uk-form-icon-flip"><i class="material-icons">search</i></span> |
|
41 |
<input (ngModelChange)="onKeywordChange($event)" |
|
42 |
[(ngModel)]="keyword" |
|
43 |
class="uk-input uk-form-small" placeholder="Locate indicator.."> |
|
44 |
</div> |
|
45 |
<div [class.uk-active]="grid" class="uk-margin-small-left"> |
|
46 |
<a [routerLink]="" class="uk-icon-button" (click)="changeGrid(true)"><i |
|
47 |
class="material-icons">view_module</i></a> |
|
48 |
</div> |
|
49 |
<div [class.uk-active]="!grid" class="uk-margin-small-left"> |
|
50 |
<a [routerLink]="" class="uk-icon-button" (click)="changeGrid(false)"><i class="material-icons">list</i></a> |
|
51 |
</div> |
|
52 |
</div> |
|
53 |
</div> |
|
54 |
<div *ngIf="stakeholder" id="page_content_inner"> |
|
55 |
<div class="uk-child-width-1-2 uk-flex-middle" uk-grid> |
|
56 |
<div> |
|
57 |
<ul class="uk-breadcrumb"> |
|
58 |
<li class="uk-disabled">{{stakeholder.topics[topicIndex].name}}</li> |
|
59 |
<li>{{stakeholder.topics[topicIndex].categories[categoryIndex].name}}</li> |
|
60 |
<li>{{stakeholder.topics[topicIndex].categories[categoryIndex].subCategories[subcategoryIndex].name}}</li> |
|
61 |
</ul> |
|
62 |
</div> |
|
63 |
<div class="uk-flex uk-flex-right"> |
|
64 |
<button class="md-btn md-btn-primary">Preview</button> |
|
65 |
</div> |
|
66 |
</div> |
|
67 |
<h6 class="uk-text-bold">Number Indicators</h6> |
|
68 |
<div [class.uk-child-width-1-3@m]="grid" |
|
69 |
[class.uk-child-width-1-2@s]="grid" |
|
70 |
[class.uk-child-width-1-1]="!grid" |
|
71 |
uk-height-match="target: .md-card" |
|
72 |
uk-grid> |
|
73 |
<ng-template ngFor [ngForOf]="displayNumbers" let-indicator let-i="index"> |
|
74 |
<div> |
|
75 |
<div class="md-card"> |
|
76 |
<div class="md-card-toolbar"> |
|
77 |
<div class="md-card-toolbar-actions" [class.uk-flex-middle]="!grid" [class.uk-flex]="!grid"> |
|
78 |
<span *ngIf="!grid" class="uk-margin-medium-right uk-flex uk-flex-middle"> |
|
79 |
<i |
|
80 |
class="material-icons md-24 uk-margin-small-right">{{indicatorUtils.isPublicIcon.get(indicator.isPublic)}}</i> |
|
81 |
{{(indicator.isPublic) ? 'Public' : 'Private'}} |
|
82 |
</span> |
|
83 |
<span *ngIf="!grid" class="uk-margin-medium-right uk-flex uk-flex-middle"> |
|
84 |
<i class="material-icons md-24 uk-margin-small-right" |
|
85 |
[class.md-color-green-300]="indicator.isActive">{{indicatorUtils.isActiveIcon}}</i> |
|
86 |
{{(indicator.isActive) ? 'Active' : 'Inactive'}} |
|
87 |
</span> |
|
88 |
<i class="md-icon material-icons">more_vert</i> |
|
89 |
</div> |
|
90 |
<h3 class="md-card-toolbar-heading-text">{{indicator.name}}</h3> |
|
91 |
</div> |
|
92 |
<div *ngIf="grid" class="md-card-content"> |
|
93 |
<div class="uk-flex uk-flex-center" uk-grid> |
|
94 |
<div class="uk-width-1-1"> |
|
95 |
{{indicator.description}} |
|
96 |
</div> |
|
97 |
<div class="uk-width-1-2 uk-text-center"> |
|
98 |
<i class="material-icons md-24">{{indicatorUtils.isPublicIcon.get(indicator.isPublic)}}</i> |
|
99 |
<div>{{(indicator.isPublic) ? 'Public' : 'Private'}}</div> |
|
100 |
</div> |
|
101 |
<div class="uk-width-1-2 uk-text-center"> |
|
102 |
<i class="material-icons md-24" |
|
103 |
[class.md-color-green-300]="indicator.isActive">{{indicatorUtils.isActiveIcon}}</i> |
|
104 |
<div>{{(indicator.isActive) ? 'Active' : 'Inactive'}}</div> |
|
105 |
</div> |
|
106 |
</div> |
|
107 |
</div> |
|
108 |
</div> |
|
109 |
</div> |
|
110 |
</ng-template> |
|
111 |
</div> |
|
112 |
<h6 class="uk-text-bold">Chart Indicators</h6> |
|
113 |
<div [class.uk-child-width-1-3@m]="grid" |
|
114 |
[class.uk-child-width-1-2@s]="grid" |
|
115 |
[class.uk-child-width-1-1]="!grid" |
|
116 |
uk-height-match="target: .md-card" |
|
117 |
uk-grid> |
|
118 |
<ng-template ngFor [ngForOf]="displayCharts" let-indicator let-i="index"> |
|
119 |
<div> |
|
120 |
<div class="md-card"> |
|
121 |
<div class="md-card-toolbar"> |
|
122 |
<div class="md-card-toolbar-actions" [class.uk-flex-middle]="!grid" [class.uk-flex]="!grid"> |
|
123 |
<ng-template [ngIf]="!grid"> |
|
124 |
<span *ngFor="let indicatorPath of indicator.indicatorPaths" |
|
125 |
class="uk-margin-medium-right uk-text-capitalize uk-flex uk-flex-middle"> |
|
126 |
<i |
|
127 |
class="material-icons md-24 uk-margin-small-right">{{indicatorUtils.chartTypes.get(indicatorPath.type)}}</i> |
|
128 |
{{indicatorPath.type + ' Chart'}} |
|
129 |
</span> |
|
130 |
</ng-template> |
|
131 |
<span *ngIf="!grid" class="uk-margin-medium-right uk-flex uk-flex-middle"> |
|
132 |
<i |
|
133 |
class="material-icons md-24 uk-margin-small-right">{{indicatorUtils.isPublicIcon.get(indicator.isPublic)}}</i> |
|
134 |
{{(indicator.isPublic) ? 'Public' : 'Private'}} |
|
135 |
</span> |
|
136 |
<span *ngIf="!grid" class="uk-margin-medium-right uk-flex uk-flex-middle"> |
|
137 |
<i class="material-icons md-24 uk-margin-small-right" |
|
138 |
[class.md-color-green-300]="indicator.isActive">{{indicatorUtils.isActiveIcon}}</i> |
|
139 |
{{(indicator.isActive) ? 'Active' : 'Inactive'}} |
|
140 |
</span> |
|
141 |
<i class="md-icon material-icons">more_vert</i> |
|
142 |
</div> |
|
143 |
<h3 class="md-card-toolbar-heading-text">{{indicator.name}}</h3> |
|
144 |
</div> |
|
145 |
<div *ngIf="grid" class="md-card-content"> |
|
146 |
<div class="uk-flex uk-flex-center" uk-grid> |
|
147 |
<div class="uk-width-1-1"> |
|
148 |
{{indicator.description}} |
|
149 |
</div> |
|
150 |
<div class="uk-width-1-3 uk-text-center" |
|
151 |
[ngClass]="'uk-child-width-1-' + indicator.indicatorPaths.length" uk-grid> |
|
152 |
<div *ngFor="let indicatorPath of indicator.indicatorPaths"> |
|
153 |
<i class="material-icons md-24">{{indicatorUtils.chartTypes.get(indicatorPath.type)}}</i> |
|
154 |
<div class="uk-text-capitalize">{{indicatorPath.type + ' Chart'}}</div> |
|
155 |
</div> |
|
156 |
</div> |
|
157 |
<div class="uk-width-1-3 uk-text-center"> |
|
158 |
<i class="material-icons md-24">{{indicatorUtils.isPublicIcon.get(indicator.isPublic)}}</i> |
|
159 |
<div>{{(indicator.isPublic) ? 'Public' : 'Private'}}</div> |
|
160 |
</div> |
|
161 |
<div class="uk-width-1-3 uk-text-center"> |
|
162 |
<i class="material-icons md-24" |
|
163 |
[class.md-color-green-300]="indicator.isActive">{{indicatorUtils.isActiveIcon}}</i> |
|
164 |
<div>{{(indicator.isActive) ? 'Active' : 'Inactive'}}</div> |
|
165 |
</div> |
|
166 |
</div> |
|
167 |
</div> |
|
168 |
</div> |
|
169 |
</div> |
|
170 |
</ng-template> |
|
171 |
</div> |
|
172 |
</div> |
|
173 |
</div> |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/topic/topic.component.ts | ||
---|---|---|
2 | 2 |
import {ActivatedRoute, Router} from '@angular/router'; |
3 | 3 |
import {Title} from '@angular/platform-browser'; |
4 | 4 |
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; |
5 |
|
|
6 |
import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes'; |
|
7 |
import {ErrorMessagesComponent} from '../openaireLibrary/utils/errorMessages.component'; |
|
8 | 5 |
import {Category, Stakeholder, SubCategory, Topic} from "../utils/entities/stakeholder"; |
9 | 6 |
import {SideBarService} from "../library/sharedComponents/sidebar/sideBar.service"; |
10 | 7 |
import {StakeholderService} from "../services/stakeholder.service"; |
... | ... | |
17 | 14 |
templateUrl: './topic.component.html', |
18 | 15 |
}) |
19 | 16 |
export class TopicComponent implements OnInit, OnDestroy { |
20 |
public status: number;
|
|
17 |
public properties: EnvProperties;
|
|
21 | 18 |
public loading: boolean = true; |
22 |
public errorCodes: ErrorCodes; |
|
23 | 19 |
public stakeholder: Stakeholder; |
24 |
private errorMessages: ErrorMessagesComponent; |
|
25 | 20 |
public topicIndex: number = -1; |
26 | 21 |
public topic: Topic = null; |
27 | 22 |
public categoryIndex: number = -1; |
23 |
public selectedCategoryIndex: number = -1; |
|
28 | 24 |
public copyCategory: Category = null; |
29 | 25 |
public subCategoryIndex: number = -1; |
30 | 26 |
public copySubCategory: SubCategory = null; |
31 | 27 |
public valid = true; |
32 | 28 |
public edit: boolean = false; |
33 | 29 |
public toggle: boolean = false; |
34 |
public unsaved: boolean = false; |
|
35 |
public properties: EnvProperties; |
|
36 |
public chartType: string = null; |
|
37 |
public isPublic: boolean = null; |
|
38 |
public isActive: boolean = null; |
|
39 |
grid: boolean = true; |
|
40 | 30 |
|
41 | 31 |
constructor( |
42 | 32 |
private route: ActivatedRoute, |
... | ... | |
44 | 34 |
private title: Title, |
45 | 35 |
private sideBarService: SideBarService, |
46 | 36 |
private stakeholderService: StakeholderService) { |
47 |
this.errorCodes = new ErrorCodes(); |
|
48 |
this.errorMessages = new ErrorMessagesComponent(); |
|
49 |
this.status = this.errorCodes.LOADING; |
|
50 | 37 |
} |
51 | 38 |
|
52 | 39 |
public ngOnInit() { |
... | ... | |
63 | 50 |
this.navigateToError(); |
64 | 51 |
} else { |
65 | 52 |
this.title.setTitle(stakeholder.index_name); |
53 |
this.categoryIndex = 0; |
|
54 |
this.selectedCategoryIndex = 0; |
|
55 |
this.subCategoryIndex = 0; |
|
56 |
this.toggle = true; |
|
66 | 57 |
} |
67 | 58 |
} |
68 | 59 |
}); |
... | ... | |
83 | 74 |
UIkit.drop(element).show(); |
84 | 75 |
} |
85 | 76 |
|
86 |
get open(): boolean { |
|
87 |
return this.sideBarService.open; |
|
88 |
} |
|
89 |
|
|
90 |
public toggleOpen(event = null) { |
|
91 |
if (!event) { |
|
92 |
this.sideBarService.setOpen(!this.open); |
|
93 |
} else if (event && event['value'] === true) { |
|
94 |
this.sideBarService.setOpen(false); |
|
95 |
} |
|
96 |
} |
|
97 |
|
|
98 | 77 |
public toggleCategory(index: number) { |
99 |
if(this.categoryIndex !== index) {
|
|
100 |
this.categoryIndex = index;
|
|
78 |
if(this.selectedCategoryIndex !== index) {
|
|
79 |
this.selectedCategoryIndex = index;
|
|
101 | 80 |
this.toggle = true; |
102 | 81 |
} else { |
103 | 82 |
this.toggle = !this.toggle; |
... | ... | |
127 | 106 |
this.stakeholder.topics[this.topicIndex].categories[index] = Tools.copy(this.copyCategory); |
128 | 107 |
} |
129 | 108 |
this.hide(element); |
130 |
this.unsaved = true; |
|
131 | 109 |
} else { |
132 | 110 |
this.valid = false; |
133 | 111 |
} |
134 | 112 |
} |
135 | 113 |
|
136 |
public editTopicOpen(element) { |
|
137 |
if(element.className.indexOf('uk-open') !== -1) { |
|
138 |
this.hide(element); |
|
139 |
} else { |
|
140 |
this.topic = Tools.copy(this.stakeholder.topics[this.topicIndex]); |
|
141 |
this.valid = true; |
|
142 |
this.show(element); |
|
143 |
} |
|
144 |
} |
|
145 |
|
|
146 | 114 |
public editSubCategoryOpen(index:number = -1, element = null) { |
147 | 115 |
if(index === -1) { |
148 | 116 |
this.copySubCategory = new SubCategory(null, null, null, true, true); |
... | ... | |
162 | 130 |
if(this.copySubCategory.name && this.copySubCategory.name !== '') { |
163 | 131 |
this.copySubCategory.alias = this.copySubCategory.name.toLowerCase(); |
164 | 132 |
if(index === -1) { |
165 |
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].
|
|
133 |
this.stakeholder.topics[this.topicIndex].categories[this.selectedCategoryIndex].
|
|
166 | 134 |
subCategories.push(this.copySubCategory); |
167 | 135 |
} else { |
168 |
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].
|
|
136 |
this.stakeholder.topics[this.topicIndex].categories[this.selectedCategoryIndex].
|
|
169 | 137 |
subCategories[index] = Tools.copy(this.copySubCategory); |
170 | 138 |
} |
171 | 139 |
this.hide(element); |
172 |
this.unsaved = true; |
|
173 | 140 |
} else { |
174 | 141 |
this.valid = false; |
175 | 142 |
} |
176 | 143 |
} |
177 | 144 |
|
145 |
public editTopicOpen(element) { |
|
146 |
if(element.className.indexOf('uk-open') !== -1) { |
|
147 |
this.hide(element); |
|
148 |
} else { |
|
149 |
this.topic = Tools.copy(this.stakeholder.topics[this.topicIndex]); |
|
150 |
this.valid = true; |
|
151 |
this.show(element); |
|
152 |
} |
|
153 |
} |
|
154 |
|
|
178 | 155 |
public saveTopic(element) { |
179 | 156 |
if(this.topic.name && this.topic.name !== '') { |
180 | 157 |
this.topic.alias = this.topic.name.toLowerCase(); |
181 | 158 |
this.stakeholder.topics[this.topicIndex] = Tools.copy(this.topic); |
182 | 159 |
this.hide(element); |
183 |
this.unsaved = true; |
|
184 | 160 |
} else { |
185 | 161 |
this.valid = false; |
186 | 162 |
} |
... | ... | |
192 | 168 |
this.back();*/ |
193 | 169 |
} |
194 | 170 |
|
195 |
public changeGrid(value) { |
|
196 |
this.grid = value; |
|
197 |
} |
|
198 |
|
|
199 | 171 |
private navigateToError() { |
200 | 172 |
this.router.navigate(['/error'], {queryParams: {'page': this.router.url}}); |
201 | 173 |
} |
202 | 174 |
|
175 |
public getDefaultSubcategoryIndex(categoryIndex: number) { |
|
176 |
return this.stakeholder.topics[this.topicIndex].categories[categoryIndex]. |
|
177 |
subCategories.findIndex(subcategory => subcategory.alias === null); |
|
178 |
} |
|
179 |
|
|
203 | 180 |
back() { |
204 | 181 |
this.router.navigate(['../'], { |
205 | 182 |
relativeTo: this.route |
206 | 183 |
}); |
207 | 184 |
} |
185 |
|
|
186 |
chooseSubcategory(categoryIndex: number, subcategoryIndex: number) { |
|
187 |
/*let topic: Topic = this.stakeholder.topics[this.topicIndex]; |
|
188 |
let category: Category = topic.categories[this.categoryIndex]; |
|
189 |
let subCatetegory: SubCategory = category.subCategories[index];*/ |
|
190 |
this.categoryIndex = categoryIndex; |
|
191 |
this.subCategoryIndex = subcategoryIndex; |
|
192 |
} |
|
208 | 193 |
} |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/topic/indicators.component.ts | ||
---|---|---|
1 |
import {Component, Input, OnChanges, OnInit, SimpleChanges} from "@angular/core"; |
|
2 |
import {SideBarService} from "../library/sharedComponents/sidebar/sideBar.service"; |
|
3 |
import {Indicator, Stakeholder} from "../utils/entities/stakeholder"; |
|
4 |
import {IndicatorUtils} from "../utils/Tools"; |
|
5 |
|
|
6 |
@Component({ |
|
7 |
selector: 'indicators', |
|
8 |
templateUrl: './indicators.component.html' |
|
9 |
}) |
|
10 |
export class IndicatorsComponent implements OnInit, OnChanges { |
|
11 |
|
|
12 |
@Input() |
|
13 |
public topicIndex: number = 0; |
|
14 |
@Input() |
|
15 |
public categoryIndex: number = 0; |
|
16 |
@Input() |
|
17 |
public subcategoryIndex: number = 0; |
|
18 |
@Input() |
|
19 |
public stakeholder: Stakeholder = null; |
|
20 |
public indicatorUtils: IndicatorUtils = new IndicatorUtils(); |
|
21 |
public charts: Indicator[] = []; |
|
22 |
public numbers: Indicator[] = []; |
|
23 |
public displayCharts: Indicator[] = []; |
|
24 |
public displayNumbers: Indicator[] = []; |
|
25 |
public chartType: string = 'all'; |
|
26 |
public isPublic: string = 'all'; |
|
27 |
public isActive: string = 'all'; |
|
28 |
public keyword: string = null; |
|
29 |
public grid: boolean = true; |
|
30 |
|
|
31 |
constructor(private sideBarService: SideBarService) {} |
|
32 |
|
|
33 |
ngOnInit(): void { |
|
34 |
} |
|
35 |
|
|
36 |
ngOnChanges(changes: SimpleChanges): void { |
|
37 |
if(this.stakeholder) { |
|
38 |
this.charts = this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]. |
|
39 |
subCategories[this.subcategoryIndex].charts; |
|
40 |
this.displayCharts = this.charts; |
|
41 |
this.numbers = this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]. |
|
42 |
subCategories[this.subcategoryIndex].numbers; |
|
43 |
this.displayNumbers = this.numbers; |
|
44 |
} |
|
45 |
} |
|
46 |
|
|
47 |
onChartTypeChange(value) { |
|
48 |
this.displayCharts = this.filterChartType(this.charts, value); |
|
49 |
} |
|
50 |
|
|
51 |
onPrivacyChange(value) { |
|
52 |
this.displayCharts = this.filterPrivacy(this.charts, value); |
|
53 |
this.displayNumbers = this.filterPrivacy(this.numbers, value); |
|
54 |
} |
|
55 |
|
|
56 |
onStatusChange(value) { |
|
57 |
this.displayCharts = this.filterStatus(this.charts, value); |
|
58 |
this.displayNumbers = this.filterStatus(this.numbers, value); |
|
59 |
} |
|
60 |
|
|
61 |
onKeywordChange(value) { |
|
62 |
this.displayCharts = this.filterByKeyword(this.charts, value); |
|
63 |
this.displayNumbers = this.filterByKeyword(this.numbers, value); |
|
64 |
} |
|
65 |
|
|
66 |
filterChartType(indicators: Indicator[], value): Indicator[] { |
|
67 |
if (value === 'all') { |
|
68 |
return indicators; |
|
69 |
} else { |
|
70 |
return indicators.filter(indicator => |
|
71 |
indicator.indicatorPaths.filter(indicatorPath => indicatorPath.type === value).length > 0); |
|
72 |
} |
|
73 |
} |
|
74 |
|
|
75 |
filterPrivacy(indicators: Indicator[], value): Indicator[] { |
|
76 |
if (value === 'all') { |
|
77 |
return indicators; |
|
78 |
} else { |
|
79 |
return indicators.filter(indicator => indicator.isPublic === (value === 'public')); |
|
80 |
} |
|
81 |
} |
|
82 |
|
|
83 |
filterStatus(indicators: Indicator[], value): Indicator[] { |
|
84 |
if (value === 'all') { |
|
85 |
return indicators; |
|
86 |
} else { |
|
87 |
return indicators.filter(indicator => indicator.isActive === (value === 'active')); |
|
88 |
} |
|
89 |
} |
|
90 |
|
|
91 |
filterByKeyword(indicators: Indicator[], value): Indicator[] { |
|
92 |
if (value === null || value === '') { |
|
93 |
return indicators; |
|
94 |
} else { |
|
95 |
return indicators.filter(indicator => indicator.name.includes(value) || indicator.description.includes(value)); |
|
96 |
} |
|
97 |
} |
|
98 |
|
|
99 |
get open(): boolean { |
|
100 |
return this.sideBarService.open; |
|
101 |
} |
|
102 |
|
|
103 |
public toggleOpen(event = null) { |
|
104 |
if (!event) { |
|
105 |
this.sideBarService.setOpen(!this.open); |
|
106 |
} else if (event && event['value'] === true) { |
|
107 |
this.sideBarService.setOpen(false); |
|
108 |
} |
|
109 |
} |
|
110 |
|
|
111 |
public changeGrid(value) { |
|
112 |
this.grid = value; |
|
113 |
} |
|
114 |
} |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/topic/topic.module.ts | ||
---|---|---|
10 | 10 |
import {ModalModule} from "../openaireLibrary/utils/modal/modal.module"; |
11 | 11 |
import {RouterModule} from "@angular/router"; |
12 | 12 |
import {FormsModule} from "@angular/forms"; |
13 |
import {IndicatorsComponent} from "./indicators.component"; |
|
13 | 14 |
|
14 | 15 |
@NgModule({ |
15 | 16 |
imports: [ |
16 | 17 |
CommonModule, TopicRoutingModule, ModalModule, RouterModule, FormsModule |
17 | 18 |
], |
18 | 19 |
declarations: [ |
19 |
TopicComponent |
|
20 |
TopicComponent, IndicatorsComponent
|
|
20 | 21 |
], |
21 | 22 |
providers: [ |
22 | 23 |
FreeGuard, PreviousRouteRecorder, |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/assets/monitor-custom.css | ||
---|---|---|
16 | 16 |
--monitor-portal-lower-tone: #7c9144; |
17 | 17 |
--connect-portal-lower-tone: #b48536; |
18 | 18 |
--develop-portal-lower-tone: #9f4e7e; |
19 |
} |
|
20 | 19 |
|
21 |
html {
|
|
22 |
color: black !important;
|
|
20 |
--sidebar-width: 300px;
|
|
21 |
--header-height: 60px;
|
|
23 | 22 |
} |
24 | 23 |
|
25 |
li>a .uk-button { |
|
24 |
/* On link hover, his items with this class will be displayed*/ |
|
25 |
li>a .onHover { |
|
26 | 26 |
display: none; |
27 | 27 |
} |
28 | 28 |
|
29 |
li>a:hover .uk-button {
|
|
29 |
li>a:hover .onHover {
|
|
30 | 30 |
display: block; |
31 | 31 |
} |
32 |
/*---*/ |
|
33 |
|
|
34 |
|
|
35 |
/* Custom width of sidebar, change var: sidebar-width*/ |
|
36 |
#sidebar_main { |
|
37 |
width: var(--sidebar-width) !important; |
|
38 |
-webkit-transform: translate3d(calc(-1 * var(--sidebar-width)),0,0) !important; |
|
39 |
transform: translate3d(calc(-1 * var(--sidebar-width)),0,0) !important; |
|
40 |
} |
|
41 |
|
|
42 |
.sidebar_main_active #sidebar_main { |
|
43 |
-webkit-transform: translate3d(0,0,0) !important; |
|
44 |
transform: translate3d(0,0,0) !important; |
|
45 |
} |
|
46 |
|
|
47 |
@media only screen and (min-width: 1220px) { |
|
48 |
.sidebar_main_active #header_main, .sidebar_main_active #page_content, .sidebar_main_active #top_bar { |
|
49 |
margin-left: var(--sidebar-width) !important; |
|
50 |
} |
|
51 |
} |
|
52 |
/* Custom width of sidebar, change var: sidebar-width*/ |
|
53 |
body { |
|
54 |
padding-top: var(--header-height) !important; |
|
55 |
} |
|
56 |
|
|
57 |
#header_main { |
|
58 |
padding: calc((var(--header-height) - 48px)/2) 25px !important; |
|
59 |
} |
|
60 |
/*---*/ |
Also available in: Unified diff
[MonitorDashboard]: Make custom css for sidebar width and header height. Add indicators on page. Remove global save. Add indicator filters