From 3ca1ce6c1bed98613b46c5e633dc47c561f56e72 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 6 May 2021 10:14:06 +0800 Subject: [PATCH] merge --- src/forge/Main/CoderDepot.jsx | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 5a2f6438..9fa5603d 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -20,7 +20,9 @@ import DrawerPanel from '../Component/DrawerPanel'; import UpdateDescModal from './sub/UpdateDescModal'; import Nodata from '../Nodata'; - +/** + * projectDetail.type:0是托管项目,1是镜像项目,2是同步镜像项目(为2时不支持在线创建、在线上传、在线修改、在线删除、创建合并请求等功能) + */ function CoderDepot(props){ const [ projectDetail , setProjectDetail ]= useState(undefined); const [ treeValue , setTreeValue ] = useState(undefined); @@ -93,7 +95,7 @@ function CoderDepot(props){ setZip_url(result.data.zip_url); let c = result.data.last_commit setLastCommit(c && c.commit); - setLastCommitAuthor(c && (c.author || (c.commit && c.commit.author))); + setLastCommitAuthor(c && c.committer); setMainFlag(true); setReadOnly(true); } @@ -135,7 +137,7 @@ function CoderDepot(props){ } let c = result.data.last_commit setLastCommit(c && c.commit); - setLastCommitAuthor(c && (c.author || (c.commit && c.commit.author))); + setLastCommitAuthor(c && c.committer); setMainFlag(false); setReadOnly(true); } @@ -217,6 +219,7 @@ function CoderDepot(props){ ) + // 确认修改简介、website、实践课程链接 function okUpdate(d,w,l){ const url = `/${owner}/${projectsId}.json`; axios.put(url,{ @@ -295,15 +298,19 @@ 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" && - + { type === "dir" && projectDetail.type !== 2 && + } - + +
@@ -314,8 +321,8 @@ function CoderDepot(props){ { lastCommit &&
- -

{lastCommit && lastCommit.message}

+ +
{lastCommit && lastCommit.message}
{ hideBtn && changeHide(hide)}> } {lastCommit && lastCommit.time_from_now} @@ -355,6 +362,7 @@ function CoderDepot(props){ md={mdFlag} onEdit={onEdit} currentBranch={branchName || (projectDetail && projectDetail.default_branch)} + type={projectDetail.type} > } @@ -365,7 +373,7 @@ function CoderDepot(props){ (dirInfo && dirInfo.length === 0) && (fileInfo && fileInfo.length === 0) ? :"" } {/* readme文件显示(显示文件详情时不显示readme文件) */} - { dirInfo && (projectDetail && projectDetail.readme) ? :"" } + { dirInfo && (projectDetail && projectDetail.readme) ? :"" }
{