mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-11 03:41:12 +00:00
feat: wiki editor title seperation
This commit is contained in:
14
frontend/package-lock.json
generated
14
frontend/package-lock.json
generated
@@ -14,7 +14,7 @@
|
|||||||
"@gatsbyjs/reach-router": "1.3.9",
|
"@gatsbyjs/reach-router": "1.3.9",
|
||||||
"@seafile/react-image-lightbox": "2.0.2",
|
"@seafile/react-image-lightbox": "2.0.2",
|
||||||
"@seafile/resumablejs": "1.1.16",
|
"@seafile/resumablejs": "1.1.16",
|
||||||
"@seafile/sdoc-editor": "0.5.69",
|
"@seafile/sdoc-editor": "0.5.70",
|
||||||
"@seafile/seafile-calendar": "0.0.12",
|
"@seafile/seafile-calendar": "0.0.12",
|
||||||
"@seafile/seafile-editor": "1.0.99",
|
"@seafile/seafile-editor": "1.0.99",
|
||||||
"@uiw/codemirror-extensions-langs": "^4.19.4",
|
"@uiw/codemirror-extensions-langs": "^4.19.4",
|
||||||
@@ -4617,9 +4617,9 @@
|
|||||||
"integrity": "sha512-8rBbmAEuuwOAGHYGCtEzpx+bxAcGS+V30otMmhRe7bPAdh4E57RWgCa8x7pkzHGFlY1t5d+ILz1gojvPVMYQig=="
|
"integrity": "sha512-8rBbmAEuuwOAGHYGCtEzpx+bxAcGS+V30otMmhRe7bPAdh4E57RWgCa8x7pkzHGFlY1t5d+ILz1gojvPVMYQig=="
|
||||||
},
|
},
|
||||||
"node_modules/@seafile/sdoc-editor": {
|
"node_modules/@seafile/sdoc-editor": {
|
||||||
"version": "0.5.69",
|
"version": "0.5.70",
|
||||||
"resolved": "https://registry.npmjs.org/@seafile/sdoc-editor/-/sdoc-editor-0.5.69.tgz",
|
"resolved": "https://registry.npmjs.org/@seafile/sdoc-editor/-/sdoc-editor-0.5.70.tgz",
|
||||||
"integrity": "sha512-9MFvdCuvFGPulhWHFR94AJlxpTl2OwxNewr/BazaJJK2tpdSCZLtY18zpLJotNWjyrALmpJwej7jVbauFhPP1w==",
|
"integrity": "sha512-V7QecojmGV/6D1F/eOGHSCeOpvJVMee6E3FArWDnf+IRYUs2rvvSKZ/STM2eutIHdjEH5SijkUCs9WySmdDDdA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@seafile/print-js": "1.6.5",
|
"@seafile/print-js": "1.6.5",
|
||||||
"@seafile/react-image-lightbox": "2.0.4",
|
"@seafile/react-image-lightbox": "2.0.4",
|
||||||
@@ -31292,9 +31292,9 @@
|
|||||||
"integrity": "sha512-8rBbmAEuuwOAGHYGCtEzpx+bxAcGS+V30otMmhRe7bPAdh4E57RWgCa8x7pkzHGFlY1t5d+ILz1gojvPVMYQig=="
|
"integrity": "sha512-8rBbmAEuuwOAGHYGCtEzpx+bxAcGS+V30otMmhRe7bPAdh4E57RWgCa8x7pkzHGFlY1t5d+ILz1gojvPVMYQig=="
|
||||||
},
|
},
|
||||||
"@seafile/sdoc-editor": {
|
"@seafile/sdoc-editor": {
|
||||||
"version": "0.5.69",
|
"version": "0.5.70",
|
||||||
"resolved": "https://registry.npmjs.org/@seafile/sdoc-editor/-/sdoc-editor-0.5.69.tgz",
|
"resolved": "https://registry.npmjs.org/@seafile/sdoc-editor/-/sdoc-editor-0.5.70.tgz",
|
||||||
"integrity": "sha512-9MFvdCuvFGPulhWHFR94AJlxpTl2OwxNewr/BazaJJK2tpdSCZLtY18zpLJotNWjyrALmpJwej7jVbauFhPP1w==",
|
"integrity": "sha512-V7QecojmGV/6D1F/eOGHSCeOpvJVMee6E3FArWDnf+IRYUs2rvvSKZ/STM2eutIHdjEH5SijkUCs9WySmdDDdA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@seafile/print-js": "1.6.5",
|
"@seafile/print-js": "1.6.5",
|
||||||
"@seafile/react-image-lightbox": "2.0.4",
|
"@seafile/react-image-lightbox": "2.0.4",
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
"@gatsbyjs/reach-router": "1.3.9",
|
"@gatsbyjs/reach-router": "1.3.9",
|
||||||
"@seafile/react-image-lightbox": "2.0.2",
|
"@seafile/react-image-lightbox": "2.0.2",
|
||||||
"@seafile/resumablejs": "1.1.16",
|
"@seafile/resumablejs": "1.1.16",
|
||||||
"@seafile/sdoc-editor": "0.5.69",
|
"@seafile/sdoc-editor": "0.5.70",
|
||||||
"@seafile/seafile-calendar": "0.0.12",
|
"@seafile/seafile-calendar": "0.0.12",
|
||||||
"@seafile/seafile-editor": "1.0.99",
|
"@seafile/seafile-editor": "1.0.99",
|
||||||
"@uiw/codemirror-extensions-langs": "^4.19.4",
|
"@uiw/codemirror-extensions-langs": "^4.19.4",
|
||||||
|
@@ -172,7 +172,25 @@ class Wiki extends Component {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onUpdatePage = (pageId, newPage) => {
|
||||||
|
if (newPage.name === '') {
|
||||||
|
toaster.danger(gettext('Page name cannot be empty'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const { config } = this.state
|
||||||
|
let pages = config.pages;
|
||||||
|
let newPages = pages.map(page => {
|
||||||
|
if (page.id === pageId) {
|
||||||
|
return { ...page, ...newPage };
|
||||||
|
}
|
||||||
|
return page;
|
||||||
|
});
|
||||||
|
const newConfig = { ...config, pages: newPages };
|
||||||
|
this.saveWikiConfig(newConfig);
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id="main" className="wiki-main">
|
<div id="main" className="wiki-main">
|
||||||
<SidePanel
|
<SidePanel
|
||||||
|
@@ -69,13 +69,14 @@ class MainPanel extends Component {
|
|||||||
}
|
}
|
||||||
{this.props.pathExist && this.props.isDataLoading && <Loading />}
|
{this.props.pathExist && this.props.isDataLoading && <Loading />}
|
||||||
{isViewingFile && Utils.isSdocFile(this.props.path) && (
|
{isViewingFile && Utils.isSdocFile(this.props.path) && (
|
||||||
|
<div>
|
||||||
<SdocWikiViewer
|
<SdocWikiViewer
|
||||||
document={this.props.editorContent}
|
document={this.props.editorContent}
|
||||||
showOutline={false}
|
|
||||||
showToolbar={false}
|
|
||||||
docUuid={this.state.docUuid}
|
docUuid={this.state.docUuid}
|
||||||
isWikiReadOnly={isReadOnly}
|
isWikiReadOnly={isReadOnly}
|
||||||
|
topSlot={<Input className='sf-wiki-title' bsSize="lg" onChange={this.handleRenameDocument} defaultValue={currentPageConfig.name} />}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -43,4 +43,8 @@ const getIconURL = (repoId, fileName) => {
|
|||||||
return serviceURL + '/lib/' + repoId + '/file/_Internal/Wiki/Icon/' + fileName + '?raw=1';
|
return serviceURL + '/lib/' + repoId + '/file/_Internal/Wiki/Icon/' + fileName + '?raw=1';
|
||||||
};
|
};
|
||||||
|
|
||||||
export { generatorBase64Code, generateUniqueId, isObjectNotEmpty, getIconURL };
|
const getCurrentPageConfig = (pages,pageId) => {
|
||||||
|
return pages.filter(page => page.id === pageId)[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
export { generatorBase64Code, generateUniqueId, isObjectNotEmpty, getIconURL, getCurrentPageConfig };
|
||||||
|
Reference in New Issue
Block a user