diff --git a/dmp-frontend/src/app/core/pipes/field-value.pipe.ts b/dmp-frontend/src/app/core/pipes/field-value.pipe.ts
index 8eca47f68..0c01357cf 100644
--- a/dmp-frontend/src/app/core/pipes/field-value.pipe.ts
+++ b/dmp-frontend/src/app/core/pipes/field-value.pipe.ts
@@ -11,8 +11,8 @@ export class FieldValuePipe implements PipeTransform {
}
transform(controlValue: any): string | null {
- let value = controlValue.value;
- let renderStyle = controlValue.viewStyle?.renderStyle;
+ let value = controlValue?.value;
+ let renderStyle = controlValue?.viewStyle?.renderStyle;
if (renderStyle && value) {
switch (renderStyle) {
case DescriptionTemplateFieldType.CURRENCY:
diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html
index f8ce001f1..749c912a5 100644
--- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html
+++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html
@@ -99,8 +99,8 @@
diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.component.html b/dmp-frontend/src/app/ui/description/editor/description-editor.component.html
index d5d8aac67..44e497602 100644
--- a/dmp-frontend/src/app/ui/description/editor/description-editor.component.html
+++ b/dmp-frontend/src/app/ui/description/editor/description-editor.component.html
@@ -136,8 +136,8 @@
[linkToScroll]="linkToScroll"
(fieldsetFocusChange)="fieldsetIdWithFocus = $event">
-
{{formGroup?.value | json}}
+
diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.model.ts b/dmp-frontend/src/app/ui/description/editor/description-editor.model.ts
index d18e1c0ea..51643bcbe 100644
--- a/dmp-frontend/src/app/ui/description/editor/description-editor.model.ts
+++ b/dmp-frontend/src/app/ui/description/editor/description-editor.model.ts
@@ -159,7 +159,7 @@ export class DescriptionPropertyDefinitionEditorModel implements DescriptionProp
definitionSection?.fieldSets?.forEach(definitionFieldSet => {
const fieldSetResult = this.calculateFieldSetProperties(definitionFieldSet, item);
if (fieldSetResult != null) {
- result = new Map([...result, ...fieldSetResult]);
+ result.set(definitionFieldSet.id, fieldSetResult);
}
});
@@ -175,9 +175,8 @@ export class DescriptionPropertyDefinitionEditorModel implements DescriptionProp
return result;
}
- private calculateFieldSetProperties(definitionFieldSet: DescriptionTemplateFieldSet, item: DescriptionPropertyDefinition): Map {
+ public calculateFieldSetProperties(definitionFieldSet: DescriptionTemplateFieldSet, item: DescriptionPropertyDefinition): DescriptionPropertyDefinitionFieldSetEditorModel {
if (definitionFieldSet == null) return null;
- const result: Map = new Map();
// current saved values
const fieldSetValue: DescriptionPropertyDefinitionFieldSet = item?.fieldSets[definitionFieldSet.id] ?? {};
@@ -194,9 +193,7 @@ export class DescriptionPropertyDefinitionEditorModel implements DescriptionProp
} as DescriptionPropertyDefinitionFieldSetItem]
}
- result.set(definitionFieldSet.id, new DescriptionPropertyDefinitionFieldSetEditorModel().fromModel(fieldSetValue));
-
- return result;
+ return new DescriptionPropertyDefinitionFieldSetEditorModel().fromModel(fieldSetValue);
}
}
@@ -289,8 +286,8 @@ export class DescriptionPropertyDefinitionFieldSetItemEditorModel implements Des
}
const formGroup = this.formBuilder.group({});
- formGroup.addControl('comment', new FormControl({ value: this.comment, disabled: disabled }, context.getValidation('comment').validators));
- formGroup.addControl('ordinal', new FormControl({ value: this.ordinal, disabled: disabled }, context.getValidation('ordinal').validators));
+ formGroup.addControl('comment', new FormControl({ value: 'this.comment', disabled: disabled }, context.getValidation('comment').validators));
+ formGroup.addControl('ordinal', new FormControl({ value: 5, disabled: disabled }, context.getValidation('ordinal').validators));
const fieldsFormGroup = this.formBuilder.group({});
diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-composite-field-dialog/form-composite-field-dialog.component.html b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-composite-field-dialog/form-composite-field-dialog.component.html
deleted file mode 100644
index 567ff7d61..000000000
--- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-composite-field-dialog/form-composite-field-dialog.component.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-composite-field-dialog/form-composite-field-dialog.component.ts b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-composite-field-dialog/form-composite-field-dialog.component.ts
deleted file mode 100644
index ac15f6dff..000000000
--- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-composite-field-dialog/form-composite-field-dialog.component.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import {Component, Inject} from "@angular/core";
-import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
-import { VisibilityRulesService } from "../../visibility-rules/visibility-rules.service";
-
-@Component({
- selector: 'app-form-composite-field-dialog',
- templateUrl: 'form-composite-field-dialog.component.html'
-})
-export class FormCompositeFieldDialogComponent {
-
- public visibilityRulesService: VisibilityRulesService;
-
- constructor(
- private dialogRef: MatDialogRef,
- @Inject(MAT_DIALOG_DATA) public data: any
- ) {
- this.visibilityRulesService = data.visibilityRulesService;
- }
-
- cancel() {
- this.dialogRef.close();
- }
-
- save() {
- this.dialogRef.close(this.data.formGroup);
- }
-
- public close() {
- this.dialogRef.close(false);
- }
-}
diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/dialog-editor/form-fieldset-editor-dialog.component.html b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/dialog-editor/form-fieldset-editor-dialog.component.html
new file mode 100644
index 000000000..cd18dd2fd
--- /dev/null
+++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/dialog-editor/form-fieldset-editor-dialog.component.html
@@ -0,0 +1,26 @@
+
\ No newline at end of file
diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/dialog-editor/form-fieldset-editor-dialog.component.ts b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/dialog-editor/form-fieldset-editor-dialog.component.ts
new file mode 100644
index 000000000..3ef8eba01
--- /dev/null
+++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/dialog-editor/form-fieldset-editor-dialog.component.ts
@@ -0,0 +1,34 @@
+import { Component, Inject } from "@angular/core";
+import { UntypedFormGroup } from "@angular/forms";
+import { MAT_DIALOG_DATA, MatDialogRef } from "@angular/material/dialog";
+import { DescriptionTemplateFieldSet } from "@app/core/model/description-template/description-template";
+
+@Component({
+ selector: 'app-description-form-fieldset-editor-dialog',
+ templateUrl: 'form-fieldset-editor-dialog.component.html'
+})
+export class FormFieldSetEditorDialogComponent {
+
+ fieldSet: DescriptionTemplateFieldSet;
+ propertiesFormGroup: UntypedFormGroup;
+
+ constructor(
+ private dialogRef: MatDialogRef,
+ @Inject(MAT_DIALOG_DATA) public data: any
+ ) {
+ this.fieldSet = data.fieldSet;
+ this.propertiesFormGroup = data.propertiesFormGroup;
+ }
+
+ cancel() {
+ this.dialogRef.close();
+ }
+
+ save() {
+ this.dialogRef.close(this.propertiesFormGroup);
+ }
+
+ public close() {
+ this.dialogRef.close(false);
+ }
+}
diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-composite-title/form-composite-title.component.html b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/field-set-title/field-set-title.component.html
similarity index 89%
rename from dmp-frontend/src/app/ui/description/editor/description-form/components/form-composite-title/form-composite-title.component.html
rename to dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/field-set-title/field-set-title.component.html
index 5c7661260..a4ff6dc86 100644
--- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-composite-title/form-composite-title.component.html
+++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/field-set-title/field-set-title.component.html
@@ -1,6 +1,6 @@