statistics: fixed dashboard details

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@51687 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
myrto.koukouli 2018-04-05 16:54:04 +00:00
parent 99afee5cc6
commit 55e1c9531c
5 changed files with 54 additions and 116 deletions

View File

@ -5,9 +5,9 @@
</div>
<div>
<div *ngFor="let entity of allowedEntities">
<div *ngIf="statisticsSum[entity].total>0">
<div *ngIf="statisticsSum[entity].total>0 && allowedCharts[entity].length>0">
<div class="uk-text-uppercase uk-text-bold uk-heading-divider">
<h3>{{ entity == 'software' ? getCamelCaseString(entity) : (entity == 'dataset'? 'Research Data' : getCamelCaseString(entity) + 's') }}</h3>
<h3>{{ entitiesMap.get(entity) }}</h3>
</div>
<div *ngIf="allowedCharts[entity]" class="uk-grid">
<div *ngFor="let chart of allowedCharts[entity]" class="uk-width-1-2@l uk-width-1-1@m uk-first-column">

View File

@ -82,11 +82,11 @@
</span>
</div>
</div>
<div *ngIf="statisticsSum[entity].total>0 && !allowedCharts[entity]"
<div *ngIf="statisticsSum[entity].total>0 && allowedCharts[entity].length==0"
class="uk-alert uk-alert-info">
No charts available
</div>
<div *ngIf="statisticsSum[entity].total>0 && allowedCharts[entity]">
<div *ngIf="statisticsSum[entity].total>0 && allowedCharts[entity].length>0">
<div class="uk-grid">
<div *ngIf="statisticsDisplay.entities[entity].charts.map['timeline'] &&
statisticsDisplay.entities[entity].charts.map['timeline'][currentMode] &&
@ -102,50 +102,54 @@
</div>
</div>
<hr>
<div>
<h4 class="uk-text-uppercase uk-text-bold">{{ entitiesMap.get(entity) }} per project</h4>
</div>
<div>
<ul class="uk-tab uk-margin-top" data-uk-tab="{connect: '#projectChartTabs'">
<li *ngIf=" statisticsDisplay.entities[entity].charts.map['projectColumn'] &&
statisticsDisplay.entities[entity].charts.map['projectColumn'][currentMode] &&
chartsUrlMap[entity + 'Projectcolumn']"
(click)="changeDisplayedProjectChart(entity + 'Projectcolumn')">
<div *ngIf="statisticsDisplay.entities[entity].charts.map['projectColumn'][currentMode] ||
statisticsDisplay.entities[entity].charts.map['projectPie'][currentMode] ||
statisticsDisplay.entities[entity].charts.map['projectTable'][currentMode]">
<div>
<h4 class="uk-text-uppercase uk-text-bold">{{ entitiesMap.get(entity) }} per project</h4>
</div>
<div>
<ul class="uk-tab uk-margin-top" data-uk-tab="{connect: '#projectChartTabs'">
<li *ngIf=" statisticsDisplay.entities[entity].charts.map['projectColumn'] &&
statisticsDisplay.entities[entity].charts.map['projectColumn'][currentMode] &&
chartsUrlMap[entity + 'Projectcolumn']"
(click)="changeDisplayedProjectChart(entity + 'Projectcolumn')">
<a href="#">Columns</a>
</li>
<li *ngIf=" statisticsDisplay.entities[entity].charts.map['projectPie'] &&
statisticsDisplay.entities[entity].charts.map['projectPie'][currentMode] &&
chartsUrlMap[entity + 'Projectpie']"
(click)="changeDisplayedProjectChart(entity + 'Projectpie')">
<a href="#">Columns</a>
</li>
<li *ngIf=" statisticsDisplay.entities[entity].charts.map['projectPie'] &&
statisticsDisplay.entities[entity].charts.map['projectPie'][currentMode] &&
chartsUrlMap[entity + 'Projectpie']"
(click)="changeDisplayedProjectChart(entity + 'Projectpie')">
<a href="#">Pie</a>
</li>
<li *ngIf=" statisticsDisplay.entities[entity].charts.map['projectTable'] &&
statisticsDisplay.entities[entity].charts.map['projectTable'][currentMode] &&
chartsUrlMap[entity + 'Projecttable']"
(click)="changeDisplayedProjectChart(entity + 'Projecttable')">
<a href="#">Pie</a>
</li>
<li *ngIf=" statisticsDisplay.entities[entity].charts.map['projectTable'] &&
statisticsDisplay.entities[entity].charts.map['projectTable'][currentMode] &&
chartsUrlMap[entity + 'Projecttable']"
(click)="changeDisplayedProjectChart(entity + 'Projecttable')">
<a href="#">Table</a>
</li>
</ul>
<ul id="projectChartTabs" class="uk-switcher uk-margin">
<li *ngIf="statisticsDisplay.entities[entity].charts.map['projectColumn'][currentMode]">
<div *ngIf="displayedProjectChart == (entity + 'Projectcolumn')">
<iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe>
</div>
</li>
<li *ngIf="statisticsDisplay.entities[entity].charts.map['projectPie'][currentMode]">
<div *ngIf="displayedProjectChart == (entity + 'Projectpie')">
<iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe>
</div>
</li>
<li *ngIf="statisticsDisplay.entities[entity].charts.map['projectTable'][currentMode]">
<div *ngIf="displayedProjectChart == (entity + 'Projecttable')">
<iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe>
</div>
</li>
</ul>
<a href="#">Table</a>
</li>
</ul>
<ul id="projectChartTabs" class="uk-switcher uk-margin">
<li *ngIf="statisticsDisplay.entities[entity].charts.map['projectColumn'][currentMode]">
<div *ngIf="displayedProjectChart == (entity + 'Projectcolumn')">
<iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe>
</div>
</li>
<li *ngIf="statisticsDisplay.entities[entity].charts.map['projectPie'][currentMode]">
<div *ngIf="displayedProjectChart == (entity + 'Projectpie')">
<iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe>
</div>
</li>
<li *ngIf="statisticsDisplay.entities[entity].charts.map['projectTable'][currentMode]">
<div *ngIf="displayedProjectChart == (entity + 'Projecttable')">
<iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>

