From 8ace7da3a74a078fb9555e6989e92cadc10c1d37 Mon Sep 17 00:00:00 2001
From: caishi
Date: Fri, 15 Oct 2021 14:40:40 +0800
Subject: [PATCH 14/16] =?UTF-8?q?=E5=90=8C=E4=B8=8A-=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=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 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/forge/Activity/Activity.js b/src/forge/Activity/Activity.js
index a0538552..fed2992a 100644
--- a/src/forge/Activity/Activity.js
+++ b/src/forge/Activity/Activity.js
@@ -151,11 +151,11 @@ class Activity extends Component{
{data && data.close_issues_count}
- this.changeTrends("Issue","close")}>已关闭的易修
+ this.changeTrends("Issue","delay")}>已关闭的易修
{data && data.open_issues_count}
- this.changeTrends("Issue","create")}>未处理的易修
+ this.changeTrends("Issue","not_delay")}>未处理的易修
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 });