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