From dc5e459d3a3bf6b326d4a3d2fe0f3139ee9d8918 Mon Sep 17 00:00:00 2001 From: ivaosthu Date: Sat, 5 Nov 2016 13:01:17 +0100 Subject: [PATCH] added createdAt --- packages/unleash-api/lib/db/feature-toggle-store.js | 3 ++- .../src/component/feature/feature-component.jsx | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/unleash-api/lib/db/feature-toggle-store.js b/packages/unleash-api/lib/db/feature-toggle-store.js index 69e8826362..759febc83e 100644 --- a/packages/unleash-api/lib/db/feature-toggle-store.js +++ b/packages/unleash-api/lib/db/feature-toggle-store.js @@ -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, }; } diff --git a/packages/unleash-frontend-next/src/component/feature/feature-component.jsx b/packages/unleash-frontend-next/src/component/feature/feature-component.jsx index 8843d9b059..c7b0a8c756 100644 --- a/packages/unleash-frontend-next/src/component/feature/feature-component.jsx +++ b/packages/unleash-frontend-next/src/component/feature/feature-component.jsx @@ -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 = [
{strategies && strategies.map((s, i) => {s.name})}
, +
({created.toLocaleDateString('nb-NO')})
, ,