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
This commit is contained in:
sofia.baltzi 2018-11-26 12:18:47 +00:00
parent 810dd5ba65
commit 36c0812cab
2 changed files with 21 additions and 4 deletions

View File

@ -5,7 +5,7 @@
<div id="invite" class=" uk-card uk-card-default uk-padding">
<div class="uk-text-large uk-text-center uk-width-5-6@l uk-width ">Invite users to subscribe</div>
<div *ngIf="showLoading" class="uk-animation-fade uk-width-1-1" role="alert"><span class="loading-gif uk-align-center"></span>></div>
<div *ngIf="showLoading" class="uk-animation-fade uk-width-1-1" role="alert"><span class="loading-gif uk-align-center"></span></div>
<div *ngIf="communityId != null && !showLoading && !errorMessage">
<!--table *ngIf="communityId != null && community != null && !showLoading && !errorMessage" class="uk-table uk-align-center"-->
<table class="uk-table uk-align-center">
@ -141,7 +141,9 @@
</table>
<div class="uk-text-left">
<span uk-icon="chevron-left"></span><span class="uk-margin-small-left"><a href="invite">Back</a></span>
<span uk-icon="chevron-left"></span><span class="uk-margin-small-left">
<a [queryParams]="communityIdParam" routerLinkActive="router-link-active" routerLink="/">Back</a>
</span>
</div>
</div>
@ -170,7 +172,9 @@
</div>
<div class="uk-width-medium uk-text-muted uk-text-small style=display:none">separate multiple emails with a comma</div>
<div class="uk-text-right">
<span class="uk-margin-small-left" uk-icon="cog"></span><span class="uk-margin-small-left uk-text-small"><a href="invite">customise it</a></span>
<span class="uk-margin-small-left" uk-icon="cog"></span><span class="uk-margin-small-left uk-text-small">
<a [queryParams]="communityIdParam" routerLinkActive="router-link-active" routerLink="/invite">customise it</a>
</span>
</div>
</div>
</div>

View File

@ -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 = '<p>OpenAIRE invites you to subscribe in <a href="https://beta.egi.openaire.eu">_Community_name_</a> dashboard. </p><p>The community dashboard is part of the <a href="https://beta.egi.openaire.eu">OpenAIRE-Connect</a> project.</p>';
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 != "") {