diff --git a/frontend/src/pages/wiki2/main-panel.js b/frontend/src/pages/wiki2/main-panel.js index b7187d5fa1..f04655b075 100644 --- a/frontend/src/pages/wiki2/main-panel.js +++ b/frontend/src/pages/wiki2/main-panel.js @@ -131,7 +131,6 @@ class MainPanel extends Component { { return pages.filter(page => page.id === pageId)[0]; }; -const getCurrentPageLocked = (pages, pageId) => { - const page = pages.filter(page => page.id === pageId)[0]; - return page ? page.locked : false; -}; - const getWikPageLink = (pageId) => { let { origin, pathname } = window.location; let pathArr = pathname.split('/'); @@ -146,7 +141,6 @@ export { isObjectNotEmpty, getIconURL, getCurrentPageConfig, - getCurrentPageLocked, getWikPageLink, throttle, getPaths, diff --git a/frontend/src/pages/wiki2/wiki-right-header/page-title.js b/frontend/src/pages/wiki2/wiki-right-header/page-title.js index 38ffbc45ca..cf209270c6 100644 --- a/frontend/src/pages/wiki2/wiki-right-header/page-title.js +++ b/frontend/src/pages/wiki2/wiki-right-header/page-title.js @@ -19,6 +19,7 @@ const propTypes = { const PageTitle = ({ isUpdateBySide, currentPageConfig, onUpdatePage }) => { const [isShowController, setIsShowController] = useState(false); const isDesktop = Utils.isDesktop(); + const onMouseEnter = useCallback(() => { setIsShowController(true); }, []); diff --git a/seahub/api2/endpoints/wiki2.py b/seahub/api2/endpoints/wiki2.py index 34abe3a885..b44c1b0e73 100644 --- a/seahub/api2/endpoints/wiki2.py +++ b/seahub/api2/endpoints/wiki2.py @@ -40,10 +40,10 @@ from seahub.utils import is_org_context, get_user_repos, is_pro_version, is_vali from seahub.views import check_folder_permission from seahub.base.templatetags.seahub_tags import email2nickname from seahub.utils.file_op import check_file_lock -from seahub.utils.repo import get_repo_owner, is_valid_repo_id_format, is_group_repo_staff, is_repo_owner, get_locked_files_by_dir +from seahub.utils.repo import get_repo_owner, is_valid_repo_id_format, is_group_repo_staff, is_repo_owner from seahub.seadoc.utils import get_seadoc_file_uuid, gen_seadoc_access_token, copy_sdoc_images_with_sdoc_uuid from seahub.settings import ENABLE_STORAGE_CLASSES, STORAGE_CLASS_MAPPING_POLICY, \ - ENCRYPTED_LIBRARY_VERSION, FILE_LOCK_EXPIRATION_DAYS + ENCRYPTED_LIBRARY_VERSION from seahub.utils.timeutils import timestamp_to_isoformat_timestr from seahub.utils.ccnet_db import CcnetDB from seahub.tags.models import FileUUIDMap @@ -459,6 +459,7 @@ class Wiki2ConfigView(APIView): wiki = wiki.to_dict() wiki_config = get_wiki_config(repo.repo_id, request.user.username) + wiki['wiki_config'] = wiki_config return Response({'wiki': wiki})