Merge branch 'develop' of https://git.trustie.net/jasder/forgeplus-react
This commit is contained in:
commit
b7869e5203
|
@ -60,12 +60,13 @@ body {
|
|||
.ant-progress-textno {
|
||||
color: #f5222d;
|
||||
}
|
||||
|
||||
.CodeMirror pre.CodeMirror-line{
|
||||
font-size: 16px!important;
|
||||
}
|
||||
/* md多空格 */
|
||||
.markdown-body p {
|
||||
margin:10px 0px!important;
|
||||
font-size: 16px !important;
|
||||
line-height: 2 !important;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
|
@ -87,6 +88,10 @@ body {
|
|||
border-left: 1px solid rgb(221, 221, 221);
|
||||
/* 某些情况下,被cm盖住了 */
|
||||
z-index: 99;
|
||||
padding:8px 8px 50px;
|
||||
}
|
||||
.editormd-preview .markdown-body{
|
||||
padding:0px !important;
|
||||
}
|
||||
|
||||
/* 图片点击放大的场景,隐藏图片链接 */
|
||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import { AlignCenter , AlignTop , FlexAJ } from '../Component/layout';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
function Releases({owner,projectsId,releaseVersions}){
|
||||
function Releases({owner,projectsId,releaseVersions , baseOperate}){
|
||||
|
||||
return(
|
||||
<div>
|
||||
|
@ -13,7 +13,7 @@ function Releases({owner,projectsId,releaseVersions}){
|
|||
{ releaseVersions && releaseVersions.total_count > 0 ?
|
||||
<Link className="font-12 color-grey-9" to={`/projects/${owner}/${projectsId}/releases`}>全部</Link>
|
||||
:
|
||||
<Link className="font-12 color-blue" to={`/projects/${owner}/${projectsId}/releases/new`}>新建</Link>
|
||||
baseOperate && <Link className="font-12 color-blue" to={`/projects/${owner}/${projectsId}/releases/new`}>新建</Link>
|
||||
}
|
||||
</FlexAJ>
|
||||
{
|
||||
|
|
|
@ -42,7 +42,7 @@ function PipelineName({visible,onCancel,onOk,value ,branchList}){
|
|||
</div>
|
||||
<div className="choosenList mt20">
|
||||
<span>触发条件:</span>
|
||||
<Select value={branchValue} style={{width:"150px"}} onChange={(e)=>setBranchValue(e)}>
|
||||
<Select value={branchValue} style={{width:"150px"}} dropdownClassName="chooseCon" onChange={(e)=>setBranchValue(e)}>
|
||||
{
|
||||
branchList && branchList.length>0 && branchList.map((item,key)=>{
|
||||
return(
|
||||
|
@ -51,7 +51,7 @@ function PipelineName({visible,onCancel,onOk,value ,branchList}){
|
|||
})
|
||||
}
|
||||
</Select>
|
||||
<Select mode="multiple" allowClear value={eventValue} style={{width:"180px",marginLeft:"10px"}} onChange={(e)=>{console.log(e);setEventValue(e)}}>
|
||||
<Select mode="multiple" allowClear value={eventValue} dropdownClassName="chooseCon" style={{width:"180px",marginLeft:"10px"}} onChange={(e)=>{console.log(e);setEventValue(e)}}>
|
||||
{
|
||||
EVENT.map((item,key)=>{
|
||||
return(
|
||||
|
|
|
@ -391,6 +391,9 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
.chooseCon.ant-select-dropdown{
|
||||
z-index: 100001;
|
||||
}
|
||||
|
||||
.choosenList{
|
||||
display: flex;
|
||||
|
|
|
@ -277,6 +277,7 @@ function CoderDepot(props){
|
|||
const mdFlag = n && n.substring(n.length-3,n.length) === ".md";
|
||||
|
||||
const { current_user } = props;
|
||||
const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter";
|
||||
const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin));
|
||||
return(
|
||||
<WhiteBack>
|
||||
|
@ -339,13 +340,16 @@ function CoderDepot(props){
|
|||
</AlignCenter>
|
||||
</AlignCenter>
|
||||
<AlignCenter>
|
||||
<div className="mr20 addOptionBtn">
|
||||
{
|
||||
projectDetail.type !== 2 &&
|
||||
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求</a>
|
||||
}
|
||||
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务</a>
|
||||
</div>
|
||||
{
|
||||
baseOperate &&
|
||||
<div className="mr20 addOptionBtn">
|
||||
{
|
||||
projectDetail.type !== 2 &&
|
||||
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求</a>
|
||||
}
|
||||
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务</a>
|
||||
</div>
|
||||
}
|
||||
{ fileOperate &&
|
||||
<Dropdown overlay={fileMenu()} className="mr20" trigger={['click']}>
|
||||
<Button type="default">文件 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-grey-9"></i></Button>
|
||||
|
@ -370,7 +374,9 @@ function CoderDepot(props){
|
|||
{ hideBtn && <span className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></span> }
|
||||
|
||||
<span className="ml12 color-grey-9 mt3">{lastCommit && lastCommit.time_from_now}</span>
|
||||
{ commitCount ? <Link to={`/projects/${owner}/${projectsId}/commits`} className="ml12 color-grey-9"><i className="iconfont icon-tijiao mr3 font-17 color-grey-9"></i>{commitCount}次提交</Link>:"" }
|
||||
{ commitCount ? <Link to={`/projects/${owner}/${projectsId}/commits/branch/${turnbar(branchName || defaultBranch)}`} className="ml12 color-grey-9">
|
||||
<i className="iconfont icon-tijiao mr3 font-17 color-grey-9"></i>{commitCount}次提交
|
||||
</Link>:"" }
|
||||
</div>
|
||||
}
|
||||
<ul className="listtablebody">
|
||||
|
@ -472,7 +478,13 @@ function CoderDepot(props){
|
|||
projectDetail && projectDetail.release_versions &&
|
||||
<React.Fragment>
|
||||
<Divider />
|
||||
<Releases owner={owner} projectsId={projectsId} releaseVersions={projectDetail.release_versions} history={props.history}/>
|
||||
<Releases
|
||||
owner={owner}
|
||||
projectsId={projectsId}
|
||||
releaseVersions={projectDetail.release_versions}
|
||||
history={props.history}
|
||||
baseOperate={baseOperate}
|
||||
/>
|
||||
</React.Fragment>
|
||||
}
|
||||
{/* 贡献者 */}
|
||||
|
|
|
@ -17,7 +17,8 @@ export default ((props)=>{
|
|||
const [ isSpin , setIsSpin ] =useState(true);
|
||||
|
||||
const { projectsId , owner } = props.match.params;
|
||||
|
||||
const { isManager , isDeveloper} = props;
|
||||
console
|
||||
useEffect(()=>{
|
||||
getBranchs(projectsId, owner);
|
||||
},[projectsId])
|
||||
|
@ -46,7 +47,10 @@ export default ((props)=>{
|
|||
</p>
|
||||
</div>
|
||||
<span>
|
||||
<Link to={`/projects/${owner}/${projectsId}/pulls/new/${item.name}`} className="mr20 color-blue mr30">创建合并请求</Link>
|
||||
{
|
||||
(isManager || isDeveloper) &&
|
||||
<Link to={`/projects/${owner}/${projectsId}/pulls/new/${item.name}`} className="mr20 color-blue mr30">创建合并请求</Link>
|
||||
}
|
||||
<Dropdown overlay={menu(item.zip_url,item.tar_url)} trigger={['click']} placement="bottomRight" className="color-green-file">
|
||||
<a className="ant-dropdown-link">
|
||||
<Tooltip title={`下载分支${item.name}`}><Icon type="cloud-download" className="font-18"/></Tooltip>
|
||||
|
@ -70,6 +74,7 @@ export default ((props)=>{
|
|||
<Menu.Item key={'1'}><a href={tar_url}>TAR.GZ</a></Menu.Item>
|
||||
</Menu>
|
||||
)
|
||||
|
||||
return(
|
||||
<React.Fragment>
|
||||
<div className="main">
|
||||
|
|
|
@ -9,6 +9,12 @@ import Nodata from '../Nodata';
|
|||
import axios from 'axios';
|
||||
import {Link} from "react-router-dom";
|
||||
|
||||
function returnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("%2F")>-1){
|
||||
return str.replaceAll('%2F','/');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
class CoderRootCommit extends Component{
|
||||
constructor(props){
|
||||
super(props)
|
||||
|
@ -57,11 +63,12 @@ class CoderRootCommit extends Component{
|
|||
this.setState({
|
||||
isSpining:true
|
||||
})
|
||||
console.log(returnbar(branch));
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
const url = `/${owner}/${projectsId}/commits.json`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
sha:branch,
|
||||
sha:returnbar(branch),
|
||||
page,
|
||||
limit
|
||||
}
|
||||
|
@ -106,7 +113,7 @@ class CoderRootCommit extends Component{
|
|||
const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state;
|
||||
const { projectDetail, commit_class , defaultBranch } = this.props;
|
||||
const { projectsId , owner , branchName } = this.props.match.params;
|
||||
let branch = branchName || defaultBranch;
|
||||
let branch = returnbar(branchName || defaultBranch);
|
||||
return(
|
||||
<React.Fragment>
|
||||
<div className={"main"}style={{padding:"0px",border:"none"}}>
|
||||
|
|
|
@ -102,6 +102,11 @@ class CoderRootIndex extends Component{
|
|||
(props) => (<FileNew {...this.props} {...props} {...this.state} getTopCount={this.getTopCount} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/commits/branch/:branchName"
|
||||
render={
|
||||
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/commits/:sha"
|
||||
render={
|
||||
(props) => (<Diff {...this.props} {...props} {...this.state}/>)
|
||||
|
|
|
@ -442,7 +442,7 @@ class Detail extends Component {
|
|||
<Link to={`${project.author.type ==="Organization" ? "/organize":'/users'}/${project.author.login}`}>{project.author.name}</Link>
|
||||
}
|
||||
<span className="ml5 mr5">/</span>
|
||||
<Link to={`/projects/${owner}/${projectsId}`} className="projectN mt6">{project && project.name}</Link>
|
||||
<Link to={`/projects/${owner}/${projectsId}`} className="projectN mt6">{projectDetail && projectDetail.name}</Link>
|
||||
</div>
|
||||
{ projectDetail && projectDetail.private && <span className="privateTag mt6">私有</span>}
|
||||
</AlignTop>
|
||||
|
|
|
@ -183,7 +183,7 @@ class MergeItem extends Component {
|
|||
) : (
|
||||
""
|
||||
)}
|
||||
{user_admin_or_member ? (
|
||||
{user_admin_or_member && item.pull_request_status === 0 ? (
|
||||
<div
|
||||
className="milepostleft"
|
||||
style={{
|
||||
|
|
|
@ -42,9 +42,10 @@ class NewMerge extends Component {
|
|||
|
||||
componentDidUpdate=(preProps)=>{
|
||||
const { project } = this.props;
|
||||
const { pull } = this.state;
|
||||
let oldProject = preProps.project;
|
||||
if(project && oldProject && (oldProject.id !== project.id)){
|
||||
this.compareProject(this.state.id,"master","master");
|
||||
this.compareProject(this.state.id,pull,"master");
|
||||
}
|
||||
}
|
||||
// 页面销毁取消监听
|
||||
|
@ -78,7 +79,8 @@ class NewMerge extends Component {
|
|||
this.set_default_pull(result.data.branches);
|
||||
this.set_default_merge(result.data.merge_projects);
|
||||
}
|
||||
this.compareProject(result.data.id,"master","master");
|
||||
const { pull } = this.state;
|
||||
this.compareProject(result.data.id,pull||"master","master");
|
||||
this.setState({isSpin: false})
|
||||
})
|
||||
.catch((error) => {
|
||||
|
|
|
@ -159,14 +159,10 @@ class merge extends Component {
|
|||
<Menu.Item key={"all"} onClick={(e) => this.getOption(e, id, name)}>
|
||||
{name}
|
||||
</Menu.Item>
|
||||
{array &&
|
||||
array.length > 0 &&
|
||||
array.map((item, key) => {
|
||||
{array && array.length > 0 && array.map((item, key) => {
|
||||
return (
|
||||
<Menu.Item
|
||||
key={item.id}
|
||||
onClick={(e) => this.getOption(e, id, item.name)}
|
||||
>
|
||||
((!item.permission) || (item.permission && item.permission !== "Reporter")) &&
|
||||
<Menu.Item key={item.id} onClick={(e) => this.getOption(e, id, item.name)}>
|
||||
{item.name}
|
||||
</Menu.Item>
|
||||
);
|
||||
|
|
|
@ -346,18 +346,20 @@ class MergeForm extends Component {
|
|||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item name="checkbox-group" label="其他">
|
||||
<Checkbox.Group>
|
||||
<div>
|
||||
<Checkbox value="A">必须审查代码</Checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<Checkbox value="B">合并后删除提交分支</Checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<Checkbox value="C">合并后关闭提到的任务</Checkbox>
|
||||
</div>
|
||||
</Checkbox.Group>
|
||||
<Form.Item label="其他">
|
||||
{getFieldDecorator("checkbox-group")(
|
||||
<Checkbox.Group>
|
||||
<div>
|
||||
<Checkbox value="A">必须审查代码</Checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<Checkbox value="B">合并后删除提交分支</Checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<Checkbox value="C">合并后关闭提到的任务</Checkbox>
|
||||
</div>
|
||||
</Checkbox.Group>
|
||||
)}
|
||||
</Form.Item>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -154,10 +154,10 @@ class Milepost extends Component {
|
|||
const { projectsId , owner } = this.props.match.params;
|
||||
const menu = (
|
||||
<Menu className="orderCondition" onClick={this.arrayList}>
|
||||
<Menu.Item key={'created_on'} value="desc">到期日从近到远</Menu.Item>
|
||||
<Menu.Item key={'created_on'} value="asc">到期日从远到近</Menu.Item>
|
||||
<Menu.Item key={'percent'} value="desc">完成度从低到高</Menu.Item>
|
||||
<Menu.Item key={'percent'} value="asc">完成度从高到低</Menu.Item>
|
||||
<Menu.Item key={'effective_date'} value="desc">到期日从近到远</Menu.Item>
|
||||
<Menu.Item key={'effective_date'} value="asc">到期日从远到近</Menu.Item>
|
||||
<Menu.Item key={'percent'} value="asc">完成度从低到高</Menu.Item>
|
||||
<Menu.Item key={'percent'} value="desc">完成度从高到低</Menu.Item>
|
||||
<Menu.Item key={'issues_count'} value="desc">任务从多到少</Menu.Item>
|
||||
<Menu.Item key={'issues_count'} value="asc">任务从少到多</Menu.Item>
|
||||
</Menu>
|
||||
|
|
|
@ -180,8 +180,8 @@ class UpdateMilepost extends Component {
|
|||
<Row type="flex" justify="space-between">
|
||||
<Col>
|
||||
<Group size="small" onChange={e => onTypeChange(e.target.value)} value={type}>
|
||||
<Button value="month">月份</Button>
|
||||
<Button value="year">年份</Button>
|
||||
<Button value="month">日期</Button>
|
||||
<Button value="year">月份</Button>
|
||||
</Group>
|
||||
</Col>
|
||||
<Col>
|
||||
|
|
|
@ -92,10 +92,10 @@ class order_form extends Component {
|
|||
|
||||
const url = `/${owner}/${projectsId}/issues/new.json`;
|
||||
axios.get(url).then((result) => {
|
||||
if (result) {
|
||||
if (result && result.data) {
|
||||
this.setState({
|
||||
issue_chosen: result.data.issue_chosen,
|
||||
branches: result.data.branches,
|
||||
branches: result.data.issue_chosen.branches,
|
||||
isSpin:false
|
||||
});
|
||||
|
||||
|
|
|
@ -58,8 +58,12 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification
|
|||
})
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
setListData(result.data.members);
|
||||
setTotal(result.data.total_count);
|
||||
if(page > 1 && ( listData && listData.length === 1)){
|
||||
setPage(page-1);
|
||||
}else{
|
||||
setListData(result.data.members);
|
||||
setTotal(result.data.total_count);
|
||||
}
|
||||
setIsSpin(false);
|
||||
}
|
||||
})
|
||||
|
|
|
@ -302,7 +302,7 @@ function New({ form , match , showNotification , history }) {
|
|||
<Form.Item
|
||||
label="分支过滤"
|
||||
className="topLine"
|
||||
help={'推送、创建,删除分支事件的分支白名单,使用 glob 模式匹配指定。若为空或 *,则将报告所有分支的事件。语法文档见github.com/gobwas/glob。示例:master,{master,release*}。'}
|
||||
help={<span>推送、创建,删除分支事件的分支白名单,使用 glob 模式匹配指定。若为空或 *,则将报告所有分支的事件。语法文档见<a href="github.com/gobwas/glob" target="_blank" className="hoverLine color-blue">github.com/gobwas/glob</a>。示例:master,{'{'}master,release*{'}'}。</span>}
|
||||
colon={false}
|
||||
style={{marginTop:'15px'}}
|
||||
>
|
||||
|
|
|
@ -58,6 +58,8 @@ class version extends Component {
|
|||
|
||||
renderList = (releases) => {
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
const { isManager , isDeveloper , isReporter } = this.props;
|
||||
console.log(isDeveloper,isManager,isReporter);
|
||||
if (releases && releases.length > 0) {
|
||||
return (
|
||||
releases.map((item, key) => {
|
||||
|
@ -74,7 +76,10 @@ class version extends Component {
|
|||
<div className="versionInfo_right">
|
||||
<span className="versionName">
|
||||
<span className="task-hide">{item.name}</span>
|
||||
<Link to={`/projects/${owner}/${projectsId}/releases/${item.version_id}/update`} className="color-blue ml3 font-12">(编辑)</Link>
|
||||
{
|
||||
(isManager || isDeveloper) &&
|
||||
<Link to={`/projects/${owner}/${projectsId}/releases/${item.version_id}/update`} className="color-blue ml3 font-12">(编辑)</Link>
|
||||
}
|
||||
</span>
|
||||
<span className="color-grey-3">
|
||||
<i className={`${item.bodyshow ? "iconfont icon-sanjiaoxing-down color-grey-8 mr3 font-14":"iconfont icon-triangle color-grey-8 mr3 font-14"}`} onClick={()=>this.showBody(key,item.bodyshow)}></i>
|
||||
|
@ -100,7 +105,7 @@ class version extends Component {
|
|||
|
||||
render() {
|
||||
const { projectsId ,owner } = this.props.match.params;
|
||||
const { data , releases , isSpin } = this.state
|
||||
const { data , releases , isSpin } = this.state;
|
||||
|
||||
return (
|
||||
<div className="main" style={{padding:"0px"}}>
|
||||
|
|
|
@ -105,6 +105,7 @@ $flex:flex;
|
|||
word-break: break-all;
|
||||
text-align: justify;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
.focusBox,.infoBox{
|
||||
width: 100%!important;
|
||||
|
|
|
@ -41,9 +41,6 @@
|
|||
z-index: 1000 !important;
|
||||
}
|
||||
|
||||
.markdown-body p {
|
||||
margin: 0 !important
|
||||
}
|
||||
.markdown-body img{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue