[Trunk|Admin]: Use scroll function from 'HelperFunctions' class (openaireLibrary/utils).

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@55416 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2019-04-24 11:44:46 +00:00
parent 68ade81676
commit f196153275
23 changed files with 50 additions and 156 deletions

View File

@ -11,6 +11,7 @@ import { EnvProperties } from '../../openaireLibrary/utils/properties/env-proper
import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'communities', selector: 'communities',
@ -59,9 +60,9 @@ export class CommunitiesComponent implements OnInit {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.scroll(); HelperFunctions.scroll();
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.getCommunities(); this.getCommunities();
}); });
} }
@ -275,10 +276,4 @@ export class CommunitiesComponent implements OnInit {
this.showLoading = false; this.showLoading = false;
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -14,6 +14,7 @@ import {Validator} from '../../../openaireLibrary/utils/email/validator';
import {Session} from '../../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'community-edit-form', selector: 'community-edit-form',
@ -66,9 +67,9 @@ export class CommunityEditFormComponent implements OnInit{
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.route.queryParams.subscribe( this.route.queryParams.subscribe(
communityId => { communityId => {
this.scroll(); HelperFunctions.scroll();
this.communityId = communityId['communityId']; this.communityId = communityId['communityId'];
this.email = {body: '', subject: '', recipients: []}; this.email = {body: '', subject: '', recipients: []};
this.emailToInform = {body: '', subject: '', recipients: []}; this.emailToInform = {body: '', subject: '', recipients: []};
@ -99,12 +100,6 @@ export class CommunityEditFormComponent implements OnInit{
}); });
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
public addManager() { public addManager() {
this.community.managers.push(''); this.community.managers.push('');
} }

View File

@ -6,6 +6,7 @@ import {AddContentProvidersComponent} from './add-content-providers.component';
import {Session} from '../../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'manage-content-providers', selector: 'manage-content-providers',
@ -47,7 +48,7 @@ export class ManageContentProvidersComponent implements OnInit {
if(params['communityId']) { if(params['communityId']) {
this.community = params['communityId']; this.community = params['communityId'];
} }
this.scroll(); HelperFunctions.scroll();
}); });
} }
@ -59,7 +60,7 @@ export class ManageContentProvidersComponent implements OnInit {
if(!Session.isLoggedIn()){ if(!Session.isLoggedIn()){
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
} else { } else {
this.scroll(); HelperFunctions.scroll();
this.toggle = !this.toggle; this.toggle = !this.toggle;
if(this.toggle) { if(this.toggle) {
@ -79,10 +80,4 @@ export class ManageContentProvidersComponent implements OnInit {
public communityContentProvidersChanged($event) { public communityContentProvidersChanged($event) {
this.communityContentProviders = $event.value; this.communityContentProviders = $event.value;
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -6,6 +6,7 @@ import {EnvProperties} from '../../../openaireLibrary/utils/properties/env-prope
import {LayoutService} from '../../../openaireLibrary/services/layout.service'; import {LayoutService} from '../../../openaireLibrary/services/layout.service';
import {Session} from '../../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'community-layout', selector: 'community-layout',
@ -36,8 +37,8 @@ export class CommunityLayoutComponent implements OnInit {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.route.queryParams.subscribe( this.route.queryParams.subscribe(
communityId => { communityId => {
this.scroll(); HelperFunctions.scroll();
this.communityId = communityId['communityId']; this.communityId = communityId['communityId'];
if (this.communityId != null && this.communityId !== '') { if (this.communityId != null && this.communityId !== '') {
this.showLoading = true; this.showLoading = true;
this.errorMessage = ''; this.errorMessage = '';
@ -54,12 +55,6 @@ export class CommunityLayoutComponent implements OnInit {
}); });
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
public updateLayout() { public updateLayout() {
if (!Session.isLoggedIn()) { if (!Session.isLoggedIn()) {
this._router.navigate(['/user-info'], { queryParams: this._router.navigate(['/user-info'], { queryParams:

View File

@ -6,6 +6,7 @@ import {AddProjectsComponent} from './add-projects.component';
import {Session} from '../../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'manage-projects', selector: 'manage-projects',
@ -59,7 +60,7 @@ export class ManageProjectsComponent implements OnInit {
if(!Session.isLoggedIn()){ if(!Session.isLoggedIn()){
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
} else { } else {
this.scroll(); HelperFunctions.scroll();
this.toggle = !this.toggle; this.toggle = !this.toggle;
if(this.toggle) { if(this.toggle) {
@ -82,12 +83,6 @@ export class ManageProjectsComponent implements OnInit {
this.communityProjects = $event.value; this.communityProjects = $event.value;
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
// public updateCommunityProjects($event) { // public updateCommunityProjects($event) {
// this.updateCommunityProjectsOnToggle = true; // this.updateCommunityProjectsOnToggle = true;
// } // }

View File

@ -6,6 +6,7 @@ import {Component, ElementRef, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router'; import {ActivatedRoute} from '@angular/router';
import {CommunityService} from '../../openaireLibrary/connect/community/community.service'; import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'dashboard', selector: 'dashboard',
@ -24,7 +25,7 @@ export class DashboardComponent implements OnInit {
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => { this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.route.queryParams.subscribe(data => { this.route.queryParams.subscribe(data => {
this.scroll(); HelperFunctions.scroll();
this.communityId = ((data['communityId']) ? data['communityId'] : data['community']); this.communityId = ((data['communityId']) ? data['communityId'] : data['community']);
this._communityService.getCommunity(this.properties, this.properties.communityAPI + this.communityId).subscribe ( this._communityService.getCommunity(this.properties, this.properties.communityAPI + this.communityId).subscribe (
community => { community => {
@ -38,10 +39,4 @@ export class DashboardComponent implements OnInit {
}); });
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -12,6 +12,7 @@ import { EnvProperties } from '../../openaireLibrary/utils/properties/env-proper
import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'divIds', selector: 'divIds',
@ -60,7 +61,7 @@ export class DivIdsComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.scroll(); HelperFunctions.scroll();
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.formGroup = this.formComponent.form; this.formGroup = this.formComponent.form;
@ -279,10 +280,4 @@ export class DivIdsComponent implements OnInit {
this.showLoading = false; this.showLoading = false;
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -12,6 +12,7 @@ import {SafeHtmlPipe} from '../../openaireLibrary/utils/pipes/safeHTML.pipe';
import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'div-help-contents', selector: 'div-help-contents',
@ -62,7 +63,7 @@ export class DivHelpContentsComponent implements OnInit {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
this.scroll(); HelperFunctions.scroll();
this.selectedCommunityPid = params['communityId']; this.selectedCommunityPid = params['communityId'];
this.selectedPageId = params['pageId']; this.selectedPageId = params['pageId'];
@ -338,10 +339,4 @@ export class DivHelpContentsComponent implements OnInit {
this.router.navigate( ['/classContents/new'], { queryParams: {communityId: this.selectedCommunityPid} } ); this.router.navigate( ['/classContents/new'], { queryParams: {communityId: this.selectedCommunityPid} } );
} }
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -8,6 +8,7 @@ import { EnvProperties } from '../../openaireLibrary/utils/properties/env-proper
import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'edit-div-help-content', selector: 'edit-div-help-content',
@ -43,7 +44,7 @@ export class EditDivHelpContentComponent implements OnInit, OnDestroy{
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
this.scroll(); HelperFunctions.scroll();
//let id = params['id']; //let id = params['id'];
let divContentId = params['classContentId']; let divContentId = params['classContentId'];
@ -153,10 +154,4 @@ export class EditDivHelpContentComponent implements OnInit, OnDestroy{
this.router.navigate(['/classContents'], { queryParams: { "communityId": this.communityPid } } ); this.router.navigate(['/classContents'], { queryParams: { "communityId": this.communityPid } } );
} }
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -7,6 +7,7 @@ import { EnvProperties } from '../../openaireLibrary/utils/properties/env-proper
import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'new-div-help-content', selector: 'new-div-help-content',
@ -40,7 +41,7 @@ export class NewDivHelpContentComponent {
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
this.scroll(); HelperFunctions.scroll();
this.communityPid = params['communityId']; this.communityPid = params['communityId'];
this.pageId = params['pageId']; this.pageId = params['pageId'];
@ -88,10 +89,4 @@ export class NewDivHelpContentComponent {
console.log('Server responded: ' + error); console.log('Server responded: ' + error);
this.showLoading = false; this.showLoading = false;
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -8,6 +8,7 @@ import { Community } from '../../domain/community';
import { EnvProperties } from '../../openaireLibrary/utils/properties/env-properties'; import { EnvProperties } from '../../openaireLibrary/utils/properties/env-properties';
import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'entities', selector: 'entities',
@ -61,7 +62,7 @@ export class EntitiesComponent implements OnInit {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
this.scroll(); HelperFunctions.scroll();
this.selectedCommunityPid = params['communityId']; this.selectedCommunityPid = params['communityId'];
this.applyCommunityFilter(this.selectedCommunityPid); this.applyCommunityFilter(this.selectedCommunityPid);
@ -322,11 +323,4 @@ export class EntitiesComponent implements OnInit {
); );
} }
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -11,6 +11,7 @@ import { EnvProperties } from '../../openaireLibrary/utils/properties/env-proper
import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'edit-page-help-content', selector: 'edit-page-help-content',
@ -48,7 +49,7 @@ export class EditPageHelpContentComponent implements OnInit, OnDestroy{
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
this.scroll(); HelperFunctions.scroll();
let pageContentId = params['pageContentId']; let pageContentId = params['pageContentId'];
this.communityPid = params['communityId']; this.communityPid = params['communityId'];
@ -133,10 +134,4 @@ export class EditPageHelpContentComponent implements OnInit, OnDestroy{
this.router.navigate(['/pageContents'], { queryParams: { "communityId": this.communityPid} } ); this.router.navigate(['/pageContents'], { queryParams: { "communityId": this.communityPid} } );
} }
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -10,6 +10,7 @@ import { EnvProperties } from '../../openaireLibrary/utils/properties/env-proper
import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'new-page-help-content', selector: 'new-page-help-content',
@ -43,7 +44,7 @@ export class NewPageHelpContentComponent {
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
this.scroll(); HelperFunctions.scroll();
this.communityPid = params['communityId']; this.communityPid = params['communityId'];
this.pageId = params['pageId']; this.pageId = params['pageId'];
@ -94,10 +95,4 @@ export class NewPageHelpContentComponent {
this.showLoading = false; this.showLoading = false;
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -14,6 +14,7 @@ import {SafeHtmlPipe} from '../../openaireLibrary/utils/pipes/safeHTML.pipe';
import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'page-help-contents', selector: 'page-help-contents',
@ -74,7 +75,7 @@ export class PageHelpContentsComponent implements OnInit {
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
this.scroll(); HelperFunctions.scroll();
this.selectedCommunityPid = params['communityId']; this.selectedCommunityPid = params['communityId'];
this.selectedPageId = params['pageId']; this.selectedPageId = params['pageId'];
@ -348,10 +349,4 @@ export class PageHelpContentsComponent implements OnInit {
this.router.navigate( ['/pageContents/new'], { queryParams: {communityId: this.selectedCommunityPid} } ); this.router.navigate( ['/pageContents/new'], { queryParams: {communityId: this.selectedCommunityPid} } );
} }
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -12,6 +12,7 @@ import { Subscription } from "rxjs/Subscription";
import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
declare var UIkit: any; declare var UIkit: any;
@Component({ @Component({
@ -55,7 +56,7 @@ export class EditHtmlPageContentComponent implements OnInit {
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
this.scroll(); HelperFunctions.scroll();
this.communityPid = params['communityId']; this.communityPid = params['communityId'];
this.pageId = params['pageId']; this.pageId = params['pageId'];
@ -159,10 +160,4 @@ export class EditHtmlPageContentComponent implements OnInit {
//this.router.navigated = false; //this.router.navigated = false;
//this.router.navigate( ['/htmlPageContent/edit'], { queryParams: { "communityId": this.communityPid, "pageId": this.pageId } } ); //this.router.navigate( ['/htmlPageContent/edit'], { queryParams: { "communityId": this.communityPid, "pageId": this.pageId } } );
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -14,6 +14,7 @@ import { Entity } from "../../domain/entity";
import { EnvProperties } from '../../openaireLibrary/utils/properties/env-properties'; import { EnvProperties } from '../../openaireLibrary/utils/properties/env-properties';
import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'pages', selector: 'pages',
@ -71,7 +72,7 @@ export class PagesComponent implements OnInit {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
this.scroll(); HelperFunctions.scroll();
this.pagesType = ""; this.pagesType = "";
if(params['type']) { if(params['type']) {
@ -369,10 +370,4 @@ export class PagesComponent implements OnInit {
public capitalizeFirstLetter(str: string) { public capitalizeFirstLetter(str: string) {
return str.charAt(0).toUpperCase() + str.slice(1); return str.charAt(0).toUpperCase() + str.slice(1);
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -10,6 +10,7 @@ import {ConfigurationService} from '../../openaireLibrary/utils/configuration/co
import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'stats', selector: 'stats',
@ -59,7 +60,7 @@ export class StatsComponent implements OnInit {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.route.queryParams.subscribe( this.route.queryParams.subscribe(
params => { params => {
this.scroll(); HelperFunctions.scroll();
this.communityId = params['communityId']; this.communityId = params['communityId'];
this.getStatistics(); this.getStatistics();
@ -467,10 +468,4 @@ export class StatsComponent implements OnInit {
this.showLoading = false; this.showLoading = false;
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -9,6 +9,7 @@ import {Session} from '../../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class';
import { concat } from 'rxjs/observable/concat'; import { concat } from 'rxjs/observable/concat';
import {HelperFunctions} from "../../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'subjects-edit-form', selector: 'subjects-edit-form',
templateUrl: './subjects-edit-form.component.html', templateUrl: './subjects-edit-form.component.html',
@ -54,7 +55,7 @@ export class SubjectsEditFormComponent implements OnInit {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.route.queryParams.subscribe( this.route.queryParams.subscribe(
communityId => { communityId => {
this.scroll(); HelperFunctions.scroll();
this.communityId = communityId['communityId']; this.communityId = communityId['communityId'];
@ -325,11 +326,4 @@ export class SubjectsEditFormComponent implements OnInit {
trackByFn(index: any, item: any) { trackByFn(index: any, item: any) {
return index; return index;
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -15,6 +15,7 @@ import {SearchUtilsClass} from '../../openaireLib
import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'manage-subscribers', selector: 'manage-subscribers',
@ -79,7 +80,7 @@ export class ManageSubscribersComponent implements OnInit {
this.route.queryParams.subscribe( this.route.queryParams.subscribe(
communityId => { communityId => {
this.scroll(); HelperFunctions.scroll();
this.communityId = communityId['communityId']; this.communityId = communityId['communityId'];
@ -302,10 +303,4 @@ export class ManageSubscribersComponent implements OnInit {
); );
} }
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -12,6 +12,7 @@ import {UserNotificationsRights} from './userNotificationsRights';
import {MailPrefsComponent} from '../../openaireLibrary/connect/userEmailPreferences/mailPrefs.component'; import {MailPrefsComponent} from '../../openaireLibrary/connect/userEmailPreferences/mailPrefs.component';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'manage-user-notifications', selector: 'manage-user-notifications',
@ -49,7 +50,7 @@ export class ManageUserNotificationsComponent implements OnInit {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.route.queryParams.subscribe( this.route.queryParams.subscribe(
communityId => { communityId => {
this.scroll(); HelperFunctions.scroll();
this.communityId = communityId['communityId']; this.communityId = communityId['communityId'];
if (this.communityId != null && this.communityId !== '') { if (this.communityId != null && this.communityId !== '') {
@ -221,10 +222,4 @@ export class ManageUserNotificationsComponent implements OnInit {
this.showLoading = false; this.showLoading = false;
this.successfulResetMessage = message; this.successfulResetMessage = message;
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -7,6 +7,7 @@ import {ActivatedRoute} from "@angular/router";
import {EnvironmentSpecificService} from "../../openaireLibrary/utils/properties/environment-specific.service"; import {EnvironmentSpecificService} from "../../openaireLibrary/utils/properties/environment-specific.service";
import {CommunitiesService} from "../../openaireLibrary/connect/communities/communities.service"; import {CommunitiesService} from "../../openaireLibrary/connect/communities/communities.service";
import {CommunityInfo} from "../../openaireLibrary/connect/community/communityInfo"; import {CommunityInfo} from "../../openaireLibrary/connect/community/communityInfo";
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'wellcome', selector: 'wellcome',
@ -127,6 +128,7 @@ export class WellcomeComponent implements OnInit {
this.propertiesService.loadEnvironment().then(es => { this.propertiesService.loadEnvironment().then(es => {
this.propertiesService.setEnvProperties(es); this.propertiesService.setEnvProperties(es);
this.properties = this.propertiesService.envSpecific; this.properties = this.propertiesService.envSpecific;
HelperFunctions.scroll();
//this._communitiesService.getCommunities(this.properties, this.properties.communityAPI + 'communities').subscribe( //this._communitiesService.getCommunities(this.properties, this.properties.communityAPI + 'communities').subscribe(
this._communitiesService.getCommunitiesState().subscribe( this._communitiesService.getCommunitiesState().subscribe(

View File

@ -15,6 +15,7 @@ import {CommunityInfo} from '../../openaireLibrary/connect/community/communityIn
import {ZenodoCommunityInfo} from '../../openaireLibrary/connect/zenodoCommunities/zenodoCommunityInfo'; import {ZenodoCommunityInfo} from '../../openaireLibrary/connect/zenodoCommunities/zenodoCommunityInfo';
import {SearchUtilsClass} from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class'; import {SearchUtilsClass} from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class';
import {ErrorCodes} from '../../openaireLibrary/utils/properties/errorCodes'; import {ErrorCodes} from '../../openaireLibrary/utils/properties/errorCodes';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({ @Component({
selector: 'zenodo-communities', selector: 'zenodo-communities',
@ -84,7 +85,7 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => { this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
this.scroll(); HelperFunctions.scroll();
if (params['communityId']) { if (params['communityId']) {
this.communityId = params['communityId']; this.communityId = params['communityId'];
@ -163,7 +164,7 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
this._router.navigate(['/user-info'], { this._router.navigate(['/user-info'], {
queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url} }); queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url} });
} else { } else {
this.scroll(); HelperFunctions.scroll();
this.toggle = !this.toggle; this.toggle = !this.toggle;
if (this.toggle) { if (this.toggle) {
@ -202,11 +203,4 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
} }
); );
} }
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
} }

View File

@ -49,7 +49,7 @@
"cacheUrl" :"http://scoobydoo.di.uoa.gr:3000/get?url=", "cacheUrl" :"http://scoobydoo.di.uoa.gr:3000/get?url=",
"adminToolsAPIURL" :"http://mpagasas.di.uoa.gr:8080/uoa-admin-tools/", "adminToolsAPIURL" :"http://duffy.di.uoa.gr:8080/uoa-admin-tools/",
"adminToolsCommunity" :"openaire", "adminToolsCommunity" :"openaire",
"communityAPI": "https://dev-openaire.d4science.org/openaire/community/", "communityAPI": "https://dev-openaire.d4science.org/openaire/community/",