Merge pull request '202110151541 release' (#179) from pre_develop_dev into pre_develop
This commit is contained in:
commit
3e3e9f3681
|
@ -2456,7 +2456,7 @@ a.hoverLine:hover{
|
|||
|
||||
|
||||
.color-grey-9 {
|
||||
color: #333333 !important;
|
||||
color: #999 !important;
|
||||
}
|
||||
|
||||
a:hover{
|
||||
|
|
|
@ -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{
|
|||
</Menu>
|
||||
)
|
||||
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(
|
||||
<div className="main">
|
||||
|
||||
|
@ -122,7 +140,7 @@ class Activity extends Component{
|
|||
<div className="orderInfo">
|
||||
<div>
|
||||
<div className="percentLine prPercent">
|
||||
<p className="percent_purple" style={{width:'100%'}}></p>
|
||||
<p className="percent_purple" style={{width:first_per}}></p>
|
||||
<p className="percent_green resetStyle" style={{width:`${second_per}`}}></p>
|
||||
</div>
|
||||
<span>{data && data.pr_all_count}合并请求</span>
|
||||
|
@ -132,25 +150,25 @@ class Activity extends Component{
|
|||
<p className="percent_red" style={{width:`${third_per}`}}></p>
|
||||
<p className="percent_green" style={{width:`${fourth_per}`}}></p>
|
||||
</div>
|
||||
<span>{data && data.issues_count}任务</span>
|
||||
<span>{data && data.issues_count}易修</span>
|
||||
</div>
|
||||
</div>
|
||||
<ul className="percentBox">
|
||||
<li>
|
||||
<span className="purple">{data && data.pr_count}</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("PullRequest","close")}>已处理的合并请求</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("PullRequest","delay")}>已处理的合并请求</span>
|
||||
</li>
|
||||
<li>
|
||||
<span className="green">{data && data.new_pr_count}</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("PullRequest","create")}>未处理的合并请求</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("PullRequest","not_delay")}>未处理的合并请求</span>
|
||||
</li>
|
||||
<li>
|
||||
<span className="red">{data && data.close_issues_count}</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("Issue","close")}>已关闭的任务</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("Issue","delay")}>已关闭的易修</span>
|
||||
</li>
|
||||
<li>
|
||||
<span className="green">{data && data.open_issues_count}</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("Issue","create")}>未处理的任务</span>
|
||||
<span className="change" onClick={()=>this.changeTrends("Issue","not_delay")}>未处理的易修</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -557,7 +557,7 @@ class Detail extends Component {
|
|||
<span className="detail_tag_btn" loading={forkSpin}>
|
||||
<Tooltip title="复刻是fork的中文名,即复制代码仓库" placement="bottom">
|
||||
<a className="detail_tag_btn_name" style={{ cursor: platform ? "pointer" : "default" }} onClick={this.forkFunc}>
|
||||
<i className="iconfont icon-fork color-grey-9 mr3 font-16"></i><span>复刻</span>
|
||||
<i className="iconfont icon-fork color-grey-9 mr3 font-16"></i><span>复刻(Fork)</span>
|
||||
</a>
|
||||
</Tooltip>
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -50,7 +50,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
|
|||
<Link to={{ pathname: `/${owner}/${projectsId}/issues`, state }}>
|
||||
<Tooltip title="易修是Issue的中文名,即问题列表" placement="bottom">
|
||||
<i className={"iconfont icon-yixiuicon1 color-grey-3 mr5 font-14"}></i>
|
||||
<span>易修</span>
|
||||
<span>易修(Issue)</span>
|
||||
</Tooltip>
|
||||
{projectDetail && projectDetail.issues_count ? <span className="num">{numFormat(projectDetail.issues_count)}</span> : ""}
|
||||
</Link>
|
||||
|
|
|
@ -121,15 +121,15 @@ function Tags(props) {
|
|||
<SubMenu tab={"tags"} projectsId={projectsId} owner={owner}/>
|
||||
<Spin spinning={isSpin}>
|
||||
<div className="tagSpin">
|
||||
{
|
||||
source && source.length > 0 &&
|
||||
<Table
|
||||
className="tagTable"
|
||||
dataSource={source} columns={columns} pagination={false}></Table>
|
||||
}
|
||||
{
|
||||
source && source.length === 0 && <Nonedata _html={'暂无数据~'}/>
|
||||
}
|
||||
{
|
||||
source && source.length > 0 &&
|
||||
<Table
|
||||
className="tagTable"
|
||||
dataSource={source} columns={columns} pagination={false}></Table>
|
||||
}
|
||||
{
|
||||
source && source.length === 0 && <Nonedata _html={'暂无数据~'}/>
|
||||
}
|
||||
</div>
|
||||
</Spin>
|
||||
</div>
|
||||
|
|
|
@ -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 });
|
||||
|
|
|
@ -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: '请填写镜像版本库地址'
|
||||
}],
|
||||
})(
|
||||
<Input placeholder="请输入需要导入到本项目的仓库地址" onChange={this.ChangeAddr} />
|
||||
<Input placeholder="请输入需要导入到本项目的仓库地址" onBlur={this.ChangeAddr} />
|
||||
)}
|
||||
</Form.Item>
|
||||
<p className="formTip color-orange">示例:https://github.com/facebook/reack.git</p>
|
||||
|
|
|
@ -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}
|
||||
/>
|
||||
{/* <CodeMirror
|
||||
value={editorValue}
|
||||
options={{
|
||||
theme: 'monokai',
|
||||
mode: 'JavaScript',
|
||||
extraKeys: {"Ctrl": "autocomplete"},//ctrl可以弹出提示
|
||||
styleActiveLine: true,
|
||||
lineNumbers: true,
|
||||
readOnly:true
|
||||
}}
|
||||
/> */}
|
||||
</div>
|
||||
{!readOnly && (
|
||||
<div className="editorBorderSubmitBox" style={{marginTop:"20px",padding:"20px"}}>
|
||||
|
|
|
@ -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 {
|
|||
)}
|
||||
</Form.Item>
|
||||
</div>
|
||||
{/* <Form.Item label="项目标识 (项目url标识部分,更改项目标识将导致原仓库地址失效)">
|
||||
<Form.Item
|
||||
label={<span>项目标识 <span className="color-grey-9">(项目url标识部分,更改项目标识将导致原仓库地址失效)</span></span>}
|
||||
>
|
||||
{getFieldDecorator("project_identifier", {
|
||||
rules: [
|
||||
{
|
||||
|
@ -299,7 +300,7 @@ class Setting extends Component {
|
|||
})(
|
||||
<Input placeholder="项目标识请使用与项目相关的英文关键字" maxLength="100" />
|
||||
)}
|
||||
</Form.Item> */}
|
||||
</Form.Item>
|
||||
<Form.Item label="项目简介">
|
||||
{getFieldDecorator("project_description", {
|
||||
rules: [],
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue