diff --git a/dmp-admin/src/app/datasets-viewer/datasets-viewer.component.html b/dmp-admin/src/app/datasets-viewer/datasets-viewer.component.html index 1b86ffbac..5095aca05 100644 --- a/dmp-admin/src/app/datasets-viewer/datasets-viewer.component.html +++ b/dmp-admin/src/app/datasets-viewer/datasets-viewer.component.html @@ -102,11 +102,11 @@ - + @@ -118,7 +118,7 @@ - + diff --git a/dmp-frontend/src/app/app.component.html b/dmp-frontend/src/app/app.component.html index ad8c4aec5..22fd1ba02 100644 --- a/dmp-frontend/src/app/app.component.html +++ b/dmp-frontend/src/app/app.component.html @@ -38,19 +38,18 @@ - - + + + - + + + + - + \ No newline at end of file diff --git a/dmp-frontend/src/app/app.component.ts b/dmp-frontend/src/app/app.component.ts index ac2fca9df..bd676656a 100644 --- a/dmp-frontend/src/app/app.component.ts +++ b/dmp-frontend/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, OnInit} from '@angular/core'; import { ServerService } from './services/server.service'; import { FieldBase } from '../app/form/fields/field-base'; import { JsonObjest } from '../app/entities/JsonObject.class'; @@ -12,7 +12,7 @@ import { MainSignInComponent } from './login/main-sign-in/main-sign-in.component styleUrls: ['./app.component.css'], providers: [] }) -export class AppComponent { +export class AppComponent implements OnInit { fields: any[]; @@ -21,6 +21,12 @@ export class AppComponent { } + ngOnInit() { + + + + } + //loggedInAs : string = null; diff --git a/dmp-frontend/src/app/datasets/dataset.component.ts b/dmp-frontend/src/app/datasets/dataset.component.ts index 39b24b50b..b1d5f3674 100644 --- a/dmp-frontend/src/app/datasets/dataset.component.ts +++ b/dmp-frontend/src/app/datasets/dataset.component.ts @@ -92,10 +92,10 @@ export class DatasetsComponent implements OnInit { } - ngOnInit() { debugger; + ngOnInit() { //this.projects = this.serverService.getDummyProjects(); this.datasets = []; - console.log(this.dmpIdforDatasets);debugger; + console.log(this.dmpIdforDatasets); this.serverService.getDatasetForDmp({ "id": this.dmpIdforDatasets }).subscribe( response => { this.tableData = response; diff --git a/dmp-frontend/src/app/dmps/dmp.component.ts b/dmp-frontend/src/app/dmps/dmp.component.ts index b4d2a5948..ceff52473 100644 --- a/dmp-frontend/src/app/dmps/dmp.component.ts +++ b/dmp-frontend/src/app/dmps/dmp.component.ts @@ -93,19 +93,12 @@ export class DmpComponent implements OnInit{ ngOnInit() { //this.projects = this.serverService.getDummyProjects(); - gapi.load('auth2', function() { - gapi.auth2.init({}); - }); this.serverService.getDmpOfUser().subscribe( response => { this.tableData = response; }, (err: HttpErrorResponse) => { - if (err.error instanceof Error) { - console.log("An error occurred:", err.error.message); - } else { - console.log("Backend returned code ${err.status}, body was: ${err.error}"); - } + } ); @@ -135,11 +128,7 @@ getDmps(){ this.tableData = response; }, (err: HttpErrorResponse) => { - if (err.error instanceof Error) { - console.log("An error occurred:", err.error.message); - } else { - console.log("Backend returned code ${err.status}, body was: ${err.error}"); - } + } ); } @@ -169,8 +158,7 @@ updateDMP(){ this.serverService.updateDmp(this.dmp) .subscribe( response =>{ - console.log("response"); - console.log(response); + this.getDmps(); } ); $("#newDmpModal").modal("hide"); diff --git a/dmp-frontend/src/app/dmps/dmps.html b/dmp-frontend/src/app/dmps/dmps.html index 4537d5f28..3368cecb5 100644 --- a/dmp-frontend/src/app/dmps/dmps.html +++ b/dmp-frontend/src/app/dmps/dmps.html @@ -195,6 +195,3 @@ - -Sign out - \ No newline at end of file diff --git a/dmp-frontend/src/app/login/googgle-sign-in/googgle-sign-in.component.ts b/dmp-frontend/src/app/login/googgle-sign-in/googgle-sign-in.component.ts index 2879a7f37..c3d852a56 100644 --- a/dmp-frontend/src/app/login/googgle-sign-in/googgle-sign-in.component.ts +++ b/dmp-frontend/src/app/login/googgle-sign-in/googgle-sign-in.component.ts @@ -60,7 +60,7 @@ export class GooggleSignInComponent implements OnInit, AfterViewInit { this.router.navigate(['/dmps'], { queryParams: { /*returnUrl: this.state.url*/ }}); }, function (error) { - simple_notifier("danger",null,"Failed to login"); + //simple_notifier("danger",null,"Failed to login"); console.log(JSON.stringify(error, undefined, 2)); }); diff --git a/dmp-frontend/src/app/pipes/dataset-status-filter.pipe.ts b/dmp-frontend/src/app/pipes/dataset-status-filter.pipe.ts index 381ca2f71..2363c33f0 100644 --- a/dmp-frontend/src/app/pipes/dataset-status-filter.pipe.ts +++ b/dmp-frontend/src/app/pipes/dataset-status-filter.pipe.ts @@ -7,7 +7,7 @@ import { Pipe, PipeTransform } from "@angular/core"; export class DatasetStatusFilterPipe implements PipeTransform { transform(array: any[], status: string): any { - debugger; + if (status) { diff --git a/dmp-frontend/src/app/projects/project.html b/dmp-frontend/src/app/projects/project.html index 7da2309dd..8b8192d85 100644 --- a/dmp-frontend/src/app/projects/project.html +++ b/dmp-frontend/src/app/projects/project.html @@ -125,6 +125,3 @@ - -Sign out - \ No newline at end of file diff --git a/dmp-frontend/src/app/projects/projects.component.ts b/dmp-frontend/src/app/projects/projects.component.ts index cefdf21c9..abf15a588 100644 --- a/dmp-frontend/src/app/projects/projects.component.ts +++ b/dmp-frontend/src/app/projects/projects.component.ts @@ -83,17 +83,13 @@ export class ProjectsComponent implements OnInit{ ngOnInit() { - gapi.load('auth2', function() { - gapi.auth2.init({}); - }); - this.getProjects(); - //this.projects = this.serverService.getDummyProjects(); this.projects = []; + this.getProjects(); } getProjects(){ - this.serverService.getProjectOfUer().subscribe( //getProjects() + this.serverService.getProjectOfUer().subscribe( response => { this.tableData = response; @@ -191,10 +187,6 @@ editRow(item, event){ } -signOut() { -     this.serverService.logOut(); -} - } diff --git a/dmp-frontend/src/app/services/interceptor.ts b/dmp-frontend/src/app/services/interceptor.ts index a8d54b57d..58f0f5b64 100644 --- a/dmp-frontend/src/app/services/interceptor.ts +++ b/dmp-frontend/src/app/services/interceptor.ts @@ -20,6 +20,7 @@ export class GlobalInterceptor implements HttpInterceptor { }, (err: any) => { if (err instanceof HttpErrorResponse) { if (err.status === 401) { + console.log("Received an unauthorized... redirecting to login page"); this.tokenService.logout(); this.router.navigate(['/login'], { queryParams: { /*returnUrl: this.state.url*/ }}); } diff --git a/dmp-frontend/src/app/services/rest-base.ts b/dmp-frontend/src/app/services/rest-base.ts index 7a3c2acb3..3066b0feb 100644 --- a/dmp-frontend/src/app/services/rest-base.ts +++ b/dmp-frontend/src/app/services/rest-base.ts @@ -17,18 +17,21 @@ export class RestBase { + /* protocol: string = "http"; hostname: string ="dl010.madgik.di.uoa.gr" ;//"localhost";//"dl010.madgik.di.uoa.gr";// port: number = 8080;//8080;// webappname: string = "dmp-backend";//"dmp-backend-new";// - +*/ - /*protocol: string = "http"; + + protocol: string = "http"; hostname: string = "dionysus.di.uoa.gr" ; port: number = 7070; - webappname: string = "dmp-backend";*/ + webappname: string = "dmp-backend"; + proxyPath : string = this.protocol+"://"+this.hostname+":"+this.port+"/"+this.webappname+"/proxy/";