1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/frontend/src/component/application/application-edit-component.js

63 lines
2.1 KiB
JavaScript
Raw Normal View History

import React, { PureComponent } from 'react';
2016-12-05 15:15:01 +01:00
import { Link } from 'react-router';
import { Grid, Cell } from 'react-mdl';
class ClientStrategies extends PureComponent {
2016-12-05 15:15:01 +01:00
componentDidMount () {
this.props.fetchApplication(this.props.appName);
}
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 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}>
<h6>Implemented strategies</h6>
2016-12-05 15:15:01 +01:00
<ol className="demo-list-item mdl-list">
{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;