From 68caf0751ea041d60bf3f8b41f3d0976117a2bc2 Mon Sep 17 00:00:00 2001 From: caishi Date: Sat, 9 Oct 2021 17:33:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=A6=E6=83=85-=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/Diff.jsx | 8 +++++++- src/forge/Merge/Files.jsx | 5 ++++- src/forge/Merge/MessageCount.js | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/forge/Main/Diff.jsx b/src/forge/Main/Diff.jsx index 86cf9384c..17535e43b 100644 --- a/src/forge/Main/Diff.jsx +++ b/src/forge/Main/Diff.jsx @@ -42,6 +42,12 @@ const Infos = styled.div` } } `; +function turnbar(str){ + if(str && str.length>0 && str.indexOf("/")>-1){ + return str.replaceAll('/','%2F'); + } + return str; +} //提交详情页 export default (props) => { const {match , history } = props; @@ -81,7 +87,7 @@ export default (props) => { {commit && commit.message &&
{commit.message}
} - {data.branch} + {data.branch} diff --git a/src/forge/Merge/Files.jsx b/src/forge/Merge/Files.jsx index a3015fcec..172038b21 100644 --- a/src/forge/Merge/Files.jsx +++ b/src/forge/Merge/Files.jsx @@ -100,7 +100,10 @@ function Files({ data,history,owner,projectsId , parentsSha }){ {item.addition+item.deletion}处 - {history.push(`/${owner}/${projectsId}${item.isDeleted ? `/commits/${truncateCommitId(parentsSha)}`:`/tree/${truncateCommitId(item.sha)}/${item.name}`}`)}}>查看文件 + { + !item.isSubmodule && + {history.push(`/${owner}/${projectsId}${item.isDeleted ? `/commits/${truncateCommitId(parentsSha)}`:`/tree/${truncateCommitId(item.sha)}/${item.name}`}`)}}>查看文件 + } { diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index b064e3c2f..8f78c0934 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -364,7 +364,7 @@ class MessageCount extends Component { to={`/${data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${turnbar(data.pull_request && data.pull_request.head)}`} className="ver-middle" > - {data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: {turnbar(data.pull_request && data.pull_request.head)} + {data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: {data.pull_request && data.pull_request.head}