Merge pull request #717 from strapi/fix-ctb

Fix ctb
This commit is contained in:
Jim LAURIE 2018-03-05 15:36:06 +01:00 committed by GitHub
commit 4bca88c070
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 14 deletions

View File

@ -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 = {

View File

@ -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