minor changes
This commit is contained in:
parent
441489623c
commit
624eec5ba2
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -65,11 +65,11 @@
|
|||
|
||||
<tr *ngFor="let dmp of mf.data" class="hover">
|
||||
<td [ngClass]="{true:'visible', false:'invisible'}[showIDs]">{{dmp?.id}}</td>
|
||||
<td class="url-like" (click)="viewDetailedDMP(dmp)">{{dmp?.label}}</td>
|
||||
<td class="url-like" (click)="viewDetailedDMP(dmp)">{{(dmp?.label?.length > 40) ? (dmp?.label | slice:0:40)+'...':(dmp?.label) }}</td>
|
||||
<td style="width:20px;">{{dmp?.version}}</td>
|
||||
<td style="width:300px;">{{dmp?.previous}}</td>
|
||||
<td>{{dmp?.project?.label}}</td>
|
||||
<td>{{(dmp?.description?.length > 20) ? (dmp?.description | slice:0:20)+'...':(dmp?.description) }}</td>
|
||||
<td>{{(dmp?.project?.label?.length > 40) ? (dmp?.project?.label | slice:0:40)+'...':(dmp?.project?.label) }}</td>
|
||||
<td>{{(dmp?.description?.length > 40) ? (dmp?.description | slice:0:40)+'...':(dmp?.description) }}</td>
|
||||
<td>{{dmp?.created | date:'yyyy-MM-dd HH:mm:ss Z'}}</td>
|
||||
<td>{{dmp?.status | statusToString }}</td>
|
||||
<td>
|
||||
|
@ -111,14 +111,14 @@
|
|||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form #newProjectForm="ngForm" (ngSubmit)="SaveNewDmp()">
|
||||
<form #dmpForm="ngForm" (ngSubmit)="SaveNewDmp()">
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<label for="label-name" class="form-control-label">Label:</label>
|
||||
<input type="text" class="form-control" id="label-name" [ngModel]="dmp?.label" (ngModelChange)="dmp.label=$event" name="label">
|
||||
<input type="text" class="form-control" id="label-name" [ngModel]="dmp?.label" (ngModelChange)="dmp.label=$event" name="label" required>
|
||||
</div>
|
||||
<label for="recipient-name" class="col-form-label">Project:</label>
|
||||
<select class="form-control" id="projectsDropDownKey" [ngModel]="dmp?.project" (ngModelChange)="dmp.project=$event" name="projectsDropDown">
|
||||
<select class="form-control" id="projectsDropDownKey" [ngModel]="dmp?.project" (ngModelChange)="dmp.project=$event" name="projectsDropDown" required>
|
||||
<option *ngFor="let opt of projectsDropDown.options" [value]="opt.key">{{opt.value}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
@ -176,7 +176,7 @@
|
|||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form #newProjectForm="ngForm" (ngSubmit)="SaveNewDmp()">
|
||||
<form #dmpForm="ngForm" (ngSubmit)="SaveNewDmp()">
|
||||
<div class="form-group">
|
||||
<label for="label-name" class="form-control-label">Label:</label>
|
||||
<input type="text" class="form-control" id="label-name" [ngModel]="dmp?.label" (ngModelChange)="dmp.label=$event" name="label">
|
||||
|
@ -201,7 +201,7 @@
|
|||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="submit" class="btn btn-primary" (click)="cloneDMP(dmp);">Save Dmp</button>
|
||||
<button type="submit" class="btn btn-primary" [disabled]="!dmpForm.form.valid" (click)="cloneDMP(dmp);">Save Dmp</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -229,5 +229,3 @@
|
|||
|
||||
<!-- Confirmation module- do not delete -->
|
||||
<confirmation [confirmationID]="'delete-dmp-confirm'" [confirmationTitle]="'Caution'" [confirmationDescr]="'This action will delete this DMP. Are you sure ? This is not revertable !'" (responseSender)="deleteDMP($event)"></confirmation>
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
<h1>
|
||||
Works
|
||||
</h1>
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>Hello {{ userInfo?.name!=null ? userInfo?.name : userInfo?.email }}</h1>
|
||||
<p>Welcome {{ userInfo?.created != userInfo?.lastloggedin ? "back" : "" }} to the <a href="https://en.wikipedia.org/wiki/Data_management_plan">Data Management Plans</a> application. </p>
|
||||
<!--
|
||||
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
|
||||
-->
|
||||
</div>
|
||||
|
||||
<!--
|
||||
{{userInfo | json}}
|
||||
-->
|
|
@ -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 {}
|
||||
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 => {
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -53,12 +53,12 @@
|
|||
|
||||
<tr *ngFor="let project of mf.data" class="hover">
|
||||
<td [ngClass]="{true:'visible', false:'invisible'}[showIDs]">{{project?.id}}</td>
|
||||
<td>{{project?.label}}</td>
|
||||
<td>{{(project?.label?.length > 40) ? (project?.label | slice:0:40)+'...':(project?.label) }}</td>
|
||||
<td>{{project?.abbreviation}}</td>
|
||||
<td>{{project?.startdate | date:'yyyy-MM-dd HH:mm:ss Z' }}</td>
|
||||
<td>{{project?.enddate | date:'yyyy-MM-dd HH:mm:ss Z'}}</td>
|
||||
<td>{{project?.status | statusToString}}</td>
|
||||
<td>{{project?.description}}</td>
|
||||
<td>{{(project?.description?.length > 40) ? (project?.description | slice:0:40)+'...':(project?.description) }}</td>
|
||||
<td>
|
||||
<a [ngClass]="{'not-active': whoami?.id!=project?.creationUser }" class="editGridColumn" (click)="editRow(project, $event)">
|
||||
<i class="fa fa-pencil fa-fw" data-toggle="tooltip" title="edit properties" id="editDMP" ></i>
|
||||
|
|
|
@ -7,10 +7,12 @@ import { Component, OnInit } from '@angular/core';
|
|||
})
|
||||
export class DmpDetailedComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
constructor() {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue