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
|
||||
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
|
||||
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
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@RequestMapping(method = RequestMethod.GET, value = {"{id}"}, produces = "application/json")
|
||||
public @ResponseBody
|
||||
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) {
|
||||
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) {
|
||||
this.isNew = true;
|
||||
|
@ -383,7 +388,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
|||
|
||||
public isSemiFormValid(formGroup: FormGroup): boolean {
|
||||
var isValid: boolean = true;
|
||||
Object.keys(formGroup.controls).forEach( controlName => {
|
||||
Object.keys(formGroup.controls).forEach(controlName => {
|
||||
if (controlName != 'datasetProfileDefinition' && formGroup.get(controlName).invalid) {
|
||||
isValid = false;
|
||||
}
|
||||
|
@ -639,7 +644,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
|||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result) {
|
||||
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]);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -367,6 +367,10 @@
|
|||
"COPY-DATASET": "Copy Dataset Description",
|
||||
"UPDATE-DATASET-PROFILE": "Update Template"
|
||||
},
|
||||
"MESSAGES": {
|
||||
"DATAESET-NOT-FOUND": "Dataset Description does not exist",
|
||||
"SUCCESS-UPDATE-DATASET-PROFILE": "Dataset Template updated successfully"
|
||||
},
|
||||
"UPLOAD": {
|
||||
"UPLOAD-XML": "Import",
|
||||
"UPLOAD-XML-FILE-TITLE": "Import Dataset Template",
|
||||
|
|
Loading…
Reference in New Issue