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

feat: wiki shortcut

This commit is contained in:
liuhongbo
2024-06-17 11:42:42 +08:00
parent e517ac05cc
commit b216db12db
2 changed files with 3 additions and 2 deletions

View File

@@ -29,7 +29,6 @@ class AddWikiPageDialog extends React.Component {
handleSubmit = () => { handleSubmit = () => {
if (!this.state.isSubmitBtnActive) return; if (!this.state.isSubmitBtnActive) return;
// first param set false to prevent redirect to new page // first param set false to prevent redirect to new page
this.props.onAddPage(false, this.state.wikiPageName); this.props.onAddPage(false, this.state.wikiPageName);
this.props.handleClose(); this.props.handleClose();

View File

@@ -8,6 +8,7 @@ import { Utils } from '../../utils/utils';
import Account from '../../components/common/account'; import Account from '../../components/common/account';
import WikiTopNav from './top-nav'; import WikiTopNav from './top-nav';
import { getCurrentPageConfig } from './utils'; import { getCurrentPageConfig } from './utils';
import WikiExternalOperations from './wiki-external-operations';
const propTypes = { const propTypes = {
path: PropTypes.string.isRequired, path: PropTypes.string.isRequired,
@@ -21,6 +22,7 @@ const propTypes = {
config: PropTypes.object, config: PropTypes.object,
currentPageId: PropTypes.string, currentPageId: PropTypes.string,
onUpdatePage: PropTypes.func, onUpdatePage: PropTypes.func,
onAddWikiPage: PropTypes.func,
}; };
class MainPanel extends Component { class MainPanel extends Component {
@@ -65,7 +67,7 @@ class MainPanel extends Component {
}; };
render() { render() {
const { permission, pathExist, isDataLoading, isViewFile, config } = this.props; const { permission, pathExist, isDataLoading, isViewFile, config, onAddWikiPage } = this.props;
const { currentPageConfig = {}, } = this.state; const { currentPageConfig = {}, } = this.state;
const isViewingFile = pathExist && !isDataLoading && isViewFile; const isViewingFile = pathExist && !isDataLoading && isViewFile;
const isReadOnly = !(permission === 'rw'); const isReadOnly = !(permission === 'rw');