mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
Remove client-strategies
This commit is contained in:
parent
9bcb7bd0ad
commit
abc8c8cfd6
@ -118,10 +118,9 @@ export default class App extends Component {
|
|||||||
{createListItem('/strategies', 'Strategies')}
|
{createListItem('/strategies', 'Strategies')}
|
||||||
{createListItem('/history', 'Event history')}
|
{createListItem('/history', 'Event history')}
|
||||||
{createListItem('/archive', 'Archived toggles')}
|
{createListItem('/archive', 'Archived toggles')}
|
||||||
<hr />
|
|
||||||
{createListItem('/applications', 'Applications')}
|
{createListItem('/applications', 'Applications')}
|
||||||
{/*createListItem('/metrics', 'Client metrics')*/}
|
{/*createListItem('/metrics', 'Client metrics')*/}
|
||||||
{createListItem('/client-strategies', 'Client strategies')}
|
{/*createListItem('/client-strategies', 'Client strategies')*/}
|
||||||
{/*createListItem('/client-instances', 'Client instances')*/}
|
{/*createListItem('/client-instances', 'Client instances')*/}
|
||||||
</Navigation>
|
</Navigation>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
@ -146,7 +145,7 @@ export default class App extends Component {
|
|||||||
<FooterLinkList>
|
<FooterLinkList>
|
||||||
{createListItem('/applications', 'Applications')}
|
{createListItem('/applications', 'Applications')}
|
||||||
{/*createListItem('/metrics', 'Client metrics')*/}
|
{/*createListItem('/metrics', 'Client metrics')*/}
|
||||||
{createListItem('/client-strategies', 'Client strategies')}
|
{/*createListItem('/client-strategies', 'Client strategies')*/}
|
||||||
{/*createListItem('/client-instances', 'Client instances')*/}
|
{/*createListItem('/client-instances', 'Client instances')*/}
|
||||||
</FooterLinkList>
|
</FooterLinkList>
|
||||||
</FooterDropDownSection>
|
</FooterDropDownSection>
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
import React, { Component } from 'react';
|
|
||||||
import { DataTable, TableHeader } from 'react-mdl';
|
|
||||||
import { Link } from 'react-router';
|
|
||||||
|
|
||||||
class ClientStrategies extends Component {
|
|
||||||
|
|
||||||
componentDidMount () {
|
|
||||||
this.props.fetchClientStrategies();
|
|
||||||
}
|
|
||||||
|
|
||||||
render () {
|
|
||||||
const source = this.props.clientStrategies
|
|
||||||
// temp hack for ignoring dumb data
|
|
||||||
.filter(item => item.strategies)
|
|
||||||
.map(item => (
|
|
||||||
{
|
|
||||||
appName: <Link to={`/applications/${item.appName}`}>{item.appName}</Link>,
|
|
||||||
strategies: item.strategies && item.strategies.map(name => (<Link key={name} style={{ marginRight: '5px' }} to={`/strategies/${name}`}>{name}</Link>)),
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<DataTable
|
|
||||||
style={{ width: '100%' }}
|
|
||||||
rows={source}
|
|
||||||
selectable={false}
|
|
||||||
>
|
|
||||||
<TableHeader name="appName">Application name</TableHeader>
|
|
||||||
<TableHeader name="strategies">Strategies</TableHeader>
|
|
||||||
</DataTable>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export default ClientStrategies;
|
|
@ -1,9 +0,0 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
import ClientStrategies from './strategy-component';
|
|
||||||
import { fetchClientStrategies } from '../../store/client-strategy-actions';
|
|
||||||
|
|
||||||
const mapStateToProps = (state) => ({ clientStrategies: state.clientStrategies.toJS() });
|
|
||||||
|
|
||||||
const StrategiesContainer = connect(mapStateToProps, { fetchClientStrategies })(ClientStrategies);
|
|
||||||
|
|
||||||
export default StrategiesContainer;
|
|
@ -1,13 +0,0 @@
|
|||||||
import { throwIfNotSuccess, headers } from './helper';
|
|
||||||
|
|
||||||
const URI = '/api/client/strategies';
|
|
||||||
|
|
||||||
function fetchAll () {
|
|
||||||
return fetch(URI, { headers })
|
|
||||||
.then(throwIfNotSuccess)
|
|
||||||
.then(response => response.json());
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
fetchAll,
|
|
||||||
};
|
|
@ -20,7 +20,6 @@ import HistoryTogglePage from './page/history/toggle';
|
|||||||
import Archive from './page/archive';
|
import Archive from './page/archive';
|
||||||
import Applications from './page/applications';
|
import Applications from './page/applications';
|
||||||
import ApplicationView from './page/applications/view';
|
import ApplicationView from './page/applications/view';
|
||||||
import ClientStrategies from './page/client-strategies';
|
|
||||||
|
|
||||||
const unleashStore = createStore(
|
const unleashStore = createStore(
|
||||||
store,
|
store,
|
||||||
@ -60,7 +59,6 @@ ReactDOM.render(
|
|||||||
<Route pageTitle=":name" path="/applications/:name" component={ApplicationView} />
|
<Route pageTitle=":name" path="/applications/:name" component={ApplicationView} />
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
<Route pageTitle="Client strategies" path="/client-strategies" component={ClientStrategies} />
|
|
||||||
</Route>
|
</Route>
|
||||||
</Router>
|
</Router>
|
||||||
</Provider>, document.getElementById('app'));
|
</Provider>, document.getElementById('app'));
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import ClientStrategy from '../../component/client-strategy/strategy-container';
|
|
||||||
|
|
||||||
const render = () => (
|
|
||||||
<div>
|
|
||||||
<h5>Client Strategies</h5>
|
|
||||||
<ClientStrategy />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
export default render;
|
|
@ -1,20 +0,0 @@
|
|||||||
import api from '../data/client-strategy-api';
|
|
||||||
|
|
||||||
export const RECEIVE_CLIENT_STRATEGIES = 'RECEIVE_CLIENT_STRATEGIES';
|
|
||||||
export const ERROR_RECEIVE_CLIENT_STRATEGIES = 'ERROR_RECEIVE_CLIENT_STRATEGIES';
|
|
||||||
|
|
||||||
const receiveMetrics = (json) => ({
|
|
||||||
type: RECEIVE_CLIENT_STRATEGIES,
|
|
||||||
value: json,
|
|
||||||
});
|
|
||||||
|
|
||||||
const errorReceiveMetrics = (statusCode) => ({
|
|
||||||
type: RECEIVE_CLIENT_STRATEGIES,
|
|
||||||
statusCode,
|
|
||||||
});
|
|
||||||
|
|
||||||
export function fetchClientStrategies () {
|
|
||||||
return dispatch => api.fetchAll()
|
|
||||||
.then(json => dispatch(receiveMetrics(json)))
|
|
||||||
.catch(error => dispatch(errorReceiveMetrics(error)));
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
import { fromJS } from 'immutable';
|
|
||||||
import { RECEIVE_CLIENT_STRATEGIES } from './client-strategy-actions';
|
|
||||||
|
|
||||||
function getInitState () {
|
|
||||||
return fromJS([]);
|
|
||||||
}
|
|
||||||
|
|
||||||
const store = (state = getInitState(), action) => {
|
|
||||||
switch (action.type) {
|
|
||||||
case RECEIVE_CLIENT_STRATEGIES:
|
|
||||||
return fromJS(action.value);
|
|
||||||
default:
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default store;
|
|
@ -7,7 +7,6 @@ import history from './history-store'; // eslint-disable-line
|
|||||||
import archive from './archive-store';
|
import archive from './archive-store';
|
||||||
import error from './error-store';
|
import error from './error-store';
|
||||||
import metrics from './metrics-store';
|
import metrics from './metrics-store';
|
||||||
import clientStrategies from './client-strategy-store';
|
|
||||||
import clientInstances from './client-instance-store';
|
import clientInstances from './client-instance-store';
|
||||||
import settings from './settings';
|
import settings from './settings';
|
||||||
import user from './user';
|
import user from './user';
|
||||||
@ -22,7 +21,6 @@ const unleashStore = combineReducers({
|
|||||||
archive,
|
archive,
|
||||||
error,
|
error,
|
||||||
metrics,
|
metrics,
|
||||||
clientStrategies,
|
|
||||||
clientInstances,
|
clientInstances,
|
||||||
settings,
|
settings,
|
||||||
user,
|
user,
|
||||||
|
Loading…
Reference in New Issue
Block a user