1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00

Link to strategy from applications page

This commit is contained in:
ivaosthu 2016-12-05 16:01:09 +01:00
parent 23bf4cb1fb
commit ef969ffff4
3 changed files with 21 additions and 7 deletions

View File

@ -1,9 +1,9 @@
import React, { Component } from 'react';
import React, { PureComponent } from 'react';
import { Link } from 'react-router';
import { Grid, Cell } from 'react-mdl';
class ClientStrategies extends Component {
class ClientStrategies extends PureComponent {
componentDidMount () {
this.props.fetchApplication(this.props.appName);
@ -23,7 +23,6 @@ class ClientStrategies extends Component {
return (
<div>
<h5>{appName}</h5>
<Grid>
<Cell col={4}>
<h6>Instances</h6>
@ -32,9 +31,15 @@ class ClientStrategies extends Component {
</ol>
</Cell>
<Cell col={4}>
<h6>Strategies</h6>
<h6>Implemented strategies</h6>
<ol className="demo-list-item mdl-list">
{/*strategies.map((name, i) => <li className="mdl-list__item" key={i}>{name}</li>)*/}
{strategies.map((name, i) => (
<li className="mdl-list__item" key={`${name}-${i}`}>
<Link to={`/strategies/view/${name}`}>
{name}
</Link>
</li>
))}
</ol>
</Cell>
<Cell col={4}>

View File

@ -13,6 +13,7 @@ import Features from './page/features';
import CreateFeatureToggle from './page/features/create';
import EditFeatureToggle from './page/features/edit';
import Strategies from './page/strategies';
import StrategyView from './page/strategies/show';
import CreateStrategies from './page/strategies/create';
import HistoryPage from './page/history';
import HistoryTogglePage from './page/history/toggle';
@ -38,6 +39,7 @@ ReactDOM.render(
<Route pageTitle="Features" path="/features/edit/:name" component={EditFeatureToggle} />
<Route pageTitle="Strategies" path="/strategies" component={Strategies} />
<Route pageTitle="Strategies" path="/strategies/create" component={CreateStrategies} />
<Route pageTitle="Strategies" path="/strategies/view/:strategyName" component={StrategyView} />
<Route pageTitle="History" path="/history" component={HistoryPage} />
<Route pageTitle="History" path="/history/:toggleName" component={HistoryTogglePage} />
<Route pageTitle="Archive" path="/archive" component={Archive} />

View File

@ -0,0 +1,7 @@
import React from 'react';
const render = ({ params }) => (
<div>Show details of strategy: {params.strategyName} (applications implementing it, toggles using it etc)!</div>
);
export default render;