From 43223c77879541b27dc7ba7883e4066c6468cea1 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 8 Apr 2021 14:21:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA2=E6=97=B6=E4=B8=8D=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E5=88=9B=E5=BB=BA=E3=80=81=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E3=80=81=E5=9C=A8=E7=BA=BF=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E3=80=81=E5=9C=A8=E7=BA=BF=E5=88=A0=E9=99=A4=E3=80=81=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=90=88=E5=B9=B6=E8=AF=B7=E6=B1=82=E7=AD=89=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/CoderDepot.jsx | 20 ++++++------ src/forge/Main/CoderRootFileDetail.js | 45 +++++++++++++++------------ src/forge/Main/Index.scss | 3 ++ src/forge/Settings/Setting.js | 2 +- 4 files changed, 40 insertions(+), 30 deletions(-) diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 0b2e68ccf..42853440d 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -21,7 +21,7 @@ import UpdateDescModal from './sub/UpdateDescModal'; import Nodata from '../Nodata'; /** - * projectDetail.type:0是托管项目,1是镜像项目,2是同步镜像项目(为2时不能上传新建文件、下载zip等) + * projectDetail.type:0是托管项目,1是镜像项目,2是同步镜像项目(为2时不支持在线创建、在线上传、在线修改、在线删除、创建合并请求等功能) */ function CoderDepot(props){ const [ projectDetail , setProjectDetail ]= useState(undefined); @@ -288,7 +288,10 @@ function CoderDepot(props){
- urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求 + { + projectDetail.type !== 2 && + urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求 + } urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务
{ type === "dir" && projectDetail.type !== 2 && @@ -296,12 +299,10 @@ function CoderDepot(props){ } - { - projectDetail.type !== 2 && - - - - } + + + +
{ @@ -350,6 +351,7 @@ function CoderDepot(props){ readOnly={readOnly} onEdit={onEdit} currentBranch={branchName || (projectDetail && projectDetail.default_branch)} + type={projectDetail.type} > } @@ -360,7 +362,7 @@ function CoderDepot(props){ (dirInfo && dirInfo.length === 0) && (fileInfo && fileInfo.length === 0) ? :"" } {/* readme文件显示(显示文件详情时不显示readme文件) */} - { dirInfo && (projectDetail && projectDetail.readme) ? :"" } + { dirInfo && (projectDetail && projectDetail.readme) ? :"" } { diff --git a/src/forge/Main/CoderRootFileDetail.js b/src/forge/Main/CoderRootFileDetail.js index a800e76c3..2ee43bee2 100644 --- a/src/forge/Main/CoderRootFileDetail.js +++ b/src/forge/Main/CoderRootFileDetail.js @@ -166,7 +166,8 @@ class CoderRootFileDetail extends Component { isDeveloper, md, currentBranch, - platform + platform, + type } = this.props; const { language, languages, description } = this.state; let flag = current_user && current_user.login && (isManager || isDeveloper); @@ -185,17 +186,18 @@ class CoderRootFileDetail extends Component { {readOnly ? ( { - detail.direct_download ? - "" - : + !detail.direct_download? this.DownLoadFile(detail.download_url)} className="ml20"> - this.EditFile(false)} className="ml20"> - - - + { + type !==2 && + this.EditFile(false)} className="ml20"> + + + } + :"" } ) : ( @@ -226,18 +228,21 @@ class CoderRootFileDetail extends Component { )} - - - - - - + { + type !==2 && + + + + + + } + )}

diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss index bd19f89c5..331eb03d1 100644 --- a/src/forge/Main/Index.scss +++ b/src/forge/Main/Index.scss @@ -95,6 +95,9 @@ & > a:first-child{ border-right: 1px solid #d9d9d9; } + & > a:last-child{ + border-right: none; + } } .infoCount{ display: inline-block; diff --git a/src/forge/Settings/Setting.js b/src/forge/Settings/Setting.js index dc6cbe2db..a85e159bc 100644 --- a/src/forge/Settings/Setting.js +++ b/src/forge/Settings/Setting.js @@ -13,7 +13,7 @@ const menu = [ {name:"易修 (Issue)",index:"issues"}, {name:"合并请求",index:"pulls"}, {name:"工作流(beta版)",index:"devops"}, - // {name:"资源库",index:"resources"}, + {name:"资源库",index:"resources"}, {name:"里程碑",index:"versions"}, {name:"动态",index:"activity"}, ]