From 1b41fe8d933eb015c26600bfec9f39b78fdea8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maren=20S=C3=BCwer?= Date: Wed, 28 Nov 2018 09:28:45 +0100 Subject: [PATCH] only show history if link is present --- .../src/repos/sources/containers/Content.js | 40 ++++++++++--------- .../repos/sources/containers/HistoryView.js | 1 - 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/scm-ui/src/repos/sources/containers/Content.js b/scm-ui/src/repos/sources/containers/Content.js index ed62e67609..97283a9145 100644 --- a/scm-ui/src/repos/sources/containers/Content.js +++ b/scm-ui/src/repos/sources/containers/Content.js @@ -68,6 +68,16 @@ class Content extends React.Component { const { showHistory, collapsed } = this.state; const icon = collapsed ? "fa-angle-right" : "fa-angle-down"; + const selector = file._links.history ? ( + + this.setShowHistoryState(changeShowHistory) + } + /> + ) : null; + return (
@@ -81,14 +91,7 @@ class Content extends React.Component { /> {file.name} -
- - this.setShowHistoryState(changeShowHistory) - } - /> -
+
{selector}
); @@ -149,16 +152,17 @@ class Content extends React.Component { const { showHistory } = this.state; const header = this.showHeader(); - const content = showHistory ? ( - - ) : ( - - ); + const content = + showHistory && file._links.history ? ( + + ) : ( + + ); const moreInformation = this.showMoreInformation(); return ( diff --git a/scm-ui/src/repos/sources/containers/HistoryView.js b/scm-ui/src/repos/sources/containers/HistoryView.js index 77806d38b2..7a5e971ed5 100644 --- a/scm-ui/src/repos/sources/containers/HistoryView.js +++ b/scm-ui/src/repos/sources/containers/HistoryView.js @@ -87,7 +87,6 @@ class HistoryView extends React.Component { } render() { - console.log(this.state); const { file } = this.props; const { loaded, error } = this.state;