[Monitor Dashboard|Trunk]

Admin:
-add monitor logo in left sidebar
-add stakeholder name and logo on the blue bar
-back button takes you to /admin



Monitor.component.html
-manage buttons takes you to /admin
- private preview to work if admin or curator




git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@58998 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Argiro Kokogiannaki 2020-06-26 10:52:58 +00:00
parent da5dbee3aa
commit 9af3095840
11 changed files with 67 additions and 75 deletions

View File

@ -34,7 +34,7 @@
# rm -rf ../src/assets/common-assets/.svn/; # rm -rf ../src/assets/common-assets/.svn/;
# rm -rf ../src/app/openaireLibrary/.svn/; # rm -rf ../src/app/openaireLibrary/.svn/;
# cd ..; npm run build:ssr; cd deploy; # cd ..; npm run build:ssr; cd deploy;
rm -rf ../src ../node_modules ../.idea/ ../installOpenaireLib.sh; rm -rf ../dist/assets/common-assets/.svn/; cd ../; rm -rf deploy; #rm -rf ../src ../node_modules ../.idea/ ../installOpenaireLib.sh; rm -rf ../dist/assets/common-assets/.svn/; cd ../; rm -rf deploy;
# echo 'Now copy to the server!' # echo 'Now copy to the server!'
##<-- to here ##<-- to here
@ -48,3 +48,6 @@
#portal files exist in "/srv/www/portal/connect" #portal files exist in "/srv/www/portal/connect"
#copy deployment files to the portal folder "cp -r /home/argiro.kokogiannaki/connect-portal/connectYYYY-MM-DD/* /srv/www/portal/connect" #copy deployment files to the portal folder "cp -r /home/argiro.kokogiannaki/connect-portal/connectYYYY-MM-DD/* /srv/www/portal/connect"
#restart portal to get the changes "pm2 restart connect" #restart portal to get the changes "pm2 restart connect"
#rm -rf src node_modules .idea/ installOpenaireLib.sh dist/browser/stats.json dist/browser/assets/common-assets/.svn/ deploy;

View File

@ -8,13 +8,33 @@ hasMiniMenu && hasSidebar" [class.stakeholderPage]="isFrontPage">
[src]="'assets/common-assets/'+(properties.environment =='beta'?'beta_flag.svg':'prototype_flag.svg')" [src]="'assets/common-assets/'+(properties.environment =='beta'?'beta_flag.svg':'prototype_flag.svg')"
[alt]="properties.environment"> [alt]="properties.environment">
<nav class="uk-navbar uk-light"> <nav class="uk-navbar uk-light">
<!--<div *ngIf="!open || !hasSidebar " class="uk-navbar-left uk-margin-small-left"> <!--<div class="uk-navbar-left uk-margin-small-left">
<div class="uk-light uk-margin-small-top"> <div class="uk-light uk-margin-small-top">
<div *ngIf="stakeHolder" class="uk-text-bold uk-h4 uk-margin-remove-bottom" >{{stakeHolder.index_name}}</div> <div *ngIf="stakeHolder" class="uk-text-bold uk-h4 uk-margin-remove-bottom" >{{stakeHolder.name}}</div>
<div class="uk-h5 uk-margin-remove">{{(stakeHolder?'Admin Dashboard':'Monitor Dashboard')}}</div>
</div> </div>
</div>--> </div>-->
<div *ngIf="stakeHolder" class="uk-navbar-left">
<a class="uk-logo uk-navbar-item ng-star-inserted uk-link "
[routerLink]="'/'+stakeHolder.alias"
routerlinkactive="uk-link">
<img *ngIf="stakeHolder.logoUrl" [src]="stakeHolder.logoUrl"
class=" logo uk-responsive-height uk-margin-small-bottom">
</a>
<ul class="uk-navbar-nav user_actions uk-padding uk-padding-remove-vertical uk-padding-remove-right">
<li>
<div class="uk-text-capitalize uk-h4 uk-margin-remove" >
<!--<span class="uk-visible@m">
{{'OpenAIRE Monitor '+(stakeholder.type == 'ri'?'Research Initiative':stakeholder.type)+
' - ' }}</span>-->
<span> {{stakeHolder.name}}</span>
</div>
</li>
</ul>
</div>
<div class="uk-navbar-right"> <div class="uk-navbar-right">
<ul class="uk-navbar-nav user_actions"> <ul class="uk-navbar-nav user_actions">
<li> <li>

