)
diff --git a/src/forge/Branch/branch.scss b/src/forge/Branch/branch.scss
index 030b05cd1..e1970722f 100644
--- a/src/forge/Branch/branch.scss
+++ b/src/forge/Branch/branch.scss
@@ -22,7 +22,7 @@
background: #fff;
max-height: 300px;
}
-.OptionsUl{
+.OptionsUl,.commitUl{
min-height: 50px;
max-height: 220px;
overflow-y: auto;
@@ -46,6 +46,26 @@
line-height: 32px;
width: 100%;
}
+.commitUl{
+ padding:0px 20px;
+}
+.commitUl li{
+ padding:15px 0px;
+ border-bottom: 1px dashed rgba(168,168,168,0.31);
+ &:last-child{
+ border:none;
+ }
+ cursor: pointer;
+}
+.commitUl .commitMsg{
+ margin-top: 8px;
+ display: flex;
+ div{
+ word-break: break-all;
+ flex: 1;
+ width: 0;
+ }
+}
.branch-tagBox{
border:1px solid #D0D0D0;
border-radius: 3px;
diff --git a/src/forge/GetData/getData.jsx b/src/forge/GetData/getData.jsx
index 216b1e1d3..3289cc86d 100644
--- a/src/forge/GetData/getData.jsx
+++ b/src/forge/GetData/getData.jsx
@@ -8,6 +8,10 @@ export const getBranch = async (id,owner)=>{
export const getTag = async (id,owner)=>{
return (await axios.get(`/${owner}/${id}/tags.json`,{params:{only_name:true}})).data.tags;
}
+// 获取提交记录
+export const getCommit = async(id,owner,search)=>{
+ return await axios.get(`/v1/${owner}/${id}/commits/recent`,{params:{keyword:search}})
+}
// 获取hooks(仓库设置-管理web钩子)列表
export const getHooks = async (id,params)=>{
return (await axios.get(`/projects/${id}/hooks.json`,{params})).data;
diff --git a/src/forge/Main/tree/Index.jsx b/src/forge/Main/tree/Index.jsx
index 8b6a1b473..57cec0c87 100644
--- a/src/forge/Main/tree/Index.jsx
+++ b/src/forge/Main/tree/Index.jsx
@@ -71,7 +71,7 @@ function Index(props) {
dataIndex: "commit",
key: 3,
ellipsis: true,
- width: "240px",
+ width: "260px",
render: (txt, item) => {
return (
@@ -97,7 +97,7 @@ function Index(props) {
dataIndex: "commit_id",
key: 4,
ellipsis: true,
- width: "250px",
+ width: "225px",
render: (txt, item) => {
return
@@ -110,54 +110,57 @@ function Index(props) {
}
- },
- {
- title: "分支类型",
- dataIndex: "default_branch",
- key: 5,
- width: "150px",
- render: (txt, item) => {
- return isManager ? txt === item.name ?
默认分支 :
: txt === item.name ? '默认分支' : '普通分支'
- }
- },
- {
- title: "操作",
- dataIndex: "name",
- key: 6,
- align: "center",
- width: "300px",
- className: "branchActionColumn",
- render: (txt, item,key) => {
- return (
- item.is_deleted ?
-
-
将基于 Commits{truncateCommitId(item.commit_id)}创建分支}>
-
-
-
:
-
- {
- (isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) &&
-
+ 合并请求
- }
-
- 下载
-
- {isManager && (txt === item.default_branch ?
:
)}
-
- )
- }
}
];
+ const mergeCol = {
+ title: "分支类型",
+ dataIndex: "default_branch",
+ key: 5,
+ width:"150px",
+ render: (txt, item) => {
+ return isManager ? txt === item.name ?
默认分支 :
: txt === item.name ? '默认分支' : '普通分支'
+ }
+ }
+
+ const operCol ={
+ title: "操作",
+ dataIndex: "name",
+ key: 6,
+ align: "center",
+ width: "300px",
+ className: "branchActionColumn",
+ render: (txt, item,key) => {
+ return (
+ item.is_deleted ?
+ isManager ?
+
将基于 Commits{truncateCommitId(item.commit_id)}恢复分支}>
+
+
+
:""
+ :
+
+ {
+ (isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) &&
+
+ 合并请求
+ }
+
+ 下载
+
+ {isManager && (txt === item.default_branch ?
:
)}
+
+ )
+ }
+ }
+
function restoreBranch(id,name){
const url = `/v1/${owner}/${projectsId}/branches/restore.json`;
Axios.post(url,{
@@ -216,9 +219,10 @@ function Index(props) {
}).then(res=>{
if(res && res.data){
// 重新请求仓库详情接口,更新分支总数信息
+ setIsSpin(true);
getDetail();
- setReload(Math.random());
setAddBranch(false);
+ setTimeout(()=>{getList()},1500);
message.success('新建分支成功');
}
})
@@ -306,7 +310,7 @@ function Index(props) {
rowKey={'name'}
className='branchListTable'
dataSource={list}
- columns={columns}
+ columns={chooseStatus==="deleted"?[...columns,operCol]:[...columns,mergeCol,operCol]}
pagination={{current: current,
pageSize: pageSize,
total: total,
@@ -396,7 +400,7 @@ function Index(props) {
>
-
删除分支,本操作将会关闭已开启的Pull Request
+
删除分支,本操作将会关闭已开启的合并请求(PR)
{
if (result) {
@@ -118,7 +119,7 @@ export default Form.create()(
...value,
body: desc,
attachment_ids: fileList,
- target_commitish:branch
+ target_commitish:saveBranch
})
.then(result => {
if (result) {
@@ -138,7 +139,8 @@ export default Form.create()(
}
function changeBranch(params) {
- setBranch(params);
+ // setBranch(params);
+ setSaveBranch(params)
}
return (
@@ -177,6 +179,7 @@ export default Form.create()(
owner={owner}
history={history}
tagflag={false}
+ commitflag={true}
branchList={projectDetail && projectDetail.branches && projectDetail.branches.list}
>
选择一个已经存在的标签,或者在发布时新建一个标签