diff --git a/packages/strapi-plugin-content-manager/config/layout.json b/packages/strapi-plugin-content-manager/config/layout.json index 0967ef424b..93c8609a20 100644 --- a/packages/strapi-plugin-content-manager/config/layout.json +++ b/packages/strapi-plugin-content-manager/config/layout.json @@ -1 +1,9 @@ -{} +{ + "gvhbjnk": { + "attributes": { + "te": { + "appearance": "WYSIWYG" + } + } + } +} \ No newline at end of file diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/RelationBox/index.js b/packages/strapi-plugin-content-type-builder/admin/src/components/RelationBox/index.js index 62cf93cf5e..10786ec1f5 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/components/RelationBox/index.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/components/RelationBox/index.js @@ -1,8 +1,8 @@ /** -* -* RelationBox -* -*/ + * + * RelationBox + * + */ import React from 'react'; import PropTypes from 'prop-types'; @@ -16,7 +16,8 @@ import styles from './styles.scss'; /* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable react/jsx-wrap-multilines */ -class RelationBox extends React.Component { // eslint-disable-line react/prefer-stateless-function +class RelationBox extends React.Component { + // eslint-disable-line react/prefer-stateless-function constructor(props) { super(props); @@ -25,7 +26,20 @@ class RelationBox extends React.Component { // eslint-disable-line react/prefer- }; } - handleClick = (e) => { + getPlaceholder = () => { + switch (true) { + case this.props.relationType === 'oneToMany' && this.props.isFirstContentType: + return pluralize(this.props.contentTypeTargetPlaceholder); + case this.props.relationType === 'manyToOne' && !this.props.isFirstContentType: + return pluralize(this.props.contentTypeTargetPlaceholder); + case this.props.relationType === 'manyToMany': + return pluralize(this.props.contentTypeTargetPlaceholder); + default: + return this.props.contentTypeTargetPlaceholder; + } + } + + handleClick = e => { const value = e.target.id.split('.'); const target = { type: 'string', @@ -42,41 +56,53 @@ class RelationBox extends React.Component { // eslint-disable-line react/prefer- name: 'params.pluginValue', }, }); - } + }; toggle = () => this.setState({ showMenu: !this.state.showMenu }); renderDropdownMenu = () => (
- - - + + {map(this.props.dropDownItems, (value, key) => { const id = value.source ? `${value.name}.${value.source}` : `${value.name}. `; let divStyle; - if (get(this.props.header, 'name') === value.name && !isEmpty(get(this.props.header,'source')) && value.source) { - divStyle = { color: '#323740', fontWeight: 'bold'}; - } else if (value.source === get(this.props.header, 'source') && value.name === get(this.props.header, 'name')) { - divStyle = { color: '#323740', fontWeight: 'bold'}; + if ( + get(this.props.header, 'name') === value.name && + !isEmpty(get(this.props.header, 'source')) && + value.source + ) { + divStyle = { color: '#323740', fontWeight: 'bold' }; + } else if ( + value.source === get(this.props.header, 'source') && + value.name === get(this.props.header, 'name') + ) { + divStyle = { color: '#323740', fontWeight: 'bold' }; } else { divStyle = { color: 'rgba(50,55,64,0.75)' }; } return ( -
+
{value.name}  - {value.source ? ( + {value.source && ( - {(message) => ( - ({message}: {value.source}) + {message => ( + + ({message}: {value.source}) + )} - ) : ''} + )}
@@ -85,63 +111,41 @@ class RelationBox extends React.Component { // eslint-disable-line react/prefer-
- ) + ); render() { - let placeholder; - - switch (true) { - case this.props.relationType === 'oneToMany' && this.props.isFirstContentType: - placeholder = pluralize(this.props.contentTypeTargetPlaceholder); - break; - case this.props.relationType === 'manyToOne' && !this.props.isFirstContentType: - placeholder = pluralize(this.props.contentTypeTargetPlaceholder); - break; - case this.props.relationType === 'manyToMany': - placeholder = pluralize(this.props.contentTypeTargetPlaceholder); - break; - default: - placeholder = this.props.contentTypeTargetPlaceholder; - } - - const content = isEmpty(this.props.input) ? -
: - ; - - const dropDown = !isEmpty(this.props.dropDownItems) ? this.renderDropdownMenu() : ''; - return (
{startCase(get(this.props.header, 'name'))}  - {get(this.props.header, 'source') ? ( - `(${get(this.props.header, 'source')})` - ): ''} + {get(this.props.header, 'source') ? `(${get(this.props.header, 'source')})` : ''} - {dropDown} + {!isEmpty(this.props.dropDownItems) && this.renderDropdownMenu()}
- {content} + {!isEmpty(this.props.input) && ( + + )}
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 1eaea03009..fcc7684708 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 @@ -539,7 +539,6 @@ export class Form extends React.Component { // eslint-disable-line react/prefer- } render() { - // Ensure typeof(popUpFormType) is String const popUpFormType = split(this.props.hash, '::')[1] || ''; const popUpTitle = this.generatePopUpTitle(popUpFormType);