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

update newly created wiki page name (#7666)

This commit is contained in:
Guodong SU 2025-03-28 16:27:19 +08:00 committed by GitHub
parent f7aaa0bff4
commit 29c8c12fa8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -13,6 +13,6 @@ const WIKI_COVER_LIST = [
'wiki-cover-9.jpg', 'wiki-cover-9.jpg',
]; ];
const DEFAULT_PAGE_NAME = 'Untitled'; const DEFAULT_PAGE_NAME = 'New page';
export { FOLDER, PAGE, WIKI_COVER_LIST, DEFAULT_PAGE_NAME }; export { FOLDER, PAGE, WIKI_COVER_LIST, DEFAULT_PAGE_NAME };

View File

@ -5,7 +5,7 @@ import { Modal } from 'reactstrap';
import { Utils } from '../../utils/utils'; import { Utils } from '../../utils/utils';
import wikiAPI from '../../utils/wiki-api'; import wikiAPI from '../../utils/wiki-api';
import SDocServerApi from '../../utils/sdoc-server-api'; import SDocServerApi from '../../utils/sdoc-server-api';
import { wikiId, siteRoot, lang, isWiki2, seadocServerUrl, wikiPermission } from '../../utils/constants'; import { wikiId, siteRoot, lang, isWiki2, seadocServerUrl, wikiPermission, gettext } from '../../utils/constants';
import WikiConfig from './models/wiki-config'; import WikiConfig from './models/wiki-config';
import toaster from '../../components/toast'; import toaster from '../../components/toast';
import SidePanel from './side-panel'; import SidePanel from './side-panel';
@ -304,7 +304,7 @@ class Wiki extends Component {
onUpdatePage = (pageId, newPage, isUpdateBySide) => { onUpdatePage = (pageId, newPage, isUpdateBySide) => {
if (newPage.name === '') { if (newPage.name === '') {
newPage.name = DEFAULT_PAGE_NAME; newPage.name = gettext(DEFAULT_PAGE_NAME);
} }
if (this.state.currentPageId === pageId) { if (this.state.currentPageId === pageId) {
this.updateDocumentTitle(newPage.name); this.updateDocumentTitle(newPage.name);

View File

@ -172,7 +172,7 @@ class SidePanel extends PureComponent {
}; };
// default page name // default page name
handleAddNewPage = (jumpToNewPage = true, pageName = DEFAULT_PAGE_NAME) => { handleAddNewPage = (jumpToNewPage = true, pageName = gettext(DEFAULT_PAGE_NAME)) => {
if (this.isAddingPage === true) return; if (this.isAddingPage === true) return;
this.isAddingPage = true; this.isAddingPage = true;
wikiAPI.createWiki2Page(wikiId, pageName).then(res => { wikiAPI.createWiki2Page(wikiId, pageName).then(res => {
@ -195,7 +195,7 @@ class SidePanel extends PureComponent {
}); });
}; };
onAddWikiPage = (jumpToNewPage = true, pageName = DEFAULT_PAGE_NAME, insert_position) => { onAddWikiPage = (jumpToNewPage = true, pageName = gettext(DEFAULT_PAGE_NAME), insert_position) => {
if (this.isAddingPage === true) return; if (this.isAddingPage === true) return;
this.isAddingPage = true; this.isAddingPage = true;
const currentPageId = this.props.getCurrentPageId(); const currentPageId = this.props.getCurrentPageId();