From 937a1a9e3f0380c1a674be4442a9c659a0ecf9f9 Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Wed, 27 Sep 2017 17:54:18 +0200 Subject: [PATCH 01/11] Add pluginRequirements function to block plugin rendering --- packages/strapi-admin/admin/src/app.js | 30 +++++++++++++++---- .../admin/src/containers/PluginPage/index.js | 5 ++-- packages/strapi-admin/config/admin.json | 2 +- packages/strapi-helper-plugin/lib/src/app.js | 14 +++++++++ .../src/components/AutoReloadBlocker/index.js | 20 +++++++++++++ .../components/AutoReloadBlocker/styles.scss | 3 ++ .../AutoReloadBlocker/tests/index.test.js | 11 +++++++ .../admin/src/pluginRequirements.js | 4 +++ .../admin/src/containers/App/index.js | 2 +- .../admin/src/pluginRequirements.js | 13 ++++++++ .../config/routes.json | 8 +++++ .../controllers/SettingsManager.js | 6 ++++ 12 files changed, 108 insertions(+), 10 deletions(-) create mode 100644 packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/index.js create mode 100644 packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/styles.scss create mode 100644 packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/tests/index.test.js create mode 100644 packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js create mode 100644 packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js diff --git a/packages/strapi-admin/admin/src/app.js b/packages/strapi-admin/admin/src/app.js index 4bcd6f0130..edd8cc619c 100755 --- a/packages/strapi-admin/admin/src/app.js +++ b/packages/strapi-admin/admin/src/app.js @@ -82,13 +82,31 @@ const registerPlugin = (plugin) => { plugin.leftMenuSections = plugin.leftMenuSections || []; - // Execute bootstrap function. - if (isFunction(plugin.bootstrap)) { - plugin.bootstrap(plugin).then(plugin => { + switch (true) { + // Execute bootstrap function and check if plugin can be rendered + case isFunction(plugin.bootstrap) && isFunction(plugin.pluginRequirements): + plugin.bootstrap(plugin) + .then(plugin => { + plugin.pluginRequirements(plugin) + .then(plugin => { + store.dispatch(pluginLoaded(plugin)); + }); + }); + break; + // Check if plugin can be rendered + case isFunction(plugin.pluginRequirements): + plugin.pluginRequirements(plugin).then(plugin => { + store.dispatch(pluginLoaded(plugin)); + }) + break; + // Execute bootstrap function + case isFunction(plugin.bootstrap): + plugin.bootstrap(plugin).then(plugin => { + store.dispatch(pluginLoaded(plugin)); + }); + break; + default: store.dispatch(pluginLoaded(plugin)); - }); - } else { - store.dispatch(pluginLoaded(plugin)); } }; diff --git a/packages/strapi-admin/admin/src/containers/PluginPage/index.js b/packages/strapi-admin/admin/src/containers/PluginPage/index.js index 2db1f6f6d8..a2f808ecb3 100755 --- a/packages/strapi-admin/admin/src/containers/PluginPage/index.js +++ b/packages/strapi-admin/admin/src/containers/PluginPage/index.js @@ -3,7 +3,7 @@ * PluginPage * */ - + import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import Helmet from 'react-helmet'; @@ -24,7 +24,8 @@ export class PluginPage extends React.Component { // eslint-disable-line react/p if (plugin.id === pluginId) { pluginName = plugin.name; - const Elem = plugin.mainComponent; + const Elem = plugin.preventComponentRendering ? plugin.blockerComponent : plugin.mainComponent; + return ; } }); diff --git a/packages/strapi-admin/config/admin.json b/packages/strapi-admin/config/admin.json index 2d2d20d05a..71d3dace02 100644 --- a/packages/strapi-admin/config/admin.json +++ b/packages/strapi-admin/config/admin.json @@ -1,6 +1,6 @@ { "languages": ["en", "fr"], "plugins": { - "ports": [3000] + "ports": [3000, 5000, 8000] } } diff --git a/packages/strapi-helper-plugin/lib/src/app.js b/packages/strapi-helper-plugin/lib/src/app.js index b6bd2605ee..3b50b31346 100755 --- a/packages/strapi-helper-plugin/lib/src/app.js +++ b/packages/strapi-helper-plugin/lib/src/app.js @@ -12,6 +12,17 @@ import App, { bootstrap } from 'containers/App'; // eslint-disable-line import configureStore from './store'; import { translationMessages } from './i18n'; +const tryRequire = () => { + try { + const config = require('pluginRequirements'); + return config.shouldRenderCompo; + } catch(err) { + return null; + } +}; + +const pluginRequirements = tryRequire(); + // Plugin identifier based on the package.json `name` value const pluginPkg = require('../../../../package.json'); const pluginId = pluginPkg.name.replace( @@ -60,6 +71,9 @@ window.Strapi.registerPlugin({ mainComponent: Comp, translationMessages, bootstrap, + pluginRequirements, + preventComponentRendering: false, + blockerComponent: null, }); // Export store diff --git a/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/index.js b/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/index.js new file mode 100644 index 0000000000..4a126aa5cf --- /dev/null +++ b/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/index.js @@ -0,0 +1,20 @@ +/** +* +* AutoReloadBlocker +* +*/ + +import React from 'react'; + + +import styles from './styles.scss'; + +function AutoReloadBlocker() { + return ( +
+ coucou +
+ ); +} + +export default AutoReloadBlocker; diff --git a/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/styles.scss b/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/styles.scss new file mode 100644 index 0000000000..1acfc17fc4 --- /dev/null +++ b/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/styles.scss @@ -0,0 +1,3 @@ +.autoReloadBlocker { + +} diff --git a/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/tests/index.test.js b/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/tests/index.test.js new file mode 100644 index 0000000000..f68cff617a --- /dev/null +++ b/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/tests/index.test.js @@ -0,0 +1,11 @@ +// import AutoReloadBlocker from '../index'; + +import expect from 'expect'; +// import { shallow } from 'enzyme'; +// import React from 'react'; + +describe('', () => { + it('Expect to have unit tests specified', () => { + expect(true).toEqual(false); + }); +}); diff --git a/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js b/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js new file mode 100644 index 0000000000..7b4a617ca3 --- /dev/null +++ b/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js @@ -0,0 +1,4 @@ +export const shouldRenderCompo = (plugin) => new Promise((resolve) => { + plugin.preventComponentRendering = false; + return resolve(plugin); +}); diff --git a/packages/strapi-plugin-settings-manager/admin/src/containers/App/index.js b/packages/strapi-plugin-settings-manager/admin/src/containers/App/index.js index a3082cc231..343886c962 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/containers/App/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/containers/App/index.js @@ -35,7 +35,7 @@ class App extends React.Component { if (this.props.loading) { return
; } - + return (
diff --git a/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js b/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js new file mode 100644 index 0000000000..74a5f1f8ba --- /dev/null +++ b/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js @@ -0,0 +1,13 @@ +import AutoReloadBlocker from 'components/AutoReloadBlocker'; +import request from 'utils/request'; + +export const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { + request('/settings-manager/autoReload') + .then(response => { + // TODO change to !response.autoReload; + plugin.preventComponentRendering = response.autoReload; + plugin.blockerComponent = AutoReloadBlocker; + return resolve(plugin); + }) + .catch(err => reject(err)); +}); diff --git a/packages/strapi-plugin-settings-manager/config/routes.json b/packages/strapi-plugin-settings-manager/config/routes.json index 6144471b58..8cc8f2451d 100755 --- a/packages/strapi-plugin-settings-manager/config/routes.json +++ b/packages/strapi-plugin-settings-manager/config/routes.json @@ -111,6 +111,14 @@ "config": { "policies": [] } + }, + { + "method": "GET", + "path": "/autoReload", + "handler": "SettingsManager.autoReload", + "config": { + "policies": [] + } } ] } diff --git a/packages/strapi-plugin-settings-manager/controllers/SettingsManager.js b/packages/strapi-plugin-settings-manager/controllers/SettingsManager.js index 12e1d74f1e..7741a98f0c 100755 --- a/packages/strapi-plugin-settings-manager/controllers/SettingsManager.js +++ b/packages/strapi-plugin-settings-manager/controllers/SettingsManager.js @@ -336,5 +336,11 @@ module.exports = { } catch (err) { ctx.body = ctx.notFound(); } + }, + + autoReload: async ctx => { + ctx.send({ + autoReload: _.get(strapi.config.environments, 'development.server.autoReload', false), + }); } }; From 8b736659234aed2cd82f4f73c259edfbd20ce5dd Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Wed, 27 Sep 2017 19:15:03 +0200 Subject: [PATCH 02/11] Created autoReloadblocker component and add pluginRequirements file to content-type-builder-plugin --- packages/strapi-admin/admin/src/app.js | 4 +- .../admin/src/translations/en.json | 5 +- .../admin/src/translations/fr.json | 4 +- .../src/components/AutoReloadBlocker/index.js | 34 +++++++++++-- .../components/AutoReloadBlocker/styles.scss | 50 +++++++++++++++++++ .../AutoReloadBlocker/tests/index.test.js | 11 ---- .../admin/src/pluginRequirements.js | 1 - .../admin/src/pluginRequirements.js | 12 +++++ .../config/routes.json | 8 +++ .../controllers/ContentTypeBuilder.js | 6 +++ .../admin/src/pluginRequirements.js | 3 +- 11 files changed, 117 insertions(+), 21 deletions(-) delete mode 100644 packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/tests/index.test.js create mode 100644 packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js diff --git a/packages/strapi-admin/admin/src/app.js b/packages/strapi-admin/admin/src/app.js index edd8cc619c..68f744b7b1 100755 --- a/packages/strapi-admin/admin/src/app.js +++ b/packages/strapi-admin/admin/src/app.js @@ -85,9 +85,9 @@ const registerPlugin = (plugin) => { switch (true) { // Execute bootstrap function and check if plugin can be rendered case isFunction(plugin.bootstrap) && isFunction(plugin.pluginRequirements): - plugin.bootstrap(plugin) + plugin.pluginRequirements(plugin) .then(plugin => { - plugin.pluginRequirements(plugin) + plugin.bootstrap(plugin) .then(plugin => { store.dispatch(pluginLoaded(plugin)); }); diff --git a/packages/strapi-admin/admin/src/translations/en.json b/packages/strapi-admin/admin/src/translations/en.json index 725671d08b..3d04d0a49b 100755 --- a/packages/strapi-admin/admin/src/translations/en.json +++ b/packages/strapi-admin/admin/src/translations/en.json @@ -10,5 +10,8 @@ "app.components.LeftMenuLinkContainer.noPluginsInstalled": "No plugins installed yet", "app.components.LeftMenuLinkContainer.plugins": "Plugins", "app.components.NotFoundPage.description": "Not Found", - "app.components.NotFoundPage.back": "Back to homepage" + "app.components.NotFoundPage.back": "Back to homepage", + "components.AutoReloadBlocker.header": "Reload feature is required for this plugin.", + "components.AutoReloadBlocker.description": "Open the following file and enable the feature." + } diff --git a/packages/strapi-admin/admin/src/translations/fr.json b/packages/strapi-admin/admin/src/translations/fr.json index c5bf22d06e..e375e46845 100755 --- a/packages/strapi-admin/admin/src/translations/fr.json +++ b/packages/strapi-admin/admin/src/translations/fr.json @@ -10,5 +10,7 @@ "app.components.LeftMenuLinkContainer.noPluginsInstalled": "Aucun plugin installé", "app.components.LeftMenuLinkContainer.plugins": "Plugins", "app.components.NotFoundPage.description": "Page introuvable", - "app.components.NotFoundPage.back": "Retourner à la page d'accueil" + "app.components.NotFoundPage.back": "Retourner à la page d'accueil", + "components.AutoReloadBlocker.header": "L' autoReload doit être activé pour ce plugin.", + "components.AutoReloadBlocker.description": "Ouvrez le fichier suivant pour activer cette fonctionnalité." } diff --git a/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/index.js b/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/index.js index 4a126aa5cf..074ee7b2df 100644 --- a/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/index.js +++ b/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/index.js @@ -5,14 +5,42 @@ */ import React from 'react'; - - +import { FormattedMessage } from 'react-intl'; import styles from './styles.scss'; function AutoReloadBlocker() { return (
- coucou +
+
+ +

+ +

+

+ +

+
+

./config/environments/development/server.json

+
+ {'{'} +
    +
  • "host":   "localhost"
  • +
  • "port":   1337,
  • +
  • "autoReload":   true,
  • +
  • "proxi":   {'{'}
  • +
  •    "enabled":   true
  • +
  • {'}'},
  • +
  • "cron":   {'{'}
  • +
  •    "enabled":   false
  • +
  • {'}'},
  • +
+ {'}'} + +
+
+
+
); } diff --git a/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/styles.scss b/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/styles.scss index 1acfc17fc4..d990cd9915 100644 --- a/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/styles.scss +++ b/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/styles.scss @@ -1,3 +1,53 @@ .autoReloadBlocker { + padding-top: 5.5rem; +} + +.header { + display: flex; + justify-content: center; + font-family: Lato; + > div { + padding-top: 2.5rem; + > h4 { + font-size: 24px; + font-weight: 700; + line-height: 24px; + margin-bottom: 0; + } + > p { + margin-top: -1px; + font-size: 14px; + color: #919BAE; + } + } + &:before{ + content: '\f021'; + font-family: 'FontAwesome'; + font-size: 4.2rem; + color: #323740; + margin-right: 20px; + line-height: 9.3rem; + } } + +.ide { + padding-top: 2.3rem; + > p { + color: #006EE7; + font-size: 14px; + } + > div { + width: 455px; + background: #FFFFFF; + color: #787E8F; + font-size: 12px; + > ul { + padding-left: 20px; + list-style: none; + > li { + list-style: none; + } + } + } +} diff --git a/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/tests/index.test.js b/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/tests/index.test.js deleted file mode 100644 index f68cff617a..0000000000 --- a/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/tests/index.test.js +++ /dev/null @@ -1,11 +0,0 @@ -// import AutoReloadBlocker from '../index'; - -import expect from 'expect'; -// import { shallow } from 'enzyme'; -// import React from 'react'; - -describe('', () => { - it('Expect to have unit tests specified', () => { - expect(true).toEqual(false); - }); -}); diff --git a/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js b/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js index 7b4a617ca3..7082cbc150 100644 --- a/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js +++ b/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js @@ -1,4 +1,3 @@ export const shouldRenderCompo = (plugin) => new Promise((resolve) => { - plugin.preventComponentRendering = false; return resolve(plugin); }); diff --git a/packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js b/packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js new file mode 100644 index 0000000000..83795c0115 --- /dev/null +++ b/packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js @@ -0,0 +1,12 @@ +import AutoReloadBlocker from 'components/AutoReloadBlocker'; +import request from 'utils/request'; + +export const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { + request('/content-type-builder/autoReload') + .then(response => { + plugin.preventComponentRendering = !response.autoReload; + plugin.blockerComponent = AutoReloadBlocker; + return resolve(plugin); + }) + .catch(err => reject(err)); +}); diff --git a/packages/strapi-plugin-content-type-builder/config/routes.json b/packages/strapi-plugin-content-type-builder/config/routes.json index 9f2dca1ce1..857022ccf0 100755 --- a/packages/strapi-plugin-content-type-builder/config/routes.json +++ b/packages/strapi-plugin-content-type-builder/config/routes.json @@ -55,6 +55,14 @@ "config": { "policies": [] } + }, + { + "method": "GET", + "path": "/autoReload", + "handler": "ContentTypeBuilder.autoReload", + "config": { + "policies": [] + } } ] } diff --git a/packages/strapi-plugin-content-type-builder/controllers/ContentTypeBuilder.js b/packages/strapi-plugin-content-type-builder/controllers/ContentTypeBuilder.js index 299d4aa5d2..593b7c3c65 100755 --- a/packages/strapi-plugin-content-type-builder/controllers/ContentTypeBuilder.js +++ b/packages/strapi-plugin-content-type-builder/controllers/ContentTypeBuilder.js @@ -191,5 +191,11 @@ module.exports = { } catch (err) { ctx.body = ctx.notFound(); } + }, + + autoReload: async ctx => { + ctx.send({ + autoReload: _.get(strapi.config.environments, 'development.server.autoReload', false), + }); } }; diff --git a/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js b/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js index 74a5f1f8ba..b2b2797db5 100644 --- a/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js +++ b/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js @@ -4,8 +4,7 @@ import request from 'utils/request'; export const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { request('/settings-manager/autoReload') .then(response => { - // TODO change to !response.autoReload; - plugin.preventComponentRendering = response.autoReload; + plugin.preventComponentRendering = !response.autoReload; plugin.blockerComponent = AutoReloadBlocker; return resolve(plugin); }) From ac11c4685859ddb21b859d94203d4731d97e9ebb Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Wed, 27 Sep 2017 19:25:14 +0200 Subject: [PATCH 03/11] Created Production blocker component --- .../admin/src/translations/en.json | 4 +- .../admin/src/translations/fr.json | 4 +- .../src/components/ProductionBlocker/index.js | 29 ++++++++++ .../components/ProductionBlocker/styles.scss | 53 +++++++++++++++++++ 4 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/index.js create mode 100644 packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/styles.scss diff --git a/packages/strapi-admin/admin/src/translations/en.json b/packages/strapi-admin/admin/src/translations/en.json index 3d04d0a49b..a83776608a 100755 --- a/packages/strapi-admin/admin/src/translations/en.json +++ b/packages/strapi-admin/admin/src/translations/en.json @@ -12,6 +12,8 @@ "app.components.NotFoundPage.description": "Not Found", "app.components.NotFoundPage.back": "Back to homepage", "components.AutoReloadBlocker.header": "Reload feature is required for this plugin.", - "components.AutoReloadBlocker.description": "Open the following file and enable the feature." + "components.AutoReloadBlocker.description": "Open the following file and enable the feature.", + "components.ProductionBlocker.header": "This plugin is only available in development.", + "components.ProductionBlocker.description": "For safety we have to disable this plugin in other environments." } diff --git a/packages/strapi-admin/admin/src/translations/fr.json b/packages/strapi-admin/admin/src/translations/fr.json index e375e46845..4a283fa371 100755 --- a/packages/strapi-admin/admin/src/translations/fr.json +++ b/packages/strapi-admin/admin/src/translations/fr.json @@ -12,5 +12,7 @@ "app.components.NotFoundPage.description": "Page introuvable", "app.components.NotFoundPage.back": "Retourner à la page d'accueil", "components.AutoReloadBlocker.header": "L' autoReload doit être activé pour ce plugin.", - "components.AutoReloadBlocker.description": "Ouvrez le fichier suivant pour activer cette fonctionnalité." + "components.AutoReloadBlocker.description": "Ouvrez le fichier suivant pour activer cette fonctionnalité.", + "components.ProductionBlocker.header": "Ce plugin est disponible uniquement en développement.", + "components.ProductionBlocker.description": "Pour des raisons de sécurité il est désactivé dans les autres environnements." } diff --git a/packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/index.js b/packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/index.js new file mode 100644 index 0000000000..40d8606631 --- /dev/null +++ b/packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/index.js @@ -0,0 +1,29 @@ +/** +* +* AutoReloadBlocker +* +*/ + +import React from 'react'; +import { FormattedMessage } from 'react-intl'; +import styles from './styles.scss'; + +function AutoReloadBlocker() { + return ( +
+
+
+ +

+ +

+

+ +

+
+
+
+ ); +} + +export default AutoReloadBlocker; diff --git a/packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/styles.scss b/packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/styles.scss new file mode 100644 index 0000000000..7ce310bd59 --- /dev/null +++ b/packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/styles.scss @@ -0,0 +1,53 @@ +.productionBlocker { + padding-top: 5.5rem; +} + +.header { + display: flex; + justify-content: center; + font-family: Lato; + > div { + padding-top: 2.5rem; + > h4 { + font-size: 24px; + font-weight: 700; + line-height: 24px; + margin-bottom: 0; + } + > p { + margin-top: -1px; + font-size: 14px; + color: #919BAE; + } + } + &:before{ + content: '\f05e'; + font-family: 'FontAwesome'; + font-size: 4.2rem; + color: #323740; + margin-right: 20px; + line-height: 9.3rem; + } + +} + +.ide { + padding-top: 2.3rem; + > p { + color: #006EE7; + font-size: 14px; + } + > div { + width: 455px; + background: #FFFFFF; + color: #787E8F; + font-size: 12px; + > ul { + padding-left: 20px; + list-style: none; + > li { + list-style: none; + } + } + } +} From 06df5282ce2bc35415ea406e689c3d5c6b18f5b7 Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Wed, 27 Sep 2017 20:10:00 +0200 Subject: [PATCH 04/11] Remove unknow props in content header button in content-type-builder plugin --- .../admin/src/components/ContentHeader/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/ContentHeader/index.js b/packages/strapi-plugin-content-type-builder/admin/src/components/ContentHeader/index.js index 299c0843a7..a6d4887297 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/components/ContentHeader/index.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/components/ContentHeader/index.js @@ -23,7 +23,7 @@ class ContentHeader extends React.Component { // eslint-disable-line react/prefe if (this.props.isLoading) { return (
-
); } From 6f2310e62dabfd4b1fe84a5d301aadef94548780 Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Thu, 28 Sep 2017 11:41:58 +0200 Subject: [PATCH 05/11] Add environment check to settings-manager pluginRequirement, add button to ProductionBlocker component --- .../src/components/ProductionBlocker/index.js | 11 ++-- .../components/ProductionBlocker/styles.scss | 65 ++++++++++++++----- .../admin/src/pluginRequirements.js | 1 + .../admin/src/pluginRequirements.js | 7 ++ .../controllers/SettingsManager.js | 1 + 5 files changed, 64 insertions(+), 21 deletions(-) diff --git a/packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/index.js b/packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/index.js index 40d8606631..12743eaa3b 100644 --- a/packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/index.js +++ b/packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/index.js @@ -1,29 +1,32 @@ /** * -* AutoReloadBlocker +* ProductionBlocker * */ import React from 'react'; +import cn from 'classnames'; import { FormattedMessage } from 'react-intl'; import styles from './styles.scss'; -function AutoReloadBlocker() { +function ProductionBlocker() { return ( ); } -export default AutoReloadBlocker; +export default ProductionBlocker; diff --git a/packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/styles.scss b/packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/styles.scss index 7ce310bd59..1d0b0d079e 100644 --- a/packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/styles.scss +++ b/packages/strapi-helper-plugin/lib/src/components/ProductionBlocker/styles.scss @@ -31,23 +31,54 @@ } -.ide { - padding-top: 2.3rem; - > p { - color: #006EE7; - font-size: 14px; - } - > div { - width: 455px; +.buttonContainer { + padding-top: 2rem; +} + +.primary { + border-radius: 0.3rem; + border: none; + font-weight: 500; + min-width: 15rem; + background: linear-gradient(315deg, #0097F6 0%, #005EEA 100%); + -webkit-font-smoothing: antialiased; + color: white; + &:active { + box-shadow: inset 1px 1px 3px rgba(0,0,0,.15); + } + padding-top: 4px; + padding-left: 1.6rem; + padding-right: 1.6rem; + &:before { + content: '\f02d'; + font-family: 'FontAwesome'; + font-weight: 600; + font-size: 1.3rem; + margin-right: 13px; + } + cursor: pointer; + font-family: Lato; + -webkit-font-smoothing: antialiased; + &:focus { + outline: 0; + } + > i { + margin-right: 1.3rem; + font-weight: 600; + padding-top: 1px; + } + &:hover { + color: white; + &::after { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + border-radius: 0.3rem; + content: ''; + opacity: 0.1; background: #FFFFFF; - color: #787E8F; - font-size: 12px; - > ul { - padding-left: 20px; - list-style: none; - > li { - list-style: none; - } - } } } +} diff --git a/packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js b/packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js index 83795c0115..bf49ffcaee 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js @@ -6,6 +6,7 @@ export const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { .then(response => { plugin.preventComponentRendering = !response.autoReload; plugin.blockerComponent = AutoReloadBlocker; + return resolve(plugin); }) .catch(err => reject(err)); diff --git a/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js b/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js index b2b2797db5..61f77ae714 100644 --- a/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js +++ b/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js @@ -1,4 +1,5 @@ import AutoReloadBlocker from 'components/AutoReloadBlocker'; +import ProductionBlocker from 'components/ProductionBlocker'; import request from 'utils/request'; export const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { @@ -6,6 +7,12 @@ export const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { .then(response => { plugin.preventComponentRendering = !response.autoReload; plugin.blockerComponent = AutoReloadBlocker; + + if (response.environment !== 'development') { + plugin.preventComponentRendering = true; + plugin.blockerComponent = ProductionBlocker; + } + return resolve(plugin); }) .catch(err => reject(err)); diff --git a/packages/strapi-plugin-settings-manager/controllers/SettingsManager.js b/packages/strapi-plugin-settings-manager/controllers/SettingsManager.js index 7741a98f0c..89ba85fa90 100755 --- a/packages/strapi-plugin-settings-manager/controllers/SettingsManager.js +++ b/packages/strapi-plugin-settings-manager/controllers/SettingsManager.js @@ -341,6 +341,7 @@ module.exports = { autoReload: async ctx => { ctx.send({ autoReload: _.get(strapi.config.environments, 'development.server.autoReload', false), + environment: strapi.config.environment, }); } }; From 76ae6ee6ddc27612e808195d8c0ac4fd56d4570d Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Thu, 28 Sep 2017 12:16:24 +0200 Subject: [PATCH 06/11] Add bootstrap file to content-manager plugin --- packages/strapi-helper-plugin/lib/src/app.js | 13 ++++++++----- .../admin/src/bootstrap.js | 12 ++++++++++++ .../admin/src/containers/App/index.js | 13 +------------ 3 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 packages/strapi-plugin-content-manager/admin/src/bootstrap.js diff --git a/packages/strapi-helper-plugin/lib/src/app.js b/packages/strapi-helper-plugin/lib/src/app.js index 3b50b31346..efe8a45ae4 100755 --- a/packages/strapi-helper-plugin/lib/src/app.js +++ b/packages/strapi-helper-plugin/lib/src/app.js @@ -7,22 +7,25 @@ import { Provider } from 'react-redux'; -import App, { bootstrap } from 'containers/App'; // eslint-disable-line +import App from 'containers/App'; // eslint-disable-line import configureStore from './store'; import { translationMessages } from './i18n'; -const tryRequire = () => { +const tryRequire = (bootstrap = false) => { try { - const config = require('pluginRequirements'); - return config.shouldRenderCompo; + const path = 'bootstrap'; + const config = bootstrap ? require('bootstrap').bootstrap : require('pluginRequirements').shouldRenderCompo; + return config; } catch(err) { return null; } }; +const bootstrap = tryRequire(true); const pluginRequirements = tryRequire(); + // Plugin identifier based on the package.json `name` value const pluginPkg = require('../../../../package.json'); const pluginId = pluginPkg.name.replace( @@ -73,7 +76,7 @@ window.Strapi.registerPlugin({ bootstrap, pluginRequirements, preventComponentRendering: false, - blockerComponent: null, + blockerComponent: null, }); // Export store diff --git a/packages/strapi-plugin-content-manager/admin/src/bootstrap.js b/packages/strapi-plugin-content-manager/admin/src/bootstrap.js new file mode 100644 index 0000000000..3605dae272 --- /dev/null +++ b/packages/strapi-plugin-content-manager/admin/src/bootstrap.js @@ -0,0 +1,12 @@ +import { generateMenu } from 'containers/App/sagas'; + +// This method is executed before the load of the plugin +export const bootstrap = (plugin) => new Promise((resole, reject) => { + generateMenu() + .then(menu => { + plugin.leftMenuSections = menu; + + resole(plugin); + }) + .catch(e => reject(e)); +}); diff --git a/packages/strapi-plugin-content-manager/admin/src/containers/App/index.js b/packages/strapi-plugin-content-manager/admin/src/containers/App/index.js index 0b18908b3b..f1d524d11f 100755 --- a/packages/strapi-plugin-content-manager/admin/src/containers/App/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/containers/App/index.js @@ -21,7 +21,7 @@ import List from 'containers/List'; import { loadModels, updateSchema } from './actions'; import { makeSelectLoading } from './selectors'; -import saga, { generateMenu } from './sagas'; +import saga from './sagas'; const tryRequire = (path) => { try { @@ -31,17 +31,6 @@ const tryRequire = (path) => { } }; -// This method is executed before the load of the plugin. -export const bootstrap = (plugin) => new Promise((resolve, reject) => { - generateMenu() - .then(menu => { - plugin.leftMenuSections = menu; - - resolve(plugin); - }) - .catch(e => reject(e)); -}); - class App extends React.Component { componentDidMount() { const config = tryRequire('../../../../config/admin.json'); From 2a6dc8c82167a665bef820e5979e66b566785576 Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Thu, 28 Sep 2017 14:00:22 +0200 Subject: [PATCH 07/11] Fix PR feedback --- packages/strapi-admin/admin/src/app.js | 8 ++-- .../admin/src/translations/fr.json | 2 +- packages/strapi-admin/config/admin.json | 5 +-- packages/strapi-admin/package.json | 4 +- packages/strapi-helper-plugin/lib/src/app.js | 1 - .../src/components/AutoReloadBlocker/index.js | 41 ++++++++++++------- .../admin/src/pluginRequirements.js | 4 +- .../admin/src/components/Button/index.js | 2 +- .../src/components/ContentHeader/index.js | 2 +- .../admin/src/components/EditForm/index.js | 2 +- .../src/components/EditFormSection/index.js | 2 +- .../components/EditFormSectionNested/index.js | 2 +- .../EditFormSectionSubNested/index.js | 2 +- .../admin/src/components/HeaderNav/index.js | 2 +- .../admin/src/components/InputEnum/index.js | 2 +- .../admin/src/components/InputNumber/index.js | 2 +- .../src/components/InputPassword/index.js | 2 +- .../admin/src/components/InputSelect/index.js | 2 +- .../admin/src/components/InputText/index.js | 2 +- .../admin/src/components/InputToggle/index.js | 2 +- .../admin/src/components/List/index.js | 2 +- .../src/components/PluginLeftMenu/index.js | 2 +- .../components/PluginLeftMenuLink/index.js | 2 +- .../components/PluginLeftMenuSection/index.js | 2 +- .../admin/src/components/PopUpForm/index.js | 2 +- .../src/components/PopUpWarning/index.js | 1 + .../admin/src/components/RowDatabase/index.js | 2 +- .../admin/src/components/RowLanguage/index.js | 2 +- .../components/SelectOptionLanguage/index.js | 2 +- .../src/components/WithFormSection/index.js | 2 +- .../admin/src/components/WithInput/index.js | 2 +- .../admin/src/containers/App/index.js | 4 +- .../admin/src/containers/HomePage/index.js | 4 +- .../src/containers/NotFoundPage/index.js | 2 +- .../admin/src/pluginRequirements.js | 2 +- 35 files changed, 66 insertions(+), 58 deletions(-) diff --git a/packages/strapi-admin/admin/src/app.js b/packages/strapi-admin/admin/src/app.js index b2bf63e5d9..68aed0cfe2 100755 --- a/packages/strapi-admin/admin/src/app.js +++ b/packages/strapi-admin/admin/src/app.js @@ -88,10 +88,10 @@ const registerPlugin = (plugin) => { case isFunction(plugin.bootstrap) && isFunction(plugin.pluginRequirements): plugin.pluginRequirements(plugin) .then(plugin => { - plugin.bootstrap(plugin) - .then(plugin => { - store.dispatch(pluginLoaded(plugin)); - }); + return plugin.bootstrap(plugin); + }) + .then(plugin => { + store.dispatch(pluginLoaded(plugin)); }); break; // Check if plugin can be rendered diff --git a/packages/strapi-admin/admin/src/translations/fr.json b/packages/strapi-admin/admin/src/translations/fr.json index 4a283fa371..015d6b0f99 100755 --- a/packages/strapi-admin/admin/src/translations/fr.json +++ b/packages/strapi-admin/admin/src/translations/fr.json @@ -11,7 +11,7 @@ "app.components.LeftMenuLinkContainer.plugins": "Plugins", "app.components.NotFoundPage.description": "Page introuvable", "app.components.NotFoundPage.back": "Retourner à la page d'accueil", - "components.AutoReloadBlocker.header": "L' autoReload doit être activé pour ce plugin.", + "components.AutoReloadBlocker.header": "L'autoReload doit être activé pour ce plugin.", "components.AutoReloadBlocker.description": "Ouvrez le fichier suivant pour activer cette fonctionnalité.", "components.ProductionBlocker.header": "Ce plugin est disponible uniquement en développement.", "components.ProductionBlocker.description": "Pour des raisons de sécurité il est désactivé dans les autres environnements." diff --git a/packages/strapi-admin/config/admin.json b/packages/strapi-admin/config/admin.json index 71d3dace02..e55c6baf82 100644 --- a/packages/strapi-admin/config/admin.json +++ b/packages/strapi-admin/config/admin.json @@ -1,6 +1,3 @@ { - "languages": ["en", "fr"], - "plugins": { - "ports": [3000, 5000, 8000] - } + "languages": ["en", "fr"] } diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index 4424f40597..bcd1ed08eb 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -43,7 +43,7 @@ "html-loader": "^0.4.3", "html-webpack-plugin": "^2.22.0", "plop": "^1.8.1", - "prettier": "^1.7.0", + "prettier": "^1.7.2", "rimraf": "^2.6.2", "strapi-helper-plugin": "3.0.0-alpha.5.5", "webpack": "^3.6.0" @@ -65,4 +65,4 @@ "npm": ">= 3.0.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-helper-plugin/lib/src/app.js b/packages/strapi-helper-plugin/lib/src/app.js index 1e6c3a4756..fa8486cc9e 100755 --- a/packages/strapi-helper-plugin/lib/src/app.js +++ b/packages/strapi-helper-plugin/lib/src/app.js @@ -15,7 +15,6 @@ import { translationMessages } from './i18n'; const tryRequire = (bootstrap = false) => { try { - const path = 'bootstrap'; const config = bootstrap ? require('bootstrap').bootstrap : require('pluginRequirements').shouldRenderCompo; return config; } catch(err) { diff --git a/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/index.js b/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/index.js index 074ee7b2df..b911a29b70 100644 --- a/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/index.js +++ b/packages/strapi-helper-plugin/lib/src/components/AutoReloadBlocker/index.js @@ -23,20 +23,33 @@ function AutoReloadBlocker() {

./config/environments/development/server.json

- {'{'} -
    -
  • "host":   "localhost"
  • -
  • "port":   1337,
  • -
  • "autoReload":   true,
  • -
  • "proxi":   {'{'}
  • -
  •    "enabled":   true
  • -
  • {'}'},
  • -
  • "cron":   {'{'}
  • -
  •    "enabled":   false
  • -
  • {'}'},
  • -
- {'}'} - +
+                
+                  {
+                  
+  "host": "localhost", +
+  "port": 1337, +
+ +  "autoReload": true, + +
+  "proxi": { +
+   "enabled": true +
+  }, +
+  "cron": { +
+   "enabled": false +
+  } +
+ } +
+
diff --git a/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js b/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js index 7082cbc150..f091c414ca 100644 --- a/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js +++ b/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js @@ -1,3 +1 @@ -export const shouldRenderCompo = (plugin) => new Promise((resolve) => { - return resolve(plugin); -}); +export const shouldRenderCompo = (plugin) => Promise.resolve(plugin); diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/Button/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/Button/index.js index 79aa78176c..d77a7f5847 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/Button/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/Button/index.js @@ -3,7 +3,7 @@ * Button * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import styles from './styles.scss'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/ContentHeader/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/ContentHeader/index.js index 96e6586333..7074d07de4 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/ContentHeader/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/ContentHeader/index.js @@ -3,7 +3,7 @@ * ContentHeader * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import styles from './styles.scss'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/EditForm/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/EditForm/index.js index 2bb519a0d8..c27f67af8d 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/EditForm/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/EditForm/index.js @@ -3,7 +3,7 @@ * EditForm * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { map } from 'lodash'; import { FormattedMessage } from 'react-intl'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/EditFormSection/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/EditFormSection/index.js index 207d66f7ce..f73dd0b20b 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/EditFormSection/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/EditFormSection/index.js @@ -3,7 +3,7 @@ * EditFormSection * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { map, isEmpty } from 'lodash'; import { FormattedMessage } from 'react-intl'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/EditFormSectionNested/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/EditFormSectionNested/index.js index 46db6ecedc..cd4f6ca53f 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/EditFormSectionNested/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/EditFormSectionNested/index.js @@ -3,7 +3,7 @@ * EditFormSectionNested * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { has, map, forEach } from 'lodash'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/EditFormSectionSubNested/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/EditFormSectionSubNested/index.js index e8f6e22e01..64fca02ce0 100644 --- a/packages/strapi-plugin-settings-manager/admin/src/components/EditFormSectionSubNested/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/EditFormSectionSubNested/index.js @@ -3,7 +3,7 @@ * EditFormSectionSubNested * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { map } from 'lodash'; import WithFormSection from 'components/WithFormSection'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/HeaderNav/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/HeaderNav/index.js index 36081b9f4d..5172ec05f1 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/HeaderNav/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/HeaderNav/index.js @@ -3,7 +3,7 @@ * HeaderNav * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { NavLink } from 'react-router-dom'; import { join, map, take } from 'lodash'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/InputEnum/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/InputEnum/index.js index 1f8240e0e9..e162274164 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/InputEnum/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/InputEnum/index.js @@ -3,7 +3,7 @@ * InputEnum * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { map } from 'lodash'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/InputNumber/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/InputNumber/index.js index b1fa747872..75fb283b9b 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/InputNumber/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/InputNumber/index.js @@ -26,7 +26,7 @@ * * - styles are retrieved from the HOC */ - +import React from 'react'; import PropTypes from 'prop-types'; import { isEmpty, includes, map, mapKeys, isObject, reject, union, uniqBy } from 'lodash'; import { FormattedMessage } from 'react-intl'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/InputPassword/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/InputPassword/index.js index fa6949e329..5788e0331d 100644 --- a/packages/strapi-plugin-settings-manager/admin/src/components/InputPassword/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/InputPassword/index.js @@ -3,7 +3,7 @@ * InputPassword * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { isEmpty, includes, mapKeys, reject, map, isObject } from 'lodash'; import { FormattedMessage } from 'react-intl'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/InputSelect/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/InputSelect/index.js index 4150a3d2c6..eb3d0c3cfd 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/InputSelect/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/InputSelect/index.js @@ -3,7 +3,7 @@ * InputSelect * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { map } from 'lodash'; import { FormattedMessage } from 'react-intl'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/InputText/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/InputText/index.js index 7d0cbf1f82..074e9aedc0 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/InputText/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/InputText/index.js @@ -26,7 +26,7 @@ * * - styles are retrieved from the HOC */ - +import React from 'react'; import PropTypes from 'prop-types'; import { isEmpty, includes, mapKeys, reject, map, isObject, union, findIndex, uniqBy, remove } from 'lodash'; import { FormattedMessage } from 'react-intl'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/InputToggle/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/InputToggle/index.js index de088edfbd..b78394f730 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/InputToggle/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/InputToggle/index.js @@ -10,7 +10,7 @@ * - target: string * - isChecked: bool */ - +import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import styles from './styles.scss'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/List/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/List/index.js index d43109f175..456c0662e6 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/List/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/List/index.js @@ -14,7 +14,7 @@ * - handleListPopButtonSave: func * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { map, isEmpty } from 'lodash'; import { FormattedMessage } from 'react-intl'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/PluginLeftMenu/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/PluginLeftMenu/index.js index 5afd5af452..62d5aa9abb 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/PluginLeftMenu/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/PluginLeftMenu/index.js @@ -3,7 +3,7 @@ * PluginLeftMenu * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { map } from 'lodash'; import PluginLeftMenuSection from 'components/PluginLeftMenuSection'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/PluginLeftMenuLink/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/PluginLeftMenuLink/index.js index e5b654e86c..43849ee6ba 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/PluginLeftMenuLink/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/PluginLeftMenuLink/index.js @@ -3,7 +3,7 @@ * PluginLeftMenuLink * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { NavLink } from 'react-router-dom'; import { FormattedMessage } from 'react-intl'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/PluginLeftMenuSection/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/PluginLeftMenuSection/index.js index 98ec7a3ff0..1fbff449a5 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/PluginLeftMenuSection/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/PluginLeftMenuSection/index.js @@ -3,7 +3,7 @@ * PluginLeftMenuSection * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { map } from 'lodash'; import { FormattedMessage } from 'react-intl'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/PopUpForm/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/PopUpForm/index.js index 21974d2c1e..b6d0fe18d2 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/PopUpForm/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/PopUpForm/index.js @@ -3,7 +3,7 @@ * PopUpForm * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { map } from 'lodash'; import WithFormSection from 'components/WithFormSection'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/PopUpWarning/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/PopUpWarning/index.js index 46b9d58880..93b2c9d80e 100644 --- a/packages/strapi-plugin-settings-manager/admin/src/components/PopUpWarning/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/PopUpWarning/index.js @@ -4,6 +4,7 @@ * */ +import React from 'react'; import PropTypes from 'prop-types'; // modal import { Button, Modal, ModalHeader, ModalBody } from 'reactstrap'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/RowDatabase/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/RowDatabase/index.js index 8817714c4a..d57f14298c 100644 --- a/packages/strapi-plugin-settings-manager/admin/src/components/RowDatabase/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/RowDatabase/index.js @@ -3,7 +3,7 @@ * RowDatabase * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { isEmpty } from 'lodash'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/RowLanguage/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/RowLanguage/index.js index 995c946ed7..bd78f2f3c4 100644 --- a/packages/strapi-plugin-settings-manager/admin/src/components/RowLanguage/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/RowLanguage/index.js @@ -3,7 +3,7 @@ * RowLanguage * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { find, get, join, isObject } from 'lodash'; import { FormattedMessage } from 'react-intl'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/SelectOptionLanguage/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/SelectOptionLanguage/index.js index 4e77ff5d4f..43c1126ab4 100644 --- a/packages/strapi-plugin-settings-manager/admin/src/components/SelectOptionLanguage/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/SelectOptionLanguage/index.js @@ -3,7 +3,7 @@ * SelectOption * */ - +import React from 'react'; import PropTypes from 'prop-types'; import getFlag, { formatLanguageLocale } from '../../utils/getFlag'; import styles from './styles.scss'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/WithFormSection/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/WithFormSection/index.js index cb3ef39560..02c84f39a8 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/WithFormSection/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/WithFormSection/index.js @@ -3,7 +3,7 @@ * WithFormSection * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { findIndex, forEach, has, isObject , join, pullAt, split, includes} from 'lodash'; diff --git a/packages/strapi-plugin-settings-manager/admin/src/components/WithInput/index.js b/packages/strapi-plugin-settings-manager/admin/src/components/WithInput/index.js index 54c32b168a..14791d7d45 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/components/WithInput/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/components/WithInput/index.js @@ -3,7 +3,7 @@ * WithInput * */ - +import React from 'react'; import styles from './styles.scss'; const WithInput = (InnerInput) => class extends React.Component { // eslint-disable-line react/prefer-stateless-function diff --git a/packages/strapi-plugin-settings-manager/admin/src/containers/App/index.js b/packages/strapi-plugin-settings-manager/admin/src/containers/App/index.js index 343886c962..9e40f4f6a1 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/containers/App/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/containers/App/index.js @@ -4,7 +4,7 @@ * contain code that should be seen on all pages. (e.g. navigation bar) * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { createStructuredSelector } from 'reselect'; @@ -35,7 +35,7 @@ class App extends React.Component { if (this.props.loading) { return
; } - + return (
diff --git a/packages/strapi-plugin-settings-manager/admin/src/containers/HomePage/index.js b/packages/strapi-plugin-settings-manager/admin/src/containers/HomePage/index.js index cafef57036..e8517870a4 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/containers/HomePage/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/containers/HomePage/index.js @@ -3,7 +3,7 @@ * HomePage * */ - +import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { bindActionCreators, compose } from 'redux'; @@ -321,7 +321,7 @@ export class HomePage extends React.Component { // eslint-disable-line react/pre renderPopUpFormLanguage = (section) => ( map(section.items, (item) => { const value = this.props.home.modifiedData[item.target] || this.props.home.selectOptions.options[0].value; - + return (
diff --git a/packages/strapi-plugin-settings-manager/admin/src/containers/NotFoundPage/index.js b/packages/strapi-plugin-settings-manager/admin/src/containers/NotFoundPage/index.js index 1a53febbd2..fbac0ebef4 100755 --- a/packages/strapi-plugin-settings-manager/admin/src/containers/NotFoundPage/index.js +++ b/packages/strapi-plugin-settings-manager/admin/src/containers/NotFoundPage/index.js @@ -8,7 +8,7 @@ * reloading is not a neccessity for you then you can refactor it and remove * the linting exception. */ - +import React from 'react'; import { FormattedMessage } from 'react-intl'; export default class NotFound extends React.Component { diff --git a/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js b/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js index 61f77ae714..617c640dc3 100644 --- a/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js +++ b/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js @@ -5,7 +5,7 @@ import request from 'utils/request'; export const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { request('/settings-manager/autoReload') .then(response => { - plugin.preventComponentRendering = !response.autoReload; + plugin.preventComponentRendering = response.autoReload; plugin.blockerComponent = AutoReloadBlocker; if (response.environment !== 'development') { From 594c3832ac5ec3f171116913ef99161524ade3d9 Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Thu, 28 Sep 2017 14:15:15 +0200 Subject: [PATCH 08/11] Export default in pluginRequirements and bootstrap files --- packages/strapi-admin/package.json | 2 +- packages/strapi-helper-plugin/lib/src/app.js | 3 ++- packages/strapi-helper-plugin/package.json | 2 +- .../strapi-plugin-content-manager/admin/src/bootstrap.js | 4 +++- .../admin/src/pluginRequirements.js | 4 +++- .../admin/src/pluginRequirements.js | 5 ++++- .../admin/src/pluginRequirements.js | 6 ++++-- 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index bcd1ed08eb..b226563621 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -65,4 +65,4 @@ "npm": ">= 3.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-helper-plugin/lib/src/app.js b/packages/strapi-helper-plugin/lib/src/app.js index fa8486cc9e..49134f05e4 100755 --- a/packages/strapi-helper-plugin/lib/src/app.js +++ b/packages/strapi-helper-plugin/lib/src/app.js @@ -15,7 +15,8 @@ import { translationMessages } from './i18n'; const tryRequire = (bootstrap = false) => { try { - const config = bootstrap ? require('bootstrap').bootstrap : require('pluginRequirements').shouldRenderCompo; + const config = bootstrap ? require('bootstrap').default : require('pluginRequirements').default; + console.log(config) return config; } catch(err) { return null; diff --git a/packages/strapi-helper-plugin/package.json b/packages/strapi-helper-plugin/package.json index 31f9ab71c8..9446a85d55 100755 --- a/packages/strapi-helper-plugin/package.json +++ b/packages/strapi-helper-plugin/package.json @@ -115,4 +115,4 @@ "webpack-hot-middleware": "^2.18.2", "whatwg-fetch": "^2.0.3" } -} +} \ No newline at end of file diff --git a/packages/strapi-plugin-content-manager/admin/src/bootstrap.js b/packages/strapi-plugin-content-manager/admin/src/bootstrap.js index 3605dae272..2251dbc0b7 100644 --- a/packages/strapi-plugin-content-manager/admin/src/bootstrap.js +++ b/packages/strapi-plugin-content-manager/admin/src/bootstrap.js @@ -1,7 +1,7 @@ import { generateMenu } from 'containers/App/sagas'; // This method is executed before the load of the plugin -export const bootstrap = (plugin) => new Promise((resole, reject) => { +const bootstrap = (plugin) => new Promise((resole, reject) => { generateMenu() .then(menu => { plugin.leftMenuSections = menu; @@ -10,3 +10,5 @@ export const bootstrap = (plugin) => new Promise((resole, reject) => { }) .catch(e => reject(e)); }); + +export default bootstrap; diff --git a/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js b/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js index f091c414ca..fcf49dd7d8 100644 --- a/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js +++ b/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js @@ -1 +1,3 @@ -export const shouldRenderCompo = (plugin) => Promise.resolve(plugin); +const shouldRenderCompo = (plugin) => Promise.resolve(plugin); + +export default shouldRenderCompo; diff --git a/packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js b/packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js index bf49ffcaee..0070ba9ceb 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js @@ -1,7 +1,7 @@ import AutoReloadBlocker from 'components/AutoReloadBlocker'; import request from 'utils/request'; -export const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { +const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { request('/content-type-builder/autoReload') .then(response => { plugin.preventComponentRendering = !response.autoReload; @@ -11,3 +11,6 @@ export const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { }) .catch(err => reject(err)); }); + + +export default shouldRenderCompo; diff --git a/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js b/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js index 617c640dc3..d6a78a0601 100644 --- a/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js +++ b/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js @@ -2,10 +2,10 @@ import AutoReloadBlocker from 'components/AutoReloadBlocker'; import ProductionBlocker from 'components/ProductionBlocker'; import request from 'utils/request'; -export const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { +const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { request('/settings-manager/autoReload') .then(response => { - plugin.preventComponentRendering = response.autoReload; + plugin.preventComponentRendering = !response.autoReload; plugin.blockerComponent = AutoReloadBlocker; if (response.environment !== 'development') { @@ -17,3 +17,5 @@ export const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { }) .catch(err => reject(err)); }); + +export default shouldRenderCompo; From 5a1fae533a975d04fea355c754dd0410d2756389 Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Thu, 28 Sep 2017 14:28:57 +0200 Subject: [PATCH 09/11] Remove logs, and hange params name --- packages/strapi-admin/package.json | 2 +- packages/strapi-helper-plugin/lib/src/app.js | 3 +-- .../admin/src/bootstrap.js | 4 ++-- .../admin/src/pluginRequirements.js | 3 --- .../admin/src/pluginRequirements.js | 16 -------------- .../admin/src/pluginRequirements.js | 21 ------------------- 6 files changed, 4 insertions(+), 45 deletions(-) delete mode 100644 packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js delete mode 100644 packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js delete mode 100644 packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index 6c25543a55..c985dbbdef 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -66,4 +66,4 @@ "npm": ">= 3.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-helper-plugin/lib/src/app.js b/packages/strapi-helper-plugin/lib/src/app.js index 49134f05e4..b77085f170 100755 --- a/packages/strapi-helper-plugin/lib/src/app.js +++ b/packages/strapi-helper-plugin/lib/src/app.js @@ -15,8 +15,7 @@ import { translationMessages } from './i18n'; const tryRequire = (bootstrap = false) => { try { - const config = bootstrap ? require('bootstrap').default : require('pluginRequirements').default; - console.log(config) + const config = bootstrap ? require('bootstrap').default : require('requirements').default; return config; } catch(err) { return null; diff --git a/packages/strapi-plugin-content-manager/admin/src/bootstrap.js b/packages/strapi-plugin-content-manager/admin/src/bootstrap.js index 2251dbc0b7..acc622fcb2 100644 --- a/packages/strapi-plugin-content-manager/admin/src/bootstrap.js +++ b/packages/strapi-plugin-content-manager/admin/src/bootstrap.js @@ -1,12 +1,12 @@ import { generateMenu } from 'containers/App/sagas'; // This method is executed before the load of the plugin -const bootstrap = (plugin) => new Promise((resole, reject) => { +const bootstrap = (plugin) => new Promise((resolve, reject) => { generateMenu() .then(menu => { plugin.leftMenuSections = menu; - resole(plugin); + resolve(plugin); }) .catch(e => reject(e)); }); diff --git a/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js b/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js deleted file mode 100644 index fcf49dd7d8..0000000000 --- a/packages/strapi-plugin-content-manager/admin/src/pluginRequirements.js +++ /dev/null @@ -1,3 +0,0 @@ -const shouldRenderCompo = (plugin) => Promise.resolve(plugin); - -export default shouldRenderCompo; diff --git a/packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js b/packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js deleted file mode 100644 index 0070ba9ceb..0000000000 --- a/packages/strapi-plugin-content-type-builder/admin/src/pluginRequirements.js +++ /dev/null @@ -1,16 +0,0 @@ -import AutoReloadBlocker from 'components/AutoReloadBlocker'; -import request from 'utils/request'; - -const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { - request('/content-type-builder/autoReload') - .then(response => { - plugin.preventComponentRendering = !response.autoReload; - plugin.blockerComponent = AutoReloadBlocker; - - return resolve(plugin); - }) - .catch(err => reject(err)); -}); - - -export default shouldRenderCompo; diff --git a/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js b/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js deleted file mode 100644 index d6a78a0601..0000000000 --- a/packages/strapi-plugin-settings-manager/admin/src/pluginRequirements.js +++ /dev/null @@ -1,21 +0,0 @@ -import AutoReloadBlocker from 'components/AutoReloadBlocker'; -import ProductionBlocker from 'components/ProductionBlocker'; -import request from 'utils/request'; - -const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { - request('/settings-manager/autoReload') - .then(response => { - plugin.preventComponentRendering = !response.autoReload; - plugin.blockerComponent = AutoReloadBlocker; - - if (response.environment !== 'development') { - plugin.preventComponentRendering = true; - plugin.blockerComponent = ProductionBlocker; - } - - return resolve(plugin); - }) - .catch(err => reject(err)); -}); - -export default shouldRenderCompo; From a033d97e3448b99bc267abe7afb0e6e4b7cc886b Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Thu, 28 Sep 2017 14:31:51 +0200 Subject: [PATCH 10/11] Change pluginRequirements file to requirements --- .../admin/src/requirements.js | 3 +++ .../admin/src/requirements.js | 16 ++++++++++++++ .../admin/src/requirements.js | 21 +++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 packages/strapi-plugin-content-manager/admin/src/requirements.js create mode 100644 packages/strapi-plugin-content-type-builder/admin/src/requirements.js create mode 100644 packages/strapi-plugin-settings-manager/admin/src/requirements.js diff --git a/packages/strapi-plugin-content-manager/admin/src/requirements.js b/packages/strapi-plugin-content-manager/admin/src/requirements.js new file mode 100644 index 0000000000..fcf49dd7d8 --- /dev/null +++ b/packages/strapi-plugin-content-manager/admin/src/requirements.js @@ -0,0 +1,3 @@ +const shouldRenderCompo = (plugin) => Promise.resolve(plugin); + +export default shouldRenderCompo; diff --git a/packages/strapi-plugin-content-type-builder/admin/src/requirements.js b/packages/strapi-plugin-content-type-builder/admin/src/requirements.js new file mode 100644 index 0000000000..0070ba9ceb --- /dev/null +++ b/packages/strapi-plugin-content-type-builder/admin/src/requirements.js @@ -0,0 +1,16 @@ +import AutoReloadBlocker from 'components/AutoReloadBlocker'; +import request from 'utils/request'; + +const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { + request('/content-type-builder/autoReload') + .then(response => { + plugin.preventComponentRendering = !response.autoReload; + plugin.blockerComponent = AutoReloadBlocker; + + return resolve(plugin); + }) + .catch(err => reject(err)); +}); + + +export default shouldRenderCompo; diff --git a/packages/strapi-plugin-settings-manager/admin/src/requirements.js b/packages/strapi-plugin-settings-manager/admin/src/requirements.js new file mode 100644 index 0000000000..d6a78a0601 --- /dev/null +++ b/packages/strapi-plugin-settings-manager/admin/src/requirements.js @@ -0,0 +1,21 @@ +import AutoReloadBlocker from 'components/AutoReloadBlocker'; +import ProductionBlocker from 'components/ProductionBlocker'; +import request from 'utils/request'; + +const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { + request('/settings-manager/autoReload') + .then(response => { + plugin.preventComponentRendering = !response.autoReload; + plugin.blockerComponent = AutoReloadBlocker; + + if (response.environment !== 'development') { + plugin.preventComponentRendering = true; + plugin.blockerComponent = ProductionBlocker; + } + + return resolve(plugin); + }) + .catch(err => reject(err)); +}); + +export default shouldRenderCompo; From 9a9a8499b1485109a9e73efae4252537cbb8ad89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20GEORGET?= Date: Fri, 29 Sep 2017 11:29:17 +0200 Subject: [PATCH 11/11] Update README.md --- README.md | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4b81eb2223..3b59930005 100755 --- a/README.md +++ b/README.md @@ -1,11 +1,23 @@ -![Logo](https://cldup.com/7umchwdUBh.png) +

+

API creation made simple, secure and fast.

+

The most advanced open-source Content Management Framework to build powerful API with no effort.

+
+

+ + Dependency Status + + + Dependency Status + + + Dependency Status + + + Dependency Status + +

-[![npm version](https://img.shields.io/npm/v/strapi.svg)](https://www.npmjs.org/package/strapi) -[![npm downloads](https://img.shields.io/npm/dm/strapi.svg)](https://www.npmjs.org/package/strapi) -[![Build status](https://travis-ci.org/strapi/strapi.svg?branch=master)](https://travis-ci.org/strapi/strapi) -[![Slack status](http://strapi-slack.herokuapp.com/badge.svg)](http://slack.strapi.io) - -[Strapi](http://strapi.io) is an open source solution to create, deploy and manage your own API. It provides a powerful dashboard and features to make your life easier. +
## v3.0.0 coming soon... We've been working on a major update to Strapi for several months now, rewriting the core framework and the dashboard. Some parts of this work have been merged into our master branch. Currently, this is not stable and ready.