mirror of
https://github.com/strapi/strapi.git
synced 2025-08-10 17:58:07 +00:00
commit
4bca88c070
@ -7,8 +7,10 @@ import cn from 'classnames';
|
|||||||
import styles from './styles.scss';
|
import styles from './styles.scss';
|
||||||
|
|
||||||
function InputText(props) {
|
function InputText(props) {
|
||||||
|
const placeholder = isEmpty(props.placeholder) ? 'app.utils.placeholder.defaultMessage' : props.placeholder;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormattedMessage id={props.placeholder} defaultMessage={props.placeholder}>
|
<FormattedMessage id={placeholder} defaultMessage={placeholder}>
|
||||||
{(message) => (
|
{(message) => (
|
||||||
<input
|
<input
|
||||||
autoFocus={props.autoFocus}
|
autoFocus={props.autoFocus}
|
||||||
@ -32,7 +34,7 @@ function InputText(props) {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</FormattedMessage>
|
</FormattedMessage>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
InputText.defaultProps = {
|
InputText.defaultProps = {
|
||||||
|
@ -14,6 +14,7 @@ import {
|
|||||||
findIndex,
|
findIndex,
|
||||||
filter,
|
filter,
|
||||||
get,
|
get,
|
||||||
|
has,
|
||||||
includes,
|
includes,
|
||||||
isEmpty,
|
isEmpty,
|
||||||
isUndefined,
|
isUndefined,
|
||||||
@ -455,8 +456,16 @@ export class Form extends React.Component { // eslint-disable-line react/prefer-
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
renderModalBodyChooseAttributes = () => (
|
renderModalBodyChooseAttributes = () => {
|
||||||
map(forms.attributesDisplay.items, (attribute, key) => (
|
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) => (
|
||||||
<AttributeCard
|
<AttributeCard
|
||||||
key={key}
|
key={key}
|
||||||
attribute={attribute}
|
attribute={attribute}
|
||||||
@ -466,7 +475,8 @@ export class Form extends React.Component { // eslint-disable-line react/prefer-
|
|||||||
tabIndex={key}
|
tabIndex={key}
|
||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
)
|
);
|
||||||
|
}
|
||||||
|
|
||||||
testContentType = (contentTypeName, cbSuccess, successData, cbFail, failData) => {
|
testContentType = (contentTypeName, cbSuccess, successData, cbFail, failData) => {
|
||||||
// Check if the content type is in the localStorage (not saved) to prevent request error
|
// Check if the content type is in the localStorage (not saved) to prevent request error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user