Delete SnackBar Dmp Error

This commit is contained in:
Diamantis Tziotzios 2019-02-15 16:19:07 +02:00
parent f3168f4e06
commit 3f97ab9f41
4 changed files with 10 additions and 4 deletions

View File

@ -212,7 +212,7 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
if (this.definition != null && this.definition.getFields() != null && !this.definition.getFields().isEmpty() && this.properties != null) {
this.definition.getFields().forEach(item -> {
Optional<Map<String, Object>> fieldOptional = ((List<Map<String, Object>>) this.properties.get("fields")).stream().filter(field -> field.get("id").equals(item.getId().toString())).findFirst();
item.setValue(fieldOptional.orElse(null).get("value"));
if (fieldOptional.isPresent()) item.setValue(fieldOptional.get().get("value"));
});
}
if (entity.getCreator() != null) this.creator.fromDataModel(entity.getCreator());

View File

@ -129,7 +129,7 @@
<!-- <h4 mat-subheader class="col-12">{{'DMP-EDITOR.FIELDS.PROFILE' | translate}}</h4> -->
<mat-form-field class="col-md-6">
<app-single-auto-complete required='false' [formControl]="formGroup.get('profile')"
<app-single-auto-complete [required]='false' [formControl]="formGroup.get('profile')"
placeholder="{{'DMP-EDITOR.FIELDS.PROFILE' | translate}}"
[configuration]="dmpProfileAutoCompleteConfiguration">
</app-single-auto-complete>

View File

@ -193,6 +193,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
.pipe(takeUntil(this._destroyed))
.subscribe(Option => {
if (Option instanceof Object) {
this.selectedDmpProfileDefinition=null;
this.dmpProfileService.getSingle(Option.id)
.pipe(takeUntil(this._destroyed))
.subscribe(result => {
@ -257,6 +258,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
onCallbackError(error: any) {
this.setErrorModel(error.error);
//this.validateAllFormFields(this.formGroup);
}
@ -337,11 +339,14 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
.pipe(takeUntil(this._destroyed))
.subscribe(
complete => { this.onCallbackSuccess() },
error => this.onCallbackError(error)
error => this.onDeleteCallbackError(error)
);
}
});
}
onDeleteCallbackError(error){
this.uiNotificationService.snackBarNotification(error.error.message? error.error.message : this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DELETE'), SnackBarNotificationLevel.Error);
}
// selectOption(option: any) {
// this.dmp.definition = null;

View File

@ -19,7 +19,8 @@
"UNSUCCESSFUL-LOGOUT": "Unsuccessful Logout",
"UNSUCCESSFUL-LOGIN": "Unsuccessful Login",
"SUCCESSFUL-DATASET-PROFILE-DELETE": "Successful Delete",
"UNSUCCESSFUL-DATASET-PROFILE-DELETE": "This profile can not deleted, because Datasets are associated with it"
"UNSUCCESSFUL-DATASET-PROFILE-DELETE": "This profile can not deleted, because Datasets are associated with it",
"UNSUCCESSFUL-DELETE":"Unsuccessful Delete"
},
"ERRORS": {
"HTTP-REQUEST-ERROR": "An Unexpected Error Has Occured"