From 624eec5ba27064729f1efad13a02b2a339581ac7 Mon Sep 17 00:00:00 2001 From: Nikolaos Laskaris Date: Thu, 16 Nov 2017 19:07:27 +0200 Subject: [PATCH] minor changes --- dmp-frontend/src/app/dmps/dmp.component.ts | 16 ++++------- dmp-frontend/src/app/dmps/dmps.html | 18 ++++++------- .../src/app/homepage/homepage.component.html | 15 ++++++++--- .../src/app/homepage/homepage.component.ts | 27 +++++++++++++++++-- dmp-frontend/src/app/projects/project.html | 4 +-- .../dmp-detailed/dmp-detailed.component.ts | 8 +++--- 6 files changed, 57 insertions(+), 31 deletions(-) diff --git a/dmp-frontend/src/app/dmps/dmp.component.ts b/dmp-frontend/src/app/dmps/dmp.component.ts index 7d0b32889..c0e75f764 100644 --- a/dmp-frontend/src/app/dmps/dmp.component.ts +++ b/dmp-frontend/src/app/dmps/dmp.component.ts @@ -45,7 +45,7 @@ export class DmpComponent implements OnInit{ showIDs : boolean = false; - dmp : any = null; + dmp : any; @Input() projectsDropDown:DropdownField; @Input() statusDropDown: DropdownField; @@ -60,10 +60,9 @@ export class DmpComponent implements OnInit{ this.projectsDropDown = new DropdownField(); this.projectsDropDown.options = []; this.statusDropDown = new DropdownField(); - this.statusDropDown.options= [{key:'', value:null},{key:'0', value:"Active"},{key:'1', value:"Inactive"}, {key:'2', value:"Submitted"}, {key:'3', value:"Cancel"}] + this.statusDropDown.options= [{key:'', value:null},{key:'0', value:"Active"},{key:'1', value:"Inactive"}] //this.projects = []; - this.dmp = this.clearDmp(); } @@ -101,17 +100,12 @@ export class DmpComponent implements OnInit{ } ) - } + this.clearDmp(); - showDMPDetails(dmp) { - console.log("Showing details for dmp : " + JSON.stringify(dmp)); - // TODO: Add here code to show details of dmp. - //1. hide dmp table and show component for detailed dmp - //2. also edit the breadcrumb + } - getDmps(muted? : boolean){ this.serverService.getDmpOfUser().subscribe( response => { @@ -198,7 +192,7 @@ export class DmpComponent implements OnInit{ newDmpForm(item){ - this.dmp = this.clearDmp(); + this.clearDmp(); $("#newDmpModal").modal("show"); } diff --git a/dmp-frontend/src/app/dmps/dmps.html b/dmp-frontend/src/app/dmps/dmps.html index 7118ba627..28eded532 100644 --- a/dmp-frontend/src/app/dmps/dmps.html +++ b/dmp-frontend/src/app/dmps/dmps.html @@ -65,11 +65,11 @@ {{dmp?.id}} - {{dmp?.label}} + {{(dmp?.label?.length > 40) ? (dmp?.label | slice:0:40)+'...':(dmp?.label) }} {{dmp?.version}} {{dmp?.previous}} - {{dmp?.project?.label}} - {{(dmp?.description?.length > 20) ? (dmp?.description | slice:0:20)+'...':(dmp?.description) }} + {{(dmp?.project?.label?.length > 40) ? (dmp?.project?.label | slice:0:40)+'...':(dmp?.project?.label) }} + {{(dmp?.description?.length > 40) ? (dmp?.description | slice:0:40)+'...':(dmp?.description) }} {{dmp?.created | date:'yyyy-MM-dd HH:mm:ss Z'}} {{dmp?.status | statusToString }} @@ -111,14 +111,14 @@ @@ -229,5 +229,3 @@ - - diff --git a/dmp-frontend/src/app/homepage/homepage.component.html b/dmp-frontend/src/app/homepage/homepage.component.html index 30d22cf68..64cebdff9 100644 --- a/dmp-frontend/src/app/homepage/homepage.component.html +++ b/dmp-frontend/src/app/homepage/homepage.component.html @@ -1,3 +1,12 @@ -

- Works -

\ No newline at end of file + +
+

Hello {{ userInfo?.name!=null ? userInfo?.name : userInfo?.email }}

+

Welcome {{ userInfo?.created != userInfo?.lastloggedin ? "back" : "" }} to the Data Management Plans application.

+ +
+ + \ No newline at end of file diff --git a/dmp-frontend/src/app/homepage/homepage.component.ts b/dmp-frontend/src/app/homepage/homepage.component.ts index 894f16749..c8d1ea827 100644 --- a/dmp-frontend/src/app/homepage/homepage.component.ts +++ b/dmp-frontend/src/app/homepage/homepage.component.ts @@ -1,4 +1,6 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import { ServerService } from '../../app/services/server.service'; @Component({ selector: 'homepage', @@ -6,4 +8,25 @@ import { Component } from '@angular/core'; styleUrls: ['./homepage.component.css'], providers: [] }) -export class HomepageComponent {} \ No newline at end of file +export class HomepageComponent implements OnInit{ + + private userInfo: any; + + constructor(private serverService: ServerService, private route: ActivatedRoute, private router: Router){ + + } + + + ngOnInit() { + this.serverService.whoami().subscribe( + userInfo => { + this.userInfo = userInfo; + }, + error => { + + } + ); + } + + +} \ No newline at end of file diff --git a/dmp-frontend/src/app/projects/project.html b/dmp-frontend/src/app/projects/project.html index e79dab8f5..3685db049 100644 --- a/dmp-frontend/src/app/projects/project.html +++ b/dmp-frontend/src/app/projects/project.html @@ -53,12 +53,12 @@ {{project?.id}} - {{project?.label}} + {{(project?.label?.length > 40) ? (project?.label | slice:0:40)+'...':(project?.label) }} {{project?.abbreviation}} {{project?.startdate | date:'yyyy-MM-dd HH:mm:ss Z' }} {{project?.enddate | date:'yyyy-MM-dd HH:mm:ss Z'}} {{project?.status | statusToString}} - {{project?.description}} + {{(project?.description?.length > 40) ? (project?.description | slice:0:40)+'...':(project?.description) }} diff --git a/dmp-frontend/src/app/viewers/dmp-detailed/dmp-detailed.component.ts b/dmp-frontend/src/app/viewers/dmp-detailed/dmp-detailed.component.ts index 6173c090d..eb79350d2 100644 --- a/dmp-frontend/src/app/viewers/dmp-detailed/dmp-detailed.component.ts +++ b/dmp-frontend/src/app/viewers/dmp-detailed/dmp-detailed.component.ts @@ -7,10 +7,12 @@ import { Component, OnInit } from '@angular/core'; }) export class DmpDetailedComponent implements OnInit { - constructor() { } - - ngOnInit() { + constructor() { } + ngOnInit() { + + } + }