2016-06-18 21:53:18 +02:00
|
|
|
'use strict';
|
2016-06-18 21:55:46 +02:00
|
|
|
const React = require('react');
|
2016-06-18 21:53:18 +02:00
|
|
|
const FeatureActions = require('../../stores/FeatureToggleActions');
|
2014-12-17 21:56:27 +01:00
|
|
|
|
2016-06-18 21:53:18 +02:00
|
|
|
const ArchiveFeatureComponent = React.createClass({
|
2014-12-17 21:56:27 +01:00
|
|
|
|
2016-06-18 21:53:18 +02:00
|
|
|
onRevive(item) {
|
2015-03-17 20:29:03 +01:00
|
|
|
FeatureActions.revive.triggerPromise(item);
|
|
|
|
},
|
2014-12-17 21:56:27 +01:00
|
|
|
|
2016-06-18 21:53:18 +02:00
|
|
|
render() {
|
2015-03-17 20:29:03 +01:00
|
|
|
return (
|
|
|
|
<div>
|
2015-03-28 09:51:31 +01:00
|
|
|
<h1>Archived Feature Toggles</h1>
|
|
|
|
<hr />
|
2015-03-17 20:29:03 +01:00
|
|
|
<table className="outerborder man">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2015-03-27 22:19:56 +01:00
|
|
|
{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
|
|
|
|
2016-06-18 21:53:18 +02:00
|
|
|
renderArchivedItem(f) {
|
2015-03-17 20:29:03 +01:00
|
|
|
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>);
|
2016-06-18 21:55:46 +02:00
|
|
|
},
|
2014-12-17 21:56:27 +01:00
|
|
|
});
|
|
|
|
|
2015-03-03 19:27:17 +01:00
|
|
|
module.exports = ArchiveFeatureComponent;
|