2016-12-05 16:01:09 +01:00
|
|
|
import React, { PureComponent } from 'react';
|
2016-12-05 15:15:01 +01:00
|
|
|
|
|
|
|
import { Link } from 'react-router';
|
|
|
|
import { Grid, Cell } from 'react-mdl';
|
|
|
|
|
2016-12-05 16:01:09 +01:00
|
|
|
class ClientStrategies extends PureComponent {
|
2016-12-05 15:15:01 +01:00
|
|
|
|
|
|
|
componentDidMount () {
|
|
|
|
this.props.fetchApplication(this.props.appName);
|
|
|
|
}
|
|
|
|
|
2016-12-05 16:01:09 +01:00
|
|
|
render () {
|
2016-12-05 15:15:01 +01:00
|
|
|
if (!this.props.application) {
|
|
|
|
return <div>Loading application info...</div>;
|
|
|
|
}
|
|
|
|
const {
|
|
|
|
appName,
|
|
|
|
instances,
|
|
|
|
strategies,
|
|
|
|
seenToggles,
|
|
|
|
} = this.props.application;
|
2016-12-05 16:01:09 +01:00
|
|
|
|
2016-12-05 15:15:01 +01:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<h5>{appName}</h5>
|
|
|
|
<Grid>
|
|
|
|
<Cell col={4}>
|
|
|
|
<h6>Instances</h6>
|
|
|
|
<ol className="demo-list-item mdl-list">
|
|
|
|
{instances.map(({ instanceId }, i) => <li className="mdl-list__item" key={i}>{instanceId}</li>)}
|
|
|
|
</ol>
|
|
|
|
</Cell>
|
|
|
|
<Cell col={4}>
|
2016-12-05 16:01:09 +01:00
|
|
|
<h6>Implemented strategies</h6>
|
2016-12-05 15:15:01 +01:00
|
|
|
<ol className="demo-list-item mdl-list">
|
2016-12-05 16:01:09 +01:00
|
|
|
{strategies.map((name, i) => (
|
|
|
|
<li className="mdl-list__item" key={`${name}-${i}`}>
|
|
|
|
<Link to={`/strategies/view/${name}`}>
|
|
|
|
{name}
|
|
|
|
</Link>
|
|
|
|
</li>
|
|
|
|
))}
|
2016-12-05 15:15:01 +01:00
|
|
|
</ol>
|
|
|
|
</Cell>
|
|
|
|
<Cell col={4}>
|
|
|
|
<h6>Toggles</h6>
|
|
|
|
<ol className="demo-list-item mdl-list">
|
|
|
|
{seenToggles.map((name, i) => <li className="mdl-list__item" key={i}>
|
|
|
|
<Link to={`/features/edit/${name}`}>
|
|
|
|
{name}
|
|
|
|
</Link>
|
|
|
|
</li>)}
|
|
|
|
</ol>
|
|
|
|
</Cell>
|
|
|
|
</Grid>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export default ClientStrategies;
|