From 4aaaf7498df9cbcef8a8123db8a234b741a8745f Mon Sep 17 00:00:00 2001 From: Michal Klobukowski Date: Tue, 27 Nov 2018 23:08:43 +0100 Subject: [PATCH] Use formValues to access property key value Feature #14393 Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski --- .../resource-properties-form/property-value-field.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views-components/resource-properties-form/property-value-field.tsx b/src/views-components/resource-properties-form/property-value-field.tsx index eed8e75b..8574e609 100644 --- a/src/views-components/resource-properties-form/property-value-field.tsx +++ b/src/views-components/resource-properties-form/property-value-field.tsx @@ -3,9 +3,10 @@ // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; -import { WrappedFieldProps, Field } from 'redux-form'; +import { WrappedFieldProps, Field, formValues } from 'redux-form'; import { connect } from 'react-redux'; import { identity } from 'lodash'; +import { compose } from 'redux'; import { RootState } from '~/store/store'; import { getVocabulary } from '~/store/vocabulary/vocabulary-selctors'; import { Autocomplete } from '~/components/autocomplete/autocomplete'; @@ -26,7 +27,10 @@ const mapStateToProps = (state: RootState): VocabularyProp => ({ vocabulary: getVocabulary(state.properties), }); -export const PropertyValueField = connect(mapStateToProps)( +export const PropertyValueField = compose( + connect(mapStateToProps), + formValues({ propertyKey: 'key' }) +)( (props: PropertyValueFieldProps) =>