1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

added createdAt

This commit is contained in:
ivaosthu 2016-11-05 13:01:17 +01:00 committed by Ivar Conradi Østhus
parent eca27ef91e
commit dc5e459d3a
2 changed files with 5 additions and 2 deletions

View File

@ -3,7 +3,7 @@
const eventType = require('../event-type');
const logger = require('../logger');
const NotFoundError = require('../error/notfound-error');
const FEATURE_COLUMNS = ['name', 'description', 'enabled', 'strategies'];
const FEATURE_COLUMNS = ['name', 'description', 'enabled', 'strategies', 'created_at'];
class FeatureToggleStore {
constructor (db, eventStore) {
@ -49,6 +49,7 @@ class FeatureToggleStore {
description: row.description,
enabled: row.enabled > 0,
strategies: row.strategies,
createdAt: row.created_at,
};
}

View File

@ -9,10 +9,12 @@ import Chip from 'react-toolbox/lib/chip';
import style from './feature.scss';
const Feature = ({ feature, onFeatureClick, onFeatureRemove, metrics = { yes: 0, no: 0, hasData: false } }) => {
const { name, description, enabled, strategies } = feature;
const { name, description, enabled, strategies, createdAt } = feature;
const created = new Date(createdAt);
const actions = [
<div key="strategies">{strategies && strategies.map((s, i) => <Chip key={i}><small>{s.name}</small></Chip>)}</div>,
<div key="created"><small>({created.toLocaleDateString('nb-NO')})</small></div>,
<Link key="change" to={`/features/edit/${name}`} title={`Edit ${name}`}>
<FontIcon value="edit" className={style.action} />
</Link>,