View File

@ -2,18 +2,18 @@
<div id="header_main" class=" light_header"> <div id="header_main" class=" light_header">
<nav class="uk-navbar"> <nav class="uk-navbar">
<div *ngIf="stakeholder" class="uk-navbar-left"> <div *ngIf="stakeholder" class="uk-navbar-left">
<a class="uk-logo uk-navbar-item ng-star-inserted uk-link " <a class="uk-logo uk-navbar-item ng-star-inserted uk-link uk-margin-left "
routerlink="/" [routerLink]="'/'+stakeholder.alias"
routerlinkactive="uk-link"> routerlinkactive="uk-link">
<img *ngIf="stakeholder.logoUrl" [src]="stakeholder.logoUrl" class=" logo uk-responsive-height"> <img *ngIf="stakeholder.logoUrl" [src]="stakeholder.logoUrl" class=" logo uk-responsive-height">
</a> </a>
<ul class="uk-navbar-nav user_actions uk-padding uk-padding-remove-vertical uk-padding-remove-right"> <ul class="uk-navbar-nav user_actions uk-padding uk-padding-remove-vertical uk-padding-remove-right">
<li title="It is comming soon. Stay tuned!"> <li>
<div class="uk-text-capitalize uk-h4 uk-margin-remove" > <div class="uk-text-capitalize uk-h4 uk-margin-remove" >
<span class="uk-visible@m"> <!--<span class="uk-visible@m">
{{'OpenAIRE Monitor '+(stakeholder.type == 'ri'?'Research Initiative':stakeholder.type)+ {{'OpenAIRE Monitor '+(stakeholder.type == 'ri'?'Research Initiative':stakeholder.type)+
' - ' }}</span> ' - ' }}</span>-->
<span> {{stakeholder.name}}</span> <span> {{stakeholder.name}}</span>
</div> </div>
@ -28,7 +28,7 @@
<ul *ngIf="!privateStakeholder" <ul *ngIf="!privateStakeholder"
class="uk-navbar-nav user_actions uk-padding uk-padding-remove-vertical uk-padding-remove-right"> class="uk-navbar-nav user_actions uk-padding uk-padding-remove-vertical uk-padding-remove-right">
<li title="It is comming soon. Stay tuned!"> <li title="It is comming soon. Stay tuned!">
<a class="login" [routerLink]="(isAdmin()?['/admin', this.stakeholder.alias]:null)" > <a class="login" [routerLink]="(isAdmin()?['/admin']:null)" >
Manage Manage
</a> </a>
@ -110,28 +110,20 @@
(activeCategory && activeCategory.description && activeCategory.description.length > 0) || (activeCategory && activeCategory.description && activeCategory.description.length > 0) ||
(activeTopic && activeTopic.description && activeTopic.description.length > 0))" (activeTopic && activeTopic.description && activeTopic.description.length > 0))"
class="uk-text-center"> class="uk-text-center">
<div class="uk-h5 uk-height-small uk-margin-large-top"> <div class="uk-h5 uk-height-small uk-margin-large-top uk-margin-xlarge-right uk-margin-xlarge-left">
{{activeSubCategory && activeSubCategory.description && activeSubCategory.description.length > 0 ? activeSubCategory.description {{activeSubCategory && activeSubCategory.description && activeSubCategory.description.length > 0 ? activeSubCategory.description
: (activeCategory && activeCategory.description && activeCategory.description.length > 0 ? activeCategory.description : : (activeCategory && activeCategory.description && activeCategory.description.length > 0 ? activeCategory.description :
(activeTopic.description && activeTopic.description.length > 0 ? activeTopic.description : ""))}} (activeTopic.description && activeTopic.description.length > 0 ? activeTopic.description : ""))}}
</div> </div>
</div> </div>
<div <div *ngIf="!loading && !privateStakeholder &&
*ngIf="stakeholder && (!activeTopic || !activeCategory || !activeSubCategory) && !privateStakeholder"
class="uk-text-center">
<div class="uk-h5 uk-height-medium">
No indicators available yet. Stay tuned!
</div>
</div>
<div *ngIf="!loading &&
(!activeSubCategory || (!activeSubCategory ||
( (
(activeSubCategory.numbers.length == 0 || (activeSubCategory.numbers.length == 1 && activeSubCategory.numbers[0].indicators.length == 0)) (activeSubCategory.numbers.length == 0 || (activeSubCategory.numbers.length == 1 && activeSubCategory.numbers[0].indicators.length == 0))
&& &&
(activeSubCategory.charts.length == 0 || (activeSubCategory.charts.length == 1 && activeSubCategory.charts[0].indicators.length == 0)) (activeSubCategory.charts.length == 0 || (activeSubCategory.charts.length == 1 && activeSubCategory.charts[0].indicators.length == 0))
))"> ) || !activeTopic || !activeCategory || !activeSubCategory)" >
<div class=" uk-text-center"> <div class=" uk-text-center">
<div class="uk-h3"> <div class="uk-h3">
No indicators available yet. Stay tuned! No indicators available yet. Stay tuned!

View File

@ -115,7 +115,7 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
subscription = this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => { subscription = this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) { if (stakeholder) {
this.stakeholder = stakeholder; this.stakeholder = stakeholder;
if(stakeholder.isActive && (stakeholder.isPublic || this.isAdmin())) { if(stakeholder.isActive && (stakeholder.isPublic || this.isPublicOrIsMember(stakeholder.isPublic))) {
this.seoService.createLinkForCanonicalURL(url, false); this.seoService.createLinkForCanonicalURL(url, false);
this._meta.updateTag({content: url}, "property='og:url'"); this._meta.updateTag({content: url}, "property='og:url'");
var description = "Monitor Dashboard | " + this.stakeholder.name; var description = "Monitor Dashboard | " + this.stakeholder.name;
@ -238,16 +238,10 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
if (this.activeCategory) { if (this.activeCategory) {
this.activeSubCategory = this.activeCategory.subCategories.find(subCategory => this.isPublicOrIsMember(subCategory.isPublic) && subCategory.isActive); this.activeSubCategory = this.activeCategory.subCategories.find(subCategory => this.isPublicOrIsMember(subCategory.isPublic) && subCategory.isActive);
if (this.activeSubCategory) { if (this.activeSubCategory) {
this.setSideBar();
this.setIndicators(); this.setIndicators();
// } else {
// this.navigateToError();
} }
// } else {
// this.navigateToError();
} }
// } else { this.setSideBar();
// this.navigateToError();
} }
} }
} }
@ -399,7 +393,7 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
} else { } else {
if (this.isViewPublic) { // preview for not members if (this.isViewPublic) { // preview for not members
return false; return false;
} else if(this.user) { } else if(this.isAdmin()) {
// if user is member, return true // if user is member, return true
return true; return true;
} }

