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> <div>
<div *ngFor="let entity of allowedEntities"> <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"> <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>
<div *ngIf="allowedCharts[entity]" class="uk-grid"> <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"> <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> </span>
</div> </div>
</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"> class="uk-alert uk-alert-info">
No charts available No charts available
</div> </div>
<div *ngIf="statisticsSum[entity].total>0 && allowedCharts[entity]"> <div *ngIf="statisticsSum[entity].total>0 && allowedCharts[entity].length>0">
<div class="uk-grid"> <div class="uk-grid">
<div *ngIf="statisticsDisplay.entities[entity].charts.map['timeline'] && <div *ngIf="statisticsDisplay.entities[entity].charts.map['timeline'] &&
statisticsDisplay.entities[entity].charts.map['timeline'][currentMode] && statisticsDisplay.entities[entity].charts.map['timeline'][currentMode] &&
@ -102,6 +102,9 @@
</div> </div>
</div> </div>
<hr> <hr>
<div *ngIf="statisticsDisplay.entities[entity].charts.map['projectColumn'][currentMode] ||
statisticsDisplay.entities[entity].charts.map['projectPie'][currentMode] ||
statisticsDisplay.entities[entity].charts.map['projectTable'][currentMode]">
<div> <div>
<h4 class="uk-text-uppercase uk-text-bold">{{ entitiesMap.get(entity) }} per project</h4> <h4 class="uk-text-uppercase uk-text-bold">{{ entitiesMap.get(entity) }} per project</h4>
</div> </div>
@ -149,6 +152,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -8,11 +8,6 @@ import "rxjs/add/observable/zip";
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes'; import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
import {
availableCharts, availableEntities, availableEntitiesMap, StatisticsDisplay,
StatisticsSummary
} from "./statisticsEntities";
import {StatisticsService} from '../utils/services/statistics.service'; import {StatisticsService} from '../utils/services/statistics.service';
import {CommunityService} from "../openaireLibrary/connect/community/community.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 {Meta} from '../openaireLibrary/sharedComponents/metaService';
import { DomSanitizer, SafeResourceUrl, SafeUrl } from '@angular/platform-browser'; import { DomSanitizer, SafeResourceUrl, SafeUrl } from '@angular/platform-browser';
import {ConnectHelper} from '../openaireLibrary/connect/connectHelper'; import {ConnectHelper} from '../openaireLibrary/connect/connectHelper';
import {
availableCharts, availableEntitiesMap, StatisticsDisplay,
StatisticsSummary
} from "../openaireLibrary/connect/statistics/statisticsEntities";
@Component({ @Component({
selector: 'statistics', 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 { Injectable } from '@angular/core';
import { Http, Response, Headers, RequestOptions } from '@angular/http'; import { Http, Response, Headers, RequestOptions } from '@angular/http';
import { Observable } from 'rxjs/Rx'; import { Observable } from 'rxjs/Rx';
import { StatisticsDisplay, StatisticsSummary } from '../../statistics/statisticsEntities'; import {StatisticsDisplay, StatisticsSummary} from "../../openaireLibrary/connect/statistics/statisticsEntities";
@Injectable() @Injectable()