diff --git a/src/pages/dataElements/form/CustomAttributes.tsx b/src/pages/dataElements/form/CustomAttributes.tsx index 0d422fe4..206c32b4 100644 --- a/src/pages/dataElements/form/CustomAttributes.tsx +++ b/src/pages/dataElements/form/CustomAttributes.tsx @@ -18,16 +18,25 @@ type CustomAttributeProps = { index: number } +type DisplayOptions = Array<{ + value: string | undefined + label: string +}> + function CustomAttribute({ attribute, index }: CustomAttributeProps) { const name = `attributeValues[${index}].value` if (attribute.optionSet?.options) { - const options = attribute.optionSet?.options.map( + let options: DisplayOptions = [ + { value: undefined, label: i18n.t('') }, + ] + const mappedOptions = attribute.optionSet.options.map( ({ code, displayName }) => ({ value: code, label: displayName, }) ) + options = options.concat(mappedOptions) return (