View File

@ -3,17 +3,17 @@
<img *ngIf="properties.environment =='beta' || properties.environment =='development'" class="badge" <img *ngIf="properties.environment =='beta' || properties.environment =='development'" class="badge"
[src]="'assets/common-assets/'+(properties.environment =='beta'?'beta_flag.svg':'prototype_flag.svg')" [src]="'assets/common-assets/'+(properties.environment =='beta'?'beta_flag.svg':'prototype_flag.svg')"
[alt]="properties.environment"> [alt]="properties.environment">
<div class="uk-position-relative uk-display-inline-block uk-margin-small-top"> <div class="uk-position-relative uk-margin-small-top">
<div *ngIf="!stakeholder.defaultId" class="uk-badge default">Default</div> <!-- <div *ngIf="!stakeholder.defaultId" class="uk-badge default">Default</div>-->
<img class="logo" *ngIf="stakeholder.logoUrl" [src]="stakeholder.logoUrl"> <!-- <img class="logo" *ngIf="stakeholder.logoUrl" [src]="stakeholder.logoUrl">-->
<div class="uk-margin-top" *ngIf="!stakeholder.logoUrl" >{{stakeholder.name}}</div> <!-- <div class="uk-margin-top" *ngIf="!stakeholder.logoUrl" >{{stakeholder.name}}</div>-->
<div class="portalLogo logo" ></div>
</div> </div>
</div> </div>
<div *ngIf="stakeholder" class="menu_section"> <div *ngIf="stakeholder" class="menu_section">
<ul> <ul>
<li class="uk-margin-bottom md-bg-blue-900 uk-padding-small"> <li class="uk-margin-bottom md-bg-blue-900 uk-padding-small">
<a (click)="backClicked()" class="md-color-white"> <a [routerLink]="'../'" class="md-color-white">
<span class="menu_icon"><i class="material-icons md-color-white">arrow_back</i></span> <span class="menu_icon"><i class="material-icons md-color-white">arrow_back</i></span>
<div class="menu_title uk-width-expand uk-text-uppercase"> <div class="menu_title uk-width-expand uk-text-uppercase">
Back Back

