[Admin | Trunk]: 1. Add statistics overall toggle. 2. Remove conditions if there are resutls on statistics. 3. Add titles in all pages.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@58371 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-04-01 13:40:48 +00:00
parent 69541b882b
commit fd780ad708
29 changed files with 110 additions and 48 deletions

View File

@ -93,7 +93,6 @@ const appRoutes: Routes = [
loadChildren: './pages/helpcontent/edit-page-help-content.module#EditPageHelpContentModule',
resolve: { envSpecific: EnvironmentSpecificResolver }
},
{
path: 'classContents',
loadChildren: './pages/divhelpcontent/div-help-contents.module#DivHelpContentsModule',

View File

@ -11,6 +11,7 @@ import {AlertModal} from '../../openaireLibrary/utils/modal/alert';
import {UtilitiesService} from '../../openaireLibrary/services/utilities.service';
import {AffiliationService} from "../../openaireLibrary/connect/affiliations/affiliation.service";
import {HelpContentService} from "../../services/help-content.service";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'affiliations',
@ -43,6 +44,7 @@ export class AffiliationsComponent implements OnInit {
constructor(private element: ElementRef,
private route: ActivatedRoute,
private _router: Router,
private title: Title,
private affiliationService: AffiliationService,
private _helpContentService: HelpContentService) {
}
@ -51,6 +53,9 @@ export class AffiliationsComponent implements OnInit {
ngOnInit() {
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
if(!this.curatorAffiliations) {
this.title.setTitle('Administration Dashboard | Related Organizations');
}
if (!Session.isLoggedIn()) {
this._router.navigate(['/user-info'], {
queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url}

View File

@ -12,6 +12,7 @@ import { EnvProperties } from '../../openaireLibrary/utils/properties/env-proper
import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'communities',
@ -61,13 +62,14 @@ export class CommunitiesComponent implements OnInit {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
HelperFunctions.scroll();
this.title.setTitle('Administration Dashboard | Communities');
this.properties = data.envSpecific;
this.getCommunities();
});
}
constructor(private element: ElementRef, private route: ActivatedRoute,
private title: Title,
private _router: Router, private _helpContentService: HelpContentService) {}

View File

@ -15,6 +15,7 @@ import {Validator} from '../../../openaireLibrary/utils/email/validator';
import {Session} from '../../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../../openaireLibrary/utils/HelperFunctions.class";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'community-edit-form',
@ -53,6 +54,7 @@ export class CommunityEditFormComponent implements OnInit{
public properties: EnvProperties = null;
constructor (private element: ElementRef,
private title: Title,
private route: ActivatedRoute,
private _router: Router,
public _fb: FormBuilder,
@ -68,7 +70,7 @@ export class CommunityEditFormComponent implements OnInit{
this.route.queryParams.subscribe(
communityId => {
HelperFunctions.scroll();
this.title.setTitle('Administration Dashboard | Community Profile');
this.communityId = communityId['communityId'];
this.email = {body: '', subject: '', recipients: []};

View File

@ -6,6 +6,7 @@ import {EnvProperties} from '../../../../openaireLibrary/utils/properties/env-pr
import {ContentProvider} from '../../../../openaireLibrary/utils/entities/contentProvider';
import {FormArray, FormBuilder, FormGroup, Validators} from '@angular/forms';
import {ManageCommunityContentProvidersService} from '../../../../services/manageContentProviders.service';
import {Title} from '@angular/platform-browser';
@Component({
selector: 'criteria',
@ -22,6 +23,7 @@ export class CriteriaComponent implements OnInit {
public errorMessage: string;
constructor(private route: ActivatedRoute, private _router: Router,
private title: Title,
private searchCommunityDataprovidersService: SearchCommunityDataprovidersService,
private manageCommunityContentProvidersService: ManageCommunityContentProvidersService,
private fb: FormBuilder) {
@ -37,6 +39,7 @@ export class CriteriaComponent implements OnInit {
if (params['openaireId']) {
this.openaireId = params['openaireId'];
}
this.title.setTitle('Administration Dashboard | Criteria');
this.searchCommunityDataprovidersService.searchDataproviders(this.properties, this.community).subscribe(dataProviders => {
dataProviders.forEach(dataProvider => {
if (dataProvider.openaireId == this.openaireId) {

View File

@ -7,6 +7,7 @@ import {AddContentProvidersComponent} from './add-content-providers.component';
import {Session} from '../../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../../openaireLibrary/utils/HelperFunctions.class";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'manage-content-providers',
@ -47,12 +48,15 @@ export class ManageContentProvidersComponent implements OnInit {
this.route.queryParams.subscribe(params => {
if(params['communityId']) {
this.community = params['communityId'];
this.title.setTitle('Administration Dashboard | Content Providers');
}
HelperFunctions.scroll();
});
}
constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router) {}
constructor(private element: ElementRef,
private title: Title,
private route: ActivatedRoute, private _router: Router) {}
public ngOnDestroy() {}

View File

@ -7,6 +7,7 @@ import {AddProjectsComponent} from './add-projects.component';
import {Session} from '../../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../../openaireLibrary/utils/HelperFunctions.class";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'manage-projects',
@ -48,11 +49,14 @@ export class ManageProjectsComponent implements OnInit {
this.route.queryParams.subscribe(params => {
if(params['communityId']) {
this.community = params['communityId'];
this.title.setTitle('Administration Dashboard | Projects');
}
});
}
constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router) {}
constructor(private element: ElementRef,
private title: Title,
private route: ActivatedRoute, private _router: Router) {}
public ngOnDestroy() {}

View File

@ -12,6 +12,7 @@ import {UtilitiesService} from '../../openaireLibrary/services/utilities.service
import {HelpContentService} from '../../services/help-content.service';
import {AlertModal} from '../../openaireLibrary/utils/modal/alert';
import {UserManagementService} from '../../openaireLibrary/services/user-management.service';
import {Title} from '@angular/platform-browser';
@Component({
selector: 'curator',
@ -47,6 +48,7 @@ export class CuratorComponent implements OnInit {
constructor(private element: ElementRef,
private route: ActivatedRoute,
private _router: Router,
private title: Title,
private curatorService: CuratorService,
private utilitiesService: UtilitiesService,
private helpContentService: HelpContentService,
@ -64,6 +66,7 @@ export class CuratorComponent implements OnInit {
} else {
this.route.queryParams.subscribe((params) => {
this.communityId = params['communityId'];
this.title.setTitle('Administration Dashboard | Personal Info');
this.showLoading = true;
this.updateErrorMessage = '';
this.userManagementService.getUserInfo().subscribe(user => {

View File

@ -6,7 +6,7 @@ import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properti
import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {Curator} from '../../openaireLibrary/utils/entities/CuratorInfo';
import {DomSanitizer} from '@angular/platform-browser';
import {DomSanitizer, Title} from '@angular/platform-browser';
import {CustomizationOptions} from '../../openaireLibrary/connect/community/CustomizationOptions';
import {StringUtils} from '../../openaireLibrary/utils/string-utils.class';
import {LayoutService} from '../../openaireLibrary/services/layout.service';
@ -47,6 +47,7 @@ export class CustomizationComponent implements OnInit {
constructor(private element: ElementRef,
private route: ActivatedRoute,
private _router: Router,
private title: Title,
private sanitizer: DomSanitizer,
private layoutService: LayoutService) {
}
@ -62,6 +63,7 @@ export class CustomizationComponent implements OnInit {
} else {
this.route.queryParams.subscribe((params) => {
this.communityId = params['communityId'];
this.title.setTitle('Administration Dashboard | Customization');
this.showLoading = true;
this.errorMessage = '';
this.successfulSaveMessage = '';

View File

@ -7,6 +7,7 @@ import {ActivatedRoute} from '@angular/router';
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'dashboard',
@ -19,10 +20,12 @@ export class DashboardComponent implements OnInit {
constructor( private element: ElementRef,
private route: ActivatedRoute,
private title: Title,
private _communityService: CommunityService) {}
ngOnInit() {
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
this.title.setTitle('Administration Dashboard | Overview');
this.properties = data.envSpecific;
this.route.queryParams.subscribe(data => {
HelperFunctions.scroll();

View File

@ -11,6 +11,7 @@ import { EnvProperties } from '../../openaireLibrary/utils/properties/env-proper
import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'divIds',
@ -60,7 +61,7 @@ export class DivIdsComponent implements OnInit {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
HelperFunctions.scroll();
this.title.setTitle('Administration Dashboard | Classes');
this.properties = data.envSpecific;
this.formGroup = this.formComponent.form;
@ -68,7 +69,9 @@ export class DivIdsComponent implements OnInit {
});
}
constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router, private _helpContentService: HelpContentService) {}
constructor(private element: ElementRef, private route: ActivatedRoute,
private _router: Router, private title: Title,
private _helpContentService: HelpContentService) {}
getDivIds() {
if(!Session.isLoggedIn()){

View File

@ -13,6 +13,7 @@ import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {PageHelpContent} from "../../domain/page-help-content";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'div-help-contents',
@ -64,7 +65,7 @@ export class DivHelpContentsComponent implements OnInit {
this.route.queryParams.subscribe(params => {
HelperFunctions.scroll();
this.title.setTitle('Administration Dashboard | Class Help Texts');
this.selectedCommunityPid = params['communityId'];
this.selectedPageId = params['pageId'];
@ -78,7 +79,9 @@ export class DivHelpContentsComponent implements OnInit {
});
}
constructor(private element: ElementRef, private route: ActivatedRoute, private _helpService: HelpContentService, private router : Router) {}
constructor(private element: ElementRef, private route: ActivatedRoute,
private title: Title,
private _helpService: HelpContentService, private router : Router) {}
getPage(pageId: string) {
if(!Session.isLoggedIn()){
@ -87,7 +90,6 @@ export class DivHelpContentsComponent implements OnInit {
this.showLoading = true;
this.updateErrorMessage = "";
this.errorMessage = "";
this._helpService.getPage(pageId, this.properties.adminToolsAPIURL).subscribe(
page => {
if( (this.selectedCommunityPid == 'openaire' && !page.openaire)

View File

@ -10,6 +10,7 @@ import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {Page} from "../../domain/page";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'edit-div-help-content',
@ -39,6 +40,7 @@ export class EditDivHelpContentComponent implements OnInit, OnDestroy{
private element: ElementRef,
private route: ActivatedRoute,
private router: Router,
private title: Title,
private _helpContentService: HelpContentService) {}
ngOnInit() {
@ -52,7 +54,7 @@ export class EditDivHelpContentComponent implements OnInit, OnDestroy{
let divContentId = params['classContentId'];
this.communityPid = params['communityId'];
this.pageId = params['pageId'];
this.title.setTitle('Administration Dashboard | Edit Class Help Text');
if(!divContentId) {
this.router.navigate(['/classContents'], { queryParams: { "communityId": this.communityPid} });
}

View File

@ -9,6 +9,7 @@ import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {Page} from "../../domain/page";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'new-div-help-content',
@ -37,6 +38,7 @@ export class NewDivHelpContentComponent {
private element: ElementRef,
private route: ActivatedRoute,
private router: Router,
private title: Title,
private _helpContentService: HelpContentService) {}
ngOnInit() {
@ -45,7 +47,7 @@ export class NewDivHelpContentComponent {
this.properties = data.envSpecific;
this.route.queryParams.subscribe(params => {
HelperFunctions.scroll();
this.title.setTitle('Administration Dashboard | New Class Help Text');
this.communityPid = params['communityId'];
this.pageId = params['pageId'];

View File

@ -10,6 +10,7 @@ import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {UserManagementService} from '../../openaireLibrary/services/user-management.service';
import {Title} from '@angular/platform-browser';
@Component({
selector: 'entities',
@ -57,7 +58,7 @@ export class EntitiesComponent implements OnInit {
public isPortalAdministrator = null;
constructor(private element: ElementRef, private route: ActivatedRoute,
private _router: Router,
private _router: Router, private title: Title,
private _helpContentService: HelpContentService,
private userManagementService: UserManagementService) {}
@ -66,7 +67,7 @@ export class EntitiesComponent implements OnInit {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.title.setTitle('Administration Dashboard | Entities');
this.route.queryParams.subscribe(params => {
HelperFunctions.scroll();
this.userManagementService.getUserInfo().subscribe( user => {

View File

@ -13,6 +13,7 @@ import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {Page} from "../../domain/page";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'edit-page-help-content',
@ -44,6 +45,7 @@ export class EditPageHelpContentComponent implements OnInit, OnDestroy{
private element: ElementRef,
private route: ActivatedRoute,
private router: Router,
private title: Title,
private _helpContentService: HelpContentService) {}
ngOnInit() {
@ -56,7 +58,7 @@ export class EditPageHelpContentComponent implements OnInit, OnDestroy{
let pageContentId = params['pageContentId'];
this.communityPid = params['communityId'];
this.pageId = params['pageId'];
this.title.setTitle('Administration Dashboard | Edit Page Help Text');
if(!pageContentId) {
this.router.navigate(['/pageContents'], { queryParams: { "communityId": this.communityPid} });
}

View File

@ -12,6 +12,7 @@ import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {Page} from "../../domain/page";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'new-page-help-content',
@ -40,6 +41,7 @@ export class NewPageHelpContentComponent {
private element: ElementRef,
private route: ActivatedRoute,
private router: Router,
private title: Title,
private _helpContentService: HelpContentService) {}
ngOnInit() {
@ -48,7 +50,7 @@ export class NewPageHelpContentComponent {
this.properties = data.envSpecific;
this.route.queryParams.subscribe(params => {
HelperFunctions.scroll();
this.title.setTitle('Administration Dashboard | New Page Help Text');
this.communityPid = params['communityId'];
this.pageId = params['pageId'];

View File

@ -14,6 +14,7 @@ import {SafeHtmlPipe} from '../../openaireLibrary/utils/pipes/safeHTML.pipe';
import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'page-help-contents',
@ -75,7 +76,7 @@ export class PageHelpContentsComponent implements OnInit {
this.properties = data.envSpecific;
this.route.queryParams.subscribe(params => {
HelperFunctions.scroll();
this.title.setTitle('Administration Dashboard | Page Help Texts');
this.selectedCommunityPid = params['communityId'];
this.selectedPageId = params['pageId'];
@ -90,7 +91,9 @@ export class PageHelpContentsComponent implements OnInit {
// this.formGroup = this.formComponent.form;
}
constructor(private element: ElementRef, private route: ActivatedRoute, private router : Router, private _helpService: HelpContentService) {}
constructor(private element: ElementRef, private route: ActivatedRoute,
private title: Title,
private router : Router, private _helpService: HelpContentService) {}
getPage(pageId: string) {
if(!Session.isLoggedIn()){

View File

@ -13,6 +13,7 @@ import { Subscription } from "rxjs";
import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {Title} from '@angular/platform-browser';
declare var UIkit: any;
@Component({
@ -43,7 +44,7 @@ export class EditHtmlPageContentComponent implements OnInit {
private element: ElementRef,
private route: ActivatedRoute,
private router: Router,
//private location: Location,
private title: Title,
private _helpContentService: HelpContentService,
private _htmlContentService: HtmlPageContentService) {
this.router.routeReuseStrategy.shouldReuseRoute = function(){
@ -57,7 +58,7 @@ export class EditHtmlPageContentComponent implements OnInit {
this.properties = data.envSpecific;
this.sub = this.route.queryParams.subscribe(params => {
HelperFunctions.scroll();
this.title.setTitle('Administration Dashboard | Edit HTML page');
this.communityPid = params['communityId'];
this.pageId = params['pageId'];

View File

@ -14,6 +14,8 @@ import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from '../../openaireLibrary/utils/HelperFunctions.class';
import {UserManagementService} from '../../openaireLibrary/services/user-management.service';
import {Title} from '@angular/platform-browser';
import {StringUtils} from '../../openaireLibrary/utils/string-utils.class';
@Component({
selector: 'pages',
@ -56,6 +58,7 @@ export class PagesComponent implements OnInit {
public isPortalAdministrator = null;
constructor(private element: ElementRef, private route: ActivatedRoute,
private title: Title,
private _router: Router, private _helpContentService: HelpContentService,
private userManagementService: UserManagementService) {
}
@ -68,10 +71,11 @@ export class PagesComponent implements OnInit {
this.route.queryParams.subscribe(params => {
HelperFunctions.scroll();
this.title.setTitle('Administration Dashboard | Pages');
this.pagesType = '';
if (params['type']) {
this.pagesType = params['type'];
this.title.setTitle('Administration Dashboard | ' + StringUtils.capitalize(this.pagesType) + ' Pages');
}
this.keyword = '';

View File

@ -2,7 +2,8 @@
<div class="menubar ">
<div *ngIf="statisticsSum" class="page-title uk-article-title">
Statistics
<!--<small>[total number of projects is <span class="uk-text-bold">{{ statisticsSum.total_projects }}</span>]</small>-->
<mat-slide-toggle class="uk-margin-small-left" *ngIf="statisticsDisplay" title="Show/Hide all indicators" [checked]="statisticsDisplay.isActive"
(change)="toggleShowGraphAnalysisView()"></mat-slide-toggle>
</div>
</div>
@ -19,12 +20,11 @@
<div [style.display]="showLoading ? 'inline' : 'none'" class="uk-animation-fade uk-width-1-1" role="alert"><img class="uk-align-center loading-gif"></div>
<div class="uk-alert uk-alert-primary uk-margin-top-large">
<div>
<div class="uk-flex uk-flex-middle">
<span class="uk-margin-small-right uk-icon uk-icon-justify" uk-icon="warning"></span>
<span>
Options for showing/hiding statistics from the Community Gateway's Overview and Graph Analysis view.<br>
Regardless of the administrator's choices, numbers equal to 0 will not appear in Graph Analysis view.<br>
Also, statistics of deactivated entities will not appear in either Community Gateway's Overview and Graph Analysis view.
Indicators won't be shown in Community Gateway when the numbers are 0 or the dependent entity is deactivated in spite of their status.
</span>
</div>
</div>
@ -32,11 +32,7 @@
<div class="users-list">
<div class="col-md-12">
<article class="uk-article ">
<div *ngIf="!statisticsSum || statisticsSum.total_projects==0" class="uk-alert uk-alert-info">
No statistics are available yet for {{ communityId.toUpperCase() }}
</div>
<div *ngIf="statisticsSum && statisticsSum.total_projects>0 && statisticsDisplay && chartsInfoMap"
<div *ngIf="statisticsDisplay && chartsInfoMap"
class="uk-margin uk-margin-top">
<div>
<ul class="uk-tab uk-margin-top" data-uk-tab="{connect:'#tabs'}">
@ -52,7 +48,7 @@
<div *ngIf="(displayedEntity == entity)">
<div class="uk-heading-divider">
<h3>{{ entitiesMap.get(entity) }} <small *ngIf="deactivatedEntity" class="uk-text-danger uk-text-small">(this entity has been deactivated)</small></h3>
<h3 class="uk-text-capitalize">{{ entitiesMap.get(entity) }} <small *ngIf="deactivatedEntity" class="uk-text-danger uk-text-small">(this entity has been deactivated)</small></h3>
<div uk-grid>
<div class="uk-width-1-3">
<div class="uk-flex uk-flex-middle uk-padding uk-padding-remove-top" uk-grid>
@ -284,12 +280,7 @@
</div>
</div>
</div>
<div *ngIf="statisticsSum[entity].total==0"
class="uk-alert uk-alert-info">
No {{ entitiesMap.get(entity) }} statistics available yet
</div>
<div *ngIf="statisticsSum[entity].total>0">
<div>
<div>
<div *ngIf="statisticsDisplay.entities[entity].charts.map['timeline'] &&
chartsInfoMap[entity + 'Timeline']"

View File

@ -3,7 +3,7 @@ import {HelpContentService} from '../../services/help-content.service';
import {ActivatedRoute, Router} from '@angular/router';
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
import { Community } from '../../domain/community';
import { DomSanitizer } from '@angular/platform-browser';
import {DomSanitizer, Title} from '@angular/platform-browser';
import {TitleCasePipe} from '@angular/common';
import {availableEntitiesMap, StatisticsDisplay, StatisticsSummary} from '../../openaireLibrary/connect/statistics/statisticsEntities';
import {ConfigurationService} from '../../openaireLibrary/utils/configuration/configuration.service';
@ -53,6 +53,7 @@ export class StatsComponent implements OnInit {
private configService: ConfigurationService,
private route: ActivatedRoute,
private _router: Router,
private title: Title,
private sanitizer: DomSanitizer,
private titleCase: TitleCasePipe) {}
@ -63,7 +64,7 @@ export class StatsComponent implements OnInit {
this.route.queryParams.subscribe(
params => {
HelperFunctions.scroll();
this.title.setTitle('Administration Dashboard | Statistics');
this.communityId = params['communityId'];
this.getStatistics();
});
@ -86,7 +87,6 @@ export class StatsComponent implements OnInit {
this.statisticsDisplay = null;
this.contentService.getCommunityStatistics(this.properties.statisticsAPIURL, this.communityId).subscribe(
stats => {
this.statisticsSum = stats;
if(stats["other"]){ //hack because in stats API the entity name is "other" while in admin API is "orp". This component uses also "orp" name
this.statisticsSum["orp"]=stats["other"];
@ -382,6 +382,12 @@ export class StatsComponent implements OnInit {
}
}
toggleShowGraphAnalysisView() {
this.contentService.statisticsIsActiveToggle(this.properties.adminToolsAPIURL, this.statisticsDisplay._id).subscribe(status => {
this.statisticsDisplay.isActive = status;
});
}
toggleShowInMonitor(entity: string, chartsOrNumbers: string, title: string) {
if(!Session.isLoggedIn()){
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });

View File

@ -10,6 +10,7 @@ import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.
import { concat } from 'rxjs/observable/concat';
import {HelperFunctions} from "../../../openaireLibrary/utils/HelperFunctions.class";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'subjects-edit-form',
templateUrl: './subjects-edit-form.component.html',
@ -45,6 +46,7 @@ export class SubjectsEditFormComponent implements OnInit {
private route: ActivatedRoute,
private _router: Router,
public _fb: FormBuilder,
private title: Title,
private _helpContentService: HelpContentService,
private _communityService: CommunityService,
private _subjectsService: SubjectsService) { }
@ -56,7 +58,7 @@ export class SubjectsEditFormComponent implements OnInit {
this.route.queryParams.subscribe(
communityId => {
HelperFunctions.scroll();
this.title.setTitle('Administration Dashboard | Subjects');
this.communityId = communityId['communityId'];
if (!Session.isLoggedIn()) {

View File

@ -16,6 +16,7 @@ import {SearchUtilsClass} from '../../openaireLib
import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'manage-subscribers',
@ -66,6 +67,7 @@ export class ManageSubscribersComponent implements OnInit {
constructor (private element: ElementRef,
private route: ActivatedRoute,
private title: Title,
private _router: Router,
public _fb: FormBuilder,
private _subscribeService: SubscribeService) {
@ -83,7 +85,7 @@ export class ManageSubscribersComponent implements OnInit {
HelperFunctions.scroll();
this.communityId = communityId['communityId'];
this.title.setTitle('Administration Dashboard | Subscribers');
if (this.communityId != null && this.communityId != '') {
this._getCommunitySubscribers();
}

View File

@ -14,6 +14,7 @@ import {MailPrefsComponent} from '../../openaireLibrary/connect/userEmailPrefere
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from '../../openaireLibrary/utils/HelperFunctions.class';
import {UserManagementService} from '../../openaireLibrary/services/user-management.service';
import {Title} from '@angular/platform-browser';
@Component({
selector: 'manage-user-notifications',
@ -44,6 +45,7 @@ export class ManageUserNotificationsComponent implements OnInit {
@ViewChild(MailPrefsComponent) mailPrefs: MailPrefsComponent;
constructor(private route: ActivatedRoute, private _router: Router, public _fb: FormBuilder,
private title: Title,
private _manageUserNotificationsService: ManageUserNotificationsService,
private element: ElementRef, private userManagementService: UserManagementService) {
}
@ -56,6 +58,7 @@ export class ManageUserNotificationsComponent implements OnInit {
HelperFunctions.scroll();
this.communityId = communityId['communityId'];
if (this.communityId != null && this.communityId !== '') {
this.title.setTitle('Administration Dashboard | User Notifications');
this.showLoading = true;
this.updateErrorMessage = '';
this.errorMessage = '';

View File

@ -7,6 +7,7 @@ import {CommunitiesService} from '../../openaireLibrary/connect/communities/comm
import {CommunityInfo} from '../../openaireLibrary/connect/community/communityInfo';
import {HelperFunctions} from '../../openaireLibrary/utils/HelperFunctions.class';
import {UserManagementService} from '../../openaireLibrary/services/user-management.service';
import {Title} from '@angular/platform-browser';
@Component({
selector: 'wellcome',
@ -92,11 +93,13 @@ export class WellcomeComponent implements OnInit {
private user: User;
constructor(private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService, private _communitiesService: CommunitiesService,
private title: Title,
private userManagementService: UserManagementService) {
}
ngOnInit() {
this.showLoading = true;
this.title.setTitle('Administration Dashboard | OpenAIRE-Connect');
this.propertiesService.loadEnvironment().then(es => {
this.propertiesService.setEnvProperties(es);
this.properties = this.propertiesService.envSpecific;

View File

@ -16,6 +16,7 @@ import {ZenodoCommunityInfo} from '../../openaireLibrary/connect/zenodoCommuniti
import {SearchUtilsClass} from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class';
import {ErrorCodes} from '../../openaireLibrary/utils/properties/errorCodes';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {Title} from '@angular/platform-browser';
@Component({
selector: 'zenodo-communities',
@ -76,7 +77,7 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
private errorCodes: ErrorCodes = new ErrorCodes();
constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router,
private _ΖenodoCommunitieService: ZenodoCommunitiesService,
private _ΖenodoCommunitieService: ZenodoCommunitiesService, private title: Title,
private _communityService: CommunityService,
private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService) {}
@ -89,6 +90,7 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
if (params['communityId']) {
this.communityId = params['communityId'];
this.title.setTitle('Administration Dashboard | Zenodo Communities');
if (!Session.isLoggedIn()) {
this._router.navigate(['/user-info'], {
queryParams: { 'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url} });

View File

@ -394,4 +394,9 @@ export class HelpContentService {
//.map(stats => <any>stats.json())
.pipe(catchError(this.handleError));
}
statisticsIsActiveToggle(apiURL: string, id: string): Observable<boolean> {
const url = apiURL + '/statistics/' + encodeURIComponent(id) + '/toggle';
return this.http.post<boolean>(url, {}, CustomOptions.getAuthOptionsWithBody()).pipe(catchError(this.handleError));
}
}

View File

@ -4,7 +4,7 @@
"useCache" : false,
"metricsAPIURL" : "https://beta.services.openaire.eu/usagestats/",
"framesAPIURL" : "https://beta.openaire.eu/stats3/",
"claimsAPIURL" : "http://duffy.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/",
"claimsAPIURL" : "http://dl170.madgik.di.uoa.gr:8180/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/",
"statisticsAPIURL" : "https://beta.services.openaire.eu/stats-api/",
"statisticsFrameAPIURL":"https://beta.openaire.eu/stats/",
"statisticsFrameNewAPIURL": "http://marilyn.athenarc.gr:8080/stats-api/",
@ -36,10 +36,9 @@
"vocabulariesAPI" :"https://beta.services.openaire.eu/provision/mvc/vocabularies/",
"piwikBaseUrl" :" https://analytics.openaire.eu/piwik.php?idsite=6",
"loginUrl" :"http://scoobydoo.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/openid_connect_login",
"userInfoUrl" : "http://scoobydoo.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/api/users/getUserInfo?accessToken=",
"loginUrl" :"http://dl170.madgik.di.uoa.gr:8180/dnet-login/openid_connect_login",
"userInfoUrl" : "http://dl170.madgik.di.uoa.gr:8180/dnet-openaire-users-1.0.0-SNAPSHOT/api/users/getUserInfo?accessToken=",
"logoutUrl" :"https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
"cookieDomain" :".di.uoa.gr",