[Monitor|Dashboard]
Links to Admin available for monitor Curators, Community Curators and portal administrators Indicators page: Admin: Indicators: add tooltips for active/public show message when stakeholder values couln't be parsed allow urls from different installations of stats-tool indicator Utils: add parsing for echarts library build the chart url using the current stakeholder values (index_id, index_name, etc) git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@58823 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
7c72562336
commit
31824bf208
|
@ -12,7 +12,7 @@
|
|||
"start:ssr": "npm run build:ssr && npm run serve:ssr",
|
||||
"start:prerender": "npm run build:prerender && npm run serve:prerender",
|
||||
"build": "ng build",
|
||||
"build:client-and-server-bundles": "ng build --prod --sourceMap --stats-json=true && ng run ng-universal-demo:server:production",
|
||||
"build:client-and-server-bundles": "ng build --prod --sourceMap --stats-json=true --base-href /monitor/dashboard/ && ng run ng-universal-demo:server:production",
|
||||
"build:prerender": "npm run build:client-and-server-bundles && npm run webpack:server && npm run generate:prerender",
|
||||
"build:ssr": "npm run build:client-and-server-bundles && npm run webpack:server",
|
||||
"generate:prerender": "cd dist && node prerender",
|
||||
|
|
|
@ -112,10 +112,15 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||
|
||||
buildMenu() {
|
||||
this.userMenuItems = [];
|
||||
if (Session.isPortalAdministrator(this.user)) {
|
||||
/* if (Session.isPortalAdministrator(this.user)) {
|
||||
this.userMenuItems.push(new MenuItem("", "Manage helptexts",
|
||||
"", "/helptexts", true, [], [], {communityId:'openaire'}))
|
||||
|
||||
}*/
|
||||
if (Session.isPortalAdministrator(this.user) || Session.isMonitorCurator(this.user) || Session.isCommunityCurator(this.user)) {
|
||||
this.userMenuItems.push(new MenuItem("", "Manage Stakeholders",
|
||||
"", "/admin", true, [], [], {communityId:'openaire'}))
|
||||
|
||||
}
|
||||
if (this.user) {
|
||||
this.userMenuItems.push(new MenuItem("", "User information", "", "/user-info", false, [], [], {}));
|
||||
|
|
|
@ -173,10 +173,14 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a *ngIf="stakeholder && isLoggedIn()" id="style_switcher" class="" routerLinkActive="active"
|
||||
[routerLink]="['/admin', this.stakeholder.alias]">
|
||||
<div id="style_switcher_toggle"><i class="material-icons">settings</i></div>
|
||||
</a>
|
||||
<div *ngIf="stakeholder" id="style_switcher" title="This functionality is comming soon. Stay tuned!">
|
||||
<div id="style_switcher_toggle">
|
||||
<a *ngIf="isAdmin() " [routerLink]="['/admin', this.stakeholder.alias]" >
|
||||
<i class="material-icons">settings</i>
|
||||
</a>
|
||||
<i *ngIf="!isAdmin() " class="material-icons uk-text-muted">settings</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import {Subscription} from "rxjs";
|
|||
import {Session, User} from "../openaireLibrary/login/utils/helper.class";
|
||||
import {MenuItem} from "../openaireLibrary/sharedComponents/menu";
|
||||
import {UserManagementService} from "../openaireLibrary/services/user-management.service";
|
||||
import {StakeholderCreator} from "../utils/entities/stakeholderCreator";
|
||||
|
||||
@Component({
|
||||
selector: 'monitor',
|
||||
|
@ -114,18 +115,18 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
|
|||
// if (params['stakeholder'] == "fwf") {
|
||||
// stakeholder = new Stakeholder(null, "funder", "fwf_________::FWF", "Austrian Science Fund (FWF)", "FWF",
|
||||
// "fwf", true, true, null);
|
||||
// stakeholder = this.stakeholderUtils.createFunderFromDefaultProfile(stakeholder, StakeholderCreator.createFunderDefaultProfile().topics);
|
||||
// stakeholder = this.stakeholderUtils.createFunderFromDefaultProfile(stakeholder, StakeholderCreator.createFunderDefaultProfile(stakeholder).topics);
|
||||
// stakeholder.logoUrl = "./assets/fwf.png";
|
||||
// } else if (params['stakeholder'] == "arc") {
|
||||
// stakeholder = new Stakeholder(null, "funder", "arc_________::ARC",
|
||||
// "Australian Research Council (ARC)", "ARC", "arc", true, true, null);
|
||||
// stakeholder = this.stakeholderUtils.createFunderFromDefaultProfile(stakeholder, StakeholderCreator.createFunderDefaultProfile().topics);
|
||||
// stakeholder = this.stakeholderUtils.createFunderFromDefaultProfile(stakeholder, StakeholderCreator.createFunderDefaultProfile(stakeholder).topics);
|
||||
// stakeholder.logoUrl = "./assets/arc1.gif";
|
||||
// } else {
|
||||
// } else if (params['stakeholder'] == "ec") {
|
||||
// stakeholder = new Stakeholder(null, "funder", "ec__________::EC",
|
||||
// "European Commission", "EC",
|
||||
// "ec", true, true, null);
|
||||
// stakeholder = this.stakeholderUtils.createFunderFromDefaultProfile(stakeholder, StakeholderCreator.createFunderDefaultProfile().topics);
|
||||
// stakeholder = this.stakeholderUtils.createFunderFromDefaultProfile(stakeholder, StakeholderCreator.createFunderDefaultProfile(stakeholder).topics);
|
||||
// stakeholder.logoUrl = "./assets/ec.png";
|
||||
// }
|
||||
if (stakeholder) {
|
||||
|
@ -346,7 +347,7 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
|
|||
|
||||
public getUrlByStakeHolder(indicatorPath: IndicatorPath) {
|
||||
return this.sanitizer.bypassSecurityTrustResourceUrl(
|
||||
this.statisticsService.getChartUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(indicatorPath, this.fundingL0, this.startYear, this.endYear)));
|
||||
this.statisticsService.getChartUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath, this.fundingL0, this.startYear, this.endYear)));
|
||||
}
|
||||
|
||||
public setActiveChart(i: number, j: number, type: string) {
|
||||
|
@ -377,10 +378,13 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
|
|||
|
||||
buildMenu() {
|
||||
this.userMenuItems = [];
|
||||
if (Session.isPortalAdministrator(this.user)) {
|
||||
this.userMenuItems.push(new MenuItem("", "Manage helptexts",
|
||||
((this.properties.environment == "beta") ? "https://beta.admin.connect.openaire.eu" : "https://admin.explore.openaire.eu") + "/dashboard?communityId=openaire", "", true, [], [], {}))
|
||||
|
||||
// if (Session.isPortalAdministrator(this.user)) {
|
||||
// this.userMenuItems.push(new MenuItem("", "Manage helptexts",
|
||||
// ((this.properties.environment == "beta") ? "https://beta.admin.connect.openaire.eu" : "https://admin.explore.openaire.eu") + "/dashboard?communityId=openaire", "", true, [], [], {}))
|
||||
//
|
||||
// }
|
||||
if (this.user) {
|
||||
this.userMenuItems.push(new MenuItem("", "Manage Stakeholders", "", "/admin", false, [], [], {}));
|
||||
}
|
||||
if (this.user) {
|
||||
this.userMenuItems.push(new MenuItem("", "User information", "", "/user-info", false, [], [], {}));
|
||||
|
@ -388,7 +392,7 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
|
|||
}
|
||||
|
||||
isAdmin(){
|
||||
return this.user && Session.isPortalAdministrator(this.user);
|
||||
return this.user && (Session.isPortalAdministrator(this.user) || Session.isCommunityCurator(this.user) || Session.isMonitorCurator(this.user));
|
||||
}
|
||||
|
||||
isLoggedIn() {
|
||||
|
|
|
@ -137,11 +137,11 @@
|
|||
<div class="uk-width-1-1">
|
||||
{{indicator.description}}
|
||||
</div>
|
||||
<div class="uk-width-1-2 uk-text-center">
|
||||
<div class="uk-width-1-2 uk-text-center" title="{{indicator.isPublic?'Visible to all users':'Visible to members'}}">
|
||||
<i class="material-icons md-24">{{indicatorUtils.isPublicIcon.get(indicator.isPublic)}}</i>
|
||||
<div>{{(indicator.isPublic) ? 'Public' : 'Private'}}</div>
|
||||
</div>
|
||||
<div class="uk-width-1-2 uk-text-center">
|
||||
<div class="uk-width-1-2 uk-text-center" title="{{indicator.isActive?'Included in the indicators list':'Available only through administration dashboard'}}">
|
||||
<i class="material-icons md-24"
|
||||
[class.md-color-green-300]="indicator.isActive">{{indicatorUtils.isActiveIcon}}</i>
|
||||
<div>{{(indicator.isActive) ? 'Active' : 'Inactive'}}</div>
|
||||
|
@ -198,13 +198,13 @@
|
|||
{{indicatorPath.type + ' Chart'}}
|
||||
</div>
|
||||
</ng-template>
|
||||
<div *ngIf="!grid" class="uk-margin-medium-right uk-flex uk-flex-middle">
|
||||
<div *ngIf="!grid" class="uk-margin-medium-right uk-flex uk-flex-middle" title="{{indicator.isPublic?'Visible to all users':'Visible to members'}}">
|
||||
<i class="material-icons md-24 uk-margin-small-right">
|
||||
{{indicatorUtils.isPublicIcon.get(indicator.isPublic)}}
|
||||
</i>
|
||||
{{(indicator.isPublic) ? 'Public' : 'Private'}}
|
||||
</div>
|
||||
<div *ngIf="!grid" class="uk-margin-medium-right uk-flex uk-flex-middle">
|
||||
<div *ngIf="!grid" class="uk-margin-medium-right uk-flex uk-flex-middle" title="{{indicator.isActive?'Included in the indicators list':'Available only through administration dashboard'}}" >
|
||||
<i class="material-icons md-24 uk-margin-small-right"
|
||||
[class.md-color-green-300]="indicator.isActive">
|
||||
{{indicatorUtils.isActiveIcon}}
|
||||
|
@ -247,21 +247,23 @@
|
|||
<div class="uk-text-capitalize">{{indicatorPath.type + ' Chart'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-width-1-3 uk-text-center">
|
||||
<div class="uk-width-1-3 uk-text-center"
|
||||
title="{{indicator.isPublic?'Visible to all users':'Visible to members'}}">
|
||||
<i class="material-icons md-24">
|
||||
{{indicatorUtils.isPublicIcon.get(indicator.isPublic)}}
|
||||
</i>
|
||||
<div>{{(indicator.isPublic) ? 'Public' : 'Private'}}</div>
|
||||
</div>
|
||||
<div class="uk-width-1-3 uk-text-center">
|
||||
<div class="uk-width-1-3 uk-text-center"
|
||||
title="{{indicator.isActive?'Included in the indicators list':'Available only through administration dashboard'}}">
|
||||
<i class="material-icons md-24" [class.md-color-green-300]="indicator.isActive">
|
||||
{{indicatorUtils.isActiveIcon}}
|
||||
</i>
|
||||
<div>{{(indicator.isActive) ? 'Active' : 'Inactive'}}</div>
|
||||
</div>
|
||||
<iframe *ngIf="indicator.indicatorPaths[0] && indicator.indicatorPaths[0].source !== 'image' &&
|
||||
safeUrls.get(indicatorUtils.getFullUrl(indicator.indicatorPaths[0]))"
|
||||
[src]="safeUrls.get(indicatorUtils.getFullUrl(indicator.indicatorPaths[0]))"
|
||||
safeUrls.get(indicatorUtils.getFullUrl(stakeholder, indicator.indicatorPaths[0]))"
|
||||
[src]="safeUrls.get(indicatorUtils.getFullUrl(stakeholder, indicator.indicatorPaths[0]))"
|
||||
class="uk-width-1-1 uk-height-medium"></iframe>
|
||||
<div *ngIf="indicator.indicatorPaths[0] && indicator.indicatorPaths[0].source === 'image'">
|
||||
<img class="uk-width-1-1 uk-height-medium" [src]="indicator.indicatorPaths[i].url">
|
||||
|
@ -338,8 +340,12 @@
|
|||
<div *ngFor="let indicatorPath of indicatorPaths.controls; let i=index"
|
||||
[formGroup]="indicatorPath">
|
||||
<div dashboard-input class="uk-form-row"
|
||||
[title]="indicatorPath.get('url').disabled?'Default chart URLs cannot change':''"
|
||||
[formInput]="indicatorPath.get('url')"
|
||||
label="Chart Url"></div>
|
||||
<div *ngIf="urlParameterizedMessage.length > 0" class="uk-alert-warning uk-alert">
|
||||
{{urlParameterizedMessage}}
|
||||
</div>
|
||||
<div formArrayName="parameters">
|
||||
<div *ngIf="getParameter(i, 'title')" class="uk-form-row">
|
||||
<div dashboard-input
|
||||
|
|
|
@ -78,6 +78,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
@ViewChild('deleteModal') deleteModal: AlertModal;
|
||||
@ViewChild('deleteChartSectionModal') deleteChartSectionModal: AlertModal;
|
||||
|
||||
urlParameterizedMessage = "";
|
||||
constructor(private layoutService: LayoutService,
|
||||
private stakeholderService: StakeholderService,
|
||||
private statisticsService: StatisticsService,
|
||||
|
@ -227,7 +228,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
this.displayCharts.forEach(section => {
|
||||
section.indicators.forEach(indicator => {
|
||||
indicator.indicatorPaths.forEach(indicatorPath => {
|
||||
let url = this.indicatorUtils.getFullUrl(indicatorPath);
|
||||
let url = this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath);
|
||||
if (!this.safeUrls.get('url')) {
|
||||
indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath);
|
||||
this.safeUrls.set(url, indicatorPath.safeResourceUrl);
|
||||
|
@ -357,11 +358,11 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
|
||||
private getSecureUrlByStakeHolder(indicatorPath: IndicatorPath) {
|
||||
return this.sanitizer.bypassSecurityTrustResourceUrl(
|
||||
this.statisticsService.getChartUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(indicatorPath)));
|
||||
this.statisticsService.getChartUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath)));
|
||||
}
|
||||
|
||||
private getUrlByStakeHolder(indicatorPath: IndicatorPath) {
|
||||
return this.statisticsService.getChartUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(indicatorPath));
|
||||
return this.statisticsService.getChartUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath));
|
||||
}
|
||||
|
||||
public addIndicatorPath(value: string = '', parameters: FormArray = new FormArray([]), disableUrl: boolean = false) {
|
||||
|
@ -382,6 +383,17 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
this.urlSubscriptions.push(this.indicatorPaths.at(index).get('url').valueChanges.subscribe(value => {
|
||||
if (this.indicatorPaths.at(index).get('url').valid) {
|
||||
let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.statisticsService.getChartSource(value), value, 'bar', this.stakeholder);
|
||||
if(indicatorPath.chartObject && Object.keys(indicatorPath.parameters).indexOf("index_id") ==-1 && Object.keys(indicatorPath.parameters).indexOf("index_name") ==-1 && Object.keys(indicatorPath.parameters).indexOf("index_shortName") ==-1 ){
|
||||
// default profile
|
||||
if(this.stakeholder.defaultId == null){
|
||||
this.urlParameterizedMessage = "This chart couldn't be generated properly. Stakeholders based on this profile may not inherit the data correctly."
|
||||
}else{
|
||||
this.urlParameterizedMessage = "This chart couldn't be generated properly. Please make sure chart data is for the current stakeholder."
|
||||
}
|
||||
}else {
|
||||
this.urlParameterizedMessage = "";
|
||||
}
|
||||
console.debug(this.urlParameterizedMessage);
|
||||
let parameters = this.getParametersAsFormArray(indicatorPath);
|
||||
(this.indicatorPaths.at(index) as FormGroup).setControl('parameters', parameters);
|
||||
if (!this.indicator.indicatorPaths[index]) {
|
||||
|
@ -421,6 +433,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
}
|
||||
|
||||
public editChartIndicatorOpen(section: Section, id = null) {
|
||||
this.urlParameterizedMessage = "";
|
||||
this.urlSubscriptions.forEach(value => {
|
||||
if (value instanceof Subscriber) {
|
||||
value.unsubscribe();
|
||||
|
|
|
@ -196,8 +196,7 @@ export class IndicatorUtils {
|
|||
['end_year', [Validators.required, Validators.pattern('^\\d+$')]]
|
||||
]);
|
||||
|
||||
public getFullUrl(indicatorPath: IndicatorPath, fundingL0: string = null, startDate: string = null, endDate: string = null): string {
|
||||
|
||||
public getFullUrl(stakeholder:Stakeholder, indicatorPath: IndicatorPath, fundingL0: string = null, startDate: string = null, endDate: string = null): string {
|
||||
let replacedUrl = indicatorPath.chartObject;
|
||||
if (indicatorPath.parameters) {
|
||||
Object.keys(indicatorPath.parameters).forEach(key => {
|
||||
|
@ -208,6 +207,16 @@ export class IndicatorUtils {
|
|||
if (endDate && key == "end_year" && indicatorPath.filters["end_year"]) {
|
||||
replacedValue = (replacedValue > endDate) ? endDate : replacedValue;
|
||||
}
|
||||
if (key == "index_id") {
|
||||
replacedValue = stakeholder.index_id;
|
||||
}
|
||||
if (key == "index_name") {
|
||||
replacedValue = stakeholder.index_name;
|
||||
}
|
||||
if (key == "index_shortName") {
|
||||
replacedValue = stakeholder.index_shortName.toLowerCase();
|
||||
}
|
||||
|
||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue)
|
||||
});
|
||||
}
|
||||
|
@ -299,7 +308,7 @@ export class IndicatorUtils {
|
|||
private getQueryObjectName(obj){
|
||||
if(obj["library"] && obj["library"] == "GoogleCharts"){
|
||||
return "queriesInfo";
|
||||
}else if(obj["library"] && obj["library"] == "HighCharts") {
|
||||
}else if(obj["library"] && ( obj["library"] == "HighCharts" || obj["library"] == "eCharts")) {
|
||||
return "queries";
|
||||
}
|
||||
}
|
||||
|
@ -425,8 +434,8 @@ export class IndicatorUtils {
|
|||
let parameters = (query["query"]["parameters"])?query["query"]["parameters"]:[];
|
||||
if(name.split('.')[0] == "rcd" && parameters.length > 0 && stakeholder.type=="ri") {
|
||||
//rcd.{{queryname}}
|
||||
parameters[0] = ChartHelper.prefix + "index_shortName" + ChartHelper.suffix;
|
||||
indicatorPath.parameters["index_shortName"] = stakeholder.index_shortName.toLowerCase();
|
||||
parameters[0] = ChartHelper.prefix + "index_id" + ChartHelper.suffix;
|
||||
indicatorPath.parameters["index_id"] = stakeholder.index_id;
|
||||
}else if(name.split('.')[0] == "monitor" && parameters.length == 0 && stakeholder.type=="funder"){
|
||||
// old saved queries without params
|
||||
//monitor.{{funder_shortName}}.{{type}}.{{queryname}}
|
||||
|
@ -441,7 +450,7 @@ export class IndicatorUtils {
|
|||
indicatorPath.parameters["index_id"] = stakeholder.index_id;
|
||||
}else if( name.split('.').length > 3 && name.split('.')[3] == "shortname") {
|
||||
parameters[0] = ChartHelper.prefix + "index_shortName" + ChartHelper.suffix;
|
||||
indicatorPath.parameters["index_shortName"] = stakeholder.index_shortName;
|
||||
indicatorPath.parameters["index_shortName"] = stakeholder.index_shortName.toLowerCase();
|
||||
}else if( name.split('.').length > 3 && name.split('.')[3] == "name") {
|
||||
parameters[0] = ChartHelper.prefix + "index_name" + ChartHelper.suffix;
|
||||
indicatorPath.parameters["index_name"] = stakeholder.index_name;
|
||||
|
@ -463,7 +472,7 @@ export class IndicatorUtils {
|
|||
}
|
||||
private extractTitle(obj, indicatorPath: IndicatorPath) {
|
||||
let title = "";
|
||||
if (obj["library"] && obj["library"] == "HighCharts" &&obj["chartDescription"]["title"]) {
|
||||
if (obj["library"] && ( obj["library"] == "HighCharts" || obj["library"] == "eCharts") && obj["chartDescription"]["title"]) {
|
||||
title = obj["chartDescription"]["title"]["text"];
|
||||
obj["chartDescription"]["title"]["text"] = ChartHelper.prefix + "title" + ChartHelper.suffix;
|
||||
}else if (obj["library"] && obj["library"] == "GoogleCharts" && obj["chartDescription"]["options"]["title"]) {
|
||||
|
@ -479,17 +488,24 @@ export class IndicatorUtils {
|
|||
subtitle = obj["chartDescription"]["subtitle"]["text"];
|
||||
obj["chartDescription"]["subtitle"]["text"] = ChartHelper.prefix + "subtitle" + ChartHelper.suffix;
|
||||
indicatorPath.parameters["subtitle"] = subtitle ? subtitle : "";
|
||||
}else if (obj["chartDescription"]["title"] && obj["chartDescription"]["title"]["subtext"]) {
|
||||
subtitle = obj["chartDescription"]["title"]["subtext"];
|
||||
obj["chartDescription"]["title"]["subtext"] = ChartHelper.prefix + "subtitle" + ChartHelper.suffix;
|
||||
indicatorPath.parameters["subtitle"] = subtitle ? subtitle : "";
|
||||
}
|
||||
}
|
||||
|
||||
private extractXTitle(obj, indicatorPath: IndicatorPath) {
|
||||
let title = "";
|
||||
if (obj["library"] && obj["library"] == "HighCharts" && obj["chartDescription"]["xAxis"]["title"]) {
|
||||
if (obj["library"] && obj["library"] == "HighCharts" && obj["chartDescription"]["xAxis"]["title"]) {
|
||||
title = obj["chartDescription"]["xAxis"]["title"]["text"];
|
||||
obj["chartDescription"]["xAxis"]["title"]["text"] = ChartHelper.prefix + "xAxisTitle" + ChartHelper.suffix;
|
||||
}else if (obj["library"] && obj["library"] == "GoogleCharts" && obj["chartDescription"]["options"]["hAxis"]["title"]) {
|
||||
title = obj["chartDescription"]["options"]["hAxis"]["title"];
|
||||
obj["chartDescription"]["options"]["hAxis"]["title"] = ChartHelper.prefix + "xAxisTitle" + ChartHelper.suffix;
|
||||
}else if (obj["library"] && obj["library"] == "eCharts" && obj["chartDescription"]["xAxis"]["name"]) {
|
||||
title = obj["chartDescription"]["xAxis"]["name"];
|
||||
obj["chartDescription"]["xAxis"]["name"] = ChartHelper.prefix + "xAxisTitle" + ChartHelper.suffix;
|
||||
}
|
||||
indicatorPath.parameters["xAxisTitle"] = title ? title : "";
|
||||
}
|
||||
|
@ -502,6 +518,9 @@ export class IndicatorUtils {
|
|||
}else if (obj["library"] && obj["library"] == "GoogleCharts" && obj["chartDescription"]["options"]["vAxis"]["title"]) {
|
||||
title = obj["chartDescription"]["options"]["vAxis"]["title"];
|
||||
obj["chartDescription"]["options"]["vAxis"]["title"] = ChartHelper.prefix + "yAxisTitle" + ChartHelper.suffix;
|
||||
}else if (obj["library"] && obj["library"] == "eCharts" && obj["chartDescription"]["yAxis"]["name"]) {
|
||||
title = obj["chartDescription"]["yAxis"]["name"];
|
||||
obj["chartDescription"]["yAxis"]["name"] = ChartHelper.prefix + "xAxisTitle" + ChartHelper.suffix;
|
||||
}
|
||||
indicatorPath.parameters["yAxisTitle"] = title ? title : "";
|
||||
}
|
||||
|
|
|
@ -10,35 +10,37 @@ import {SourceType} from "../entities/stakeholder";
|
|||
})
|
||||
export class StatisticsService {
|
||||
|
||||
numberSources: Map<string, string> = new Map<string, string>();
|
||||
chartSources: Map<SourceType, string> = new Map<SourceType, string>();
|
||||
numberSources: Map<string, string[]> = new Map<string, string[]>();
|
||||
chartSources: Map<SourceType, string[]> = new Map<SourceType, string[]>();
|
||||
|
||||
constructor(private http:HttpClient, private environmentSpecificService: EnvironmentSpecificService) {
|
||||
this.environmentSpecificService.subscribeEnvironment().subscribe(properties => {
|
||||
this.numberSources.set('statistics', properties.statisticsAPIURL);
|
||||
this.numberSources.set('search', properties.searchAPIURLLAst);
|
||||
this.numberSources.set('metrics', properties.metricsAPIURL);
|
||||
this.chartSources.set('stats-tool', properties.statisticsFrameNewAPIURL);
|
||||
this.chartSources.set('old', properties.statisticsFrameAPIURL);
|
||||
this.chartSources.set('metrics', properties.metricsAPIURL);
|
||||
this.chartSources.set('image', '');
|
||||
})
|
||||
}
|
||||
constructor(private http:HttpClient, private environmentSpecificService: EnvironmentSpecificService) {
|
||||
this.environmentSpecificService.subscribeEnvironment().subscribe(properties => {
|
||||
this.numberSources.set('statistics', [properties.statisticsAPIURL]);
|
||||
this.numberSources.set('search', [properties.searchAPIURLLAst]);
|
||||
this.numberSources.set('metrics', [properties.metricsAPIURL]);
|
||||
this.chartSources.set('stats-tool', [properties.statisticsFrameNewAPIURL, "http://marilyn.athenarc.gr:8080/stats-api/", "http://88.197.53.71:8080/stats-api/", "https://stats.madgik.di.uoa.gr/stats-api/"]);
|
||||
this.chartSources.set('old', [properties.statisticsFrameAPIURL]);
|
||||
this.chartSources.set('metrics', [properties.metricsAPIURL]);
|
||||
this.chartSources.set('image', [""]);
|
||||
})
|
||||
}
|
||||
|
||||
getNumbers(source: string, url: string): Observable<any> {
|
||||
return this.http.get<any>(this.numberSources.get(source) + url);
|
||||
}
|
||||
|
||||
getChartUrl(source: SourceType, url: string): string {
|
||||
return this.chartSources.get(source) + url;
|
||||
return this.chartSources.get(source)[0] + url;
|
||||
}
|
||||
|
||||
getChartSource(url: string): SourceType {
|
||||
let source: SourceType = 'image';
|
||||
this.chartSources.forEach((value, key) => {
|
||||
this.chartSources.forEach((values, key) => {
|
||||
values.forEach((value) => {
|
||||
if(value !== '' && url.indexOf(value) !== -1) {
|
||||
source = key;
|
||||
}
|
||||
});
|
||||
});
|
||||
return source;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"framesAPIURL" : "https://beta.openaire.eu/stats3/",
|
||||
"statisticsAPIURL" : "https://beta.services.openaire.eu/stats-api/",
|
||||
"statisticsFrameAPIURL":"https://beta.openaire.eu/stats/",
|
||||
"statisticsFrameNewAPIURL": "http://88.197.53.71:8080/stats-api/",
|
||||
"statisticsFrameNewAPIURL": "https://stats.madgik.di.uoa.gr/stats-api/",
|
||||
"useNewStatistisTool":false,
|
||||
"claimsAPIURL" : "http://scoobydoo.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/",
|
||||
"searchAPIURLLAst" : "https://beta.services.openaire.eu/search/v2/api/",
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<base href="/"/>
|
||||
<!-- <base href="/monitor/dashboard/"/>-->
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
||||
<meta name="description" content="OpenAIRE Monitor, funder, funding, research, "/>
|
||||
|
||||
|
@ -51,17 +50,6 @@
|
|||
<app-root></app-root>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
window.onerror = function (errorMsg, url, lineNumber, column, errorObj) {
|
||||
// console.log(errorMsg + " __" + url + " __" + lineNumber + " __" + column + " __" + errorObj);
|
||||
if((errorMsg && errorMsg.indexOf("uikit.js") != -1) || url.indexOf("uikit.js") != -1 ){
|
||||
console.log("********UIKIT Error ***********");
|
||||
$.getScript("assets/theme-assets/uikit/js/uikit.min.js");
|
||||
$.getScript("assets/theme-assets/uikit/js/uikit-icons.min.js");
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
console.log("Is ready - load uikit ***")
|
||||
|
@ -106,8 +94,4 @@
|
|||
document.getElementsByTagName("head")[0].appendChild(fileref)
|
||||
}*/
|
||||
</script>
|
||||
<!-- Go to www.addthis.com/dashboard to customize your tools -->
|
||||
<!-- to update addThis: https://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-559d24521cd8c080-->
|
||||
<!-- <script type="text/javascript" src="https://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5a12dbd124e4e521"></script> -->
|
||||
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-559d24521cd8c080"></script>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue