Merge branch 'master' of git.curoverse.com:arvados-workbench2 into 14503_keep_services
[arvados.git] / src / store / vocabulary / vocabulary-selctors.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { PropertiesState, getProperty } from '~/store/properties/properties';
6 import { Vocabulary } from '~/models/vocabulary';
7
8 export const VOCABULARY_PROPERTY_NAME = 'vocabulary';
9
10 export const DEFAULT_VOCABULARY: Vocabulary = {
11     strict: false,
12     tags: {},
13 };
14
15 export const getVocabulary = (state: PropertiesState) =>
16     getProperty<Vocabulary>(VOCABULARY_PROPERTY_NAME)(state) || DEFAULT_VOCABULARY;