|
|
@ -261,17 +261,15 @@ export class ContentPageComponent implements CanComponentDeactivate, OnDestroy, |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
for (const field of this.schema.fields) { |
|
|
for (const field of this.schema.fields) { |
|
|
if (field.properties.hasOwnProperty('defaultValue')) { |
|
|
const defaultValue = field.defaultValue(); |
|
|
const defaultValue = field.defaultValue(); |
|
|
if (defaultValue) { |
|
|
if (defaultValue) { |
|
|
const fieldForm = <FormGroup>this.contentForm.get(field.name); |
|
|
const fieldForm = <FormGroup>this.contentForm.get(field.name); |
|
|
if (field.partitioning === 'language') { |
|
|
if (field.partitioning === 'language') { |
|
|
for (let language of this.languages) { |
|
|
for (let language of this.languages) { |
|
|
fieldForm.controls[language.iso2Code].setValue(defaultValue); |
|
|
fieldForm.controls[language.iso2Code].setValue(defaultValue); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
fieldForm.controls['iv'].setValue(defaultValue); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
fieldForm.controls['iv'].setValue(defaultValue); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|