mirror of
https://github.com/strapi/strapi.git
synced 2025-08-12 10:48:12 +00:00
Fix content-type creation bug in content-manager
This commit is contained in:
parent
3c9434c024
commit
be5f28260b
@ -4,7 +4,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
import { LOAD_MODELS, LOADED_MODELS, UPDATE_SCHEMA } from './constants';
|
||||
import { EMPTY_STORE, LOAD_MODELS, LOADED_MODELS, UPDATE_SCHEMA } from './constants';
|
||||
|
||||
export function emptyStore() {
|
||||
return {
|
||||
type: EMPTY_STORE,
|
||||
};
|
||||
}
|
||||
|
||||
export function loadModels() {
|
||||
return {
|
||||
|
@ -4,6 +4,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
export const EMPTY_STORE = 'contentManager/App/EMPTY_STORE';
|
||||
export const LOAD_MODELS = 'contentManager/App/LOAD_MODELS';
|
||||
export const LOADED_MODELS = 'contentManager/App/LOADED_MODELS';
|
||||
export const UPDATE_SCHEMA = 'contentManager/App/UPDATE_SCHEMA';
|
||||
|
@ -19,7 +19,7 @@ import Home from 'containers/Home';
|
||||
import Edit from 'containers/Edit';
|
||||
import List from 'containers/List';
|
||||
|
||||
import { loadModels, updateSchema } from './actions';
|
||||
import { emptyStore, loadModels, updateSchema } from './actions';
|
||||
import { makeSelectLoading } from './selectors';
|
||||
|
||||
import saga from './sagas';
|
||||
@ -43,6 +43,10 @@ class App extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.props.emptyStore();
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.props.loading) {
|
||||
return <div />;
|
||||
@ -65,6 +69,7 @@ App.contextTypes = {
|
||||
};
|
||||
|
||||
App.propTypes = {
|
||||
emptyStore: PropTypes.func.isRequired,
|
||||
loading: PropTypes.bool.isRequired,
|
||||
loadModels: PropTypes.func.isRequired,
|
||||
updateSchema: PropTypes.func.isRequired,
|
||||
@ -73,6 +78,7 @@ App.propTypes = {
|
||||
export function mapDispatchToProps(dispatch) {
|
||||
return bindActionCreators(
|
||||
{
|
||||
emptyStore,
|
||||
loadModels,
|
||||
updateSchema,
|
||||
},
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
import { fromJS, List } from 'immutable';
|
||||
|
||||
import { LOAD_MODELS, LOADED_MODELS, UPDATE_SCHEMA } from './constants';
|
||||
import { EMPTY_STORE, LOAD_MODELS, LOADED_MODELS, UPDATE_SCHEMA } from './constants';
|
||||
|
||||
const initialState = fromJS({
|
||||
loading: true,
|
||||
@ -17,6 +17,12 @@ const initialState = fromJS({
|
||||
|
||||
function appReducer(state = initialState, action) {
|
||||
switch (action.type) {
|
||||
case EMPTY_STORE:
|
||||
return state
|
||||
.set('loading', true)
|
||||
.set('models', false)
|
||||
.set('schema', false)
|
||||
.set('formValidations', List());
|
||||
case LOAD_MODELS:
|
||||
return state;
|
||||
case LOADED_MODELS:
|
||||
|
Loading…
x
Reference in New Issue
Block a user