15067: Updates the vocabulary model to match the new format.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Thu, 31 Oct 2019 14:19:56 +0000 (11:19 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Thu, 31 Oct 2019 14:19:56 +0000 (11:19 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

src/models/vocabulary.ts
src/store/vocabulary/vocabulary-selectors.ts

index ea23ad2c79ffc05d56f3e0fa42572a37bc6a38ad..173c8371f3c778a2f42d8febf2685b513c676e49 100644 (file)
@@ -5,18 +5,28 @@
 import { isObject, has, every } from 'lodash/fp';
 
 export interface Vocabulary {
-    strict: boolean;
+    strict_tags: boolean;
     tags: Record<string, Tag>;
 }
 
+export interface Label {
+    lang?: string;
+    label: string;
+}
+
+export interface TagValue {
+    labels: Label[];
+}
+
 export interface Tag {
     strict?: boolean;
-    values?: string[];
+    labels: Label[];
+    values?: Record<string, TagValue>;
 }
 
 const VOCABULARY_VALIDATORS = [
     isObject,
-    has('strict'),
+    has('strict_tags'),
     has('tags'),
 ];
 
index d317cb4786e4babb6db6242916197a27aaabae73..39f5a01ec86e78786345e0411209df3e97b6833f 100644 (file)
@@ -8,7 +8,7 @@ import { Vocabulary } from '~/models/vocabulary';
 export const VOCABULARY_PROPERTY_NAME = 'vocabulary';
 
 export const DEFAULT_VOCABULARY: Vocabulary = {
-    strict: false,
+    strict_tags: false,
     tags: {},
 };