From ca6861c8d84708ddfef87af5d39d228ac9ff53db Mon Sep 17 00:00:00 2001 From: Michael An <2331806369@qq.com> Date: Mon, 1 Jul 2024 11:25:08 +0800 Subject: [PATCH] change more menu icon (#6273) --- .../src/components/cur-dir-path/dir-tool.js | 34 ++++++++----------- frontend/src/css/toolbar.css | 1 - frontend/src/pages/org-admin/org-user-item.js | 2 +- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/frontend/src/components/cur-dir-path/dir-tool.js b/frontend/src/components/cur-dir-path/dir-tool.js index fa10622b9e..c4fc928554 100644 --- a/frontend/src/components/cur-dir-path/dir-tool.js +++ b/frontend/src/components/cur-dir-path/dir-tool.js @@ -54,7 +54,7 @@ class DirTool extends React.Component { return Utils.getFileName(filePath).includes('.md'); } - getList2 = () => { + getMenu = () => { const list = []; const { repoID, userPerm, currentPath } = this.props; const { TAGS, TRASH, HISTORY } = TextTranslation; @@ -73,20 +73,15 @@ class DirTool extends React.Component { } else { let trashUrl = siteRoot + 'repo/' + repoID + '/trash/'; list.push({...TRASH, href: trashUrl}); - let historyUrl = siteRoot + 'repo/history/' + repoID + '/'; list.push({...HISTORY, href: historyUrl}); } - return list; }; onMenuItemClick = (item) => { const { key, href } = item; switch (key) { - case 'Properties': - this.props.switchViewMode('detail'); - break; case 'Tags': this.setState({isRepoTagDialogOpen: !this.state.isRepoTagDialogOpen}); break; @@ -99,16 +94,6 @@ class DirTool extends React.Component { } }; - getMenuList = () => { - const list = []; - const list2 = this.getList2(); - const { PROPERTIES, } = TextTranslation; - if (!this.props.isCustomPermission) { - list.push(PROPERTIES); - } - return list.concat(list2); - }; - onMenuItemKeyDown = (e, item) => { if (e.key == 'Enter' || e.key == 'Space') { this.onMenuItemClick(item); @@ -116,19 +101,25 @@ class DirTool extends React.Component { }; render() { - const menuItems = this.getMenuList(); + const menuItems = this.getMenu(); const { isDropdownMenuOpen } = this.state; const { repoID, currentMode } = this.props; + const propertiesText = TextTranslation.PROPERTIES.value; return (
+ {!this.props.isCustomPermission && + this.props.switchViewMode('detail')}> + + + } {menuItems.length > 0 && ; } else { return ( - {menuItem.value} + {menuItem.value} + ); } })} diff --git a/frontend/src/css/toolbar.css b/frontend/src/css/toolbar.css index 224046661a..59d559ec3e 100644 --- a/frontend/src/css/toolbar.css +++ b/frontend/src/css/toolbar.css @@ -35,7 +35,6 @@ /* end file-operation toolbar */ #cur-folder-more-op-toggle { - margin-left: 10px; margin-right: -4px; } diff --git a/frontend/src/pages/org-admin/org-user-item.js b/frontend/src/pages/org-admin/org-user-item.js index dd38dd2472..b0b226bef8 100644 --- a/frontend/src/pages/org-admin/org-user-item.js +++ b/frontend/src/pages/org-admin/org-user-item.js @@ -56,7 +56,7 @@ class UserItem extends React.Component { }; toggleResetPW = () => { - const { email, name } = this.props.user; + const { email } = this.props.user; toaster.success(gettext('Resetting user\'s password, please wait for a moment.')); seafileAPI.orgAdminResetOrgUserPassword(orgID, email).then(res => { toaster.success(res.data.reset_tip);