mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
fix cancel add/create toggle
This commit is contained in:
parent
c867d602e8
commit
e39e319ed4
@ -1,4 +1,6 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
import { hashHistory } from 'react-router';
|
||||||
|
|
||||||
|
|
||||||
import { createFeatureToggles } from '../../store/feature-actions';
|
import { createFeatureToggles } from '../../store/feature-actions';
|
||||||
import AddComponent from './add-component';
|
import AddComponent from './add-component';
|
||||||
@ -17,9 +19,9 @@ const prepare = (methods, dispatch) => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
methods.onCancel = () => {
|
methods.onCancel = (evt) => {
|
||||||
debugger;
|
evt.preventDefault();
|
||||||
window.history.back();
|
hashHistory.push('/features');
|
||||||
};
|
};
|
||||||
|
|
||||||
methods.addStrategy = (v) => {
|
methods.addStrategy = (v) => {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
import { hashHistory } from 'react-router';
|
||||||
|
|
||||||
import { requestUpdateFeatureToggle } from '../../store/feature-actions';
|
import { requestUpdateFeatureToggle } from '../../store/feature-actions';
|
||||||
import AddComponent from './add-component';
|
import AddComponent from './add-component';
|
||||||
@ -39,8 +40,9 @@ const prepare = (methods, dispatch) => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
methods.onCancel = () => {
|
methods.onCancel = (evt) => {
|
||||||
window.history.back();
|
evt.preventDefault();
|
||||||
|
hashHistory.push('/features');
|
||||||
};
|
};
|
||||||
|
|
||||||
methods.addStrategy = (v) => {
|
methods.addStrategy = (v) => {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import { Router, Route, IndexRedirect, useRouterHistory } from 'react-router';
|
import { Router, Route, IndexRedirect, hashHistory } from 'react-router';
|
||||||
import { createHashHistory } from 'history';
|
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import thunkMiddleware from 'redux-thunk';
|
import thunkMiddleware from 'redux-thunk';
|
||||||
import { createStore, applyMiddleware } from 'redux';
|
import { createStore, applyMiddleware } from 'redux';
|
||||||
@ -17,8 +16,6 @@ import CreateStrategies from './page/strategies/create';
|
|||||||
import HistoryPage from './page/history';
|
import HistoryPage from './page/history';
|
||||||
import Archive from './page/archive';
|
import Archive from './page/archive';
|
||||||
|
|
||||||
const appHistory = useRouterHistory(createHashHistory)({ queryKey: false });
|
|
||||||
|
|
||||||
const unleashStore = createStore(
|
const unleashStore = createStore(
|
||||||
store,
|
store,
|
||||||
applyMiddleware(
|
applyMiddleware(
|
||||||
@ -28,7 +25,7 @@ const unleashStore = createStore(
|
|||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<Provider store={unleashStore}>
|
<Provider store={unleashStore}>
|
||||||
<Router history={appHistory}>
|
<Router history={hashHistory}>
|
||||||
<Route path="/" component={App}>
|
<Route path="/" component={App}>
|
||||||
<IndexRedirect to="/features" />
|
<IndexRedirect to="/features" />
|
||||||
<Route path="/features" component={Features} />
|
<Route path="/features" component={Features} />
|
||||||
|
Loading…
Reference in New Issue
Block a user