1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/public/js/components/feature/ArchiveFeatureComponent.jsx

46 lines
1.3 KiB
React
Raw Normal View History

var React = require("react");
var FeatureActions = require('../../stores/FeatureToggleActions');
2014-12-17 21:56:27 +01:00
var ArchiveFeatureComponent = React.createClass({
2015-03-17 20:29:03 +01:00
onRevive: function(item) {
FeatureActions.revive.triggerPromise(item);
},
2014-12-17 21:56:27 +01:00
2015-03-17 20:29:03 +01:00
render: function () {
return (
<div>
<h1>Archived feature toggles</h1>
<table className="outerborder man">
<thead>
<tr>
<th>Name</th>
<th></th>
</tr>
</thead>
<tbody>
{this.props.archivedFeatures.map(this.renderArchivedItem)}
2015-03-17 20:29:03 +01:00
</tbody>
</table>
</div>
);
},
2014-12-17 21:56:27 +01:00
2015-03-17 20:29:03 +01:00
renderArchivedItem: function(f) {
return (
<tr key={f.name}>
<td>
{f.name}<br />
<span className="opaque smalltext word-break">{f.description}</span>
</td>
<td className="rightify" width="150">
<button onClick={this.onRevive.bind(this, f)} title="Revive feature toggle">
<span className="icon-svar"></span>
</button>
</td>
</tr>);
}
2014-12-17 21:56:27 +01:00
});
module.exports = ArchiveFeatureComponent;