diff --git a/ui/js/dfv/src/components/field-wrapper/repeatable-field-list.js b/ui/js/dfv/src/components/field-wrapper/repeatable-field-list.js index ac648bc247..8fc80c69c7 100644 --- a/ui/js/dfv/src/components/field-wrapper/repeatable-field-list.js +++ b/ui/js/dfv/src/components/field-wrapper/repeatable-field-list.js @@ -57,6 +57,7 @@ const RepeatableFieldList = ( { allPodFieldsMap, setFullValue, setHasBlurred, + storeKey, } ) => { // Helper functions for setting, moving, adding, and deleting the value // or subvalues. @@ -203,6 +204,7 @@ const RepeatableFieldList = ( { /> ) : null } key={ `${ fieldConfig.name }-${ index }` } + storeKey={ storeKey } /> ); } ) } @@ -276,6 +278,11 @@ RepeatableFieldList.propTypes = { * Function to call when a field has blurred. */ setHasBlurred: PropTypes.func.isRequired, + + /** + * Redux store key. + */ + storeKey: PropTypes.string.isRequired, }; export default RepeatableFieldList; diff --git a/ui/js/dfv/src/components/field-wrapper/subfield-wrapper.js b/ui/js/dfv/src/components/field-wrapper/subfield-wrapper.js index 4090232924..d7436f5f3d 100644 --- a/ui/js/dfv/src/components/field-wrapper/subfield-wrapper.js +++ b/ui/js/dfv/src/components/field-wrapper/subfield-wrapper.js @@ -40,6 +40,7 @@ const SubfieldWrapper = ( { allPodFieldsMap, setValue, setHasBlurred, + storeKey, } ) => { // Adjust the `name`/`htmlAttr[name]` and IDs // for repeatable fields, so that each value gets saved. @@ -70,7 +71,8 @@ const SubfieldWrapper = ( { const [ validationMessages, addValidationRules ] = useValidation( [], value, - subfieldConfig.name + subfieldConfig.name, + storeKey ); // Set up useSortable hook @@ -189,7 +191,7 @@ SubfieldWrapper.propTypes = { /** * Pod slug being edited. - */ + */ podName: PropTypes.string, /** @@ -210,8 +212,13 @@ SubfieldWrapper.propTypes = { /** * Function to call when a field has blurred. - */ + */ setHasBlurred: PropTypes.func.isRequired, + + /** + * Redux store key. + */ + storeKey: PropTypes.string.isRequired, }; export default SubfieldWrapper; diff --git a/ui/js/dfv/src/store/store.js b/ui/js/dfv/src/store/store.js index 704d6b35bf..9f1b406cd1 100644 --- a/ui/js/dfv/src/store/store.js +++ b/ui/js/dfv/src/store/store.js @@ -84,7 +84,6 @@ export const initEditPodStore = ( config, storeKey = '' ) => { }, ...omit( config, [ 'fieldTypes', 'relatedObjects' ] ), }; - console.log({initEditPodStore:initialState}); return initStore( initialState, storeKey ); }; @@ -97,7 +96,6 @@ export const initPodStore = ( config = {}, initialValues = {}, storeKey = '' ) = ...omit( config, [ 'fieldTypes', 'relatedObjects' ] ), currentPod: initialValues, }; - console.log({initPodStore:initialState}); return initStore( initialState, storeKey ); };