mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-02 15:57:31 +00:00
repire wiki (#2582)
This commit is contained in:
parent
c00d4f30bd
commit
20acecebe1
@ -84,7 +84,11 @@ class MainPanel extends Component {
|
||||
<button className="btn btn-secondary operation-item" title="Edit File" onClick={this.onEditClick}>{gettext('Edit Page')}</button>
|
||||
}
|
||||
</div>
|
||||
<CommonToolbar onSearchedClick={this.props.onSearchedClick} searchPlaceholder={'Search files in this library'}/>
|
||||
<CommonToolbar
|
||||
repoID={repoID}
|
||||
onSearchedClick={this.props.onSearchedClick}
|
||||
searchPlaceholder={'Search files in this library'}
|
||||
/>
|
||||
</div>
|
||||
<div className="cur-view-container">
|
||||
<div className="cur-view-path">
|
||||
|
@ -12,7 +12,7 @@ import CreateFile from '../../components/dialog/create-file-dialog';
|
||||
const propTypes = {
|
||||
changedNode: PropTypes.object,
|
||||
treeData: PropTypes.object.isRequired,
|
||||
currentFilePath: PropTypes.string.isRequired,
|
||||
currentPath: PropTypes.string.isRequired,
|
||||
closeSideBar: PropTypes.bool.isRequired,
|
||||
onCloseSide: PropTypes.func.isRequired,
|
||||
onDirCollapse: PropTypes.func.isRequired,
|
||||
@ -199,7 +199,7 @@ class SidePanel extends Component {
|
||||
<div className="wiki-pages-container">
|
||||
{this.props.treeData &&
|
||||
<TreeView
|
||||
currentFilePath={this.props.currentFilePath}
|
||||
currentPath={this.props.currentPath}
|
||||
treeData={this.props.treeData}
|
||||
currentNode={this.state.currentNode}
|
||||
isNodeItemFrezee={this.state.isNodeItemFrezee}
|
||||
|
@ -3,7 +3,7 @@ import ReactDOM from 'react-dom';
|
||||
import SidePanel from './pages/wiki/side-panel';
|
||||
import MainPanel from './pages/wiki/main-panel';
|
||||
import moment from 'moment';
|
||||
import { slug, repoID, siteRoot, initialFilePath } from './utils/constants';
|
||||
import { slug, repoID, siteRoot, initialPath } from './utils/constants';
|
||||
import editorUtilities from './utils/editor-utilties';
|
||||
import Node from './components/tree-view/node';
|
||||
import Tree from './components/tree-view/tree';
|
||||
@ -36,7 +36,7 @@ class Wiki extends Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.initWikiData(initialFilePath);
|
||||
this.initWikiData(initialPath);
|
||||
}
|
||||
|
||||
initWikiData(filePath){
|
||||
@ -115,7 +115,7 @@ class Wiki extends Component {
|
||||
|
||||
onSearchedClick = (item) => {
|
||||
let path = item.path;
|
||||
if (this.state.currentFilePath !== path) {
|
||||
if (this.state.filePath !== path) {
|
||||
this.initMainPanelData(path);
|
||||
|
||||
let tree = this.state.tree_data.clone();
|
||||
@ -152,7 +152,7 @@ class Wiki extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
onNodeClick = (e, node) => {
|
||||
onNodeClick = (node) => {
|
||||
if (node instanceof Node && node.isMarkdown()){
|
||||
let tree = this.state.tree_data.clone();
|
||||
this.initMainPanelData(node.path);
|
||||
@ -174,7 +174,7 @@ class Wiki extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
onDirCollapse = (e, node) => {
|
||||
onDirCollapse = (node) => {
|
||||
let tree = this.state.tree_data.clone();
|
||||
let findNode = tree.getNodeByPath(node.path);
|
||||
findNode.isExpanded = !findNode.isExpanded;
|
||||
@ -471,7 +471,7 @@ class Wiki extends Component {
|
||||
closeSideBar={this.state.closeSideBar}
|
||||
onCloseSide ={this.onCloseSide}
|
||||
treeData={this.state.tree_data}
|
||||
currentFilePath={this.state.filePath}
|
||||
currentPath={this.state.filePath}
|
||||
changedNode={this.state.changedNode}
|
||||
onAddFolderNode={this.onAddFolderNode}
|
||||
onAddFileNode={this.onAddFileNode}
|
||||
|
@ -10,9 +10,8 @@
|
||||
config: {
|
||||
slug: "{{ wiki.slug }}",
|
||||
repoId: "{{ wiki.repo_id }}",
|
||||
initial_file_path: "{{ file_path }}",
|
||||
permission: "{{ user_can_write }}"
|
||||
serviceUrl: "{{ service_url}}",
|
||||
initial_path: "{{ file_path }}",
|
||||
permission: "{{ user_can_write }}",
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user