mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 13:35:44 +01:00
only show history if link is present
This commit is contained in:
@@ -68,6 +68,16 @@ class Content extends React.Component<Props, State> {
|
||||
const { showHistory, collapsed } = this.state;
|
||||
const icon = collapsed ? "fa-angle-right" : "fa-angle-down";
|
||||
|
||||
const selector = file._links.history ? (
|
||||
<ButtonGroup
|
||||
file={file}
|
||||
historyIsSelected={showHistory}
|
||||
showHistory={(changeShowHistory: boolean) =>
|
||||
this.setShowHistoryState(changeShowHistory)
|
||||
}
|
||||
/>
|
||||
) : null;
|
||||
|
||||
return (
|
||||
<span className={classes.pointer}>
|
||||
<article className="media">
|
||||
@@ -81,14 +91,7 @@ class Content extends React.Component<Props, State> {
|
||||
/>
|
||||
<span>{file.name}</span>
|
||||
</div>
|
||||
<div className="media-right">
|
||||
<ButtonGroup
|
||||
historyIsSelected={showHistory}
|
||||
showHistory={(changeShowHistory: boolean) =>
|
||||
this.setShowHistoryState(changeShowHistory)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div className="media-right">{selector}</div>
|
||||
</article>
|
||||
</span>
|
||||
);
|
||||
@@ -149,7 +152,8 @@ class Content extends React.Component<Props, State> {
|
||||
const { showHistory } = this.state;
|
||||
|
||||
const header = this.showHeader();
|
||||
const content = showHistory ? (
|
||||
const content =
|
||||
showHistory && file._links.history ? (
|
||||
<HistoryView file={file} repository={repository} />
|
||||
) : (
|
||||
<SourcesView
|
||||
|
||||
@@ -87,7 +87,6 @@ class HistoryView extends React.Component<Props, State> {
|
||||
}
|
||||
|
||||
render() {
|
||||
console.log(this.state);
|
||||
const { file } = this.props;
|
||||
const { loaded, error } = this.state;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user