From db82b698f42304b63c62b3ba12616987e1c95212 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Thu, 31 Oct 2019 11:19:56 -0300 Subject: [PATCH] 15067: Updates the vocabulary model to match the new format. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- src/models/vocabulary.ts | 16 +++++++++++++--- src/store/vocabulary/vocabulary-selectors.ts | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/models/vocabulary.ts b/src/models/vocabulary.ts index ea23ad2c79..173c8371f3 100644 --- a/src/models/vocabulary.ts +++ b/src/models/vocabulary.ts @@ -5,18 +5,28 @@ import { isObject, has, every } from 'lodash/fp'; export interface Vocabulary { - strict: boolean; + strict_tags: boolean; tags: Record; } +export interface Label { + lang?: string; + label: string; +} + +export interface TagValue { + labels: Label[]; +} + export interface Tag { strict?: boolean; - values?: string[]; + labels: Label[]; + values?: Record; } const VOCABULARY_VALIDATORS = [ isObject, - has('strict'), + has('strict_tags'), has('tags'), ]; diff --git a/src/store/vocabulary/vocabulary-selectors.ts b/src/store/vocabulary/vocabulary-selectors.ts index d317cb4786..39f5a01ec8 100644 --- a/src/store/vocabulary/vocabulary-selectors.ts +++ b/src/store/vocabulary/vocabulary-selectors.ts @@ -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: {}, }; -- 2.30.2