mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 23:20:51 +00:00
update draft (#2491)
This commit is contained in:
@@ -9,6 +9,7 @@ import DraftContent from './pages/drafts/draft-content';
|
||||
import ReviewContent from './pages/drafts/review-content';
|
||||
import FilesActivities from './pages/dashboard/files-activities';
|
||||
import Starred from './pages/starred/starred';
|
||||
import editUtilties from './utils/editor-utilties';
|
||||
|
||||
import 'seafile-ui';
|
||||
import './assets/css/fa-solid.css';
|
||||
@@ -25,9 +26,24 @@ class App extends Component {
|
||||
this.state = {
|
||||
isOpen: false,
|
||||
isSidePanelClosed: false,
|
||||
draftCounts: 0,
|
||||
draftList:[]
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getDrafts()
|
||||
}
|
||||
|
||||
getDrafts = () => {
|
||||
editUtilties.listDrafts().then(res => {
|
||||
this.setState({
|
||||
draftCounts: res.data.draft_counts,
|
||||
draftList: res.data.data
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
onCloseSidePanel = () => {
|
||||
this.setState({
|
||||
isSidePanelClosed: !this.state.isSidePanelClosed
|
||||
@@ -41,18 +57,19 @@ class App extends Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
let href = window.location.href.split('/');
|
||||
let currentTab = href[href.length - 2];
|
||||
|
||||
return (
|
||||
<div id="main">
|
||||
<SidePanel isSidePanelClosed={this.state.isSidePanelClosed} onCloseSidePanel={this.onCloseSidePanel} currentTab={currentTab} />
|
||||
<SidePanel isSidePanelClosed={this.state.isSidePanelClosed} onCloseSidePanel={this.onCloseSidePanel} currentTab={currentTab} draftCounts={this.state.draftCounts} />
|
||||
|
||||
<MainPanel onShowSidePanel={this.onShowSidePanel}>
|
||||
<Router>
|
||||
<FilesActivities path={siteRoot + 'dashboard'} />
|
||||
<DraftsView path={siteRoot + 'drafts'} currentTab={currentTab}>
|
||||
<DraftContent path='/' />
|
||||
<DraftContent path='/' getDrafts={this.getDrafts} draftList={this.state.draftList}/>
|
||||
<ReviewContent path='reviews' />
|
||||
</DraftsView>
|
||||
<Starred path={siteRoot + 'starred'} />
|
||||
|
Reference in New Issue
Block a user