From c8d269aecae8aa953c46a73aab92eb079927cacb Mon Sep 17 00:00:00 2001 From: soupette Date: Wed, 3 Apr 2019 17:06:07 +0200 Subject: [PATCH] Fix MarketPlace and plugin documentation proptypes error --- .../admin/src/containers/Marketplace/index.js | 41 +++++++++++-------- .../admin/src/containers/HomePage/index.js | 11 +++-- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/packages/strapi-admin/admin/src/containers/Marketplace/index.js b/packages/strapi-admin/admin/src/containers/Marketplace/index.js index e7614c7def..80564995af 100644 --- a/packages/strapi-admin/admin/src/containers/Marketplace/index.js +++ b/packages/strapi-admin/admin/src/containers/Marketplace/index.js @@ -1,7 +1,7 @@ /** - * + * * Marketplace - * + * */ import React from 'react'; @@ -33,11 +33,9 @@ import saga from './saga'; import styles from './styles.scss'; class Marketplace extends React.Component { - getChildContext = () => ( - { - downloadPlugin: this.props.downloadPlugin, - } - ); + getChildContext = () => ({ + downloadPlugin: this.props.downloadPlugin, + }); componentDidMount() { // Fetch the available and installed plugins @@ -56,9 +54,15 @@ class Marketplace extends React.Component { ); renderPluginCard = plugin => { - const { adminPage: { currentEnvironment }, availablePlugins, downloadPlugin, history, installedPlugins } = this.props; + const { + admin: { currentEnvironment }, + availablePlugins, + downloadPlugin, + history, + installedPlugins, + } = this.props; const currentPlugin = availablePlugins[plugin]; - + return ( { + downloadPlugin={e => { e.preventDefault(); e.stopPropagation(); @@ -77,7 +81,7 @@ class Marketplace extends React.Component { }} /> ); - } + }; render() { const { availablePlugins, isLoading } = this.props; @@ -113,7 +117,7 @@ Marketplace.childContextTypes = { Marketplace.defaultProps = {}; Marketplace.propTypes = { - adminPage: PropTypes.object.isRequired, + admin: PropTypes.object.isRequired, availablePlugins: PropTypes.array.isRequired, downloadPlugin: PropTypes.func.isRequired, getAvailableAndInstalledPlugins: PropTypes.func.isRequired, @@ -136,16 +140,19 @@ function mapDispatchToProps(dispatch) { ); } -const withConnect = connect(mapStateToProps, mapDispatchToProps); +const withConnect = connect( + mapStateToProps, + mapDispatchToProps, +); /* Remove this line if the container doesn't have a route and -* check the documentation to see how to create the container's store -*/ + * check the documentation to see how to create the container's store + */ const withReducer = injectReducer({ key: 'marketplace', reducer }); /* Remove the line below the container doesn't have a route and -* check the documentation to see how to create the container's store -*/ + * check the documentation to see how to create the container's store + */ const withSaga = injectSaga({ key: 'marketplace', saga }); export default compose( diff --git a/packages/strapi-plugin-documentation/admin/src/containers/HomePage/index.js b/packages/strapi-plugin-documentation/admin/src/containers/HomePage/index.js index 5015a2044e..097f4f3e5b 100755 --- a/packages/strapi-plugin-documentation/admin/src/containers/HomePage/index.js +++ b/packages/strapi-plugin-documentation/admin/src/containers/HomePage/index.js @@ -202,7 +202,7 @@ HomePage.defaultProps = { didCheckErrors: false, docVersions: [], form: [], - formErrors: [], + formErrors: {}, isLoading: true, onChange: () => {}, onClickDeleteDoc: () => {}, @@ -210,7 +210,6 @@ HomePage.defaultProps = { onSubmit: () => {}, onUpdateDoc: () => {}, versionToDelete: '', - }; HomePage.propTypes = { @@ -218,7 +217,7 @@ HomePage.propTypes = { didCheckErrors: PropTypes.bool, docVersions: PropTypes.array, form: PropTypes.array, - formErrors: PropTypes.array, + formErrors: PropTypes.object, getDocInfos: PropTypes.func.isRequired, isLoading: PropTypes.bool, onChange: PropTypes.func, @@ -249,7 +248,11 @@ const withConnect = connect( mapStateToProps, mapDispatchToProps, ); -const withReducer = strapi.injectReducer({ key: 'homePage', reducer, pluginId }); +const withReducer = strapi.injectReducer({ + key: 'homePage', + reducer, + pluginId, +}); const withSaga = strapi.injectSaga({ key: 'homePage', saga, pluginId }); export default compose(