From 22c5ba819e0678a3025f099ce186dcb3b3592fce Mon Sep 17 00:00:00 2001 From: soupette Date: Mon, 11 Feb 2019 14:26:20 +0100 Subject: [PATCH] Remove single for content type b --- .../admin/src/containers/App/index.js | 13 ++++++++----- .../admin/src/containers/App/selectors.js | 2 +- .../admin/src/containers/Form/selectors.js | 2 +- .../admin/src/containers/HomePage/index.js | 7 +++---- .../admin/src/containers/HomePage/selectors.js | 2 +- .../admin/src/containers/ModelPage/index.js | 6 ++---- .../admin/src/containers/ModelPage/selectors.js | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/App/index.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/App/index.js index af53dc9825..6bdc195356 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/App/index.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/App/index.js @@ -24,12 +24,13 @@ import formReducer from 'containers/Form/reducer'; import { makeSelectShouldRefetchContentType } from 'containers/Form/selectors'; // Utils -import injectSaga from 'utils/injectSaga'; -import injectReducer from 'utils/injectReducer'; +// import injectSaga from 'utils/injectSaga'; +// import injectReducer from 'utils/injectReducer'; import { storeData } from '../../utils/storeData'; import styles from './styles.scss'; import { modelsFetch } from './actions'; +import reducer from './reducer'; import saga from './sagas'; /* eslint-disable consistent-return */ @@ -92,10 +93,12 @@ const mapStateToProps = createStructuredSelector({ }); const withConnect = connect(mapStateToProps, mapDispatchToProps); -const withSaga = injectSaga({ key: 'global', saga }); -const withFormReducer = injectReducer({ key: 'form', reducer: formReducer }); -const withFormSaga = injectSaga({ key: 'form', saga: formSaga }); +const withReducer = strapi.injectReducer({ key: 'global', reducer, pluginId: 'content-type-builder' }); +const withSaga = strapi.injectSaga({ key: 'global', saga, pluginId: 'content-type-builder' }); +const withFormReducer = strapi.injectReducer({ key: 'form', reducer: formReducer, pluginId: 'content-type-builder' }); +const withFormSaga = strapi.injectSaga({ key: 'form', saga: formSaga, pluginId: 'content-type-builder' }); export default compose( + withReducer, withFormReducer, withFormSaga, withSaga, diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/App/selectors.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/App/selectors.js index f9b6cb77a8..a0dfa9546d 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/App/selectors.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/App/selectors.js @@ -4,7 +4,7 @@ import { createSelector } from 'reselect'; * Direct selector to the list state domain */ -const selectGlobalDomain = () => state => state.get('global'); +const selectGlobalDomain = () => state => state.get('content-type-builder-global'); const makeSelectLoading = () => createSelector( selectGlobalDomain(), diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/selectors.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/selectors.js index 716acc94f3..12836375c4 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/selectors.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/selectors.js @@ -3,7 +3,7 @@ import { createSelector } from 'reselect'; /** * Direct selector to the form state domain */ -const selectFormDomain = () => state => state.get('form'); +const selectFormDomain = () => state => state.get('content-type-builder-form'); /** * Other specific selectors diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/HomePage/index.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/HomePage/index.js index 2cf75dc960..101839fc70 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/HomePage/index.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/HomePage/index.js @@ -23,8 +23,7 @@ import ContentHeader from 'components/ContentHeader'; import EmptyContentTypeView from 'components/EmptyContentTypeView'; import TableList from 'components/TableList'; -import injectSaga from 'utils/injectSaga'; -import injectReducer from 'utils/injectReducer'; +// Utils import { storeData } from '../../utils/storeData'; import selectHomePage from './selectors'; @@ -140,8 +139,8 @@ function mapDispatchToProps(dispatch) { } const withConnect = connect(mapStateToProps, mapDispatchToProps); -const withReducer = injectReducer({ key: 'homePage', reducer }); -const withSaga = injectSaga({ key: 'homePage', saga }); +const withReducer = strapi.injectReducer({ key: 'homePage', reducer, pluginId: 'content-type-builder' }); +const withSaga = strapi.injectSaga({ key: 'homePage', saga, pluginId: 'content-type-builder' }); export default compose( withReducer, diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/HomePage/selectors.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/HomePage/selectors.js index 2e0aa89903..4f6f7e2790 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/HomePage/selectors.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/HomePage/selectors.js @@ -3,7 +3,7 @@ import { createSelector } from 'reselect'; /** * Direct selector to the homePage state domain */ -const selectHomePageDomain = () => state => state.get('homePage'); +const selectHomePageDomain = () => state => state.get('content-type-builder-homePage'); /** * Other specific selectors diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelPage/index.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelPage/index.js index e2486a91d6..9027aab785 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelPage/index.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelPage/index.js @@ -23,8 +23,6 @@ import Form from 'containers/Form'; import List from 'components/List'; import PluginLeftMenu from 'components/PluginLeftMenu'; import forms from 'containers/Form/forms.json'; -import injectSaga from 'utils/injectSaga'; -import injectReducer from 'utils/injectReducer'; import { storeData } from '../../utils/storeData'; import { cancelChanges, @@ -355,8 +353,8 @@ function mapDispatchToProps(dispatch) { } const withConnect = connect(mapStateToProps, mapDispatchToProps); -const withSaga = injectSaga({ key: 'modelPage', saga }); -const withReducer = injectReducer({ key: 'modelPage', reducer }); +const withSaga = strapi.injectSaga({ key: 'modelPage', saga, pluginId: 'content-type-builder' }); +const withReducer = strapi.injectReducer({ key: 'modelPage', reducer, pluginId: 'content-type-builder' }); export default compose( withReducer, diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelPage/selectors.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelPage/selectors.js index 908ebfecb6..bc7d32f29a 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelPage/selectors.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelPage/selectors.js @@ -3,7 +3,7 @@ import { createSelector } from 'reselect'; /** * Direct selector to the modelPage state domain */ -const selectModelPageDomain = () => state => state.get('modelPage'); +const selectModelPageDomain = () => state => state.get('content-type-builder-modelPage'); /** * Other specific selectors