mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
added createdAt
This commit is contained in:
parent
1a7fe9f6c6
commit
02e10817aa
@ -3,7 +3,7 @@
|
|||||||
const eventType = require('../event-type');
|
const eventType = require('../event-type');
|
||||||
const logger = require('../logger');
|
const logger = require('../logger');
|
||||||
const NotFoundError = require('../error/notfound-error');
|
const NotFoundError = require('../error/notfound-error');
|
||||||
const FEATURE_COLUMNS = ['name', 'description', 'enabled', 'strategies'];
|
const FEATURE_COLUMNS = ['name', 'description', 'enabled', 'strategies', 'created_at'];
|
||||||
|
|
||||||
class FeatureToggleStore {
|
class FeatureToggleStore {
|
||||||
constructor (db, eventStore) {
|
constructor (db, eventStore) {
|
||||||
@ -49,6 +49,7 @@ class FeatureToggleStore {
|
|||||||
description: row.description,
|
description: row.description,
|
||||||
enabled: row.enabled > 0,
|
enabled: row.enabled > 0,
|
||||||
strategies: row.strategies,
|
strategies: row.strategies,
|
||||||
|
createdAt: row.created_at,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,10 +9,12 @@ import Chip from 'react-toolbox/lib/chip';
|
|||||||
import style from './feature.scss';
|
import style from './feature.scss';
|
||||||
|
|
||||||
const Feature = ({ feature, onFeatureClick, onFeatureRemove, metrics = { yes: 0, no: 0, hasData: false } }) => {
|
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 = [
|
const actions = [
|
||||||
<div key="strategies">{strategies && strategies.map((s, i) => <Chip key={i}><small>{s.name}</small></Chip>)}</div>,
|
<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}`}>
|
<Link key="change" to={`/features/edit/${name}`} title={`Edit ${name}`}>
|
||||||
<FontIcon value="edit" className={style.action} />
|
<FontIcon value="edit" className={style.action} />
|
||||||
</Link>,
|
</Link>,
|
||||||
|
Loading…
Reference in New Issue
Block a user