Restore TAG_VALUE_VALIDATION
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Wed, 28 Nov 2018 12:07:24 +0000 (13:07 +0100)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Wed, 28 Nov 2018 12:07:24 +0000 (13:07 +0100)
Feature #14393

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>

src/views-components/resource-properties-form/property-value-field.tsx

index 56eaf6d5674c3ccfb5f2c1bc83004f3ebf69af79..db2db3f7ece5e63ed7656f2f3a417996b3238dad 100644 (file)
@@ -7,9 +7,9 @@ import { WrappedFieldProps, Field, formValues } from 'redux-form';
 import { compose } from 'redux';
 import { Autocomplete } from '~/components/autocomplete/autocomplete';
 import { Vocabulary } from '~/models/vocabulary';
-import { require } from '~/validators/require';
 import { PROPERTY_KEY_FIELD_NAME } from '~/views-components/resource-properties-form/property-key-field';
 import { VocabularyProp, connectVocabulary, buildProps } from '~/views-components/resource-properties-form/property-field-common';
+import { TAG_VALUE_VALIDATION } from '~/validators/validators';
 
 interface PropertyKeyProp {
     propertyKey: string;
@@ -39,8 +39,8 @@ const PropertyValueInput = ({ vocabulary, propertyKey, ...props }: WrappedFieldP
 
 const getValidation = (props: PropertyValueFieldProps) =>
     isStrictTag(props.propertyKey, props.vocabulary)
-        ? [require, matchTagValues(props)]
-        : [require];
+        ? [...TAG_VALUE_VALIDATION, matchTagValues(props)]
+        : TAG_VALUE_VALIDATION;
 
 const matchTagValues = ({ vocabulary, propertyKey }: PropertyValueFieldProps) =>
     (value: string) =>