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 = (
<div ref={refFa}>
<SelectOverlay
visible={visible}
changeBranch={ChangeB}
tagflag={tagflag}
projectsId={projectsId}

View File

@ -2,7 +2,7 @@ import React , { useState , useEffect } from 'react';
import { Input , Spin , Menu } from 'antd';
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 [ nav , setNav ] = useState(0);
const [ isSpin , setIsSpin ] = useState(true);
@ -11,6 +11,14 @@ function SelectOverlay({ changeBranch , tagflag , branchList , projectsId , owne
const [ datas , setDatas ] = useState(undefined);
const [ keys ,setKeys] = useState("branch");
// useEffect(()=>{
// if(visible){
// setKeys("branch");
// getBranchs(projectsId,owner);
// setIsSpin(true);
// }
// },[visible])
useEffect(()=>{
if(branchList){
setData(branchList);
@ -68,12 +76,16 @@ function SelectOverlay({ changeBranch , tagflag , branchList , projectsId , owne
<Spin spinning={isSpin}>
<ul className="OptionsUl" id="ul-btn">
{
datas && datas.length>0 ?
datas && datas.length>0 &&
datas.map((item,key)=>{
return(
<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>
}
</ul>

View File

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

View File

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

View File

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

View File

@ -59,7 +59,7 @@ function Tags(props) {
return (
<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"/>
<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>
)
}

View File

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

View File

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

View File

@ -50,7 +50,7 @@ export default ((props)=>{
<i className="iconfont icon-zuobiao mr5"></i>
<Link to={`/${OIdentifier}`}>{detail && detail.organization && detail.organization.nickname}</Link>
<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>
{
detail &&