Delete SnackBar Dmp Error
This commit is contained in:
parent
f3168f4e06
commit
3f97ab9f41
|
@ -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) {
|
if (this.definition != null && this.definition.getFields() != null && !this.definition.getFields().isEmpty() && this.properties != null) {
|
||||||
this.definition.getFields().forEach(item -> {
|
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();
|
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());
|
if (entity.getCreator() != null) this.creator.fromDataModel(entity.getCreator());
|
||||||
|
|
|
@ -129,7 +129,7 @@
|
||||||
|
|
||||||
<!-- <h4 mat-subheader class="col-12">{{'DMP-EDITOR.FIELDS.PROFILE' | translate}}</h4> -->
|
<!-- <h4 mat-subheader class="col-12">{{'DMP-EDITOR.FIELDS.PROFILE' | translate}}</h4> -->
|
||||||
<mat-form-field class="col-md-6">
|
<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}}"
|
placeholder="{{'DMP-EDITOR.FIELDS.PROFILE' | translate}}"
|
||||||
[configuration]="dmpProfileAutoCompleteConfiguration">
|
[configuration]="dmpProfileAutoCompleteConfiguration">
|
||||||
</app-single-auto-complete>
|
</app-single-auto-complete>
|
||||||
|
|
|
@ -193,6 +193,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(Option => {
|
.subscribe(Option => {
|
||||||
if (Option instanceof Object) {
|
if (Option instanceof Object) {
|
||||||
|
this.selectedDmpProfileDefinition=null;
|
||||||
this.dmpProfileService.getSingle(Option.id)
|
this.dmpProfileService.getSingle(Option.id)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(result => {
|
.subscribe(result => {
|
||||||
|
@ -257,6 +258,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
|
|
||||||
onCallbackError(error: any) {
|
onCallbackError(error: any) {
|
||||||
this.setErrorModel(error.error);
|
this.setErrorModel(error.error);
|
||||||
|
|
||||||
//this.validateAllFormFields(this.formGroup);
|
//this.validateAllFormFields(this.formGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,11 +339,14 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
complete => { this.onCallbackSuccess() },
|
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) {
|
// selectOption(option: any) {
|
||||||
// this.dmp.definition = null;
|
// this.dmp.definition = null;
|
||||||
|
|
|
@ -19,7 +19,8 @@
|
||||||
"UNSUCCESSFUL-LOGOUT": "Unsuccessful Logout",
|
"UNSUCCESSFUL-LOGOUT": "Unsuccessful Logout",
|
||||||
"UNSUCCESSFUL-LOGIN": "Unsuccessful Login",
|
"UNSUCCESSFUL-LOGIN": "Unsuccessful Login",
|
||||||
"SUCCESSFUL-DATASET-PROFILE-DELETE": "Successful Delete",
|
"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": {
|
"ERRORS": {
|
||||||
"HTTP-REQUEST-ERROR": "An Unexpected Error Has Occured"
|
"HTTP-REQUEST-ERROR": "An Unexpected Error Has Occured"
|
||||||
|
|
Loading…
Reference in New Issue