Merge branch 'master' of gitlab.eudat.eu:dmp/OpenAIRE-EUDAT-DMP-service-pilot

This commit is contained in:
annampak 2017-11-10 17:55:48 +02:00
commit 77c53b30a2
6 changed files with 19 additions and 19 deletions

View File

@ -56,12 +56,10 @@
--> -->
<div id="appBody" class="child_div_right"> <div id="appBody" class="child_div_right">
<router-outlet [ngClass]="{true:'visible'}[tokenService.isLoggedIn() == true]" ></router-outlet> <router-outlet></router-outlet>
<!--
<main-window [ngClass]="{false:'invisible'}[tokenService.isLoggedIn() == true]"></main-window>
-->
<!--this should be invisible --> <!--this should be invisible -->
<app-main-sign-in [ngClass]="'invisible'"></app-main-sign-in> <app-main-sign-in [ngClass]="'invisible'"></app-main-sign-in>

View File

@ -50,12 +50,14 @@ export class AppComponent implements OnInit {
login(){ login(){
console.log("navigating to login") console.log("navigating to login")
//redirect to login page //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(){ logout(){
this.tokenService.logout(); this.tokenService.logout();
this.router.navigate(['/login'], { queryParams: { /*returnUrl: this.state.url*/ }}); this.router.navigate([''], { queryParams: { /*returnUrl: this.state.url*/ }});
location.reload();
} }

View File

@ -1,5 +1,5 @@
import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core'; 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 { Router, ActivatedRoute } from '@angular/router';
import { ServerService } from '../../app/services/server.service'; import { ServerService } from '../../app/services/server.service';
import { Dmp } from '../entities/model/dmp'; import { Dmp } from '../entities/model/dmp';
@ -7,7 +7,7 @@ import { Dataset } from '../entities/model/dataset';
import { Project } from '../entities/model/project'; import { Project } from '../entities/model/project';
import { ConfirmationComponent } from '../widgets/confirmation/confirmation.component'; 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 { DropdownField } from '../../app/form/fields/dropdown/field-dropdown';
import { Param } from '../entities/model/param'; import { Param } from '../entities/model/param';
import { ModalComponent } from '../modal/modal.component'; import { ModalComponent } from '../modal/modal.component';

View File

@ -75,7 +75,6 @@ export class GooggleSignInComponent implements OnInit, AfterViewInit, Injectable
//simple_notifier("success",null,"Successful login"); //simple_notifier("success",null,"Successful login");
let profile = googleUser.getBasicProfile(); let profile = googleUser.getBasicProfile();
this.tokenService.login(googleUser.getAuthResponse().id_token, TokenProvider.google, profile.getName(), profile.getEmail()); this.tokenService.login(googleUser.getAuthResponse().id_token, TokenProvider.google, profile.getName(), profile.getEmail());
this.router.navigate(['/workspace'], { queryParams: { /*returnUrl: this.state.url*/ }});
}, },
function (error) { function (error) {
//simple_notifier("danger",null,"Failed to login"); //simple_notifier("danger",null,"Failed to login");

View File

@ -17,10 +17,4 @@
<div class="tab-pane" id="all-projects"> <div class="tab-pane" id="all-projects">
<projects></projects> <projects></projects>
</div> </div>
<div class="tab-pane" id="3a">
<h3>We applied clearfix to the tab-content to rid of the gap between the tab and the content</h3>
</div>
<div class="tab-pane" id="4a">
<h3>We use css to change the background color of the content to be equal to the tab</h3>
</div>
</div> </div>

View File

@ -2,7 +2,8 @@ import { Component, OnInit } from '@angular/core';
import { DmpComponent } from '../dmps/dmp.component'; import { DmpComponent } from '../dmps/dmp.component';
import { ProjectsComponent } from '../projects/projects.component'; import { ProjectsComponent } from '../projects/projects.component';
import { TokenService, TokenProvider } from '../services/login/token.service';
import {Router} from '@angular/router';
@Component({ @Component({
selector: 'user-workspace', selector: 'user-workspace',
@ -11,9 +12,15 @@ import { ProjectsComponent } from '../projects/projects.component';
}) })
export class UserWorkspaceComponent implements OnInit { export class UserWorkspaceComponent implements OnInit {
constructor() { } constructor(public tokenService: TokenService, private router : Router) {
}
ngOnInit() { ngOnInit() {
//if(!this.tokenService.isLoggedIn())
//this.router.navigate([''], { queryParams: { /*returnUrl: this.state.url*/ }});
} }
} }