From 509b3a6186cbae369ef9d97b8944560f4549c2de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Sat, 29 Feb 2020 10:30:13 +0100 Subject: [PATCH] fix: clean up history view a bit --- .../history/history-list-component.jsx | 58 ++++++++++--------- frontend/src/component/history/history.scss | 11 ++-- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/frontend/src/component/history/history-list-component.jsx b/frontend/src/component/history/history-list-component.jsx index 15e7c4d7a2..52ceb8c24f 100644 --- a/frontend/src/component/history/history-list-component.jsx +++ b/frontend/src/component/history/history-list-component.jsx @@ -8,6 +8,27 @@ import { formatFullDateTimeWithLocale } from '../common/util'; import styles from './history.scss'; +const HistoryMeta = ({ entry, timeFormatted }) => ( +
+
+
Changed at:
+
{timeFormatted}
+
Changed by:
+
{entry.createdBy}
+
Type:
+
{entry.type}
+
Name:
+
{entry.data.name}
+
+ Change + +
+); +HistoryMeta.propTypes = { + entry: PropTypes.object.isRequired, + timeFormatted: PropTypes.string.isRequired, +}; + class HistoryList extends Component { static propTypes = { title: PropTypes.string, @@ -26,7 +47,7 @@ class HistoryList extends Component { } render() { const showData = this.props.settings.showData; - const { history, hideName } = this.props; + const { history } = this.props; if (!history || history.length < 0) { return null; } @@ -35,7 +56,6 @@ class HistoryList extends Component { {v} @@ -48,40 +68,24 @@ class HistoryList extends Component { } else { entries = ( Object.assign( { - diff: , - name: entry.data.name, + meta: ( + + ), }, entry ) )} className={commonStyles.fullwidth} - style={{ border: 0, tableLayout: 'fixed', minWidth: '840px' }} + style={{ border: 0, tableLayout: 'fixed' }} > - - Type - - - User - - {hideName ? ( - [] - ) : ( - - Feature Toggle - - )} - Diff - - Time + + Change
); diff --git a/frontend/src/component/history/history.scss b/frontend/src/component/history/history.scss index 3f2b77c57b..7c58c063c8 100644 --- a/frontend/src/component/history/history.scss +++ b/frontend/src/component/history/history.scss @@ -33,22 +33,25 @@ dl { - padding: 0.5em; + padding: 0em; } dt { float: left; clear: left; - width: 100px; font-weight: bold; } dd { - margin: 0 0 0 110px; + margin: 0 0 0 83px; padding: 0 0 0.5em 0; } } .history-item:nth-child(odd) { background-color: #efefef; -} \ No newline at end of file +} + +.history-item { + padding: 5px; +}