diff --git a/packages/strapi-plugin-content-manager/admin/src/components/Edit/index.js b/packages/strapi-plugin-content-manager/admin/src/components/Edit/index.js index 3f573bc6f0..cb09c4ea2a 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/Edit/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/Edit/index.js @@ -14,15 +14,12 @@ import { isFunction, upperFirst, } from 'lodash'; - // You can find these components in either // ./node_modules/strapi-helper-plugin/lib/src // or strapi/packages/strapi-helper-plugin/lib/src import Input from 'components/InputsIndex'; - import InputJSONWithErrors from 'components/InputJSONWithErrors'; import WysiwygWithErrors from 'components/WysiwygWithErrors'; - import styles from './styles.scss'; const getInputType = (type = '') => { @@ -115,41 +112,49 @@ class Edit extends React.PureComponent { orderAttributes = () => get(this.props.schema, ['editDisplay', 'fields'], []); + renderAttr = (attr, key) => { + if (attr.includes('__col-md')) { + const className = attr.split('__')[1]; + + return
; + } + + const details = get(this.props.schema, ['editDisplay', 'availableFields', attr]); + // Retrieve the input's bootstrapClass from the layout + const layout = this.getInputLayout(attr); + const appearance = get(layout, 'appearance'); + const type = !isEmpty(appearance) ? appearance.toLowerCase() : get(layout, 'type', getInputType(details.type)); + const inputDescription = get(details, 'description', null); + + return ( + + ); + } + render(){ return (