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

update draft (#2491)

This commit is contained in:
C_Q
2018-11-01 17:52:59 +08:00
committed by Daniel Pan
parent 41bc505562
commit 4cc735cf1f
11 changed files with 104 additions and 19 deletions

View File

@@ -12,7 +12,6 @@ class DraftContent extends React.Component {
constructor(props) {
super(props);
this.state = {
draftList: [],
isLoadingDraft: true,
isMenuShow: false,
menuPosition: {top:'', left: ''},
@@ -32,11 +31,9 @@ class DraftContent extends React.Component {
initDraftList() {
this.setState({isLoadingDraft: true});
editUtilties.listDrafts().then(res => {
this.setState({
draftList: res.data.data,
isLoadingDraft: false,
});
this.props.getDrafts();
this.setState({
isLoadingDraft: false,
});
}
@@ -113,14 +110,14 @@ class DraftContent extends React.Component {
return (
<div className="cur-view-content">
{this.state.isLoadingDraft && <Loading /> }
{(!this.state.isLoadingDraft && this.state.draftList.length !==0) &&
{(!this.state.isLoadingDraft && this.props.draftList.length !==0) &&
<DraftListView
draftList={this.state.draftList}
draftList={this.props.draftList}
isItemFreezed={this.state.isItemFreezed}
onMenuToggleClick={this.onMenuToggleClick}
/>
}
{(!this.state.isLoadingDraft && this.state.draftList.length === 0) &&
{(!this.state.isLoadingDraft && this.props.draftList.length === 0) &&
<div className="message empty-tip">
<h2>{gettext('No draft yet')}</h2>
<p>{gettext('Draft is a way to let you collaborate with others on files. You can create a draft from a file, edit the draft and then ask for a review. The original file will be updated only after the draft be reviewed.')}</p>