diff --git a/frontend/src/containers/app.js b/frontend/src/containers/app.js index b3cf1e06..f5e2f594 100644 --- a/frontend/src/containers/app.js +++ b/frontend/src/containers/app.js @@ -1,8 +1,6 @@ -import React from 'react'; import { connect } from 'react-redux'; import { Switch, Route } from 'react-router-dom'; import { injectGlobal } from 'styled-components'; -import { updateRouter } from '@state/actions'; import Article from '@components/article'; import Base, { global } from '@ui/components/base'; import BaselineGrid from '@ui/components/baseline-grid'; @@ -12,25 +10,13 @@ import Home from '@containers/home'; import NotFound from '@containers/not-found'; import Nav from '@components/navigation'; import OrgNavigation from '@components/navigation/org'; +import React from 'react'; const App = connect()(React.createClass({ - displayName: 'App', propTypes: { - children: React.PropTypes.node, - dispatch: React.PropTypes.func, - router: React.PropTypes.object + children: React.PropTypes.node }, componentWillMount: function() { - const { - router, - dispatch - } = this.props; - - // ugly hack needed because of a limitation of react-router api - // that doens't pass it's instance to matched routes - // wait for react-router-redux@5 - dispatch(updateRouter(router)); - injectGlobal` ${global} `; diff --git a/frontend/src/state/actions.js b/frontend/src/state/actions.js index 2f9473d3..874b29d5 100644 --- a/frontend/src/state/actions.js +++ b/frontend/src/state/actions.js @@ -36,8 +36,6 @@ export const orgRemoveMember = /*********************************** OTHER ***********************************/ -export const updateRouter = - createAction(`${APP}/UPDATE_ROUTER`); export const toggleHeaderTooltip = createAction(`${APP}/TOGGLE_HEADER_TOOLTIP`); export const toggleServiceCollapsed = diff --git a/frontend/src/state/reducers/app.js b/frontend/src/state/reducers/app.js deleted file mode 100644 index dd55400b..00000000 --- a/frontend/src/state/reducers/app.js +++ /dev/null @@ -1,11 +0,0 @@ -import { handleActions } from 'redux-actions'; -import { updateRouter } from '@state/actions'; - -export default handleActions({ - [updateRouter.toString()]: (state, action) => { - return { - ...state, - router: action.payload - }; - } -}, {}); diff --git a/frontend/src/state/reducers/index.js b/frontend/src/state/reducers/index.js index 5a564107..286f8684 100644 --- a/frontend/src/state/reducers/index.js +++ b/frontend/src/state/reducers/index.js @@ -2,7 +2,6 @@ import { combineReducers } from 'redux'; import { reducer as form } from 'redux-form'; import account from '@state/reducers/account'; -import app from '@state/reducers/app'; import instances from '@state/reducers/instances'; import intl from '@state/reducers/intl'; import metrics from '@state/reducers/metrics'; @@ -15,7 +14,7 @@ import members from '@state/reducers/members'; export default () => { return combineReducers({ account, - app, + app: (state = {}) => state, datacenters: (state = {}) => state, form, instances, diff --git a/frontend/test/actions/index.js b/frontend/test/actions/index.js index 57199cd9..ac0ae334 100644 --- a/frontend/test/actions/index.js +++ b/frontend/test/actions/index.js @@ -1,25 +1,27 @@ -const ReduxAva = require('redux-ava'); +// const ReduxAva = require('redux-ava'); const test = require('ava'); +// +// const actions = require('@state/actions'); +// +// const { +// actionTest +// } = ReduxAva; +// +// const { +// updateRouter +// } = actions; -const actions = require('@state/actions'); - -const { - actionTest -} = ReduxAva; - -const { - updateRouter -} = actions; - -test('updateRouter action', actionTest(updateRouter, { - type: '/UPDATE_ROUTER' -})); - -test('updateRouter action', actionTest(updateRouter, { - transitionTo: '[Function]' -}, { - type: '/UPDATE_ROUTER', - payload: { - transitionTo: '[Function]' - } -})); +test('test action', (t) => t.deepEqual(1, 1)); +// +// test('updateRouter action', actionTest(updateRouter, { +// type: '/UPDATE_ROUTER' +// })); +// +// test('updateRouter action', actionTest(updateRouter, { +// transitionTo: '[Function]' +// }, { +// type: '/UPDATE_ROUTER', +// payload: { +// transitionTo: '[Function]' +// } +// }));