mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
Wiki add new page below or above (#7118)
* Wiki add new page below or above * change var name * remove sibling page * update create wiki page logic * fix page does not exist --------- Co-authored-by: 孙永强 <11704063+s-yongqiang@user.noreply.gitee.com>
This commit is contained in:
@@ -83,16 +83,16 @@ class SidePanel extends PureComponent {
|
||||
});
|
||||
};
|
||||
|
||||
addPage = (page, parentId, successCallback, errorCallback, jumpToNewPage = true) => {
|
||||
addPage = (page, parent_id, successCallback, errorCallback, jumpToNewPage = true) => {
|
||||
const { config } = this.props;
|
||||
const navigation = config.navigation;
|
||||
const pageId = page.id;
|
||||
const page_id = page.id;
|
||||
config.pages.push(page);
|
||||
PageUtils.addPage(navigation, pageId, parentId);
|
||||
PageUtils.addPage({ navigation, page_id, parent_id });
|
||||
config.navigation = navigation;
|
||||
JSON.stringify(config);
|
||||
this.props.updateWikiConfig(config);
|
||||
jumpToNewPage && this.props.setCurrentPage(pageId, successCallback);
|
||||
jumpToNewPage && this.props.setCurrentPage(page_id, successCallback);
|
||||
successCallback && successCallback();
|
||||
};
|
||||
|
||||
@@ -104,6 +104,19 @@ class SidePanel extends PureComponent {
|
||||
this.props.updateWikiConfig(config);
|
||||
};
|
||||
|
||||
addSiblingPage = (page, parent_id, insert_position, sibling_page_id, successCallback) => {
|
||||
const { config } = this.props;
|
||||
const navigation = config.navigation;
|
||||
const page_id = page.page_id;
|
||||
config.pages.push(page);
|
||||
PageUtils.addPage({ navigation, page_id, parent_id, insert_position, sibling_page_id });
|
||||
config.navigation = navigation;
|
||||
JSON.stringify(config);
|
||||
this.props.updateWikiConfig(config);
|
||||
this.props.setCurrentPage(page_id, successCallback);
|
||||
successCallback && successCallback();
|
||||
};
|
||||
|
||||
toggleTrashDialog = () => {
|
||||
this.setState({ isShowTrashDialog: !this.state.isShowTrashDialog });
|
||||
};
|
||||
@@ -128,6 +141,7 @@ class SidePanel extends PureComponent {
|
||||
getCurrentPageId={this.props.getCurrentPageId}
|
||||
addPageInside={this.addPageInside}
|
||||
toggleTrashDialog={this.toggleTrashDialog}
|
||||
addSiblingPage={this.addSiblingPage}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user