View File

@ -8,11 +8,6 @@ import "rxjs/add/observable/zip";
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
import {
availableCharts, availableEntities, availableEntitiesMap, StatisticsDisplay,
StatisticsSummary
} from "./statisticsEntities";
import {StatisticsService} from '../utils/services/statistics.service';
import {CommunityService} from "../openaireLibrary/connect/community/community.service";
@ -22,6 +17,10 @@ import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.
import {Meta} from '../openaireLibrary/sharedComponents/metaService';
import { DomSanitizer, SafeResourceUrl, SafeUrl } from '@angular/platform-browser';
import {ConnectHelper} from '../openaireLibrary/connect/connectHelper';
import {
availableCharts, availableEntitiesMap, StatisticsDisplay,
StatisticsSummary
} from "../openaireLibrary/connect/statistics/statisticsEntities";
@Component({
selector: 'statistics',

View File

@ -1,65 +0,0 @@
export const availableCharts = [
'timeline',
'graph',
'projectColumn',
'projectPie',
'projectTable'
];
export const availableNumbers = [
'total',
'project',
'open',
'closed',
'restricted',
'embargo',
];
export const availableEntities = [
'publication',
'dataset',
'software'
];
export const availableEntitiesMap = new Map([
['publication', 'Publications'],
['dataset', 'Research Data'],
['software', 'Software']
]);
export class DisplayStatsOptions {
showInMonitor: boolean;
showInDashboard: boolean;
}
export class StatisticsMap {
map: Map<string,DisplayStatsOptions>;
}
export class EntityStats {
charts: StatisticsMap;
numbers: StatisticsMap;
}
export class StatisticsDisplay {
pid: string;
entities: Map<string,EntityStats>;
id: string;
}
export class StatisticsNumbers {
total: number;
open_access: number;
embargo: number;
restricted: number;
closed_access: number;
projects: number;
}
export class StatisticsSummary {
publications : StatisticsNumbers;
datasets: StatisticsNumbers;
software: StatisticsNumbers;
total_projects: number;
virtual_organizations: number;
}

View File

@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { Http, Response, Headers, RequestOptions } from '@angular/http';
import { Observable } from 'rxjs/Rx';
import { StatisticsDisplay, StatisticsSummary } from '../../statistics/statisticsEntities';
import {StatisticsDisplay, StatisticsSummary} from "../../openaireLibrary/connect/statistics/statisticsEntities";
@Injectable()