Extract PROPERTY_KEY_FIELD_NAME to keep consistency between fields
[arvados-workbench2.git] / src / views-components / resource-properties-form / property-key-field.tsx
index fdd89d09321d3b0d472ad99753184751da17cf7c..c5e13985090e465bdb69abaa70c86476369f5ee4 100644 (file)
@@ -20,10 +20,12 @@ const mapStateToProps = (state: RootState): VocabularyProp => ({
     vocabulary: getVocabulary(state.properties),
 });
 
+export const PROPERTY_KEY_FIELD_NAME = 'key';
+
 export const PropertyKeyField = connect(mapStateToProps)(
     ({ vocabulary }: VocabularyProp) =>
         <Field
-            name='key'
+            name={PROPERTY_KEY_FIELD_NAME}
             component={PropertyKeyInput}
             vocabulary={vocabulary}
             validate={getValidation(vocabulary)} />);
@@ -53,7 +55,7 @@ const matchTags = (vocabulary: Vocabulary) =>
             ? undefined
             : 'Incorrect key';
 
-const getSuggestions = (value: string, vocabulary: Vocabulary) => 
+const getSuggestions = (value: string, vocabulary: Vocabulary) =>
     getTagsList(vocabulary).filter(tag => tag.includes(value) && tag !== value);
 
 const getTagsList = ({ tags }: Vocabulary) =>