diff --git a/frontend/src/component/history/history-item-diff.jsx b/frontend/src/component/history/history-item-diff.jsx index 2471dc8367..73198f683e 100644 --- a/frontend/src/component/history/history-item-diff.jsx +++ b/frontend/src/component/history/history-item-diff.jsx @@ -17,16 +17,6 @@ const KLASSES = { N: style.positive, // added }; -export function getIcon (type) { - switch (type) { - case 'feature-updated': return 'autorenew'; - case 'feature-created': return 'add'; - case 'feature-deleted': return 'remove'; - case 'feature-archived': return 'archived'; - default: return 'star'; - } -} - function buildItemDiff (diff, key) { let change; if (diff.lhs !== undefined) { @@ -77,52 +67,20 @@ class HistoryItem extends PureComponent { }; } - renderEventDiff (logEntry) { + render () { + const entry = this.props.entry; let changes; - if (logEntry.diffs) { - changes = logEntry.diffs.map(buildDiff); + if (entry.diffs) { + changes = entry.diffs.map(buildDiff); } else { // Just show the data if there is no diff yet. - changes =
{changes.length === 0 ? '(no changes)' : changes}
;
- }
-
- render () {
- const {
- createdBy,
- id,
- type,
- } = this.props.entry;
-
- const createdAt = (new Date(this.props.entry.createdAt)).toLocaleString('nb-NO');
- const icon = getIcon(type);
-
- const data = this.renderEventDiff(this.props.entry);
-
- return data;
-
- return (
-
+ {changes.length === 0 ? '(no changes)' : changes}
+
);
}
}
diff --git a/frontend/src/component/history/history-list-component.jsx b/frontend/src/component/history/history-list-component.jsx
index 565aed7181..f3cd3c93cc 100644
--- a/frontend/src/component/history/history-list-component.jsx
+++ b/frontend/src/component/history/history-list-component.jsx
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import HistoryItemDiff from './history-item-diff';
import HistoryItemJson from './history-item-json';
-import { Switch, Table, TableHeader, Grid, Cell } from 'react-mdl';
+import { Table, TableHeader, Icon } from 'react-mdl';
import { HeaderTitle, SwitchWithLabel } from '../common';
import style from './history.scss';
@@ -36,7 +36,7 @@ class HistoryList extends Component {