diff --git a/packages/strapi-plugin-content-manager/admin/src/components/Block/index.js b/packages/strapi-plugin-content-manager/admin/src/components/Block/index.js index d18691c850..d9ab20fdf7 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/Block/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/Block/index.js @@ -9,13 +9,15 @@ import { FormattedMessage } from 'react-intl'; import styles from './styles.scss'; +const renderMsg = msg =>

{msg}

; + const Block = ({ children, description, style, title }) => (
- {msg =>

{msg}

} + {renderMsg}
{children} diff --git a/packages/strapi-plugin-content-manager/admin/src/components/DraggableAttr/index.js b/packages/strapi-plugin-content-manager/admin/src/components/DraggableAttr/index.js index c9cd5ded9a..34048d44f9 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/DraggableAttr/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/DraggableAttr/index.js @@ -97,6 +97,10 @@ class DraggableAttr extends React.Component { this.props.onClickEditListItem(this.props.index); } + handleDragEnd = () => this.setState({ dragStart: false }); + + handleDragStart = () => this.setState({ dragStart: true }); + handleMouseEnter = () => { if (!this.props.isDraggingSibling) { this.setState({ isOver: true }); @@ -123,8 +127,8 @@ class DraggableAttr extends React.Component { connectDropTarget(
this.setState({ dragStart: true })} - onDragEnd={() => this.setState({ dragStart: false })} + onDragStart={this.handleDragStart} + onDragEnd={this.handleDragEnd} onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave} onClick={this.handleClickEdit} diff --git a/packages/strapi-plugin-content-manager/admin/src/containers/SettingsPage/index.js b/packages/strapi-plugin-content-manager/admin/src/containers/SettingsPage/index.js index 23e2734fd8..6f3d04018f 100644 --- a/packages/strapi-plugin-content-manager/admin/src/containers/SettingsPage/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/containers/SettingsPage/index.js @@ -92,6 +92,11 @@ class SettingsPage extends React.PureComponent { this.props.history.push(`${pathname}${destination}`); } + handleConfirmReset = () => { + this.props.onReset(); + this.toggleWarningCancel(); + } + handleReset = (e) => { e.preventDefault(); this.setState({ showWarningCancel: true }); @@ -106,6 +111,17 @@ class SettingsPage extends React.PureComponent { toggleWarningCancel = () => this.setState(prevState => ({ showWarningCancel: !prevState.showWarningCancel })); + renderForm = input => ( + + ); + + renderRow = model => ; + render() { const { showWarning, showWarningCancel } = this.state; const { onChange, onReset, onSubmit } = this.props; @@ -127,9 +143,7 @@ class SettingsPage extends React.PureComponent { confirm: 'content-manager.popUpWarning.button.confirm', }} popUpWarningType="danger" - onConfirm={() => { - onSubmit(); - }} + onConfirm={onSubmit} /> { - onReset(); - this.toggleWarningCancel(); - }} + onConfirm={this.handleConfirmReset} />
- {forms.inputs.map(input => ( - - ))} + {forms.inputs.map(this.renderForm)}
+ {/* LIST */}
- {this.getModels().map(model => )} + {this.getModels().map(this.renderRow)}
+ {/* LIST */}
);