15067: Makes key/value matching case insensitive.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Mon, 4 Nov 2019 16:37:20 +0000 (13:37 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Mon, 4 Nov 2019 16:37:20 +0000 (13:37 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

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

index 23e69afceb7dae4db023be97cfe8707361e1e066..5c7c0ec4d84df4159c975d80b8b45988de6e6e46 100644 (file)
@@ -40,7 +40,7 @@ const matchTags = (vocabulary: Vocabulary) =>
             : 'Incorrect key';
 
 const getSuggestions = (value: string, vocabulary: Vocabulary) =>
-    getTagsList(vocabulary).filter(tag => tag.label.includes(value) && tag.label !== value);
+    getTagsList(vocabulary).filter(tag => tag.label.toLowerCase().includes(value.toLowerCase()));
 
 const getTagsList = ({ tags }: Vocabulary) => {
     const ret = tags && Object.keys(tags)
index a547659ffa4d35d1d7db7415da05388459453546..ce4f5a52591e6b106049edc9719d29def8a259d5 100644 (file)
@@ -49,7 +49,7 @@ const matchTagValues = ({ vocabulary, propertyKey }: PropertyValueFieldProps) =>
             : 'Incorrect value';
 
 const getSuggestions = (value: string, tagKey: string, vocabulary: Vocabulary) =>
-    getTagValues(tagKey, vocabulary).filter(v => v.label.includes(value) && v.label !== value);
+    getTagValues(tagKey, vocabulary).filter(v => v.label.toLowerCase().includes(value.toLowerCase()));
 
 const isStrictTag = (tagKey: string, vocabulary: Vocabulary) => {
     const tag = vocabulary.tags[tagKey];