Session helper: Set properly user id - fix issue with mining tool

Claims change message "claim more links also for connect"


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@52616 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2018-06-29 11:58:37 +00:00
parent 420b3cefd6
commit 66a4a8e457
2 changed files with 4 additions and 3 deletions

View File

@ -19,7 +19,7 @@ import {Observable} from 'rxjs/Observable';
<div>
<div class="uk-text-right">
<a *ngIf="!fetchBy || fetchBy != 'Context'" routerLink="/participate/claim">Claim more links?</a>
<a *ngIf="isConnect && fetchBy && fetchBy == 'Context' && fetchId" [href]="'https://beta.'+fetchId+'.openaire.eu/participate/claim'" target="_blank">Add more Links?</a>
<a *ngIf="isConnect && fetchBy && fetchBy == 'Context' && fetchId" [href]="'https://beta.'+fetchId+'.openaire.eu/participate/claim'" target="_blank">Claim more links?</a>
</div>
<displayClaims [enableDelete]=true [myClaims]=false [isAdmin]=true [fetchBy]= fetchBy [fetchId]=fetchId
[communityId]="(fetchBy && fetchBy == 'Context')?fetchId:null"></displayClaims>

View File

@ -16,7 +16,7 @@ export class Session{
public static removeUser() {
COOKIE.deleteCookie(COOKIE.cookieName_id)
COOKIE.deleteCookie(COOKIE.cookieName_u);
COOKIE.deleteCookie("SESSION");
COOKIE.deleteCookie("openAIRESession");
}
public static getUser():User {
@ -55,7 +55,8 @@ export class Session{
var dataStr:string = data.substr(1,data.length-2).replace(/\\/g,"");
var info = JSON.parse(dataStr);
var user: User = new User();
user.id = (info.sub && info.sub.indexOf('@'))?info.sub.substring(0,info.sub.indexOf('@')):info.sub;
var sub = (info.sub)?StringUtils.URIDecode(info.sub):"";
user.id = (sub && sub.indexOf('@'))?sub.substring(0,sub.indexOf('@')):sub;
user.firstname = (StringUtils.URIDecode((info.firstname && info.firstname!="")?info.firstname:"")).replace("+"," ");
user.lastname = (StringUtils.URIDecode((info.lastname && info.lastname!="")?info.lastname:"")).replace("+"," ");