Fixes bug on showing deleted Dataset Descriptions and fixes language on Dataset Description Template version update.
This commit is contained in:
parent
74779d8054
commit
39b0ca0140
|
@ -65,12 +65,14 @@ public class DatasetDaoImpl extends DatabaseAccess<Dataset> implements DatasetDa
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dataset find(UUID id) {
|
public Dataset find(UUID id) {
|
||||||
return getDatabaseService().getQueryable(Dataset.class).where((builder, root) -> builder.equal((root.get("id")), id)).getSingle();
|
return getDatabaseService().getQueryable(Dataset.class)
|
||||||
|
.where((builder, root) -> builder.and(builder.notEqual(root.get("status"),Dataset.Status.DELETED.getValue()), builder.notEqual(root.get("status"),Dataset.Status.CANCELED.getValue()), builder.equal((root.get("id")), id))).getSingle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dataset find(UUID id, String hint) {
|
public Dataset find(UUID id, String hint) {
|
||||||
return getDatabaseService().getQueryable(Dataset.getHints(), Dataset.class).withHint(hint).where((builder, root) -> builder.equal((root.get("id")), id)).getSingle();
|
return getDatabaseService().getQueryable(Dataset.getHints(), Dataset.class).withHint(hint)
|
||||||
|
.where((builder, root) -> builder.and(builder.notEqual(root.get("status"),Dataset.Status.DELETED.getValue()), builder.notEqual(root.get("status"),Dataset.Status.CANCELED.getValue()), builder.equal((root.get("id")), id))).getSingle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -71,6 +71,7 @@ public class DatasetWizardController extends BaseController {
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<AssociatedProfile>>().status(ApiMessageCode.NO_MESSAGE).payload(dataManagementPlans));
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<AssociatedProfile>>().status(ApiMessageCode.NO_MESSAGE).payload(dataManagementPlans));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
@RequestMapping(method = RequestMethod.GET, value = {"{id}"}, produces = "application/json")
|
@RequestMapping(method = RequestMethod.GET, value = {"{id}"}, produces = "application/json")
|
||||||
public @ResponseBody
|
public @ResponseBody
|
||||||
ResponseEntity getSingle(@PathVariable String id, @RequestHeader("Content-Type") String contentType, @ClaimedAuthorities(claims = {ANONYMOUS}) Principal principal) throws IllegalAccessException, IOException, InstantiationException {
|
ResponseEntity getSingle(@PathVariable String id, @RequestHeader("Content-Type") String contentType, @ClaimedAuthorities(claims = {ANONYMOUS}) Principal principal) throws IllegalAccessException, IOException, InstantiationException {
|
||||||
|
|
|
@ -135,6 +135,11 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
||||||
if (this.formGroup.get('dmp').value.status == DmpStatus.Draft && this.formGroup.get('status').value == DatasetStatus.Finalized) {
|
if (this.formGroup.get('dmp').value.status == DmpStatus.Draft && this.formGroup.get('status').value == DatasetStatus.Finalized) {
|
||||||
this.hasReversableStatus = true;
|
this.hasReversableStatus = true;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-WIZARD.MESSAGES.DATAESET-NOT-FOUND'), SnackBarNotificationLevel.Error);
|
||||||
|
this.router.navigate(['/plans']);
|
||||||
|
return Observable.of(null);
|
||||||
});
|
});
|
||||||
} else if (dmpId != null) {
|
} else if (dmpId != null) {
|
||||||
this.isNew = true;
|
this.isNew = true;
|
||||||
|
@ -639,7 +644,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
||||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.profileUpdateId = this.itemId;
|
this.profileUpdateId = this.itemId;
|
||||||
this.uiNotificationService.snackBarNotification("Profile changed, WOW!", SnackBarNotificationLevel.Success);
|
this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-WIZARD.MESSAGES.SUCCESS-UPDATE-DATASET-PROFILE'), SnackBarNotificationLevel.Success);
|
||||||
this.router.navigate(['/datasets/profileupdate/' + this.profileUpdateId]);
|
this.router.navigate(['/datasets/profileupdate/' + this.profileUpdateId]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -367,6 +367,10 @@
|
||||||
"COPY-DATASET": "Copy Dataset Description",
|
"COPY-DATASET": "Copy Dataset Description",
|
||||||
"UPDATE-DATASET-PROFILE": "Update Template"
|
"UPDATE-DATASET-PROFILE": "Update Template"
|
||||||
},
|
},
|
||||||
|
"MESSAGES": {
|
||||||
|
"DATAESET-NOT-FOUND": "Dataset Description does not exist",
|
||||||
|
"SUCCESS-UPDATE-DATASET-PROFILE": "Dataset Template updated successfully"
|
||||||
|
},
|
||||||
"UPLOAD": {
|
"UPLOAD": {
|
||||||
"UPLOAD-XML": "Import",
|
"UPLOAD-XML": "Import",
|
||||||
"UPLOAD-XML-FILE-TITLE": "Import Dataset Template",
|
"UPLOAD-XML-FILE-TITLE": "Import Dataset Template",
|
||||||
|
|
Loading…
Reference in New Issue