From b32c4ab215a30a0e72979c8faa257593bb0d91e7 Mon Sep 17 00:00:00 2001 From: Michael An <2331806369@qq.com> Date: Mon, 9 Sep 2024 16:47:55 +0800 Subject: [PATCH] fix file extended properties path (#6739) * fix file extended properties path * delete ueseless codes --- frontend/src/components/cur-dir-path/dir-path.js | 3 +++ .../src/components/dir-view-mode/dir-column-file.js | 12 +++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/cur-dir-path/dir-path.js b/frontend/src/components/cur-dir-path/dir-path.js index 819abba7e4..4e1a8786be 100644 --- a/frontend/src/components/cur-dir-path/dir-path.js +++ b/frontend/src/components/cur-dir-path/dir-path.js @@ -122,6 +122,9 @@ class DirPath extends React.Component { path = path[path.length - 1] === '/' ? path.slice(0, path.length - 1) : path; let pathList = path.split('/'); let nodePath = ''; + if (pathList.length === 2 && !pathList[0] && pathList[1] === PRIVATE_FILE_TYPE.FILE_EXTENDED_PROPERTIES) { + return null; + } let pathElem = pathList.map((item, index) => { if (item === '') { return null; diff --git a/frontend/src/components/dir-view-mode/dir-column-file.js b/frontend/src/components/dir-view-mode/dir-column-file.js index 91f7ade915..c80f08735b 100644 --- a/frontend/src/components/dir-view-mode/dir-column-file.js +++ b/frontend/src/components/dir-view-mode/dir-column-file.js @@ -36,17 +36,11 @@ class DirColumnFile extends React.Component { } } - onEditClick = (e) => { - e.preventDefault(); - let { path, repoID } = this.props; - let url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(path) + '?mode=edit'; - window.open(url); - }; - onOpenFile = (e) => { e.preventDefault(); - let { path, repoID } = this.props; - let newUrl = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(path); + let { path, repoID, currentDirent } = this.props; + let { name } = currentDirent || {}; + let newUrl = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(path) + '/' + name; window.open(newUrl, '_blank'); };