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/Activity/Activity.js b/src/forge/Activity/Activity.js
index 0272f065..4a7a1d34 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,10 +36,15 @@ class Activity extends Component{
constructor(props){
super(props);
this.state={
- time:'30',
+ time:undefined,
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,
@@ -63,8 +72,15 @@ 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);
}
}).catch(error=>{
console.log(error);
@@ -74,19 +90,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)=>{
@@ -108,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:"全部"}];
- 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)+'%';
+ 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(
@@ -122,7 +140,7 @@ class Activity extends Component{
{data && data.pr_all_count}合并请求
@@ -132,25 +150,25 @@ class Activity extends Component{
-
{data && data.issues_count}任务
+
{data && data.issues_count}易修
-
{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}
- this.changeTrends("Issue","close")}>已关闭的任务
+ this.changeTrends("Issue","delay")}>已关闭的易修
-
{data && data.open_issues_count}
- this.changeTrends("Issue","create")}>未处理的任务
+ this.changeTrends("Issue","not_delay")}>未处理的易修
diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js
index da6d9338..06d2fc44 100644
--- a/src/forge/Main/Detail.js
+++ b/src/forge/Main/Detail.js
@@ -557,7 +557,7 @@ class Detail extends Component {
- 复刻
+ 复刻(Fork)
{
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/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/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)} : ""}
diff --git a/src/forge/Main/tag/Index.jsx b/src/forge/Main/tag/Index.jsx
index 0fd40b1f..ff764851 100644
--- a/src/forge/Main/tag/Index.jsx
+++ b/src/forge/Main/tag/Index.jsx
@@ -121,15 +121,15 @@ function Tags(props) {
- {
- source && source.length > 0 &&
-
- }
- {
- source && source.length === 0 &&
- }
+ {
+ source && source.length > 0 &&
+
+ }
+ {
+ source && source.length === 0 &&
+ }
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 });
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 ec9f80c8..deccb3da 100644
--- a/src/forge/Settings/Setting.js
+++ b/src/forge/Settings/Setting.js
@@ -157,19 +157,18 @@ 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`);
- // }else{
- // }
+ if(values.project_identifier !== projectsId){
+ this.props.history.push(`/${owner}/${values.project_identifier}/settings`);
+ }else{
const { getDetail } = this.props;
getDetail && getDetail();
+ }
}
+ this.setState({
+ loading:false
+ })
}).catch((error) => {
- console.log(error);
this.setState({
loading:false
})
@@ -288,7 +287,9 @@ class Setting extends Component {
)}
- {/*
+ 项目标识 (项目url标识部分,更改项目标识将导致原仓库地址失效)}
+ >
{getFieldDecorator("project_identifier", {
rules: [
{
@@ -299,7 +300,7 @@ class Setting extends Component {
})(
)}
- */}
+
{getFieldDecorator("project_description", {
rules: [],
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;