diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts b/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts index 0dc486ee2..3bd5956a1 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts @@ -678,7 +678,7 @@ export class DescriptionEditorComponent extends BaseEditor { this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success); - this.refreshOnNavigateToData(data ? data.id : null); + this.formGroup = null; this.backToDmp(); }); } diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.html b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.html index 8a96b965d..c3e514155 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.html @@ -82,7 +82,7 @@
- + {{field.data.label}} {{propertiesFormGroup?.get(field.id).get('textValue').getError('backendError').message}}
@@ -119,7 +119,7 @@ {{ (field.data.label | translate)}} - diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts index 7cf364498..fc58f2496 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts @@ -2,6 +2,7 @@ import { COMMA, ENTER } from '@angular/cdk/keycodes'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit, SimpleChanges } from '@angular/core'; import { UntypedFormControl, UntypedFormGroup } from '@angular/forms'; +import { MatCheckboxChange } from '@angular/material/checkbox'; import { MatDialog } from "@angular/material/dialog"; import { DescriptionTemplateFieldType } from '@app/core/common/enum/description-template-field-type'; import { DescriptionTemplateFieldValidationType } from '@app/core/common/enum/description-template-field-validation-type'; @@ -116,6 +117,15 @@ export class DescriptionFormFieldComponent extends BaseComponent implements OnIn } } + checkBoxChanged(event: MatCheckboxChange){ + if (event.checked){ + this.propertiesFormGroup?.get(this.field.id).get('textValue').setValue("true"); + } else{ + this.propertiesFormGroup?.get(this.field.id).get('textValue').setValue("false"); + } + this.visibilityRulesService.reloadVisibility(); + } + private applyFieldType(){ this.isRequired = this.field.validations?.includes(DescriptionTemplateFieldValidationType.Required); @@ -164,7 +174,8 @@ export class DescriptionFormFieldComponent extends BaseComponent implements OnIn // } break; case DescriptionTemplateFieldType.CHECK_BOX: - this.propertiesFormGroup?.get(this.field.id).get('textValue').setValue(this.propertiesFormGroup?.get(this.field.id).get('textValue').value === 'true'); + if (this.propertiesFormGroup?.get(this.field.id).get('textValue').value == undefined) this.propertiesFormGroup?.get(this.field.id).get('textValue').setValue("false"); + this.visibilityRulesService.reloadVisibility(); break; }