add loader when opening description for dataset and dmp

This commit is contained in:
annabakouli 2017-12-11 13:20:48 +02:00
parent e069a14b55
commit 5fdc5b6720
3 changed files with 24 additions and 17 deletions

View File

@ -217,7 +217,7 @@ public class DMPs {
DMP d = dMPDao.read(dmp.getId());
d.setStatus(new Short("-1"));
dMPDao.update(d);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("{\"msg\":\"Could not soft delete DMP!\"");
return ResponseEntity.status(HttpStatus.OK).body("{\"msg\":\"deleted DMP!\"");
} catch (Exception e) {
e.printStackTrace();
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("{\"msg\":\"Could not soft delete DMP!\"");

View File

@ -134,9 +134,9 @@ export class DatasetsComponent implements OnInit {
properties: '',
profile: { "id": '' },
dmp: { "id": '' },
services:[],
registries:[],
dataRepositories:[]
services: [],
registries: [],
dataRepositories: []
}
}
@ -203,7 +203,6 @@ export class DatasetsComponent implements OnInit {
this.serverService.getDatasetForDmp({ "id": dmpid }).subscribe(
response => {
this.tableData = response;
},
error => {
console.log("could not retrieve dataset for dpm: " + dmpid);
@ -216,14 +215,15 @@ export class DatasetsComponent implements OnInit {
editRow(item, event) {
if (event.toElement.id == "editDataset") {
//this.dataset = item;
this.serverService.getDatasetByID(item.id).subscribe(item=>{
this.dataset = item;
this.dataset.profile = item.profile.id;
$("#newDatasetModal").modal("show");
}
)
this.spinnerService.show();
this.serverService.getDatasetByID(item.id).subscribe(item => {
this.dataset = item;
this.dataset.profile = item.profile.id;
$("#newDatasetModal").modal("show");
},
error => simple_notifier("danger", null, "Could not Open Dataset"),
() => this.spinnerService.hide()
)
}
else if (event.toElement.id == "describeDataset") {
this.describeDataset(item);

View File

@ -17,6 +17,7 @@ import { NgForm } from '@angular/forms';
import { DatasetsComponent } from '../datasets/dataset.component';
import { StatusToString } from '../pipes/various/status-to-string';
import { MenuItem } from 'primeng/primeng';
import { Ng4LoadingSpinnerService } from 'ng4-loading-spinner';
declare var $: any;
@ -59,7 +60,9 @@ export class DmpComponent implements OnInit {
constructor(
private serverService: ServerService,
private route: ActivatedRoute,
private router: Router) {
private router: Router,
private spinnerService: Ng4LoadingSpinnerService
) {
this.projectsDropDown = new DropdownField();
this.projectsDropDown.options = [];
this.statusDropDown = new DropdownField();
@ -190,12 +193,16 @@ export class DmpComponent implements OnInit {
editDmp(item) {
this.serverService.getDmp(item.id).subscribe(result=>{
this.spinnerService.show();
this.serverService.getDmp(item.id).subscribe(result => {
this.dmp = result;
this.dmp.project = result.project.id
$("#newDmpModal").modal("show");
})
},
error => simple_notifier("danger", null, "Failed to Open DMP"),
() => this.spinnerService.hide()
)
}
cloneDmp(item) {