Merge pull request '代码合并后修改的问题' (#122) from caishi/forgeplus-react:pre_develop_dev into pre_develop_dev

This commit is contained in:
jasder 2021-10-09 15:56:13 +08:00
commit 9b4f1b7cd9
10 changed files with 65 additions and 51 deletions

View File

@ -41,6 +41,7 @@ export default (({ projectsId , branch , owner , changeBranch , branchList , tag
const menu = ( const menu = (
<div ref={refFa}> <div ref={refFa}>
<SelectOverlay <SelectOverlay
visible={visible}
changeBranch={ChangeB} changeBranch={ChangeB}
tagflag={tagflag} tagflag={tagflag}
projectsId={projectsId} projectsId={projectsId}

View File

@ -2,7 +2,7 @@ import React , { useState , useEffect } from 'react';
import { Input , Spin , Menu } from 'antd'; import { Input , Spin , Menu } from 'antd';
import { getBranch , getTag } from '../GetData/getData'; import { getBranch , getTag } from '../GetData/getData';
function SelectOverlay({ changeBranch , tagflag , branchList , projectsId , owner }) { function SelectOverlay({ changeBranch , tagflag , branchList , projectsId , owner , visible }) {
const [ inputValue , setInputValue] = useState(undefined); const [ inputValue , setInputValue] = useState(undefined);
const [ nav , setNav ] = useState(0); const [ nav , setNav ] = useState(0);
const [ isSpin , setIsSpin ] = useState(true); const [ isSpin , setIsSpin ] = useState(true);
@ -11,6 +11,14 @@ function SelectOverlay({ changeBranch , tagflag , branchList , projectsId , owne
const [ datas , setDatas ] = useState(undefined); const [ datas , setDatas ] = useState(undefined);
const [ keys ,setKeys] = useState("branch"); const [ keys ,setKeys] = useState("branch");
// useEffect(()=>{
// if(visible){
// setKeys("branch");
// getBranchs(projectsId,owner);
// setIsSpin(true);
// }
// },[visible])
useEffect(()=>{ useEffect(()=>{
if(branchList){ if(branchList){
setData(branchList); setData(branchList);
@ -68,12 +76,16 @@ function SelectOverlay({ changeBranch , tagflag , branchList , projectsId , owne
<Spin spinning={isSpin}> <Spin spinning={isSpin}>
<ul className="OptionsUl" id="ul-btn"> <ul className="OptionsUl" id="ul-btn">
{ {
datas && datas.length>0 ? datas && datas.length>0 &&
datas.map((item,key)=>{ datas.map((item,key)=>{
return( return(
<li key={key} onClick={()=>chooseitem(item.name)}><a className="task-hide ulALink">{item.name}</a></li> <li key={key} onClick={()=>chooseitem(item.name)}><a className="task-hide ulALink">{item.name}</a></li>
) )
}): })
}
{
datas && datas.length === 0 &&
<p className="listTips">暂无{inputValue}{nav === 0 ?"分支":"标签"}~</p> <p className="listTips">暂无{inputValue}{nav === 0 ?"分支":"标签"}~</p>
} }
</ul> </ul>

View File

@ -23,6 +23,7 @@
max-height: 300px; max-height: 300px;
} }
.OptionsUl{ .OptionsUl{
min-height: 50px;
max-height: 220px; max-height: 220px;
overflow-y: auto; overflow-y: auto;
} }

View File

@ -340,8 +340,8 @@ function CoderDepot(props){
const mdFlag = n && n.substring(n.length-3,n.length) === ".md"; const mdFlag = n && n.substring(n.length-3,n.length) === ".md";
const { current_user } = props; const { current_user } = props;
const baseOper = projectDetail && projectDetail.permission; const baseOper = current_user && current_user.login && issuesFlag;
const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter"; const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter" && projectDetail.type !== 2 && pullsFlag;
const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin)); const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin));
return( return(
@ -421,14 +421,14 @@ function CoderDepot(props){
</AlignCenter> </AlignCenter>
<AlignCenter className="depotBtn"> <AlignCenter className="depotBtn">
{ {
((baseOperate && projectDetail.type !== 2 && pullsFlag) || (baseOper && issuesFlag)) && (baseOperate || baseOper) &&
<div className="addOptionBtn"> <div className="addOptionBtn">
{ {
baseOperate && projectDetail.type !== 2 && pullsFlag && baseOperate &&
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/pulls/new/${branchName || defaultBranch}`)} >+ 合并请求</CheckProfile> <CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/pulls/new/${branchName || defaultBranch}`)} >+ 合并请求</CheckProfile>
} }
{ {
baseOper && issuesFlag && baseOper &&
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/issues/new`)} >+ 易修</CheckProfile> <CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/issues/new`)} >+ 易修</CheckProfile>
} }
</div> </div>

View File

@ -688,16 +688,12 @@ class Detail extends Component {
} }
></Route> ></Route>
{/* 复制详情 copyetail*/} {/* 复制详情 copyetail*/}
{/* <Route path="/:owner/:projectsId/issues/:orderId/copyetail" <Route path="/:owner/:projectsId/issues/:orderId/copyetail"
render={
(props) => (<OrdercopyDetail {...this.props} {...props} {...this.state} {...common} />)
}
></Route> */}
<Route path="/:owner/:projectsId/issues/:orderId/:operateName"
render={ render={
(props) => (<OrderupdateDetail {...this.props} {...props} {...this.state} {...common} />) (props) => (<OrderupdateDetail {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 任务详情 */} {/* 任务详情 */}
<Route path="/:owner/:projectsId/issues/:orderId" <Route path="/:owner/:projectsId/issues/:orderId"
render={ render={

View File

@ -59,7 +59,7 @@ function Tags(props) {
return ( return (
<Tooltip placement="top" title={`最后提交日期:${item.created_at_unix ? moment(item.created_at_unix*1000).format('YYYY-MM-DD'):''}`}> <Tooltip placement="top" title={`最后提交日期:${item.created_at_unix ? moment(item.created_at_unix*1000).format('YYYY-MM-DD'):''}`}>
<img src={Tree} alt="提交ID" width="22px" className="mr4"/> <img src={Tree} alt="提交ID" width="22px" className="mr4"/>
<Link className="hover color-blue" to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.id}`)}`}>{truncateCommitId(item.id)}</Link> <Link className="hover color-blue" to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.commit && item.commit.sha}`)}`}>{truncateCommitId(item.commit && item.commit.sha)}</Link>
</Tooltip> </Tooltip>
) )
} }

View File

@ -83,8 +83,9 @@ class UserSubmitComponent extends Component {
if (result.data && result.data.name) { if (result.data && result.data.name) {
this.props.showNotification("文件新建成功!"); this.props.showNotification("文件新建成功!");
if(submitType === "1"){ if(submitType === "1"){
const { getTopCount } = this.props; const { getTopCount , getDetail } = this.props;
getTopCount && getTopCount(values.branchname); getTopCount && getTopCount(values.branchname);
getDetail && getDetail();
} }
let url = `/${owner}/${projectsId}${values.branchname ? `/tree/${turnbar(values.branchname)}`: (branch ? `/tree/${turnbar(branch)}` : "")}`; let url = `/${owner}/${projectsId}${values.branchname ? `/tree/${turnbar(values.branchname)}`: (branch ? `/tree/${turnbar(branch)}` : "")}`;
this.props.history.push(url); this.props.history.push(url);
@ -147,6 +148,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; let b = currentBranch || branch;
return ( return (
<div> <div>
<span className="df" style={{ alignItems: "center" }}> <span className="df" style={{ alignItems: "center" }}>

View File

@ -123,22 +123,25 @@ class Detail extends Component {
//复制 //复制
copydetail = () => { copydetail = () => {
const { projectsId, orderId, owner } = this.props.match.params; const { projectsId, orderId, owner } = this.props.match.params;
const url = `/${owner}/${projectsId}/issues/${orderId}/copy.json`; // const url = `/${owner}/${projectsId}/issues/${orderId}/copy.json`;
axios // axios
.post(url, { // .post(url, {
project_id: projectsId, // project_id: projectsId,
id: orderId, // id: orderId,
}) // })
.then((result) => { // .then((result) => {
if (result) { // if (result) {
// this.props.history.push(
// `/${owner}/${projectsId}/issues/${result.data.issue_id}/copyetail`
// );
// }
// })
// .catch((error) => {
// console.log(error);
// });
this.props.history.push( this.props.history.push(
`/${owner}/${projectsId}/issues/${result.data.issue_id}/copyetail` `/${owner}/${projectsId}/issues/${orderId}/copyetail`
); );
}
})
.catch((error) => {
console.log(error);
});
}; };
// 翻页 // 翻页

View File

@ -178,7 +178,6 @@ class order_form extends Component {
this.setState({ this.setState({
isSpin: false, isSpin: false,
}); });
console.log(error);
}); });
} else { } else {
const url = `/${owner}/${projectsId}/issues/${orderId}.json`; const url = `/${owner}/${projectsId}/issues/${orderId}.json`;

View File

@ -50,7 +50,7 @@ export default ((props)=>{
<i className="iconfont icon-zuobiao mr5"></i> <i className="iconfont icon-zuobiao mr5"></i>
<Link to={`/${OIdentifier}`}>{detail && detail.organization && detail.organization.nickname}</Link> <Link to={`/${OIdentifier}`}>{detail && detail.organization && detail.organization.nickname}</Link>
<i className="iconfont icon-youjiantou ml3 mr3 font-12 color-grey-9"></i> <i className="iconfont icon-youjiantou ml3 mr3 font-12 color-grey-9"></i>
<span className="color-grey-9">{detail ? detail.name : "新建团队"}</span> <span className="color-grey-9">{detail ? detail.nickname : "新建团队"}</span>
</div> </div>
{ {
detail && detail &&