revert changes on "description editor > added option to skip form-refresh on save"

This commit is contained in:
Sofia Papacharalampous 2024-04-26 18:21:55 +03:00
parent c91a2408a3
commit 57cbc1d8e4
2 changed files with 4 additions and 4 deletions

View File

@ -628,6 +628,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
refreshData(): void {
this.getItem(this.editorModel.id, (data: Description) => this.prepareForm(data));
this.tocValidationService.validateForm();
}
refreshOnNavigateToData(id?: Guid): void {
@ -648,8 +649,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
this.descriptionService.persist(formData)
.pipe(takeUntil(this._destroyed)).subscribe(
complete => {
onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete, this.isNew);
this.tocValidationService.validateForm();
onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete);
this.descriptionIsOnceSaved = true;
if (this.formGroup.get('status').value == DescriptionStatus.Finalized) this.isFinalized = true;
},

View File

@ -109,12 +109,12 @@ export abstract class BaseEditor<EditorModelType extends BaseEditorModel, Entity
onCallbackSuccess(data?: any, refresh: boolean = true): void {
onCallbackSuccess(data?: any): void {
console.log("Success:", data);
this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
if (refresh) this.refreshOnNavigateToData(data ? data.id : null);
this.refreshOnNavigateToData(data ? data.id : null);
}
onCallbackDeleteSuccess(data?: any): void {