1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-13 05:39:59 +00:00

Show draft review info at repo info bar (#2832)

This commit is contained in:
C_Q
2019-01-18 14:50:42 +08:00
committed by Daniel Pan
parent f0e9c7a1b1
commit d1f55247ff
14 changed files with 450 additions and 30 deletions

View File

@@ -63,6 +63,8 @@ const propTypes = {
reviewID: PropTypes.any,
usedRepoTags: PropTypes.array.isRequired,
readmeMarkdown: PropTypes.object,
draftCounts: PropTypes.number,
reviewCounts: PropTypes.number,
};
class MainPanel extends Component {
@@ -160,6 +162,9 @@ class MainPanel extends Component {
render() {
const ErrMessage = (<div className="message empty-tip err-message"><h2>{gettext('Folder does not exist.')}</h2></div>);
const showRepoInfoBar = this.props.path === '/' && (
this.props.usedRepoTags.length != 0 || this.props.readmeMarkdown != null ||
this.props.draftCounts != 0 || this.props.reviewCounts != 0);
return (
<div className="main-panel wiki-main-panel o-hidden">
@@ -240,12 +245,14 @@ class MainPanel extends Component {
</Fragment>
</WikiMarkdownViewer> :
<Fragment>
{this.props.path === '/' && !(this.props.usedRepoTags.length === 0 && this.props.readmeMarkdown === null) && (
{showRepoInfoBar && (
<RepoInfoBar
repoID={repoID}
currentPath={this.props.path}
usedRepoTags={this.props.usedRepoTags}
readmeMarkdown={this.props.readmeMarkdown}
draftCounts={this.props.draftCounts}
reviewCounts={this.props.reviewCounts}
/>
)}
<DirentListView