diff --git a/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/ComposeFieldMultiple.tsx b/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/ComposeFieldMultiple.tsx index 9c77c8631..babc6d8a4 100644 --- a/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/ComposeFieldMultiple.tsx +++ b/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/ComposeFieldMultiple.tsx @@ -44,7 +44,7 @@ export const ComposedFieldMultiple = ({ .filter(([_, metadataField]) => metadataField.isRequired) .map(([key, _]) => key) : [], - [] + [childMetadataFields, notRequiredWithChildFieldsRequired] ) const childFieldNamesThatTriggerRequired = useMemo( @@ -54,7 +54,7 @@ export const ComposedFieldMultiple = ({ .filter(([_, metadataField]) => !metadataField.isRequired) .map(([key, _]) => key) : [], - [] + [childMetadataFields, notRequiredWithChildFieldsRequired] ) const handleOnAddField = (index: number) => { diff --git a/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/ComposedField.tsx b/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/ComposedField.tsx index 7ca1a5723..bdb919ea5 100644 --- a/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/ComposedField.tsx +++ b/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/ComposedField.tsx @@ -31,7 +31,7 @@ export const ComposedField = ({ .filter(([_, metadataField]) => metadataField.isRequired) .map(([key, _]) => key) : [], - [] + [childMetadataFields, notRequiredWithChildFieldsRequired] ) const childFieldNamesThatTriggerRequired = useMemo( @@ -41,7 +41,7 @@ export const ComposedField = ({ .filter(([_, metadataField]) => !metadataField.isRequired) .map(([key, _]) => key) : [], - [] + [childMetadataFields, notRequiredWithChildFieldsRequired] ) return ( diff --git a/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/Primitive.tsx b/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/Primitive.tsx index 1b8c4e271..095a56224 100644 --- a/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/Primitive.tsx +++ b/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/Primitive.tsx @@ -67,7 +67,7 @@ export const Primitive = ({ } } return rulesToApply - }, [rulesToApply, fieldShouldBecomeRequired]) + }, [rulesToApply, fieldShouldBecomeRequired, displayName, isFieldThatMayBecomeRequired, t]) const isTextArea = type === TypeMetadataFieldOptions.Textbox diff --git a/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx b/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx index 8e8ca7b48..b0b02ad1d 100644 --- a/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx +++ b/src/sections/shared/form/DatasetMetadataForm/MetadataForm/MetadataBlockFormFields/MetadataFormField/Fields/Vocabulary.tsx @@ -67,7 +67,7 @@ export const Vocabulary = ({ } } return rulesToApply - }, [rulesToApply, fieldShouldBecomeRequired]) + }, [rulesToApply, fieldShouldBecomeRequired, displayName, isFieldThatMayBecomeRequired, t]) return (