manage-subscribers.component & manage-user-notifications.component: when Session is expired, redirect to '/user-info' page to show a proper message (fix unhandled cases).

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@53741 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2018-11-14 11:06:25 +00:00
parent 9ddb0b32c9
commit 1dd618dae7
2 changed files with 35 additions and 10 deletions

View File

@ -134,6 +134,10 @@ export class ManageSubscribersComponent implements OnInit {
}
filterData(row: any, query: string) {
if(!Session.isLoggedIn()){
console.info(this._router.url);
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
} else {
let returnValue: boolean = false;
if(query) {
@ -151,6 +155,7 @@ export class ManageSubscribersComponent implements OnInit {
}
return true;
}
}
filterQuery(data, query){
if(data.toLowerCase().indexOf(query.toLowerCase()) > -1) {

View File

@ -165,6 +165,10 @@ export class ManageUserNotificationsComponent implements OnInit {
}
*/
if(!Session.isLoggedIn()){
console.info(this._router.url);
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
} else {
this.mailPrefs.restoreNotification(0);
if(this.userNotifications && this.initialUserNotifications) {
@ -177,16 +181,27 @@ export class ManageUserNotificationsComponent implements OnInit {
this.resetChange();
}
}
public changeValueForNewManagers(notifyForManagers : any) {
if(!Session.isLoggedIn()){
console.info(this._router.url);
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
} else {
this.userNotifications.notifyForNewManagers = !notifyForManagers;
this.change();
}
}
public changeValueForNewSubscribers(notifyForSubscribers : any) {
if(!Session.isLoggedIn()){
console.info(this._router.url);
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
} else {
this.userNotifications.notifyForNewSubscribers = !notifyForSubscribers;
this.change();
}
}
private change() {
this.hasChanged = true;
@ -203,8 +218,13 @@ export class ManageUserNotificationsComponent implements OnInit {
}
public mailPrefsChanged(): boolean {
if(!Session.isLoggedIn()){
console.info(this._router.url);
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
} else {
return this.mailPrefs.prefsChanged["0"];//(0);
}
}
handleUpdateError(message: string, error) {
this.updateErrorMessage = message;