[Trunk|Library]: Use scroll function from 'HelperFunctions' class (utils folder).

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@55418 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2019-04-24 12:31:01 +00:00
parent 6125f3553e
commit c3ab3b18fa
14 changed files with 57 additions and 95 deletions

View File

@ -1,5 +1,5 @@
import {Component, ViewChild} from '@angular/core';
import {ElementRef, Input} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
@ -29,6 +29,7 @@ import {ErrorCodes} from '../../utils/properties/errorCo
import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
@Component({
@ -95,16 +96,13 @@ export class DataProviderComponent {
private reloadDataproviders: boolean = true;
private reloadRelatedDatasources: boolean = true;
private nativeElement : Node;
sub: any;
piwiksub: any;
subInfo: any;
relatedDatasourcesSub: any;
properties:EnvProperties;
constructor (private element: ElementRef,
private _dataproviderService: DataProviderService,
constructor (private _dataproviderService: DataProviderService,
private _piwikService:PiwikService,
private route: ActivatedRoute,
private _meta: Meta,
@ -142,9 +140,7 @@ export class DataProviderComponent {
this.getDataProviderInfo(this.datasourceId);
}
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
HelperFunctions.scroll();
});
}

View File

@ -1,5 +1,5 @@
import {Component, ViewChild} from '@angular/core';
import {ElementRef, Input} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
@ -12,6 +12,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
import {DatasetService} from './dataset.service';
import {PiwikService} from '../../utils/piwik/piwik.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
@Component({
@ -61,8 +62,7 @@ export class DatasetComponent {
sub: any; piwiksub: any; infoSub: any;
properties:EnvProperties;
constructor (private element: ElementRef,
private _datasetService: DatasetService,
constructor (private _datasetService: DatasetService,
private _piwikService:PiwikService,
private route: ActivatedRoute,
private _meta: Meta,
@ -102,7 +102,7 @@ export class DatasetComponent {
this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
/*this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
*/
this.scroll();
HelperFunctions.scroll();
});
}
@ -202,12 +202,6 @@ export class DatasetComponent {
return Array.from(map.keys());
}
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
private handleError(message: string, error) {
console.error("Research Data Landing Page: "+message, error);
}

View File

@ -1,4 +1,5 @@
import {Component, Input, ElementRef} from '@angular/core';
import {Component, Input} from '@angular/core';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
@Component({
selector: 'availableOn',
@ -64,13 +65,11 @@ export class AvailableOnComponent {
public threshold: number = 5;
public showNum: number = 5;
constructor (private element: ElementRef) {}
constructor () {}
ngOnInit() {}
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
HelperFunctions.scroll();
}
}

View File

@ -1,4 +1,5 @@
import {Component, Input, ElementRef} from '@angular/core';
import {Component, Input} from '@angular/core';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
@Component({
selector: 'fundedBy',
@ -71,7 +72,7 @@ export class FundedByComponent {
public threshold: number = 5;
public showNum: number = 5;
constructor (private element: ElementRef) {}
constructor () {}
ngOnInit() {}
@ -124,8 +125,6 @@ export class FundedByComponent {
}
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
HelperFunctions.scroll();
}
}

View File

@ -1,4 +1,5 @@
import {Component, Input, ElementRef} from '@angular/core';
import {Component, Input} from '@angular/core';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
@Component({
selector: 'publishedIn',
@ -54,14 +55,12 @@ export class PublishedInComponent {
public showAll: boolean = false;
constructor (private element: ElementRef) {}
constructor () {}
ngOnInit() {}
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
HelperFunctions.scroll();
}
public getKeys( map) {
return Array.from(map.keys());

View File

@ -1,5 +1,6 @@
import {Component, Input, ElementRef} from '@angular/core';
import {Component, Input} from '@angular/core';
import {RouterHelper} from '../../utils/routerHelper.class';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
@Component({
selector: 'showAuthors',
@ -46,7 +47,7 @@ export class ShowAuthorsComponent {
public showAll: boolean = false;
public routerHelper:RouterHelper = new RouterHelper();
constructor (private element: ElementRef) {
constructor () {
}
ngOnInit() {
@ -57,8 +58,6 @@ export class ShowAuthorsComponent {
}
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
HelperFunctions.scroll();
}
}

View File

@ -1,4 +1,5 @@
import {Component, Input, ElementRef} from '@angular/core';
import {Component, Input} from '@angular/core';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
@Component({
selector: 'showIdentifiers',
@ -47,7 +48,7 @@ export class ShowIdentifiersComponent {
public sizeOfPreviousIdentifiers: number = -1;
public pageSize: number = 10;
constructor (private element: ElementRef) {
constructor () {
this.doiURL = "https://dx.doi.org/";
this.pmcURL = "http://europepmc.org/articles/";
this.handleURL = "http://hdl.handle.net/";
@ -84,9 +85,7 @@ export class ShowIdentifiersComponent {
}
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
HelperFunctions.scroll();
}
public getKeys( map) {
return Array.from(map.keys());

View File

@ -27,6 +27,7 @@ import {PiwikService} from '../../utils/piwik/piwik.service';
import {StringUtils} from '../../utils/string-utils.class';
import {EnvProperties} from '../../utils/properties/env-properties';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
@Component({
selector: 'organization',
@ -142,11 +143,9 @@ export class OrganizationComponent {
this.warningMessage="No valid organization id";
}
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
HelperFunctions.scroll();
this.csvParamsTail = '" and relorganizationid exact "'+this.organizationId+'" ))';
this.csvParamsTail = '" and relorganizationid exact "'+this.organizationId+'" ))';
});

View File

@ -1,5 +1,5 @@
import {Component, ViewChild} from '@angular/core';
import {ElementRef, Input} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
@ -12,6 +12,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
import {OrpService} from './orp.service';
import {PiwikService} from '../../utils/piwik/piwik.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
@Component({
@ -61,8 +62,7 @@ export class OrpComponent {
sub: any; piwiksub: any; infoSub: any;
properties:EnvProperties;
constructor (private element: ElementRef,
private _orpService: OrpService,
constructor (private _orpService: OrpService,
private _piwikService:PiwikService,
private route: ActivatedRoute,
private _meta: Meta,
@ -189,9 +189,7 @@ export class OrpComponent {
}
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
HelperFunctions.scroll();
}
private handleError(message: string, error) {

View File

@ -1,5 +1,5 @@
import {Component, ViewChild} from '@angular/core';
import {ElementRef, Input} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Params} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
@ -27,6 +27,7 @@ import {ErrorCodes} from '../../utils/properties/errorCodes'
import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
@Component({
selector: 'project',
@ -101,8 +102,7 @@ export class ProjectComponent{
sub: any; piwiksub: any; infoSub: any; downloadFilePiwikSub: any;
properties:EnvProperties;
constructor ( private element: ElementRef,
private _projectService: ProjectService,
constructor ( private _projectService: ProjectService,
private _piwikService:PiwikService,
private route: ActivatedRoute,
private _searchPublicationsService: SearchPublicationsService,
@ -161,9 +161,7 @@ properties:EnvProperties;
this.csvParamsSoftware = "?format=csv-special&type=software&fq=(((oaftype exact result) and (resulttypeid exact software)) and (relprojectid exact \""+this.projectId+"\"))";
this.csvParamsOrps = "?format=csv-special&type=other&fq=(((oaftype exact result) and (resulttypeid exact other)) and (relprojectid exact \""+this.projectId+"\"))";
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
HelperFunctions.scroll();
});
}

View File

@ -1,5 +1,5 @@
import {Component, ViewChild} from '@angular/core';
import {ElementRef, Input} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
@ -12,6 +12,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {PublicationService} from './publication.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
@Component({
@ -72,8 +73,7 @@ export class PublicationComponent {
sub: any; piwiksub: any; infoSub: any;
properties:EnvProperties;
constructor ( private element: ElementRef,
private _publicationService: PublicationService,
constructor ( private _publicationService: PublicationService,
private _piwikService:PiwikService,
private route: ActivatedRoute,
private _meta: Meta,
@ -293,9 +293,7 @@ export class PublicationComponent {
}
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
HelperFunctions.scroll();
}
/*
start(i: number, bioentitiesPage: number) {

View File

@ -1,5 +1,5 @@
import {Component, ViewChild} from '@angular/core';
import {ElementRef, Input} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
@ -12,6 +12,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
@Component({
selector: 'software',
@ -56,8 +57,7 @@ export class SoftwareComponent {
sub: any; piwiksub: any; infoSub: any;
properties:EnvProperties;
constructor (private element: ElementRef,
private _softwareService: SoftwareService,
constructor (private _softwareService: SoftwareService,
private _piwikService:PiwikService,
private route: ActivatedRoute,
private _meta: Meta,
@ -196,9 +196,7 @@ export class SoftwareComponent {
}
public scroll() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
HelperFunctions.scroll();
}
private handleError(message: string, error) {

View File

@ -1,11 +1,7 @@
import {Component, Input, Output, EventEmitter, ViewChild, ElementRef} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import {Component} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Location} from '@angular/common';
import {ErrorCodes} from '../utils/properties/errorCodes';
import {RouterHelper} from '../utils/routerHelper.class';
import {Session} from '../login/utils/helper.class';
import {HelperFunctions} from "../utils/HelperFunctions.class";
@Component({
selector: 'reload',
@ -23,18 +19,11 @@ import {Session} from '../login/utils/helper.class';
})
export class ReloadComponent {
constructor (private element: ElementRef,
private route: ActivatedRoute,
private _router: Router,
private location: Location
) {
}
constructor (private route: ActivatedRoute, private _router: Router) {}
public ngOnInit() {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
HelperFunctions.scroll();
var URL = Session.getReloadUrl();
if(URL && URL["path"] && URL["path"] != null && URL["path"] != ""){

View File

@ -1,6 +1,6 @@
import {Component, Input} from '@angular/core';
import {ViewChild, Output} from '@angular/core';
import {EventEmitter,ElementRef} from '@angular/core';
import {EventEmitter} from '@angular/core';
import {Location} from '@angular/common';
import {Router, ActivatedRoute} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
@ -15,6 +15,7 @@ import {ErrorCodes} from '../../utils/properties/errorCodes';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
@Component({
selector: 'search-page',
@ -78,7 +79,6 @@ export class SearchPageComponent {
private location: Location,
private _meta: Meta,
private _title: Title,
private element: ElementRef,
private _piwikService:PiwikService,
private router: Router,
private seoService: SEOService) {
@ -99,9 +99,8 @@ export class SearchPageComponent {
this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, this.piwikSiteId).subscribe();
}
});
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
HelperFunctions.scroll();
// this.updateBaseUrlWithParameters(this.filters);
this.updateTitle(this.pageTitle);
var description = "Openaire, search, repositories, open access, type, content provider, funder, project, " + this.type + "," +this.pageTitle;
@ -550,9 +549,7 @@ export class SearchPageComponent {
index:indexQuery,
params: this.queryParameters
});
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
HelperFunctions.scroll();
}
filterChanged($event){
this.goTo(1);