diff --git a/src/forge/Activity/Activity.js b/src/forge/Activity/Activity.js index 0450e462..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_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)+'%'; + + 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(
@@ -143,19 +156,19 @@ class Activity extends Component{
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/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

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 && (
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 })