-
-
-
-
-
-
-
-
+ [ngClass]="getClass('element', 'control')">
+
+
+
+
+
+
-
-
+
+
+
+
+
diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts
index 1843beb448..20a4a6c275 100644
--- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts
+++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts
@@ -69,6 +69,7 @@ export class DsDynamicFormArrayComponent extends DynamicFormArrayComponent imple
}
ngOnInit(): void {
+ console.log(this.model);
this.submissionObjectService
.findById(this.model.submissionId).pipe(
getSucceededRemoteData(),
diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/ds-dynamic-row-array-model.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/ds-dynamic-row-array-model.ts
index 432446c56c..1a20453248 100644
--- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/ds-dynamic-row-array-model.ts
+++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/ds-dynamic-row-array-model.ts
@@ -4,12 +4,14 @@ export interface DynamicRowArrayModelConfig extends DynamicFormArrayModelConfig
notRepeatable: boolean;
required: boolean;
submissionId: string;
+ hasRelationship: boolean;
}
export class DynamicRowArrayModel extends DynamicFormArrayModel {
@serializable() notRepeatable = false;
@serializable() required = false;
@serializable() submissionId: string;
+ @serializable() hasRelationship: boolean;
isRowArray = true;
constructor(config: DynamicRowArrayModelConfig, layout?: DynamicFormControlLayout) {
@@ -17,5 +19,6 @@ export class DynamicRowArrayModel extends DynamicFormArrayModel {
this.notRepeatable = config.notRepeatable;
this.required = config.required;
this.submissionId = config.submissionId;
+ this.hasRelationship = config.hasRelationship;
}
}
diff --git a/src/app/shared/form/builder/parsers/field-parser.ts b/src/app/shared/form/builder/parsers/field-parser.ts
index 7b83d20e1d..5cacbe962c 100644
--- a/src/app/shared/form/builder/parsers/field-parser.ts
+++ b/src/app/shared/form/builder/parsers/field-parser.ts
@@ -48,7 +48,8 @@ export abstract class FieldParser {
id: uniqueId() + '_array',
label: this.configData.label,
initialCount: this.getInitArrayIndex() + 1,
- notRepeatable: !this.configData.repeatable || hasValue(this.configData.selectableRelationship),
+ notRepeatable: !this.configData.repeatable,
+ hasRelationship: isNotEmpty(this.configData.selectableRelationship),
required: isNotEmpty(this.configData.mandatory),
submissionId: this.submissionId,
groupFactory: () => {
@@ -79,7 +80,7 @@ export abstract class FieldParser {
}
}
setLayout(model, 'element', 'host', 'col');
- if (model.hasLanguages) {
+ if (model.hasLanguages|| isNotEmpty(model.relationship)) {
setLayout(model, 'grid', 'control', 'col');
}
return [model];
@@ -193,7 +194,7 @@ export abstract class FieldParser {
}
}
- protected initModel(id?: string, label = true, setErrors = true) {
+ protected initModel(id?: string, label = true, setErrors = true, hint = true) {
const controlModel = Object.create(null);
@@ -218,11 +219,11 @@ export abstract class FieldParser {
// Set label
this.setLabel(controlModel, label);
-
+ if (hint) {
+ controlModel.hint = this.configData.hints;
+ }
controlModel.placeholder = this.configData.label;
- controlModel.hint = this.configData.hints;
-
if (this.configData.mandatory && setErrors) {
this.markAsRequired(controlModel);
}
diff --git a/src/app/shared/form/form.component.html b/src/app/shared/form/form.component.html
index aebf8bcf67..61649e384d 100644
--- a/src/app/shared/form/form.component.html
+++ b/src/app/shared/form/form.component.html
@@ -1,62 +1,71 @@