恢复分支相关修改
This commit is contained in:
parent
4243819efa
commit
82d700cdf8
|
|
@ -3,7 +3,7 @@ import CopyTool from '../../Component/CopyTool';
|
|||
import { truncateCommitId } from '../../common/util';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { getImageUrl , turnbar } from 'educoder';
|
||||
import { Button, Dropdown , Input, Menu , message, Modal, Select, Spin, Table, Tooltip , Radio } from 'antd';
|
||||
import { Button, Dropdown , Input, Menu , message, Modal, Select, Spin, Table, Tooltip , Radio , Popover } from 'antd';
|
||||
import Modals from '../../Component/PublicModal/Index';
|
||||
import './Index.scss';
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ function Index(props) {
|
|||
const { projectsId , owner } = props.match.params;
|
||||
const { isManager , isDeveloper , projectDetail , defaultBranch, getDetail } = props;
|
||||
useEffect(()=>{
|
||||
getList(chooseStatus);
|
||||
getList();
|
||||
},[name, reload, pageSize, current,chooseStatus])
|
||||
|
||||
useEffect(()=>{
|
||||
|
|
@ -131,9 +131,13 @@ function Index(props) {
|
|||
width: "300px",
|
||||
className: "branchActionColumn",
|
||||
render: (txt, item,key) => {
|
||||
console.log("-----:",item.is_deleted);
|
||||
return (
|
||||
item.is_deleted ? <div style={{textAlign:"right"}}><Button onClick={()=>restoreBranch(item.branch_id,item.name)}>恢复分支</Button></div>:
|
||||
item.is_deleted ?
|
||||
<div style={{textAlign:"right"}}>
|
||||
<Popover content={<span>将基于 Commits<span className="color-blue ml3 mr3">{truncateCommitId(item.commit_id)}</span>创建分支</span>}>
|
||||
<Button onClick={()=>restoreBranch(item.branch_id,item.name)}>恢复分支</Button>
|
||||
</Popover>
|
||||
</div>:
|
||||
<div className="treeabout">
|
||||
{
|
||||
(isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) &&
|
||||
|
|
@ -166,7 +170,7 @@ function Index(props) {
|
|||
})
|
||||
}
|
||||
|
||||
function getList(state) {
|
||||
function getList() {
|
||||
const url = `/v1/${owner}/${projectsId}/branches.json`;
|
||||
Axios.get(url,{
|
||||
params:{
|
||||
|
|
@ -303,7 +307,13 @@ function Index(props) {
|
|||
className='branchListTable'
|
||||
dataSource={list}
|
||||
columns={columns}
|
||||
pagination={{current: current, pageSize: pageSize, total: total, showSizeChanger: true, onShowSizeChange:onShowSizeChange, showQuickJumper: true, onChange: changePage}}
|
||||
pagination={{current: current,
|
||||
pageSize: pageSize,
|
||||
total: total,
|
||||
showSizeChanger: true,
|
||||
onShowSizeChange:onShowSizeChange,
|
||||
showQuickJumper: true, onChange: changePage,hideOnSinglePage:true
|
||||
}}
|
||||
>
|
||||
</Table>
|
||||
{/* {
|
||||
|
|
@ -386,7 +396,7 @@ function Index(props) {
|
|||
>
|
||||
<div className="contents mb30" style={{justifyContent: 'flex-start'}}>
|
||||
<i className='iconfont icon-shanchu_tc_icon1 font-36 mr18' style={{color: '#ca0002'}}></i>
|
||||
<p style={{color: '#333'}}>确定删除{visible.name}分支?</p>
|
||||
<p style={{color: '#333'}}>删除分支,本操作将会关闭已开启的Pull Request</p>
|
||||
</div>
|
||||
</Modals>
|
||||
<Modal
|
||||
|
|
|
|||
Loading…
Reference in New Issue