Menu items: don;t add community id parameter for production
Piwik: add new piwik ids for aginfra, clarin in monitor: track piwik only for monitor - not when component is used from dashboard set the proper title and community id Monitor: hide hr when there are not the charts above it git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@52386 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
3a25d0c4af
commit
bde2f196d6
|
@ -87,12 +87,11 @@ export class AppComponent {
|
|||
items: [new MenuItem("","Publications","","/search/find/publications",false,["publication"],["/search/find/publications"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}),
|
||||
new MenuItem("","Research Data","","/search/find/datasets",false,["dataset"],["/search/find/datasets"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}),
|
||||
new MenuItem("","Software","","/search/find/software",false,["software"],["/search/find/software"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}),
|
||||
new MenuItem("","Projects","","/search/find/projects/",false,["project"],["/search/find/projects"],{communityId: community.communityId}),
|
||||
new MenuItem("","Content Providers","","/search/find/dataproviders",false,["datasource"],["/search/find/dataproviders"],{communityId: community.communityId}),
|
||||
// new MenuItem("","Organizations","","/search/find/organizations/",false,["organization"],["/search/find/organizations"],{community: community.communityId}),
|
||||
new MenuItem("","Projects","","/search/find/projects/",false,["project"],["/search/find/projects"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}),
|
||||
new MenuItem("","Content Providers","","/search/find/dataproviders",false,["datasource"],["/search/find/dataproviders"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}),
|
||||
]},
|
||||
{
|
||||
rootItem: new MenuItem("monitor","Monitor","","/monitor",false,[],["/statistics"],{communityId:community.communityId}),
|
||||
rootItem: new MenuItem("monitor","Monitor","","/monitor",false,[],["/statistics"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}),
|
||||
items: []
|
||||
},
|
||||
{
|
||||
|
|
|
@ -100,7 +100,14 @@
|
|||
<iframe [src]=displayedGraphUrl width="1000" height="450"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<hr *ngIf="(statisticsDisplay.entities[entity].charts.map['timeline'] &&
|
||||
statisticsDisplay.entities[entity].charts.map['timeline'][currentMode] &&
|
||||
chartsUrlMap[entity + 'Timeline'] &&
|
||||
(displayedTimeline == (entity + 'Timeline'))) || (statisticsDisplay.entities[entity].charts.map['graph'] &&
|
||||
statisticsDisplay.entities[entity].charts.map['graph'][currentMode] &&
|
||||
chartsUrlMap[entity + 'Graph'] &&
|
||||
(displayedGraph == (entity + 'Graph')))">
|
||||
|
||||
<div *ngIf="statisticsDisplay.entities[entity].charts.map['projectColumn'][currentMode] ||
|
||||
statisticsDisplay.entities[entity].charts.map['projectPie'][currentMode] ||
|
||||
statisticsDisplay.entities[entity].charts.map['projectTable'][currentMode]">
|
||||
|
|
|
@ -23,6 +23,7 @@ import {ConnectHelper} from '../openaireLibrary/connect/connectHelper';
|
|||
import {availableCharts, availableEntitiesMap, StatisticsDisplay,
|
||||
StatisticsSummary
|
||||
} from "../openaireLibrary/connect/statistics/statisticsEntities";
|
||||
import {PiwikHelper} from '../utils/piwikHelper';
|
||||
|
||||
@Component({
|
||||
selector: 'statistics',
|
||||
|
@ -90,9 +91,6 @@ export class StatisticsComponent {
|
|||
this.properties = data.envSpecific;
|
||||
var url = data.envSpecific.baseLink+this._router.url;
|
||||
this._meta.updateTag({content:url},"property='og:url'");
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE").subscribe();
|
||||
}
|
||||
|
||||
this.route.queryParams.subscribe(
|
||||
communityId => {
|
||||
|
@ -100,7 +98,10 @@ export class StatisticsComponent {
|
|||
if(!this.communityId){
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname);
|
||||
}
|
||||
console.log(" Stats! "+ this.properties.statisticsAPIURL);
|
||||
if(this.currentMode == "showInMonitor" && this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView(this.properties, "Monitor "+ this.communityId, PiwikHelper.siteIDs[this.communityId]).subscribe();
|
||||
}
|
||||
// console.log(" Stats! "+ this.properties.statisticsAPIURL);
|
||||
this.createStatisticsObjects();
|
||||
});
|
||||
});
|
||||
|
@ -120,7 +121,7 @@ export class StatisticsComponent {
|
|||
}
|
||||
|
||||
createStatisticsObjects() {
|
||||
console.log(" Stats! "+ this.properties.statisticsAPIURL);
|
||||
// console.log(" Stats! "+ this.properties.statisticsAPIURL);
|
||||
this._statisticsService.getCommunityStatistics(this.properties.statisticsAPIURL,this.communityId).subscribe (
|
||||
res => {
|
||||
console.log('statisticsSum is:');
|
||||
|
@ -152,7 +153,7 @@ export class StatisticsComponent {
|
|||
|
||||
|
||||
getCommunityInfo() {
|
||||
console.log(`calling ${this.properties.adminToolsAPIURL}/communityFull/${this.communityId}`);
|
||||
// console.log(`calling ${this.properties.adminToolsAPIURL}/communityFull/${this.communityId}`);
|
||||
this._configService.getCommunityInformation(this.properties.adminToolsAPIURL, this.communityId).subscribe(
|
||||
res => {
|
||||
this.communityInfo = res;
|
||||
|
@ -172,8 +173,8 @@ export class StatisticsComponent {
|
|||
initializeDisplayedCharts() {
|
||||
let firstEntity: string;
|
||||
this.entitiesList = Array.from( this.entitiesMap.keys() );
|
||||
console.log('this.entitiesList is',this.entitiesList);
|
||||
console.log(`my current mode is: ${this.currentMode}`);
|
||||
// console.log('this.entitiesList is',this.entitiesList);
|
||||
// console.log(`my current mode is: ${this.currentMode}`);
|
||||
for (let entity of this.entitiesList) {
|
||||
if (this.statisticsDisplay.entities[entity] && this.statisticsSum[entity].total && this.communityInfo.entities.filter(x => x['pid'] == entity && x['isEnabled']===true).length ) {
|
||||
this.allowedCharts[entity] = [];
|
||||
|
@ -188,7 +189,7 @@ export class StatisticsComponent {
|
|||
}
|
||||
}
|
||||
if (this.allowedCharts[entity].length) {
|
||||
console.log(`added ${entity} to allowedEntities`);
|
||||
// console.log(`added ${entity} to allowedEntities`);
|
||||
this.allowedEntities.push(entity);
|
||||
if (!firstEntity){
|
||||
firstEntity = entity;
|
||||
|
@ -222,19 +223,19 @@ export class StatisticsComponent {
|
|||
|
||||
onChangeEntity (entity: string) {
|
||||
this.displayedEntity = entity;
|
||||
console.log(`displayed entity is ${entity}`);
|
||||
console.log(`statisticsSum[${entity}].total is ${this.statisticsSum[entity].total}`);
|
||||
// console.log(`displayed entity is ${entity}`);
|
||||
// console.log(`statisticsSum[${entity}].total is ${this.statisticsSum[entity].total}`);
|
||||
|
||||
if (this.statisticsSum[entity].total &&
|
||||
this.allowedEntities.filter(x => x == entity).length ) {
|
||||
|
||||
console.log(`found ${entity} in allowedEntities`);
|
||||
// console.log(`found ${entity} in allowedEntities`);
|
||||
this.displayedTimeline = `${entity}Timeline`;
|
||||
this.displayedTimelineUrl = this.chartsUrlMap[this.displayedTimeline];
|
||||
console.log(`displayed Timeline is: ${this.displayedTimeline}`);
|
||||
// console.log(`displayed Timeline is: ${this.displayedTimeline}`);
|
||||
this.displayedGraph = `${entity}Graph`;
|
||||
this.displayedGraphUrl = this.chartsUrlMap[this.displayedGraph];
|
||||
console.log(`displayed Graph is: ${this.displayedGraph}`);
|
||||
// console.log(`displayed Graph is: ${this.displayedGraph}`);
|
||||
if (this.allowedCharts[entity]) {
|
||||
let firstProjectChart = this.allowedCharts[entity].filter( x => x.includes(entity+'Project') );
|
||||
if (firstProjectChart[0]) {
|
||||
|
@ -242,23 +243,23 @@ export class StatisticsComponent {
|
|||
} else {
|
||||
this.displayedProjectChart = '';
|
||||
this.displayedProjectChartUrl = '';
|
||||
console.log(`displayed ProjectChart is: ${this.displayedProjectChart}`);
|
||||
// console.log(`displayed ProjectChart is: ${this.displayedProjectChart}`);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.displayedTimeline = '';
|
||||
this.displayedTimelineUrl = '';
|
||||
console.log(`displayed Timeline is: ${this.displayedTimeline}`);
|
||||
// console.log(`displayed Timeline is: ${this.displayedTimeline}`);
|
||||
this.displayedGraph = '';
|
||||
this.displayedGraphUrl = '';
|
||||
console.log(`displayed Graph is: ${this.displayedGraph}`);
|
||||
// console.log(`displayed Graph is: ${this.displayedGraph}`);
|
||||
}
|
||||
}
|
||||
|
||||
changeDisplayedProjectChart(chartName: string) {
|
||||
this.displayedProjectChart = chartName;
|
||||
this.displayedProjectChartUrl = this.chartsUrlMap[this.displayedProjectChart];
|
||||
console.log(`displayed ProjectChart is: ${this.displayedProjectChart}`);
|
||||
// console.log(`displayed ProjectChart is: ${this.displayedProjectChart}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,7 +11,8 @@ export class PiwikHelper{
|
|||
"ni":88,
|
||||
"oa-pg":89,
|
||||
"rda":90,
|
||||
"aginfra":93
|
||||
"aginfra":93,
|
||||
"clarin":100
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
.mainPageSearchForm {
|
||||
background-image: url("./home.jpg");
|
||||
background-image: url("./home.jpg") !important;
|
||||
background-color: rgb(255, 255, 255);
|
||||
box-sizing: border-box;
|
||||
min-height: calc(100vh - 412.767px);
|
||||
|
|
Loading…
Reference in New Issue