From 112aacb6a107c01cc5543fdb5bbe2fdcd9e723d4 Mon Sep 17 00:00:00 2001 From: hucong <1422588487@qq.com> Date: Tue, 12 Oct 2021 11:49:04 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=BA=93=E4=BA=8C?= =?UTF-8?q?=E7=BA=A7=E9=A1=B5=E9=9D=A2=E6=A0=87=E7=AD=BE=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/tag/Index.jsx | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/forge/Main/tag/Index.jsx b/src/forge/Main/tag/Index.jsx index 458de69a..4a0ce00a 100644 --- a/src/forge/Main/tag/Index.jsx +++ b/src/forge/Main/tag/Index.jsx @@ -11,7 +11,7 @@ import moment from 'moment'; function Tags(props) { - const [ source , setSource ] = useState(undefined); + const [ source , setSource ] = useState([]); const [ isSpin , setIsSpin ] = useState(true); const { projectsId , owner } = props.match.params; @@ -104,19 +104,18 @@ function Tags(props) { return(
-
- - { - source && source.length > 0 && -
- } - { - source && source.length === 0 && - } -
-
+ { + source && source.length > 0 ? +
+ +
+
+
+ : + + }
) } From fe4c5a79d2631e62334d4e32fafacf43a1ed3905 Mon Sep 17 00:00:00 2001 From: caishi Date: Wed, 13 Oct 2021 09:57:04 +0800 Subject: [PATCH 02/16] =?UTF-8?q?=E4=BB=93=E5=BA=93=E8=AE=BE=E7=BD=AE-?= =?UTF-8?q?=E5=8F=AF=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/css/edu-purge.css | 2 +- src/forge/Settings/Setting.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/public/css/edu-purge.css b/public/css/edu-purge.css index 1ec10446..0d146204 100644 --- a/public/css/edu-purge.css +++ b/public/css/edu-purge.css @@ -2456,7 +2456,7 @@ a.hoverLine:hover{ .color-grey-9 { - color: #333333 !important; + color: #999 !important; } a:hover{ diff --git a/src/forge/Settings/Setting.js b/src/forge/Settings/Setting.js index ec9f80c8..460ec162 100644 --- a/src/forge/Settings/Setting.js +++ b/src/forge/Settings/Setting.js @@ -161,12 +161,12 @@ class Setting extends Component { loading:false }) this.props.showNotification(`仓库信息修改成功!`); - // if(values.project_identifier !== projectsId){ - // this.props.history.push(`/${owner}/${values.project_identifier}/settings`); - // }else{ - // } + if(values.project_identifier !== projectsId){ + this.props.history.push(`/${owner}/${values.project_identifier}/settings`); + }else{ const { getDetail } = this.props; getDetail && getDetail(); + } } }).catch((error) => { console.log(error); @@ -288,7 +288,9 @@ class Setting extends Component { )} - {/* + 项目标识 (项目url标识部分,更改项目标识将导致原仓库地址失效)} + > {getFieldDecorator("project_identifier", { rules: [ { @@ -299,7 +301,7 @@ class Setting extends Component { })( )} - */} + {getFieldDecorator("project_description", { rules: [], From 05eb0367ba4bad34274b16b85bc61123a75d5b40 Mon Sep 17 00:00:00 2001 From: hucong <1422588487@qq.com> Date: Thu, 14 Oct 2021 09:43:00 +0800 Subject: [PATCH 03/16] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=A4=8D=E5=88=BB?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/Detail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 4e1c241b..157b0e26 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -552,7 +552,7 @@ class Detail extends Component { - 复刻 + 复刻(Fork) { From bb6fe08c54070dbc7cd682263864592b604880d8 Mon Sep 17 00:00:00 2001 From: hucong <1422588487@qq.com> Date: Thu, 14 Oct 2021 10:00:51 +0800 Subject: [PATCH 04/16] file --- src/forge/Main/CoderDepot.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index c86e31d9..f2e4e149 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -402,7 +402,7 @@ function CoderDepot(props){ getPathUrl={getPathUrl} /> : -
+ @@ -417,7 +417,7 @@ function CoderDepot(props){ {projectDetail && projectDetail.tags && projectDetail.tags.total_count} -
+ } From f6b59e0a3a730b8232253ed092e14b85d6b8209d Mon Sep 17 00:00:00 2001 From: hucong <1422588487@qq.com> Date: Thu, 14 Oct 2021 10:20:36 +0800 Subject: [PATCH 05/16] save --- src/forge/Main/tag/Index.jsx | 21 +++++++++++---------- src/forge/Main/tag/Index.scss | 4 ---- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/forge/Main/tag/Index.jsx b/src/forge/Main/tag/Index.jsx index 4eeb4efe..a3cf69cc 100644 --- a/src/forge/Main/tag/Index.jsx +++ b/src/forge/Main/tag/Index.jsx @@ -119,18 +119,19 @@ function Tags(props) { return(
- { - source && source.length > 0 ? +
- -
-
+ { + source && source.length > 0 && +
+ } + { + source && source.length === 0 && + }
- : - - } +
) } diff --git a/src/forge/Main/tag/Index.scss b/src/forge/Main/tag/Index.scss index 70e83a83..6adba91e 100644 --- a/src/forge/Main/tag/Index.scss +++ b/src/forge/Main/tag/Index.scss @@ -39,10 +39,6 @@ } .tagSpin{ min-height: 300px; - text-align: center; - display: flex; - align-items: center; - justify-content: center; } .tagBranch{ padding-right: 15px; From 47b6c3d9481d446700036557db0e6ec3f5a39fc9 Mon Sep 17 00:00:00 2001 From: hucong <1422588487@qq.com> Date: Thu, 14 Oct 2021 10:21:47 +0800 Subject: [PATCH 06/16] save --- src/forge/Main/tag/Index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/forge/Main/tag/Index.jsx b/src/forge/Main/tag/Index.jsx index a3cf69cc..ff764851 100644 --- a/src/forge/Main/tag/Index.jsx +++ b/src/forge/Main/tag/Index.jsx @@ -12,7 +12,7 @@ import moment from 'moment'; function Tags(props) { - const [ source , setSource ] = useState([]); + const [ source , setSource ] = useState(undefined); const [ isSpin , setIsSpin ] = useState(true); const { projectsId , owner } = props.match.params; From fbbb3c3aa612d761c60d6b8f8a67d798e181d14f Mon Sep 17 00:00:00 2001 From: caishi Date: Thu, 14 Oct 2021 10:28:41 +0800 Subject: [PATCH 07/16] =?UTF-8?q?markdown=E6=96=87=E4=BB=B6=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E5=BD=B1=E5=93=8D=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/courses/css/Courses.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/courses/css/Courses.css b/src/modules/courses/css/Courses.css index cf5f1783..0d550a5c 100644 --- a/src/modules/courses/css/Courses.css +++ b/src/modules/courses/css/Courses.css @@ -298,7 +298,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket { .CodeMirror-scroll { overflow: scroll !important; margin-bottom: -30px; - margin-right: -30px; + margin-right: -30px!important; padding-bottom: 30px; height: 100%; outline: none; From 1826c1923ffc21e258952e9f64bff724100cdae5 Mon Sep 17 00:00:00 2001 From: hucong <1422588487@qq.com> Date: Thu, 14 Oct 2021 10:45:39 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=A4=8D=E5=88=BB?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/sub/DetailBanner.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/forge/Main/sub/DetailBanner.jsx b/src/forge/Main/sub/DetailBanner.jsx index 5e3ab944..22a5ce41 100644 --- a/src/forge/Main/sub/DetailBanner.jsx +++ b/src/forge/Main/sub/DetailBanner.jsx @@ -50,7 +50,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa - 易修 + 易修(Issue) {projectDetail && projectDetail.issues_count ? {numFormat(projectDetail.issues_count)} : ""} From c386bcf5e73b710d442f5e83ddd9a05285db5554 Mon Sep 17 00:00:00 2001 From: caishi Date: Thu, 14 Oct 2021 13:59:03 +0800 Subject: [PATCH 09/16] =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=B9=9F=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=98=BE=E7=A4=BA=E3=80=81=E6=A0=B7=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Activity/Activity.js | 35 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/forge/Activity/Activity.js b/src/forge/Activity/Activity.js index 0272f065..0450e462 100644 --- a/src/forge/Activity/Activity.js +++ b/src/forge/Activity/Activity.js @@ -10,6 +10,10 @@ import ActivityItem from './ActivityItem'; import axios from 'axios'; const LIMIT = 15; const ARRAY = [ + { + id:"", + name:'全部' + }, { id:1, name:'1天' @@ -32,7 +36,7 @@ class Activity extends Component{ constructor(props){ super(props); this.state={ - time:'30', + time:undefined, type:undefined, state:undefined, page:1, @@ -65,6 +69,7 @@ class Activity extends Component{ project_trends:result.data.project_trends, isSpin:false }) + window.scrollTo(0,0); } }).catch(error=>{ console.log(error); @@ -74,19 +79,19 @@ class Activity extends Component{ // 切换周期 changeTime=(e)=>{ this.setState({ - time:e.key, + time:e.key ==="item_0"?undefined:e.key, isSpin:true }) const { type,status,page } = this.state; - this.getInfo(e.key,type,status,page); + this.getInfo(e.key ==="item_0"?undefined:e.key,type,status,page); } //筛选 changeTrends=(type,status)=>{ this.setState({ - type,status + type,status,page:1 }) - const {time,page}=this.state; - this.getInfo(time,type,status,page); + const {time}=this.state; + this.getInfo(time,type,status,1); } // 分页 ChangePage=(page)=>{ @@ -109,11 +114,11 @@ class Activity extends Component{ ) render(){ const { time , data , page , project_trends , isSpin } = this.state; - - let name = time && ARRAY.filter(item=>item.id === parseInt(time)) ; - const second_per = (parseInt(data && data.close_issues_count)/parseInt(data && data.issues_count)*100)+'%'; - const third_per = (parseInt(data && data.close_issues_count)/parseInt(data && data.issues_count)*100)+'%'; - const fourth_per = (parseInt(data && data.open_issues_count)/parseInt(data && data.issues_count)*100)+'%'; + let name = time ? ARRAY.filter(item=>item.id === parseInt(time)) :[{name:"全部"}]; + const first_per = data && (parseInt(data.pr_count)/parseInt(data.pr_count+data.new_pr_count)*100).toFixed(2)+'%'; + const second_per =data && (parseInt(data.new_pr_count)/parseInt(data.pr_count+data.new_pr_count)*100).toFixed(2)+'%'; + const third_per =data && (parseInt(data.close_issues_count)/parseInt(data.issues_count)*100).toFixed(2)+'%'; + const fourth_per =data && (parseInt(data.open_issues_count)/parseInt(data.issues_count)*100).toFixed(2)+'%'; return(
@@ -122,7 +127,7 @@ class Activity extends Component{
-

+

{data && data.pr_all_count}合并请求 @@ -132,7 +137,7 @@ class Activity extends Component{

- {data && data.issues_count}任务 + {data && data.issues_count}易修
    @@ -146,11 +151,11 @@ class Activity extends Component{
  • {data && data.close_issues_count} - this.changeTrends("Issue","close")}>已关闭的任务 + this.changeTrends("Issue","close")}>已关闭的易修
  • {data && data.open_issues_count} - this.changeTrends("Issue","create")}>未处理的任务 + this.changeTrends("Issue","create")}>未处理的易修
From bb1175de01d1f748a3f6606676723d27ec3b716f Mon Sep 17 00:00:00 2001 From: caishi Date: Thu, 14 Oct 2021 14:28:20 +0800 Subject: [PATCH 10/16] =?UTF-8?q?setting=E4=BF=AE=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E6=97=B6=E8=A6=81=E9=9A=90=E8=97=8F=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Settings/Setting.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/forge/Settings/Setting.js b/src/forge/Settings/Setting.js index 460ec162..deccb3da 100644 --- a/src/forge/Settings/Setting.js +++ b/src/forge/Settings/Setting.js @@ -157,9 +157,6 @@ class Setting extends Component { ...values, }).then((result) => { if (result) { - this.setState({ - loading:false - }) this.props.showNotification(`仓库信息修改成功!`); if(values.project_identifier !== projectsId){ this.props.history.push(`/${owner}/${values.project_identifier}/settings`); @@ -168,8 +165,10 @@ class Setting extends Component { getDetail && getDetail(); } } + this.setState({ + loading:false + }) }).catch((error) => { - console.log(error); this.setState({ loading:false }) From 1aa6c0586917e4eb6d040409a62682b27e846a6b Mon Sep 17 00:00:00 2001 From: caishi Date: Thu, 14 Oct 2021 14:55:35 +0800 Subject: [PATCH 11/16] =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=AF=94=E4=BE=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Activity/Activity.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/forge/Activity/Activity.js b/src/forge/Activity/Activity.js index 0450e462..99eaa332 100644 --- a/src/forge/Activity/Activity.js +++ b/src/forge/Activity/Activity.js @@ -115,8 +115,8 @@ class Activity extends Component{ render(){ const { time , data , page , project_trends , isSpin } = this.state; let name = time ? ARRAY.filter(item=>item.id === parseInt(time)) :[{name:"全部"}]; - const first_per = data && (parseInt(data.pr_count)/parseInt(data.pr_count+data.new_pr_count)*100).toFixed(2)+'%'; - const second_per =data && (parseInt(data.new_pr_count)/parseInt(data.pr_count+data.new_pr_count)*100).toFixed(2)+'%'; + const first_per = data && (parseInt(data.pr_count)/parseInt(data.pr_all_count)*100).toFixed(2)+'%'; + const second_per =data && (parseInt(data.new_pr_count)/parseInt(data.pr_all_count)*100).toFixed(2)+'%'; const third_per =data && (parseInt(data.close_issues_count)/parseInt(data.issues_count)*100).toFixed(2)+'%'; const fourth_per =data && (parseInt(data.open_issues_count)/parseInt(data.issues_count)*100).toFixed(2)+'%'; return( From 95050bb3bd2cda20b772ba5d2e8ff9ee204072eb Mon Sep 17 00:00:00 2001 From: caishi Date: Fri, 15 Oct 2021 10:54:26 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E9=9D=9E.git=E7=BB=93=E5=B0=BE=E7=9A=84?= =?UTF-8?q?=E4=B9=9F=E9=9C=80=E8=A6=81=E8=87=AA=E5=8A=A8=E5=A1=AB=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/New/Index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js index c6eb2c3d..e9aa1f95 100644 --- a/src/forge/New/Index.js +++ b/src/forge/New/Index.js @@ -285,12 +285,16 @@ class Index extends Component { if(value.indexOf("/") > -1){ let arr = value.split("/"); let first = arr[arr.length-1]; - if(first.indexOf(".git") > -1){ + if(first.indexOf(".") > -1){ let second = first.split('.')[0]; if(!second)return; this.props.form.setFieldsValue({ repository_name:second }) + }else{ + this.props.form.setFieldsValue({ + repository_name:first + }) } } } @@ -351,7 +355,7 @@ class Index extends Component { required: true, message: '请填写镜像版本库地址' }], })( - + )}

示例:https://github.com/facebook/reack.git

From 35110b7db4b8f46e0a8b652cd567dd8abaa4d12e Mon Sep 17 00:00:00 2001 From: caishi Date: Fri, 15 Oct 2021 14:15:23 +0800 Subject: [PATCH 13/16] =?UTF-8?q?=E5=8A=A8=E6=80=81=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Activity/Activity.js | 4 ++-- src/forge/Main/Index.scss | 6 +++--- src/forge/Newfile/m_editor.js | 13 +++++++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/forge/Activity/Activity.js b/src/forge/Activity/Activity.js index 99eaa332..a0538552 100644 --- a/src/forge/Activity/Activity.js +++ b/src/forge/Activity/Activity.js @@ -143,11 +143,11 @@ class Activity extends Component{ From b30f2169e45d7d23a2d6cdb98d3353159a760f66 Mon Sep 17 00:00:00 2001 From: caishi Date: Fri, 15 Oct 2021 15:20:21 +0800 Subject: [PATCH 15/16] =?UTF-8?q?=E6=95=B0=E6=8D=AEstate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Activity/Activity.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/forge/Activity/Activity.js b/src/forge/Activity/Activity.js index fed2992a..4a7a1d34 100644 --- a/src/forge/Activity/Activity.js +++ b/src/forge/Activity/Activity.js @@ -40,6 +40,11 @@ class Activity extends Component{ type:undefined, state:undefined, page:1, + pr_count:undefined, + new_pr_count:undefined, + close_issues_count:undefined, + open_issues_count:undefined, + pr_all_count:undefined,issues_count:undefined, data:undefined, project_trends:undefined, @@ -67,7 +72,13 @@ class Activity extends Component{ this.setState({ data:result.data, project_trends:result.data.project_trends, - isSpin:false + isSpin:false, + pr_count:result.data.pr_count, + new_pr_count:result.data.new_pr_count, + close_issues_count:result.data.close_issues_count, + open_issues_count:result.data.open_issues_count, + pr_all_count:result.data.pr_all_count, + issues_count:result.data.issues_count, }) window.scrollTo(0,0); } @@ -113,12 +124,14 @@ class Activity extends Component{ ) render(){ - const { time , data , page , project_trends , isSpin } = this.state; + const { time , data , page , project_trends , isSpin , pr_count , new_pr_count , close_issues_count , open_issues_count , pr_all_count ,issues_count } = this.state; let name = time ? ARRAY.filter(item=>item.id === parseInt(time)) :[{name:"全部"}]; - const first_per = data && (parseInt(data.pr_count)/parseInt(data.pr_all_count)*100).toFixed(2)+'%'; - const second_per =data && (parseInt(data.new_pr_count)/parseInt(data.pr_all_count)*100).toFixed(2)+'%'; - const third_per =data && (parseInt(data.close_issues_count)/parseInt(data.issues_count)*100).toFixed(2)+'%'; - const fourth_per =data && (parseInt(data.open_issues_count)/parseInt(data.issues_count)*100).toFixed(2)+'%'; + + const first_per = pr_all_count > 0 ? `${parseFloat(pr_count/pr_all_count).toFixed(2)*100}%` :"50%"; + const second_per =pr_all_count > 0 ? `${parseFloat(new_pr_count/pr_all_count).toFixed(2)*100}%` :"50%"; + const third_per =issues_count > 0 ?`${parseFloat(close_issues_count/issues_count).toFixed(2)*100}%` :"50%"; + const fourth_per =issues_count > 0 ?`${parseFloat(open_issues_count/issues_count).toFixed(2)*100}%` :"50%"; + return(
From 66108083fd2e207e5a200d1edd754e141eadbff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Fri, 15 Oct 2021 15:22:22 +0800 Subject: [PATCH 16/16] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=AF=B7=E6=B1=82=E9=A1=B5=E9=9D=A2=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E5=88=86=E6=94=AF=E5=AD=98=E5=9C=A8=E4=BD=86=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=AD=98=E5=9C=A8bug=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E6=96=87=E4=BB=B6=E6=8C=89=E9=92=AE=E4=B8=8A?= =?UTF-8?q?=E7=A7=BB=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/Diff.jsx | 4 ++-- src/forge/Merge/CreateMerge.js | 33 ++++++++++++++++++++------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/forge/Main/Diff.jsx b/src/forge/Main/Diff.jsx index 6556023e..8dad59fb 100644 --- a/src/forge/Main/Diff.jsx +++ b/src/forge/Main/Diff.jsx @@ -21,8 +21,8 @@ const Infos = styled.div` & .markdown-body table{ background: #f1f8ff; } - & .f-wrap-between{ - align-items: center; + & .btnblue{ + margin-top: 12px; } & .task-hide{ width: 65rem; diff --git a/src/forge/Merge/CreateMerge.js b/src/forge/Merge/CreateMerge.js index 0f685907..c335d79f 100644 --- a/src/forge/Merge/CreateMerge.js +++ b/src/forge/Merge/CreateMerge.js @@ -96,7 +96,6 @@ class CreateMerge extends Component { // 再获取对应的仓库列表、分支列表 // 再调用比较接口 const branchParams = getBranchParams(this.props.location.pathname); - console.log('componentDidMount branchParams', branchParams); this.getMergeInfo(branchParams); }; @@ -106,7 +105,6 @@ class CreateMerge extends Component { const newPathname = this.props.location.pathname; if (oldPathname !== newPathname) { const branchParams = getBranchParams(newPathname); - console.log('componentDidUpdate branchParams', branchParams); this.getMergeInfo(branchParams); } }; @@ -142,22 +140,29 @@ class CreateMerge extends Component { pull: pullBranch, }); - if (!noMergeBranch && !noPullBranch) { - this.compareProject(result.data.id, branchParams); - } else { - const _message = []; - noMergeBranch && _message.push('目标分支不存在'); - noPullBranch && _message.push('源分支不存在'); + //判断源分支是否存在 + if(noPullBranch){ this.setState({ showMessage: true, - defaultMessage: _message.join(' , '), + defaultMessage:'源分支不存在', isCompareSpin: false, }); + }else{ + if(pullOwner === mergeOwner){ + if (!noMergeBranch) { + this.compareProject(result.data.id, branchParams); + } else { + this.setState({ + showMessage: true, + defaultMessage:'目标分支不存在', + isCompareSpin: false, + }); + } + }else{ + this.getBranchList(branchParams); + } } } - if (pullOwner !== mergeOwner) { - this.getBranchList(branchParams); - } this.setState({ isSpin: false }); }) .catch((error) => { @@ -225,7 +230,9 @@ class CreateMerge extends Component { .length === 0; this.setState({ mergeBranches: result.data, - merge: noMergeBranch ? 'master' : mergeBranch, + showMessage: noMergeBranch, + defaultMessage: '目标分支不存在', + isCompareSpin: false, }); } this.setState({ isSpin: false });