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