1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 23:48:47 +00:00

Refactor draft (#3018)

* refactor draft

* update
This commit is contained in:
陈钦亮
2019-03-01 16:49:35 +08:00
committed by Daniel Pan
parent b25c2752a7
commit 6137e720f0
47 changed files with 497 additions and 2942 deletions

View File

@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import ModalPortal from './modal-portal';
import ListTaggedFilesDialog from './dialog/list-taggedfiles-dialog';
import ListRepoDraftsDialog from './dialog/list-repo-drafts-dialog';
import ListRepoReviewsDialog from './dialog/list-repo-reviews-dialog';
import ReadmeDialog from './dialog/readme-dialog';
import { siteRoot, gettext } from '../utils/constants';
import { Utils } from '../utils/utils';
@@ -16,7 +15,6 @@ const propTypes = {
usedRepoTags: PropTypes.array.isRequired,
readmeMarkdown: PropTypes.object,
draftCounts: PropTypes.number,
reviewCounts: PropTypes.number,
updateUsedRepoTags: PropTypes.func.isRequired,
};
@@ -28,7 +26,6 @@ class RepoInfoBar extends React.Component {
currentTag: null,
isListTaggedFileShow: false,
showRepoDrafts: false,
showRepoReviews: false,
showReadmeDialog: false,
};
}
@@ -52,12 +49,6 @@ class RepoInfoBar extends React.Component {
});
}
toggleReviews = () => {
this.setState({
showRepoReviews: !this.state.showRepoReviews
});
}
toggleReadme = () => {
this.setState({
showReadmeDialog: !this.state.showReadmeDialog
@@ -107,15 +98,6 @@ class RepoInfoBar extends React.Component {
</span>
</span>
}
{this.props.reviewCounts > 0 &&
<span className="file-info">
<span className="info-icon sf2-icon-review"></span>
<span className="used-tag-name">{gettext('review')}</span>
<span className="used-tag-files" onClick={this.toggleReviews}>
{this.props.reviewCounts > 1 ? this.props.reviewCounts + ' files' : this.props.reviewCounts + ' file'}
</span>
</span>
}
</div>
{this.state.isListTaggedFileShow && (
<ModalPortal>
@@ -138,15 +120,6 @@ class RepoInfoBar extends React.Component {
</ModalPortal>
)}
{this.state.showRepoReviews && (
<ModalPortal>
<ListRepoReviewsDialog
toggle={this.toggleReviews}
repoID={this.props.repoID}
/>
</ModalPortal>
)}
{this.state.showReadmeDialog && (
<ModalPortal>
<ReadmeDialog