3 * Copyright 2017 RIFT.IO Inc
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 import React from 'react';
19 import changeCase from 'change-case'
20 import Button from '../Button'
21 import ClassNames from 'classnames'
22 import CatalogItemsActions from '../../actions/CatalogItemsActions'
23 import DescriptorModelMetaFactory from '../../libraries/model/DescriptorModelMetaFactory'
24 import Property from '../../libraries/model/DescriptorModelMetaProperty'
25 import utils from '../../libraries/utils'
27 import PropertyPanel from './PropertyPanel'
28 import Select from './Select'
30 import '../../styles/EditDescriptorModelProperties.scss'
31 import imgAdd from '../../../../node_modules/open-iconic/svg/plus.svg'
33 export default function (props) {
34 const { id, property, value, readOnly, onChange, showHelp, children } = props;
36 const title = changeCase.titleCase(property.name);
37 const helpText = showHelp ? property.description : null;
38 const cases = property.properties.map(d => ({ name: d.name, value: d.name }));
41 <div className='-is-leaf'>
42 <PropertyPanel title={title} helpText={helpText}>
43 <div className="choice">
49 placeholder={property.name}
51 readOnly={readOnly} />