Merge branch 'develop'

This commit is contained in:
caishi 2021-06-25 18:21:48 +08:00
commit 777dbd0f43
17 changed files with 135 additions and 91 deletions

View File

@ -71,7 +71,7 @@ function DrawerPanel({visible,onClose,branch,owner,projectsId,history, name , li
let dataref = event.node.props.dataRef; let dataref = event.node.props.dataRef;
if(dataref.type==="file"){ if(dataref.type==="file"){
onClose(); onClose();
history.push(`/projects/${owner}/${projectsId}/tree/${branch}/${dataref.path}`); history.push(`/projects/${owner}/${projectsId}/tree/${branch.replaceAll("/","%2F")}/${dataref.path}`);
} }
} }

View File

@ -66,7 +66,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
ellipsis:true, ellipsis:true,
render:(value,item)=>{ render:(value,item)=>{
return( return(
<Link to={`/projects/${owner}/${projectsId}/tree/${item.branch}/${value}`} className="color-blue">{value}</Link> <Link to={`/projects/${owner}/${projectsId}/tree/${item.branch.replaceAll("/","%2F")}/${value}`} className="color-blue">{value}</Link>
) )
} }
}, },

View File

@ -33,7 +33,7 @@
li{ li{
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
padding:0px; padding:0px!important;
cursor: default; cursor: default;
&:hover{ &:hover{
background-color: #fff; background-color: #fff;

View File

@ -50,7 +50,8 @@ function CoderDepot(props){
const owner = props.match.params.owner; const owner = props.match.params.owner;
const projectsId = props.match.params.projectsId; const projectsId = props.match.params.projectsId;
const branchName = props.match.params.branchName; let branchName = props.match.params.branchName;
branchName = branchName && branchName.replaceAll("%2F",'/');
const details = props.projectDetail; const details = props.projectDetail;
let pathname = props.history.location.pathname; let pathname = props.history.location.pathname;
@ -75,8 +76,9 @@ function CoderDepot(props){
useEffect(()=>{ useEffect(()=>{
if (projectsId && owner && defaultBranch){ if (projectsId && owner && defaultBranch){
if(pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${branchName}/`) > -1) { let b = branchName && branchName.replaceAll("/","%2F");
let url = pathname.split(`/tree/${branchName}/`)[1]; if(pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${b}/`) > -1) {
let url = pathname.split(`/tree/${b}/`)[1];
setTreeValue(url); setTreeValue(url);
getFileInfo(url,branchName); getFileInfo(url,branchName);
setType("file"); setType("file");
@ -92,6 +94,7 @@ function CoderDepot(props){
function getDirInfo(branch){ function getDirInfo(branch){
setIsSpin(true); setIsSpin(true);
const url = `/${owner}/${projectsId}/entries.json`; const url = `/${owner}/${projectsId}/entries.json`;
axios.get(url, { axios.get(url, {
params: { ref: branch } params: { ref: branch }
}).then((result) => { }).then((result) => {
@ -158,17 +161,20 @@ function CoderDepot(props){
// //
function changeBranch(value){ function changeBranch(value){
let url = `/projects/${owner}/${projectsId}${value && `/tree/${value}`}${treeValue ? `/${treeValue}`:""}`; let url = `/projects/${owner}/${projectsId}${value && `/tree/${value.replaceAll("/","%2F")}`}${treeValue ? `/${treeValue}`:""}`;
props.history.push(url); props.history.push(url);
} }
// //
const fileMenu =( function fileMenu(){
let b = branchName || defaultBranch;
return (
<Menu> <Menu>
<Menu.Item><a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/${branchName || defaultBranch}/uploadfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>上传文件</a></Menu.Item> <Menu.Item><a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/${b.replaceAll("/","%2F")}/uploadfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>上传文件</a></Menu.Item>
<Menu.Item><a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/${branchName || defaultBranch}/newfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>新建文件</a></Menu.Item> <Menu.Item><a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/${b.replaceAll("/","%2F")}/newfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>新建文件</a></Menu.Item>
</Menu> </Menu>
) )
}
function getPathUrl(array,index){ function getPathUrl(array,index){
if(array && array.length>0 && index){ if(array && array.length>0 && index){
@ -183,16 +189,18 @@ function CoderDepot(props){
function returnMain(){ function returnMain(){
setTreeValue(undefined); setTreeValue(undefined);
let branch = branchName || defaultBranch; let branch = branchName || defaultBranch;
props.history.push(`/projects/${owner}/${projectsId}/tree/${branch}`); props.history.push(`/projects/${owner}/${projectsId}/tree/${branch.replaceAll("/","%2F")}`);
}; };
// //
function returnUlr(url){ function returnUlr(url){
props.history.push(`/projects/${owner}/${projectsId}/tree${branchName?`/${branchName}`:""}/${url}`); let enBranch = branchName && branchName.replaceAll("/","%2F");
props.history.push(`/projects/${owner}/${projectsId}/tree${enBranch?`/${enBranch}`:""}/${url}`);
} }
// //
function goToSubRoot(path,type,filename){ function goToSubRoot(path,type,filename){
let enBranch = branchName || defaultBranch;
setType(type); setType(type);
props.history.push(`/projects/${owner}/${projectsId}${`/tree/${branchName || defaultBranch}`}${path?`/${path}`:""}`); props.history.push(`/projects/${owner}/${projectsId}${`/tree/${enBranch.replaceAll("/","%2F")}`}${path?`/${path}`:""}`);
} }
function onEdit(readOnly){ function onEdit(readOnly){
@ -317,7 +325,7 @@ function CoderDepot(props){
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务</a> <a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务</a>
</div> </div>
{ fileOperate && { fileOperate &&
<Dropdown overlay={fileMenu} className="mr20" trigger={['click']}> <Dropdown overlay={fileMenu()} className="mr20" trigger={['click']}>
<Button type="default">文件 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-grey-9"></i></Button> <Button type="default">文件 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-grey-9"></i></Button>
</Dropdown> </Dropdown>
} }

View File

@ -32,7 +32,7 @@ export default ((props)=>{
return( return(
<li key={key}> <li key={key}>
<div> <div>
<Link to={`/projects/${owner}/${projectsId}/tree/${item.name}`} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link> <Link to={`/projects/${owner}/${projectsId}/tree/${item.name.replaceAll("/","%2F")}`} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link>
<p className="f-wrap-alignCenter mt15"> <p className="f-wrap-alignCenter mt15">
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.last_commit.sha}`)}`} className="mr5 commitKey" style={{marginLeft:0}}>{item.last_commit && truncateCommitId(item.last_commit.sha)}</Link> <Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.last_commit.sha}`)}`} className="mr5 commitKey" style={{marginLeft:0}}>{item.last_commit && truncateCommitId(item.last_commit.sha)}</Link>
<span className="color-grey-3 hide-1 messages leftPoint">{item.last_commit && item.last_commit.message}</span> <span className="color-grey-3 hide-1 messages leftPoint">{item.last_commit && item.last_commit.message}</span>

View File

@ -2,6 +2,7 @@ import React , { Component } from 'react';
import { Spin , Pagination } from 'antd'; import { Spin , Pagination } from 'antd';
import { getImageUrl } from 'educoder'; import { getImageUrl } from 'educoder';
import { truncateCommitId } from '../common/util'; import { truncateCommitId } from '../common/util';
import { AlignTop } from '../Component/layout';
import SelectBranch from '../Branch/Select'; import SelectBranch from '../Branch/Select';
import Nodata from '../Nodata'; import Nodata from '../Nodata';
@ -132,10 +133,10 @@ class CoderRootCommit extends Component{
commitDatas && commitDatas.length > 0 && commitDatas.map((item,k)=>{ commitDatas && commitDatas.length > 0 && commitDatas.map((item,k)=>{
return( return(
<div key={k}> <div key={k}>
<p className="f-wrap-alignCenter"> <AlignTop>
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitKey" style={{marginLeft:0}}>{truncateCommitId(`${item.sha}`)}</Link> <Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitKey" style={{marginLeft:0,marginTop:"3px"}}>{truncateCommitId(`${item.sha}`)}</Link>
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="flex1 ml20 font-16 color-grey-3">{item.message}</Link> <Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitDesc">{item.message}</Link>
</p> </AlignTop>
<p className="f-wrap-alignCenter mt15"> <p className="f-wrap-alignCenter mt15">
{ {
item.id ? item.id ?

View File

@ -43,7 +43,7 @@ class MergeItem extends Component {
}; };
render() { render() {
const { issues, project_name, project_author_name } = this.props; const { issues, project_name, project_author_name , user_admin_or_member} = this.props;
const { projectsId , owner } = this.props.match.params; const { projectsId , owner } = this.props.match.params;
const { current_user } = this.props; const { current_user } = this.props;
const renderList = () => { const renderList = () => {
@ -99,33 +99,43 @@ class MergeItem extends Component {
</span> </span>
<span className="color-grey-8">{item.pr_time}</span> <span className="color-grey-8">{item.pr_time}</span>
<span className="ml15"> <span className="ml15">
<Tag className="pr-branch-tag"> {
<Link item.pull_request_head &&
to={`/projects/${item.is_original ? item.fork_project_user : owner}/${ item.is_original ? item.fork_project_identifier : projectsId }/tree/${item.pull_request_head}`} <Tag className="pr-branch-tag">
className="maxW200px hide-1 ver-middle" <Link
> to={`/projects/${item.is_original ? item.fork_project_user : owner}/${ item.is_original ? item.fork_project_identifier : projectsId }/tree/${item.pull_request_head.replaceAll("/","%2F")}`}
{item.is_original className="maxW200px hide-1 ver-middle"
? item.fork_project_user >
: project_author_name} {item.is_original
:{item.pull_request_head} ? item.fork_project_user
</Link> : project_author_name}
</Tag> :{item.pull_request_head}
<span className="mr8 ver-middle"> </Link>
<i </Tag>
className={ }
"iconfont icon-youjiang color-grey-c font-16" {
} item.pull_request_base &&
></i> <span className="mr8 ver-middle">
</span> <i
<Tag className="pr-branch-tag"> className={
<Link "iconfont icon-youjiang color-grey-c font-16"
to={`/projects/${owner}/${projectsId}/tree/${item.pull_request_base}`} }
className="maxW200px hide-1 ver-middle" ></i>
> </span>
{/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */} }
{project_author_name}:{item.pull_request_base} {
</Link> item.pull_request_base &&
</Tag> <Tag className="pr-branch-tag">
<Link
to={`/projects/${owner}/${projectsId}/tree/${item.pull_request_base.replaceAll("/","%2F")}`}
className="maxW200px hide-1 ver-middle"
>
{/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */}
{project_author_name}:{item.pull_request_base}
</Link>
</Tag>
}
</span> </span>
</AlignCenter> </AlignCenter>
</p> </p>
@ -167,7 +177,7 @@ class MergeItem extends Component {
) : ( ) : (
"" ""
)} )}
{current_user && current_user.login ? ( {user_admin_or_member ? (
<div <div
className="milepostleft" className="milepostleft"
style={{ style={{

View File

@ -41,6 +41,7 @@ class MessageCount extends Component {
edit_spin: false, edit_spin: false,
pr_status: undefined, pr_status: undefined,
pull_request:undefined, pull_request:undefined,
conflict_files:[],
copyVisible:false, copyVisible:false,
}; };
@ -75,7 +76,8 @@ class MessageCount extends Component {
data: result.data, data: result.data,
SpinFlag: false, SpinFlag: false,
pr_status: result.data.pull_request && result.data.pull_request.status, pr_status: result.data.pull_request && result.data.pull_request.status,
pull_request:result.data.pull_request pull_request:result.data.pull_request,
conflict_files:result.data.conflict_files
}); });
} else { } else {
this.setState({ SpinFlag: false }); this.setState({ SpinFlag: false });
@ -263,13 +265,28 @@ class MessageCount extends Component {
</div> </div>
) )
} }
mergeabledDesc=(base,head)=>{ mergeabledDesc=(base,head,conflict_files)=>{
return( return(
<ul id="descContent"> <div>
<li>git fetch origin</li> <ul id="descContent">
<li>git checkout -b {`${base}`} origin/{`${base}`}</li> <li>git fetch origin</li>
<li>git merge {`${head}`}</li> <li>git checkout -b {`${base}`} origin/{`${base}`}</li>
</ul> <li>git merge {`${head}`}</li>
</ul>
{
conflict_files && conflict_files.length>0 &&
<div>
<p className="mt10 font-16 pt10" style={{borderTop:"1px solid #f9d7d5"}}>如下文件有代码冲突</p>
<p>
{
conflict_files.map((i,k)=>{
return k>0 ? ""+i : i
})
}
</p>
</div>
}
</div>
) )
} }
@ -284,7 +301,8 @@ class MessageCount extends Component {
ismesrge, ismesrge,
SpinFlag, SpinFlag,
copyVisible, copyVisible,
pull_request pull_request,
conflict_files
} = this.state; } = this.state;
const { current_user, projectDetail } = this.props; const { current_user, projectDetail } = this.props;
const menu = ( const menu = (
@ -337,10 +355,10 @@ class MessageCount extends Component {
<div className="mt15"> <div className="mt15">
<Tag className="pr-branch-tag"> <Tag className="pr-branch-tag">
<Link <Link
to={`/projects/${owner}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${data.pull_request.head}`} to={`/projects/${owner}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${data.pull_request.head && data.pull_request.head.replaceAll("/","%2F")}`}
className="ver-middle" className="ver-middle"
> >
{data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}:{data.pull_request.head} {data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}:{data.pull_request.head && data.pull_request.head.replaceAll("/","%2F")}
</Link> </Link>
</Tag> </Tag>
<span className="mr8 ver-middle"> <span className="mr8 ver-middle">
@ -495,7 +513,7 @@ class MessageCount extends Component {
<Alert <Alert
message={this.mergeabledMes()} message={this.mergeabledMes()}
type="error" type="error"
description={this.mergeabledDesc(pull_request.base,pull_request.head)} description={this.mergeabledDesc(pull_request.base,pull_request.head,conflict_files)}
showIcon showIcon
/> />
} }

View File

@ -155,7 +155,7 @@ class merge extends Component {
renderMenu = (array, name, id) => { renderMenu = (array, name, id) => {
return ( return (
<Menu> <Menu className="orderCondition">
<Menu.Item key={"all"} onClick={(e) => this.getOption(e, id, name)}> <Menu.Item key={"all"} onClick={(e) => this.getOption(e, id, name)}>
{name} {name}
</Menu.Item> </Menu.Item>
@ -214,14 +214,9 @@ class merge extends Component {
this.getIssueList(); this.getIssueList();
}; };
islogin() { checkOperation() {
const { projectsId,owner } = this.props.match.params; const { projectsId,owner } = this.props.match.params;
if (this.props.checkIfLogin() === false) { this.props.history.push(`/projects/${owner}/${projectsId}/pulls/new`);
this.props.showLoginDialog();
return;
} else {
this.props.history.push(`/projects/${owner}/${projectsId}/pulls/new`);
}
} }
render() { render() {
const { projectsId , owner } = this.props.match.params; const { projectsId , owner } = this.props.match.params;
@ -263,9 +258,12 @@ class merge extends Component {
style={{ width: 300 }} style={{ width: 300 }}
/> />
</div> </div>
<a className="topWrapper_btn ml10" onClick={() => this.islogin()}> {
+&nbsp;新建合并请求 data && data.user_admin_or_member &&
</a> <a className="topWrapper_btn ml10" onClick={() => this.checkOperation()}>
+&nbsp;新建合并请求
</a>
}
</div> </div>
<div className="f-wrap-between screenWrap"> <div className="f-wrap-between screenWrap">
<div className="df"> <div className="df">
@ -402,6 +400,7 @@ class merge extends Component {
project_author_name={data.project_author_name} project_author_name={data.project_author_name}
{...this.props} {...this.props}
{...this.state} {...this.state}
user_admin_or_member={data && data.user_admin_or_member}
></OrderItem> ></OrderItem>
</div> </div>
):""} ):""}

View File

@ -59,7 +59,7 @@ class UserSubmitComponent extends Component {
const url = `/${owner}/${projectsId}/create_file.json`; const url = `/${owner}/${projectsId}/create_file.json`;
axios.post(url, { axios.post(url, {
filepath: filename ? filename : path, filepath: filename ? filename : path,
branch: branch, branch: branch && branch.replaceAll("%2F","/"),
new_branch: submitType === "1" ? values.branchname : undefined, new_branch: submitType === "1" ? values.branchname : undefined,
content, content,
message: values.desc, message: values.desc,
@ -72,7 +72,7 @@ class UserSubmitComponent extends Component {
const { getTopCount } = this.props; const { getTopCount } = this.props;
getTopCount && getTopCount(values.branchname); getTopCount && getTopCount(values.branchname);
} }
let url = `/projects/${owner}/${projectsId}${values.branchname ? `/tree/${values.branchname}`: (branch ? `/tree/${branch}` : "")}`; let url = `/projects/${owner}/${projectsId}${values.branchname ? `/tree/${values.branchname.replaceAll('/',"%2F")}`: (branch ? `/tree/${branch.replaceAll('/',"%2F")}` : "")}`;
this.props.history.push(url); this.props.history.push(url);
} }
}) })
@ -93,12 +93,13 @@ class UserSubmitComponent extends Component {
const { projectsId , owner } = this.props.match.params; const { projectsId , owner } = this.props.match.params;
const { submitType } = this.state; const { submitType } = this.state;
const url = `/${owner}/${projectsId}/update_file.json`; const url = `/${owner}/${projectsId}/update_file.json`;
let b = currentBranch || branch;
this.props.form.validateFieldsAndScroll((err, values) => { this.props.form.validateFieldsAndScroll((err, values) => {
if (!err) { if (!err) {
axios axios
.put(url, { .put(url, {
filepath: detail.path, filepath: detail.path,
branch: submitType === "1" ? undefined : (currentBranch || branch), branch: submitType === "1" ? undefined : b.replaceAll('%2F',"/"),
new_branch: submitType === "1" ? values.branchname : undefined, new_branch: submitType === "1" ? values.branchname : undefined,
content: content, content: content,
sha: detail.sha, sha: detail.sha,
@ -107,7 +108,8 @@ class UserSubmitComponent extends Component {
.then((result) => { .then((result) => {
this.setState({ isSpin: false }); this.setState({ isSpin: false });
if (result.data && result.data.status === 1) { if (result.data && result.data.status === 1) {
let url = `/projects/${owner}/${projectsId}${(values.branchname ? `/tree/${values.branchname}` : ((currentBranch || branch) ? `/tree/${currentBranch || branch}`:""))}`; let b = currentBranch || branch;
let url = `/projects/${owner}/${projectsId}${(values.branchname ? `/tree/${values.branchname.replaceAll('/',"%2F")}` : (b ? `/tree/${b.replaceAll('/',"%2F")}`:""))}`;
this.props.history.push(url); this.props.history.push(url);
this.props.showNotification("文件修改成功!"); this.props.showNotification("文件修改成功!");
} }
@ -130,6 +132,7 @@ class UserSubmitComponent extends Component {
const { current_user, filepath, projectDetail , currentBranch } = this.props; const { current_user, filepath, projectDetail , currentBranch } = this.props;
const { editor_type } = this.props; const { editor_type } = this.props;
let b = currentBranch || branch;
return ( return (
<div> <div>
<span className="df" style={{ alignItems: "center" }}> <span className="df" style={{ alignItems: "center" }}>
@ -188,7 +191,7 @@ class UserSubmitComponent extends Component {
> >
<Radio value="0" className="mb10"> <Radio value="0" className="mb10">
<i className="iconfont icon-banbenku font-16 mr5"></i> <i className="iconfont icon-banbenku font-16 mr5"></i>
直接提交至<span className="color-orange">{currentBranch || branch}</span> 直接提交至<span className="color-orange">{b.replaceAll('%2F',"/")}</span>
</Radio> </Radio>
<Radio value="1"> <Radio value="1">
<Icon type="pull-request" className="mr5" /> <Icon type="pull-request" className="mr5" />

View File

@ -249,7 +249,7 @@ class Detail extends Component {
添加于 {data && data.created_at} 添加于 {data && data.created_at}
</span> </span>
{data && data.user_permission ? ( {data && data.user_permission ? (
<span className="pull-right"> <span className="pull-right 123123">
<a className="color-blue fr" onClick={this.copydetail}> <a className="color-blue fr" onClick={this.copydetail}>
复制 复制
</a> </a>

View File

@ -153,7 +153,7 @@ class Milepost extends Component {
const { data, limit, page, openselect, closeselect, spinings } = this.state; const { data, limit, page, openselect, closeselect, spinings } = this.state;
const { projectsId , owner } = this.props.match.params; const { projectsId , owner } = this.props.match.params;
const menu = ( const menu = (
<Menu onClick={this.arrayList}> <Menu className="orderCondition" onClick={this.arrayList}>
<Menu.Item key={'created_on'} value="desc">到期日从近到远</Menu.Item> <Menu.Item key={'created_on'} value="desc">到期日从近到远</Menu.Item>
<Menu.Item key={'created_on'} value="asc">到期日从远到近</Menu.Item> <Menu.Item key={'created_on'} value="asc">到期日从远到近</Menu.Item>
<Menu.Item key={'percent'} value="desc">完成度从低到高</Menu.Item> <Menu.Item key={'percent'} value="desc">完成度从低到高</Menu.Item>

View File

@ -162,7 +162,7 @@ class MilepostDetail extends Component {
renderMenu = (array, name, id) => { renderMenu = (array, name, id) => {
return ( return (
<Menu> <Menu className="orderCondition">
<Menu.Item key={"all"} onClick={(e) => this.getOption(e, id, name)}>{name}</Menu.Item> <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) => {

View File

@ -42,10 +42,9 @@ class OrderItem extends Component {
}) })
} }
render() { render() {
const { item , checkbox , mile } = this.props; const { item , checkbox , mile , user_admin_or_member } = this.props;
const { projectsId , owner } = this.props.match.params; const { projectsId , owner } = this.props.match.params;
const { current_user } = this.props const { current_user } = this.props;
return ( return (
item && item &&
<div className="issueItem"> <div className="issueItem">
@ -91,7 +90,7 @@ class OrderItem extends Component {
<div className="milepostleft"> <div className="milepostleft">
<Link to={`/projects/${owner}/${projectsId}/issues/${item.id}/detail`}><i className="iconfont icon-pinglun1 mr3 font-16"></i>{item.journals_count}</Link> <Link to={`/projects/${owner}/${projectsId}/issues/${item.id}/detail`}><i className="iconfont icon-pinglun1 mr3 font-16"></i>{item.journals_count}</Link>
{ {
current_user && current_user.login ? user_admin_or_member ?
<div id="hoverBox" style={{ display: this.state.orderid === item.id && this.state.isdisplay ? 'flex' : 'none' }}> <div id="hoverBox" style={{ display: this.state.orderid === item.id && this.state.isdisplay ? 'flex' : 'none' }}>
<div className="mr8 ml8 color-grey-9"> <div className="mr8 ml8 color-grey-9">
<Link to={`/projects/${owner}/${projectsId}/issues/${item.id}/updatedetail`} className="color-grey-9"><i className="iconfont icon-bianji3 font-14 mr5"></i></Link> <Link to={`/projects/${owner}/${projectsId}/issues/${item.id}/updatedetail`} className="color-grey-9"><i className="iconfont icon-bianji3 font-14 mr5"></i></Link>

View File

@ -592,7 +592,7 @@ a.issue-type-button.active:hover {
} }
/* 发布人、指派人数量过多时要出现滚动条 */ /* 发布人、指派人数量过多时要出现滚动条 */
.ant-dropdown-menu { .ant-dropdown-menu.orderCondition {
max-height: 350px; max-height: 350px;
overflow-y: auto; overflow-y: auto;
} }

View File

@ -201,7 +201,7 @@ class order extends Component {
renderMenu = (array, name, id, toGet) => { renderMenu = (array, name, id, toGet) => {
return ( return (
<Menu> <Menu className="orderCondition">
<Menu.Item key={"all"} onClick={(e) => this.getOption(e, id, name, toGet)}> <Menu.Item key={"all"} onClick={(e) => this.getOption(e, id, name, toGet)}>
{name} {name}
</Menu.Item> </Menu.Item>
@ -347,17 +347,14 @@ class order extends Component {
this.props.showLoginDialog(); this.props.showLoginDialog();
} }
renderNew =()=>{ renderNew =()=>{
const { projectsId , owner } = this.props.match.params; const { data } = this.state;
if (this.props.checkIfLogin()) { if(data && data.user_admin_or_member){
const { projectsId , owner } = this.props.match.params;
return( return(
<Link className="topWrapper_btn ml10" target="_blank" to={`/projects/${owner}/${projectsId}/issues/new`}> <Link className="topWrapper_btn ml10" target="_blank" to={`/projects/${owner}/${projectsId}/issues/new`}>
+&nbsp;创建易修 +&nbsp;创建易修
</Link> </Link>
) )
}else{
return(
<a className="topWrapper_btn ml10" onClick={this.islogin}>+&nbsp;创建易修</a>
)
} }
} }
@ -828,6 +825,7 @@ class order extends Component {
{...this.props} {...this.props}
{...this.state} {...this.state}
deletedetail={this.deletedetail} deletedetail={this.deletedetail}
user_admin_or_member={data && data.user_admin_or_member}
></OrderItem> ></OrderItem>
) )
})} })}

View File

@ -87,6 +87,14 @@ ul,ol,dl{
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
} }
.commitDesc{
flex:1;
margin-left:20px;
font-size:16px;
color:#333;
line-height:26px;
word-break: break-all;
}
.normalBox{ .normalBox{
border-radius: 4px; border-radius: 4px;