[Monitor | Trunk]: Remove testing stakeholders. Add color for each type of stakeholder base on mocks. Remove inactive or private stakeholders

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor@58877 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Konstantinos Triantafyllou 2020-06-10 21:51:10 +00:00
parent 7f07534d02
commit aa5c712e1d
3 changed files with 38 additions and 33 deletions

View File

@ -30,7 +30,7 @@
.dashboard-section .dashboard {
transform: translateY(-50%);
background-image: url("~assets/monitor-assets/home/dashboard.png");
background-size: contain;
background-size: cover;
background-repeat: no-repeat;
background-position: top center;
margin-left: auto;
@ -57,7 +57,6 @@
}
.dashboard-section .dashboard .captain-right {
background-image: url("~assets/monitor-assets/home/captain-right.png");
background-size: contain;
@ -213,7 +212,6 @@
.stakeholder-section .stakeholders .header {
background-color: #00a0de;
position: relative;
height: 150px;
}
@ -253,8 +251,24 @@
height: 300px;
}
.stakeholder-section .stakeholders .funder .header {
background-color: #F8D5E3;
}
.stakeholder-section .stakeholders .ri .header {
background-color: #9AD5CA;
}
.stakeholder-section .stakeholders .organization .header {
background-color: #C5E0E9;
}
@media (min-width: 640px) {
.stakeholder-section .tabs > ul > li {
z-index: 2;
}
.stakeholder-section .tabs > ul > li.uk-active {
color: #1a1a1a;
border: #E3E3E3 solid 1px;

View File

@ -146,7 +146,7 @@
</div>
<div class="stakeholders uk-child-width-1-2 uk-child-width-1-3@m uk-grid uk-flex-top uk-flex-wrap-top"
uk-grid="masonry: true">
<div *ngFor="let stakeholder of stakeholders" [attr.data-type]="stakeholder.type" class="uk-margin-medium-bottom">
<div *ngFor="let stakeholder of stakeholders" [attr.data-type]="stakeholder.type" class="uk-margin-medium-bottom" [ngClass]="stakeholder.type">
<a *ngIf="directLink" [href]="getStakeholderPageUrl(stakeholder)" target="_blank">
<div class="header" [ngClass]="stakeholder.size">
<img class="uk-margin-auto" [src]="'http://dl170.madgik.di.uoa.gr/monitor/dashboard/assets/ec.png'">
@ -180,16 +180,8 @@
</ul>
</div>
<div class="stakeholders uk-child-width-1-2 uk-grid uk-grid-small" uk-grid="">
<div *ngFor="let stakeholder of stakeholders" [attr.data-type]="stakeholder.type">
<a *ngIf="directLink" [href]="getStakeholderPageUrl(stakeholder)" target="_blank">
<div class="header">
<div>
<img class="uk-margin-auto" [src]="'http://dl170.madgik.di.uoa.gr/monitor/dashboard/assets/ec.png'">
<h6 class="uk-margin-top uk-text-bold">{{stakeholder.name}}</h6>
</div>
</div>
</a>
<a *ngIf="!directLink" (click)="confirmModalOpen(stakeholder)">
<div *ngFor="let stakeholder of stakeholders" [attr.data-type]="stakeholder.type" [ngClass]="stakeholder.type">
<a [href]="getStakeholderPageUrl(stakeholder)" target="_blank">
<div class="header">
<div>
<img class="uk-margin-auto" [src]="'http://dl170.madgik.di.uoa.gr/monitor/dashboard/assets/ec.png'">

View File

@ -1,4 +1,4 @@
import {Component, ElementRef, ViewChild} from '@angular/core';
import {Component, ElementRef, ViewChild, ViewEncapsulation} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
@ -17,11 +17,14 @@ import {StakeholderService} from "../openaireLibrary/monitor/services/stakeholde
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
import {LocalStorageService} from "../openaireLibrary/services/localStorage.service";
import {Stakeholder} from "../openaireLibrary/monitor/entities/stakeholder";
import {Session, User} from "../openaireLibrary/login/utils/helper.class";
import {UserManagementService} from "../openaireLibrary/services/user-management.service";
@Component({
selector: 'home',
templateUrl: 'home.component.html',
styleUrls: ['home.component.css'],
encapsulation: ViewEncapsulation.None,
animations: [
trigger('captain-left', [
state('before', style({
@ -120,7 +123,8 @@ export class HomeComponent {
public captains: boolean = false;
@ViewChild('ref') ref: ElementRef;
@ViewChild('AlertModal') modal;
private directLink: boolean = true;
public directLink: boolean = true;
private user: User;
constructor(
private route: ActivatedRoute,
@ -130,6 +134,7 @@ export class HomeComponent {
private _piwikService: PiwikService,
private _stakeholderService: StakeholderService,
private localStorageService: LocalStorageService,
private userManagementService: UserManagementService,
private helper: HelperService,
private seoService: SEOService,
private _refineFieldResultsService: RefineFieldResultsService, private _searchResearchResultsService: SearchResearchResultsService) {
@ -159,12 +164,15 @@ export class HomeComponent {
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Monitor", this.properties.piwikSiteId).subscribe();
}
this.getNumbers();
this.getFunders();
this.getStakeholders();
// this.createGifs();
//this.getDivContents();
this.getPageContents();
this.localStorageService.get().subscribe(value => {
this.directLink = value;
});
this.userManagementService.getUserInfo().subscribe(user => {
this.user = user;
})
});
if(typeof document != "undefined") {
@ -281,7 +289,7 @@ export class HomeComponent {
}
public getFunders() {
public getStakeholders() {
this.loading = true;
this.status = this.errorCodes.LOADING;
this.subscriberErrorMessage = "";
@ -292,21 +300,8 @@ export class HomeComponent {
if (!stakeholders || stakeholders.length == 0) {
this.status = this.errorCodes.NONE;
} else {
this.stakeholders = [];
stakeholders.forEach(stakeholder => {
let index = (this.stakeholders.push(HelperFunctions.copy(stakeholder)) - 1);
this.setSizeOfStakeholder(index);
});
stakeholders.forEach(stakeholder => {
let index = (this.stakeholders.push(HelperFunctions.copy(stakeholder)) - 1);
this.setSizeOfStakeholder(index);
});
stakeholders.forEach(stakeholder => {
let index = (this.stakeholders.push(HelperFunctions.copy(stakeholder)) - 1);
this.setSizeOfStakeholder(index);
});
stakeholders.forEach(stakeholder => {
let index = (this.stakeholders.push(HelperFunctions.copy(stakeholder)) - 1);
this.stakeholders = stakeholders.filter(stakeholder => stakeholder.isActive && (stakeholder.isPublic || this.isStakeholderManager()));
this.stakeholders.forEach((stakeholder, index, stakeholders) => {
this.setSizeOfStakeholder(index);
});
}
@ -319,6 +314,10 @@ export class HomeComponent {
);
}
private isStakeholderManager() {
return Session.isPortalAdministrator(this.user) || Session.isMonitorCurator(this.user) || Session.isCommunityCurator(this.user);
}
private setSizeOfStakeholder(index) {
let mod = index % 9;
if (mod === 0 || mod === 4 || mod === 8) {