diff --git a/dmp-frontend/src/app/datasets/dataset.component.ts b/dmp-frontend/src/app/datasets/dataset.component.ts index fd8746660..84f26198e 100644 --- a/dmp-frontend/src/app/datasets/dataset.component.ts +++ b/dmp-frontend/src/app/datasets/dataset.component.ts @@ -140,8 +140,11 @@ export class DatasetsComponent implements OnInit { } else{ - this.dataset.dmp = { "id": this.dmpIdforDatasets } - this.dataset.profile = { "id": this.dataset.profile } + + this.dataset.dmp = { "id": this.dmpIdforDatasets }; + this.dataset.profile = { "id": this.dataset.profile }; + this.dataset.creator = {"id" : this.dataset.creator }; + this.serverService.updateDatsetsProfile(this.dataset).subscribe( response => { simple_notifier("success",null,"Dataset edited"); @@ -203,6 +206,7 @@ export class DatasetsComponent implements OnInit { //this.dataset.dmp = item.dmp; this.dataset.profile = item.profile==null ? null : item.profile.id; this.dataset.id = item.id; + this.dataset.creator = item.creator; $("#newDatasetModal").modal("show"); } else if(event.toElement.id == "describeDataset"){ @@ -245,7 +249,13 @@ export class DatasetsComponent implements OnInit { this.getDatasets(); }, err => { - simple_notifier("danger",null,"Could not delete the dataset"); + + if(err.status>=200 && err.status<300) + simple_notifier("success",null,"Deleted dataset"); + else + simple_notifier("danger",null,"Could not delete the dataset"); + this.getDatasets(); + } ); } diff --git a/dmp-frontend/src/app/dmps/dmp.component.ts b/dmp-frontend/src/app/dmps/dmp.component.ts index c0e75f764..904a66c79 100644 --- a/dmp-frontend/src/app/dmps/dmp.component.ts +++ b/dmp-frontend/src/app/dmps/dmp.component.ts @@ -73,7 +73,7 @@ export class DmpComponent implements OnInit{ label: '', previous:'', version:'', - profileData:'', + //profileData:'', //project: '', //profile:{} } @@ -140,6 +140,7 @@ export class DmpComponent implements OnInit{ updateDMP(){ this.dmp.project = {"id":this.dmp.project}; + this.dmp.creator = {"id": this.dmp.creator}; this.serverService.updateDmp(this.dmp) .subscribe( @@ -216,7 +217,11 @@ export class DmpComponent implements OnInit{ this.getDmps(); }, (err: HttpErrorResponse) => { - simple_notifier("danger",null,"Failed to delete the DMP"); + if(err.status>=200 && err.status<300) + simple_notifier("success",null,"Successfully deleted the DMP"); + else + simple_notifier("danger",null,"Failed to delete the DMP"); + this.getDmps(); } ); diff --git a/dmp-frontend/src/app/pipes/project-table-filter.pipe.ts b/dmp-frontend/src/app/pipes/project-table-filter.pipe.ts index 4ce000575..e1b667b5d 100644 --- a/dmp-frontend/src/app/pipes/project-table-filter.pipe.ts +++ b/dmp-frontend/src/app/pipes/project-table-filter.pipe.ts @@ -13,7 +13,7 @@ export class ProjectTableFilterPipe implements PipeTransform { return _.filter(array, row => { if(onlyMyProjects){ - return (row.label.indexOf(query) > -1) && (row.creationUser==userid); + return (row.label.indexOf(query) > -1) && (row.creationUser.id==userid); } else{ return row.label.indexOf(query) > -1; diff --git a/dmp-frontend/src/app/projects/project.html b/dmp-frontend/src/app/projects/project.html index 3685db049..85bcee400 100644 --- a/dmp-frontend/src/app/projects/project.html +++ b/dmp-frontend/src/app/projects/project.html @@ -60,7 +60,7 @@ {{project?.status | statusToString}} {{(project?.description?.length > 40) ? (project?.description | slice:0:40)+'...':(project?.description) }} - +