diff --git a/frontend/src/component/client-instance/__tests__/__snapshots__/client-instance-component-test.jsx.snap b/frontend/src/component/client-instance/__tests__/__snapshots__/client-instance-component-test.jsx.snap deleted file mode 100644 index cf49f46f90..0000000000 --- a/frontend/src/component/client-instance/__tests__/__snapshots__/client-instance-component-test.jsx.snap +++ /dev/null @@ -1,39 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renders correctly with no clientInstances 1`] = ` - - - Instance ID - - - Application name - - - IP - - - Created - - - Last Seen - - -`; diff --git a/frontend/src/component/client-instance/__tests__/client-instance-component-test.jsx b/frontend/src/component/client-instance/__tests__/client-instance-component-test.jsx deleted file mode 100644 index 0bb3801d94..0000000000 --- a/frontend/src/component/client-instance/__tests__/client-instance-component-test.jsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; - -import ClientStrategies from '../client-instance-component'; -import renderer from 'react-test-renderer'; - -jest.mock('react-mdl'); - -test('renders correctly with no clientInstances', () => { - const tree = renderer.create().toJSON(); - - expect(tree).toMatchSnapshot(); -}); diff --git a/frontend/src/component/client-instance/client-instance-component.js b/frontend/src/component/client-instance/client-instance-component.js deleted file mode 100644 index 39f143fc31..0000000000 --- a/frontend/src/component/client-instance/client-instance-component.js +++ /dev/null @@ -1,30 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { DataTable, TableHeader } from 'react-mdl'; - -class ClientStrategies extends Component { - static propTypes = { - fetchClientInstances: PropTypes.func.isRequired, - clientInstances: PropTypes.array.isRequired, - }; - - componentDidMount() { - this.props.fetchClientInstances(); - } - - render() { - const source = this.props.clientInstances; - - return ( - - Instance ID - Application name - IP - Created - Last Seen - - ); - } -} - -export default ClientStrategies; diff --git a/frontend/src/component/client-instance/client-instance-container.js b/frontend/src/component/client-instance/client-instance-container.js deleted file mode 100644 index f150c6d948..0000000000 --- a/frontend/src/component/client-instance/client-instance-container.js +++ /dev/null @@ -1,9 +0,0 @@ -import { connect } from 'react-redux'; -import ClientInstances from './client-instance-component'; -import { fetchClientInstances } from '../../store/client-instance-actions'; - -const mapStateToProps = state => ({ clientInstances: state.clientInstances.toJS() }); - -const StrategiesContainer = connect(mapStateToProps, { fetchClientInstances })(ClientInstances); - -export default StrategiesContainer; diff --git a/frontend/src/data/client-instance-api.js b/frontend/src/data/client-instance-api.js deleted file mode 100644 index 9cd45fea1d..0000000000 --- a/frontend/src/data/client-instance-api.js +++ /dev/null @@ -1,13 +0,0 @@ -import { throwIfNotSuccess, headers } from './helper'; - -const URI = 'api/admin/metrics/instances'; - -function fetchAll() { - return fetch(URI, { headers, credentials: 'include' }) - .then(throwIfNotSuccess) - .then(response => response.json()); -} - -export default { - fetchAll, -}; diff --git a/frontend/src/store/client-instance-actions.js b/frontend/src/store/client-instance-actions.js deleted file mode 100644 index de39b88903..0000000000 --- a/frontend/src/store/client-instance-actions.js +++ /dev/null @@ -1,22 +0,0 @@ -import api from '../data/client-instance-api'; - -export const RECEIVE_CLIENT_INSTANCES = 'RECEIVE_CLIENT_INSTANCES'; -export const ERROR_RECEIVE_CLIENT_INSTANCES = 'ERROR_RECEIVE_CLIENT_INSTANCES'; - -const receiveClientInstances = json => ({ - type: RECEIVE_CLIENT_INSTANCES, - value: json, -}); - -const errorReceiveClientInstances = statusCode => ({ - type: RECEIVE_CLIENT_INSTANCES, - statusCode, -}); - -export function fetchClientInstances() { - return dispatch => - api - .fetchAll() - .then(json => dispatch(receiveClientInstances(json))) - .catch(error => dispatch(errorReceiveClientInstances(error))); -} diff --git a/frontend/src/store/client-instance-store.js b/frontend/src/store/client-instance-store.js deleted file mode 100644 index 8f5c175952..0000000000 --- a/frontend/src/store/client-instance-store.js +++ /dev/null @@ -1,21 +0,0 @@ -import { fromJS } from 'immutable'; -import { RECEIVE_CLIENT_INSTANCES } from './client-instance-actions'; -import { USER_LOGOUT, USER_LOGIN } from './user/actions'; - -function getInitState() { - return fromJS([]); -} - -const store = (state = getInitState(), action) => { - switch (action.type) { - case RECEIVE_CLIENT_INSTANCES: - return fromJS(action.value); - case USER_LOGOUT: - case USER_LOGIN: - return getInitState(); - default: - return state; - } -}; - -export default store; diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 5b8694899e..d93d5629ae 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -6,7 +6,6 @@ import strategies from './strategy'; import history from './history-store'; // eslint-disable-line import archive from './archive'; import error from './error-store'; -import clientInstances from './client-instance-store'; import settings from './settings'; import user from './user'; import applications from './application'; @@ -22,7 +21,6 @@ const unleashStore = combineReducers({ history, archive, error, - clientInstances, settings, user, applications,