From 36c0812cab8a66c4592b5f43bd03ad7568423d79 Mon Sep 17 00:00:00 2001 From: "sofia.baltzi" Date: Mon, 26 Nov 2018 12:18:47 +0000 Subject: [PATCH] Fix router for inviteLink page git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@53966 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../utils/subscribe/invite/invite.component.html | 10 +++++++--- .../utils/subscribe/invite/invite.component.ts | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/app/utils/subscribe/invite/invite.component.html b/src/app/utils/subscribe/invite/invite.component.html index 5645b7d..b1065f2 100644 --- a/src/app/utils/subscribe/invite/invite.component.html +++ b/src/app/utils/subscribe/invite/invite.component.html @@ -5,7 +5,7 @@
Invite users to subscribe
- +
@@ -141,7 +141,9 @@
- Back + + Back +
@@ -170,7 +172,9 @@
separate multiple emails with a comma
- customise it + + customise it +
diff --git a/src/app/utils/subscribe/invite/invite.component.ts b/src/app/utils/subscribe/invite/invite.component.ts index 2557bfb..fa65eeb 100644 --- a/src/app/utils/subscribe/invite/invite.component.ts +++ b/src/app/utils/subscribe/invite/invite.component.ts @@ -1,4 +1,4 @@ -import {Component, OnInit, Input} from '@angular/core'; +import {Component, OnInit, Input, ElementRef} from '@angular/core'; import {SimpleChanges, OnChanges} from '@angular/core'; import {FormGroup, FormArray, FormBuilder, Validators} from "@angular/forms"; import {ActivatedRoute, Router} from '@angular/router'; @@ -39,7 +39,10 @@ export class InviteComponent implements OnInit { // public defaultBody = '

OpenAIRE invites you to subscribe in _Community_name_ dashboard.

The community dashboard is part of the OpenAIRE-Connect project.

'; public defaultBody =''; + public communityIdParam = {}; + constructor ( + private element: ElementRef, private route: ActivatedRoute, private _router: Router, public _fb: FormBuilder, @@ -52,6 +55,7 @@ export class InviteComponent implements OnInit { if(!this.communityId){ this.communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname); } + this.communityIdParam = (ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:this.communityId}; }); } @@ -80,9 +84,18 @@ export class InviteComponent implements OnInit { ); } + + this.scroll(); }); } + public scroll() { + console.info("scroll into view"); + if (typeof document !== 'undefined') { + this.element.nativeElement.scrollIntoView(); + } + } + public invite() { this.showLoading = true; if (this.recipients != "") {