From bb1175de01d1f748a3f6606676723d27ec3b716f Mon Sep 17 00:00:00 2001 From: caishi Date: Thu, 14 Oct 2021 14:28:20 +0800 Subject: [PATCH 1/6] =?UTF-8?q?setting=E4=BF=AE=E6=94=B9=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E6=97=B6=E8=A6=81=E9=9A=90=E8=97=8F=E5=8A=A0=E8=BD=BD=E6=95=88?= =?UTF-8?q?=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 2/6] =?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 3/6] =?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 4/6] =?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{
  • {data && data.pr_count} - this.changeTrends("PullRequest","close")}>已处理的合并请求 + this.changeTrends("PullRequest","delay")}>已处理的合并请求
  • {data && data.new_pr_count} - this.changeTrends("PullRequest","create")}>未处理的合并请求 + this.changeTrends("PullRequest","not_delay")}>未处理的合并请求
  • {data && data.close_issues_count} diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss index 4ec6a7cb..5f369292 100644 --- a/src/forge/Main/Index.scss +++ b/src/forge/Main/Index.scss @@ -480,7 +480,7 @@ } } .ant-anchor-wrapper{ - padding-left: 2px; + padding-left: 2px!important; .ant-anchor-ink::before{ background-color: #fff; } @@ -490,8 +490,8 @@ margin:0px auto; } .griditemAnchor{ - margin-left: 0px; - padding: 0px; + margin-left: 0px!important; + padding: 0px!important; border-bottom: 1px solid #ddd; .ant-anchor{ display: flex; diff --git a/src/forge/Newfile/m_editor.js b/src/forge/Newfile/m_editor.js index 242f7e0d..13d2ec46 100644 --- a/src/forge/Newfile/m_editor.js +++ b/src/forge/Newfile/m_editor.js @@ -1,5 +1,7 @@ import React, { Component } from "react"; import Editor from "react-monaco-editor"; +// import {UnControlled as CodeMirror} from 'react-codemirror2' + import UserSubmitComponent from "./UserSubmitComponent"; import "./index.css"; @@ -103,6 +105,17 @@ class m_editor extends Component { editorWillMount={this.editorWillMount} editorDidMount={handleEditorMount} /> + {/* */} {!readOnly && (
    From 8ace7da3a74a078fb9555e6989e92cadc10c1d37 Mon Sep 17 00:00:00 2001 From: caishi Date: Fri, 15 Oct 2021 14:40:40 +0800 Subject: [PATCH 5/6] =?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 6/6] =?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(