1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { connect } from 'react-redux';
6 import { Vocabulary } from '~/models/vocabulary';
7 import { RootState } from '~/store/store';
8 import { getVocabulary } from '~/store/vocabulary/vocabulary-selctors';
9 import { WrappedFieldMetaProps, WrappedFieldInputProps } from 'redux-form';
11 export interface VocabularyProp {
12 vocabulary: Vocabulary;
15 export const mapStateToProps = (state: RootState): VocabularyProp => ({
16 vocabulary: getVocabulary(state.properties),
19 export const connectVocabulary = connect(mapStateToProps);
21 export const ITEMS_PLACEHOLDER: string[] = [];
23 export const hasError = ({ touched, invalid }: WrappedFieldMetaProps) =>
26 export const getErrorMsg = (meta: WrappedFieldMetaProps) =>
31 export const handleBlur = ({ onBlur, value }: WrappedFieldInputProps) =>