mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-06 01:12:03 +00:00
change wiki page no name (#6795)
This commit is contained in:
@@ -13,4 +13,6 @@ const WIKI_COVER_LIST = [
|
||||
'wiki-cover-9.jpg',
|
||||
];
|
||||
|
||||
export { FOLDER, PAGE, WIKI_COVER_LIST };
|
||||
const DEFAULT_PAGE_NAME = 'Untitled';
|
||||
|
||||
export { FOLDER, PAGE, WIKI_COVER_LIST, DEFAULT_PAGE_NAME };
|
||||
|
@@ -5,13 +5,14 @@ import { Modal } from 'reactstrap';
|
||||
import { Utils } from '../../utils/utils';
|
||||
import wikiAPI from '../../utils/wiki-api';
|
||||
import SDocServerApi from '../../utils/sdoc-server-api';
|
||||
import { wikiId, siteRoot, lang, isWiki2, seadocServerUrl, gettext, wikiPermission } from '../../utils/constants';
|
||||
import { wikiId, siteRoot, lang, isWiki2, seadocServerUrl, wikiPermission } from '../../utils/constants';
|
||||
import WikiConfig from './models/wiki-config';
|
||||
import toaster from '../../components/toast';
|
||||
import SidePanel from './side-panel';
|
||||
import MainPanel from './main-panel';
|
||||
import PageUtils from './wiki-nav/page-utils';
|
||||
import LocalStorage from '../../utils/local-storage-utils';
|
||||
import { DEFAULT_PAGE_NAME } from './constant';
|
||||
|
||||
import '../../css/layout.css';
|
||||
import '../../css/side-panel.css';
|
||||
@@ -225,8 +226,7 @@ class Wiki extends Component {
|
||||
|
||||
onUpdatePage = (pageId, newPage, isUpdateBySide) => {
|
||||
if (newPage.name === '') {
|
||||
toaster.danger(gettext('Page name cannot be empty'));
|
||||
return;
|
||||
newPage.name = DEFAULT_PAGE_NAME;
|
||||
}
|
||||
if (this.state.currentPageId === pageId) {
|
||||
this.updateDocumentTitle(newPage.name);
|
||||
|
@@ -13,6 +13,7 @@ import wikiAPI from '../../utils/wiki-api';
|
||||
import { Utils } from '../../utils/utils';
|
||||
import WikiExternalOperations from './wiki-external-operations';
|
||||
import WikiTrashDialog from './wiki-trash-dialog';
|
||||
import { DEFAULT_PAGE_NAME } from './constant';
|
||||
|
||||
import './side-panel.css';
|
||||
|
||||
@@ -131,7 +132,7 @@ class SidePanel extends Component {
|
||||
};
|
||||
|
||||
// default page name
|
||||
handleAddNewPage = (jumpToNewPage = true, pageName = 'Untitled') => {
|
||||
handleAddNewPage = (jumpToNewPage = true, pageName = DEFAULT_PAGE_NAME) => {
|
||||
if (this.isAddingPage === true) return;
|
||||
this.isAddingPage = true;
|
||||
wikiAPI.createWiki2Page(wikiId, pageName).then(res => {
|
||||
|
@@ -110,7 +110,7 @@ class WikiNav extends Component {
|
||||
})}
|
||||
{wikiPermission !== 'public' &&
|
||||
<div className='wiki2-trash' onClick={this.props.toggelTrashDialog}>
|
||||
<span className="sf3-font-recycle1 sf3-font mr-2"></span>
|
||||
<span className="sf3-font-trash sf3-font mr-2"></span>
|
||||
<span>{gettext('Trash')}</span>
|
||||
</div>
|
||||
}
|
||||
|
Reference in New Issue
Block a user