View File

@ -65,33 +65,6 @@ export class StakeholderComponent implements OnInit, OnDestroy, IDeactivateCompo
public ngOnDestroy() { public ngOnDestroy() {
} }
backClicked() {
let prevRoute = localStorage.getItem('previousRoute');
// var referrer = "";
// if (typeof document !== 'undefined') {
// //console.log("document.referrer:" + document.referrer);
// referrer = document.referrer;
//
// }
// if((referrer == null || referrer.length == 0)&&typeof localStorage !== 'undefined'){
//
// referrer =localStorage.getItem('previousRoute');
// }
// prevRoute = referrer;
//
// if(prevRoute == "/"+this.stakeholder.alias ||prevRoute == "/admin"){
// this.router.navigate([prevRoute])
// }else{
prevRoute = "/"+this.stakeholder.alias;
// }
this.subscriptions.forEach(value => {
if (value instanceof Subscriber) {
value.unsubscribe();
}
});
this.router.navigate([prevRoute])
// this._location.back();
}
canExit():boolean { canExit():boolean {
this.subscriptions.forEach(value => { this.subscriptions.forEach(value => {

View File

@ -315,7 +315,7 @@
</div> </div>
</div> </div>
<div class="md-card-toolbar-heading-text"> <div class="md-card-toolbar-heading-text">
{{indicator.name ? indicator.name : indicator.indicatorPaths[0].parameters['title']}} {{indicator.name}}
</div> </div>
</div> </div>
<div *ngIf="grid" class="md-card-content"> <div *ngIf="grid" class="md-card-content">

View File

@ -112,6 +112,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
this.buildSections(); this.buildSections();
this.filterCharts(); this.filterCharts();
this.filterNumbers(); this.filterNumbers();
this.setPreview();
} }
}); });
} }
@ -143,7 +144,9 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
} }
setPreview() { setPreview() {
if(this.stakeholder && this.stakeholder.topics[this.topicIndex]) { if(this.stakeholder){
this.preview = '/' + this.stakeholder.alias;
if(this.stakeholder.topics[this.topicIndex]) {
this.preview = '/' + this.stakeholder.alias + '/' + this.stakeholder.topics[this.topicIndex].alias; this.preview = '/' + this.stakeholder.alias + '/' + this.stakeholder.topics[this.topicIndex].alias;
if (this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]) { if (this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]) {
this.preview += '/' + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].alias; this.preview += '/' + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].alias;
@ -153,6 +156,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
} }
} }
} }
}
initReorder() { initReorder() {
this.subscriptions.forEach(value => { this.subscriptions.forEach(value => {

View File

@ -3,10 +3,11 @@
<img *ngIf="properties.environment =='beta' || properties.environment =='development'" class="badge" <img *ngIf="properties.environment =='beta' || properties.environment =='development'" class="badge"
[src]="'assets/common-assets/'+(properties.environment =='beta'?'beta_flag.svg':'prototype_flag.svg')" [src]="'assets/common-assets/'+(properties.environment =='beta'?'beta_flag.svg':'prototype_flag.svg')"
[alt]="properties.environment"> [alt]="properties.environment">
<div class="uk-position-relative uk-display-inline-block uk-margin-small-top"> <div class="uk-position-relative uk-margin-small-top">
<div *ngIf="!stakeholder.defaultId" class="uk-badge default">Default</div> <!-- <div *ngIf="!stakeholder.defaultId" class="uk-badge default">Default</div>-->
<img class="logo" *ngIf="stakeholder.logoUrl" [src]="stakeholder.logoUrl"> <!-- <img class="logo" *ngIf="stakeholder.logoUrl" [src]="stakeholder.logoUrl">-->
<div class="uk-margin-top" *ngIf="!stakeholder.logoUrl" >{{stakeholder.name}}</div> <!-- <div class="uk-margin-top" *ngIf="!stakeholder.logoUrl" >{{stakeholder.name}}</div>-->
<div class="portalLogo logo" ></div>
</div> </div>
</div> </div>
<div *ngIf="stakeholder && stakeholder.topics[topicIndex]" class="menu_section"> <div *ngIf="stakeholder && stakeholder.topics[topicIndex]" class="menu_section">

View File

@ -6,6 +6,7 @@ import {filter, map} from "rxjs/operators";
import {UserManagementService} from "../openaireLibrary/services/user-management.service"; import {UserManagementService} from "../openaireLibrary/services/user-management.service";
import {LoginErrorCodes} from "../openaireLibrary/login/utils/guardHelper.class"; import {LoginErrorCodes} from "../openaireLibrary/login/utils/guardHelper.class";
import {Session} from "../openaireLibrary/login/utils/helper.class"; import {Session} from "../openaireLibrary/login/utils/helper.class";
import {properties} from "../../environments/environment";
@Injectable() @Injectable()
export class AdminDashboardGuard implements CanActivate, CanLoad { export class AdminDashboardGuard implements CanActivate, CanLoad {
@ -15,6 +16,10 @@ export class AdminDashboardGuard implements CanActivate, CanLoad {
} }
check(path: string): Observable<boolean> | boolean { check(path: string): Observable<boolean> | boolean {
/* //Argiro testing
if(properties.environment == "development"){
return true;
}*/
if (Session.isLoggedIn()) { if (Session.isLoggedIn()) {
const obs = this.userManagementService.getUserInfo(false).pipe(map(user => { const obs = this.userManagementService.getUserInfo(false).pipe(map(user => {
return (Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isMonitorCurator(user)); return (Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isMonitorCurator(user));

View File

@ -54,7 +54,7 @@ export let properties: EnvProperties = {
feedbackmail: "openaire.test@gmail.com", feedbackmail: "openaire.test@gmail.com",
cacheUrl: "http://scoobydoo.di.uoa.gr:3000/get?url=", cacheUrl: "http://scoobydoo.di.uoa.gr:3000/get?url=",
// monitorServiceAPIURL: "https://beta.services.openaire.eu/uoa-monitor-service",
monitorServiceAPIURL: "http://duffy.di.uoa.gr:8080/uoa-monitor-service", monitorServiceAPIURL: "http://duffy.di.uoa.gr:8080/uoa-monitor-service",
adminToolsAPIURL: "http://mpagasas.di.uoa.gr:8080/uoa-admin-tools", adminToolsAPIURL: "http://mpagasas.di.uoa.gr:8080/uoa-admin-tools",