diff --git a/packages/strapi-helper-plugin/lib/src/components/InputText/index.js b/packages/strapi-helper-plugin/lib/src/components/InputText/index.js index cb9182600d..3ee5f6f494 100644 --- a/packages/strapi-helper-plugin/lib/src/components/InputText/index.js +++ b/packages/strapi-helper-plugin/lib/src/components/InputText/index.js @@ -7,8 +7,10 @@ import cn from 'classnames'; import styles from './styles.scss'; function InputText(props) { + const placeholder = isEmpty(props.placeholder) ? 'app.utils.placeholder.defaultMessage' : props.placeholder; + return ( - + {(message) => ( )} - ) + ); } InputText.defaultProps = { diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/index.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/index.js index e39db9d8c0..ab2f77ad28 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/index.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/index.js @@ -14,6 +14,7 @@ import { findIndex, filter, get, + has, includes, isEmpty, isUndefined, @@ -455,18 +456,27 @@ export class Form extends React.Component { // eslint-disable-line react/prefer- } } - renderModalBodyChooseAttributes = () => ( - map(forms.attributesDisplay.items, (attribute, key) => ( - - )) - ) + renderModalBodyChooseAttributes = () => { + const attributesDisplay = forms.attributesDisplay.items; + + // Don't display the media field if the upload plugin isn't installed + if (!has(this.context.plugins.toJS(), 'upload')) { + attributesDisplay.splice(8, 1); + } + + return ( + map(attributesDisplay, (attribute, key) => ( + + )) + ); + } testContentType = (contentTypeName, cbSuccess, successData, cbFail, failData) => { // Check if the content type is in the localStorage (not saved) to prevent request error