mirror of
https://github.com/strapi/strapi.git
synced 2025-08-09 09:14:49 +00:00
commit
4bca88c070
@ -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 (
|
||||
<FormattedMessage id={props.placeholder} defaultMessage={props.placeholder}>
|
||||
<FormattedMessage id={placeholder} defaultMessage={placeholder}>
|
||||
{(message) => (
|
||||
<input
|
||||
autoFocus={props.autoFocus}
|
||||
@ -32,7 +34,7 @@ function InputText(props) {
|
||||
/>
|
||||
)}
|
||||
</FormattedMessage>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
InputText.defaultProps = {
|
||||
|
@ -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) => (
|
||||
<AttributeCard
|
||||
key={key}
|
||||
attribute={attribute}
|
||||
autoFocus={key === 0}
|
||||
routePath={this.props.routePath}
|
||||
handleClick={this.goToAttributeTypeView}
|
||||
tabIndex={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) => (
|
||||
<AttributeCard
|
||||
key={key}
|
||||
attribute={attribute}
|
||||
autoFocus={key === 0}
|
||||
routePath={this.props.routePath}
|
||||
handleClick={this.goToAttributeTypeView}
|
||||
tabIndex={key}
|
||||
/>
|
||||
))
|
||||
);
|
||||
}
|
||||
|
||||
testContentType = (contentTypeName, cbSuccess, successData, cbFail, failData) => {
|
||||
// Check if the content type is in the localStorage (not saved) to prevent request error
|
||||
|
Loading…
x
Reference in New Issue
Block a user