diff --git a/dmp-frontend/src/app/app.component.ts b/dmp-frontend/src/app/app.component.ts index 00ca991dd..d1120bfbd 100644 --- a/dmp-frontend/src/app/app.component.ts +++ b/dmp-frontend/src/app/app.component.ts @@ -50,12 +50,14 @@ export class AppComponent implements OnInit { login(){ console.log("navigating to login") //redirect to login page - this.router.navigate(['/login'], { queryParams: { /*refresh : Math.random(),returnUrl: this.state.url*/ }}); + this.router.navigate(['/login'], { queryParams: { refresh : Math.random() /*,returnUrl: this.state.url*/ }}); + location.reload(); } logout(){ this.tokenService.logout(); - this.router.navigate(['/login'], { queryParams: { /*returnUrl: this.state.url*/ }}); + this.router.navigate([''], { queryParams: { /*returnUrl: this.state.url*/ }}); + location.reload(); } diff --git a/dmp-frontend/src/app/dmps/dmp.component.ts b/dmp-frontend/src/app/dmps/dmp.component.ts index 5f2cdfe14..18ae6a8a8 100644 --- a/dmp-frontend/src/app/dmps/dmp.component.ts +++ b/dmp-frontend/src/app/dmps/dmp.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core'; -import {GoogleSignInSuccess} from 'angular-google-signin'; +import { GoogleSignInSuccess } from 'angular-google-signin'; import { Router, ActivatedRoute } from '@angular/router'; import { ServerService } from '../../app/services/server.service'; import { Dmp } from '../entities/model/dmp'; @@ -7,7 +7,7 @@ import { Dataset } from '../entities/model/dataset'; import { Project } from '../entities/model/project'; import { ConfirmationComponent } from '../widgets/confirmation/confirmation.component'; -import {DataTable} from 'angular2-datatable'; +import { DataTable } from 'angular2-datatable'; import { DropdownField } from '../../app/form/fields/dropdown/field-dropdown'; import { Param } from '../entities/model/param'; import { ModalComponent } from '../modal/modal.component'; diff --git a/dmp-frontend/src/app/user-workspace/user-workspace.component.html b/dmp-frontend/src/app/user-workspace/user-workspace.component.html index 7c98fd15d..b7210fb6b 100644 --- a/dmp-frontend/src/app/user-workspace/user-workspace.component.html +++ b/dmp-frontend/src/app/user-workspace/user-workspace.component.html @@ -17,10 +17,4 @@
-
-

We applied clearfix to the tab-content to rid of the gap between the tab and the content

-
-
-

We use css to change the background color of the content to be equal to the tab

-
\ No newline at end of file diff --git a/dmp-frontend/src/app/user-workspace/user-workspace.component.ts b/dmp-frontend/src/app/user-workspace/user-workspace.component.ts index 7da03c96c..88f47fa75 100644 --- a/dmp-frontend/src/app/user-workspace/user-workspace.component.ts +++ b/dmp-frontend/src/app/user-workspace/user-workspace.component.ts @@ -2,7 +2,8 @@ import { Component, OnInit } from '@angular/core'; import { DmpComponent } from '../dmps/dmp.component'; import { ProjectsComponent } from '../projects/projects.component'; - +import { TokenService, TokenProvider } from '../services/login/token.service'; +import {Router} from '@angular/router'; @Component({ selector: 'user-workspace', @@ -11,9 +12,15 @@ import { ProjectsComponent } from '../projects/projects.component'; }) export class UserWorkspaceComponent implements OnInit { - constructor() { } + constructor(public tokenService: TokenService, private router : Router) { + + } ngOnInit() { + + if(!this.tokenService.isLoggedIn()) + this.router.navigate([''], { queryParams: { /*returnUrl: this.state.url*/ }}); + } }