Remove single for content type b

This commit is contained in:
soupette 2019-02-11 14:26:20 +01:00
parent b52b010b61
commit 22c5ba819e
7 changed files with 17 additions and 17 deletions

View File

@ -24,12 +24,13 @@ import formReducer from 'containers/Form/reducer';
import { makeSelectShouldRefetchContentType } from 'containers/Form/selectors'; import { makeSelectShouldRefetchContentType } from 'containers/Form/selectors';
// Utils // Utils
import injectSaga from 'utils/injectSaga'; // import injectSaga from 'utils/injectSaga';
import injectReducer from 'utils/injectReducer'; // import injectReducer from 'utils/injectReducer';
import { storeData } from '../../utils/storeData'; import { storeData } from '../../utils/storeData';
import styles from './styles.scss'; import styles from './styles.scss';
import { modelsFetch } from './actions'; import { modelsFetch } from './actions';
import reducer from './reducer';
import saga from './sagas'; import saga from './sagas';
/* eslint-disable consistent-return */ /* eslint-disable consistent-return */
@ -92,10 +93,12 @@ const mapStateToProps = createStructuredSelector({
}); });
const withConnect = connect(mapStateToProps, mapDispatchToProps); const withConnect = connect(mapStateToProps, mapDispatchToProps);
const withSaga = injectSaga({ key: 'global', saga }); const withReducer = strapi.injectReducer({ key: 'global', reducer, pluginId: 'content-type-builder' });
const withFormReducer = injectReducer({ key: 'form', reducer: formReducer }); const withSaga = strapi.injectSaga({ key: 'global', saga, pluginId: 'content-type-builder' });
const withFormSaga = injectSaga({ key: 'form', saga: formSaga }); 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( export default compose(
withReducer,
withFormReducer, withFormReducer,
withFormSaga, withFormSaga,
withSaga, withSaga,

View File

@ -4,7 +4,7 @@ import { createSelector } from 'reselect';
* Direct selector to the list state domain * 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( const makeSelectLoading = () => createSelector(
selectGlobalDomain(), selectGlobalDomain(),

View File

@ -3,7 +3,7 @@ import { createSelector } from 'reselect';
/** /**
* Direct selector to the form state domain * 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 * Other specific selectors

View File

@ -23,8 +23,7 @@ import ContentHeader from 'components/ContentHeader';
import EmptyContentTypeView from 'components/EmptyContentTypeView'; import EmptyContentTypeView from 'components/EmptyContentTypeView';
import TableList from 'components/TableList'; import TableList from 'components/TableList';
import injectSaga from 'utils/injectSaga'; // Utils
import injectReducer from 'utils/injectReducer';
import { storeData } from '../../utils/storeData'; import { storeData } from '../../utils/storeData';
import selectHomePage from './selectors'; import selectHomePage from './selectors';
@ -140,8 +139,8 @@ function mapDispatchToProps(dispatch) {
} }
const withConnect = connect(mapStateToProps, mapDispatchToProps); const withConnect = connect(mapStateToProps, mapDispatchToProps);
const withReducer = injectReducer({ key: 'homePage', reducer }); const withReducer = strapi.injectReducer({ key: 'homePage', reducer, pluginId: 'content-type-builder' });
const withSaga = injectSaga({ key: 'homePage', saga }); const withSaga = strapi.injectSaga({ key: 'homePage', saga, pluginId: 'content-type-builder' });
export default compose( export default compose(
withReducer, withReducer,

View File

@ -3,7 +3,7 @@ import { createSelector } from 'reselect';
/** /**
* Direct selector to the homePage state domain * 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 * Other specific selectors

View File

@ -23,8 +23,6 @@ import Form from 'containers/Form';
import List from 'components/List'; import List from 'components/List';
import PluginLeftMenu from 'components/PluginLeftMenu'; import PluginLeftMenu from 'components/PluginLeftMenu';
import forms from 'containers/Form/forms.json'; import forms from 'containers/Form/forms.json';
import injectSaga from 'utils/injectSaga';
import injectReducer from 'utils/injectReducer';
import { storeData } from '../../utils/storeData'; import { storeData } from '../../utils/storeData';
import { import {
cancelChanges, cancelChanges,
@ -355,8 +353,8 @@ function mapDispatchToProps(dispatch) {
} }
const withConnect = connect(mapStateToProps, mapDispatchToProps); const withConnect = connect(mapStateToProps, mapDispatchToProps);
const withSaga = injectSaga({ key: 'modelPage', saga }); const withSaga = strapi.injectSaga({ key: 'modelPage', saga, pluginId: 'content-type-builder' });
const withReducer = injectReducer({ key: 'modelPage', reducer }); const withReducer = strapi.injectReducer({ key: 'modelPage', reducer, pluginId: 'content-type-builder' });
export default compose( export default compose(
withReducer, withReducer,

View File

@ -3,7 +3,7 @@ import { createSelector } from 'reselect';
/** /**
* Direct selector to the modelPage state domain * 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 * Other specific selectors