diff --git a/src/app/app.component.ts b/src/app/app.component.ts index a675768..0df99f6 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -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: [] }, { diff --git a/src/app/statistics/statistics.component.html b/src/app/statistics/statistics.component.html index ae9811e..e65314a 100644 --- a/src/app/statistics/statistics.component.html +++ b/src/app/statistics/statistics.component.html @@ -100,7 +100,14 @@ -
+
+
diff --git a/src/app/statistics/statistics.component.ts b/src/app/statistics/statistics.component.ts index 62626e5..4f90fd9 100644 --- a/src/app/statistics/statistics.component.ts +++ b/src/app/statistics/statistics.component.ts @@ -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}`); } } diff --git a/src/app/utils/piwikHelper.ts b/src/app/utils/piwikHelper.ts index f67f2e3..b195929 100644 --- a/src/app/utils/piwikHelper.ts +++ b/src/app/utils/piwikHelper.ts @@ -11,7 +11,8 @@ export class PiwikHelper{ "ni":88, "oa-pg":89, "rda":90, - "aginfra":93 + "aginfra":93, + "clarin":100 } - + } diff --git a/src/assets/connect-custom.css b/src/assets/connect-custom.css index 5598bf8..80a1b10 100644 --- a/src/assets/connect-custom.css +++ b/src/assets/connect-custom.css @@ -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);