From 22d4a2f1052f9291a4ff9888511f21811acdc010 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Fri, 9 Nov 2018 13:44:08 +0000 Subject: [PATCH] In display claims redirect when session expires. Update messages in user login errors git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@53689 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../displayClaims/displayClaims.component.ts | 6 ++++-- login/user.component.html | 16 ++++++---------- sharedComponents/bottom.component.html | 8 ++++---- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/claims/claim-utils/displayClaims/displayClaims.component.ts b/claims/claim-utils/displayClaims/displayClaims.component.ts index 8ab5380d..58ccde80 100644 --- a/claims/claim-utils/displayClaims/displayClaims.component.ts +++ b/claims/claim-utils/displayClaims/displayClaims.component.ts @@ -8,6 +8,7 @@ import {ModalLoading} from '../../../utils/modal/loading.component'; import {AlertModal} from '../../../utils/modal/alert'; import {Session} from '../../../login/utils/helper.class'; import{EnvProperties} from '../../../utils/properties/env-properties'; +import {LoginErrorCodes} from '../../../login/utils/guardHelper.class'; @Component({ @@ -122,7 +123,7 @@ export class DisplayClaimsComponent { getClaims () { if(!Session.isLoggedIn()){ this.userValidMessage = "User session has expired. Please login again."; - + this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); }else{ this.selected=[]; var types = ''; @@ -463,6 +464,7 @@ handleErrors(err){ deleteById(id:string){ if(!Session.isLoggedIn()){ this.userValidMessage = "User session has expired. Please login again."; + this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); }else{ console.log("Deleting claim with id:"+id); @@ -495,7 +497,7 @@ handleErrors(err){ batchDeleteById(ids:string[]){ if(!Session.isLoggedIn()){ this.userValidMessage = "User session has expired. Please login again."; - + this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); }else{ console.warn("Deleting claim with ids:"+ids); this._claimService.deleteBulk(ids,this.properties.claimsAPIURL).subscribe( diff --git a/login/user.component.html b/login/user.component.html index 51bb8390..27553940 100644 --- a/login/user.component.html +++ b/login/user.component.html @@ -33,27 +33,23 @@
The requested page requires authentication. - Please Sign in + Please sign in to continue.
- You are not authorized to use the requested page + You are not authorized to use the requested page.
- The session has expired. Please sign in again or continue browsing as a guest. - - - Please Sign in - + The session has expired. Please sign in again or continue browsing as a guest.
- You are not authorized to use the requested page + You are not authorized to use the requested page.
- There is no community selected + There is no research community selected.
- For this action you have to subscribe to community first + For this action you have to subscribe to research community first.
{{errorMessage}}
diff --git a/sharedComponents/bottom.component.html b/sharedComponents/bottom.component.html index 2bda8168..a1e00718 100644 --- a/sharedComponents/bottom.component.html +++ b/sharedComponents/bottom.component.html @@ -35,21 +35,21 @@