代码库页面创建发行版权限控制
This commit is contained in:
parent
6d1b410ba1
commit
3d3c0b5095
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import { AlignTop } from '../Component/layout';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
function Releases({owner,projectsId,releaseVersions , baseOperate , projectType}){
|
||||
function Releases({ owner, projectsId, releaseVersions, distribution }) {
|
||||
return(
|
||||
<div>
|
||||
<Link to={`/${owner}/${projectsId}/releases`} className="font-16 color-ooo hoverA">
|
||||
|
@ -27,7 +27,8 @@ function Releases({owner,projectsId,releaseVersions , baseOperate , projectType}
|
|||
})
|
||||
:
|
||||
<div className="mt8">
|
||||
您暂未发布任何版本{baseOperate && projectType !==2 && <Link className="color-blue ml20" to={{pathname:`/${owner}/${projectsId}/releases/new`,state:{stable:true}}}>创建新版本</Link>}
|
||||
您暂未发布任何版本
|
||||
{distribution && <Link className="color-blue ml20" to={{pathname:`/${owner}/${projectsId}/releases/new`,state:{stable:true}}}>创建新版本</Link>}
|
||||
</div>
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,8 @@ function CoderDepot(props){
|
|||
branchName = returnbar(branchName);
|
||||
const details = props.projectDetail;
|
||||
let pathname = props.history.location.pathname;
|
||||
|
||||
//distribution:判断此用户是否可以创建发行版
|
||||
const distribution = details && details.type != 2 && (details.permission === "Admin" || details.permission === "Owner" || details.permission === "Manager");
|
||||
const { bannerList } = props;
|
||||
|
||||
useEffect(()=>{
|
||||
|
@ -139,7 +140,6 @@ function CoderDepot(props){
|
|||
ref:ref || branchName
|
||||
}
|
||||
}).then((result) => {
|
||||
console.log('getReadmeInfo', result)
|
||||
if (result) {
|
||||
setReadme(result.data);
|
||||
} else {
|
||||
|
@ -197,7 +197,6 @@ function CoderDepot(props){
|
|||
}
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
console.log(result)
|
||||
let en = result.data.entries;
|
||||
if(en.type){
|
||||
setDirInfo(undefined);
|
||||
|
@ -547,12 +546,11 @@ function CoderDepot(props){
|
|||
<React.Fragment>
|
||||
<Divider />
|
||||
<Releases
|
||||
owner={owner}
|
||||
projectsId={projectsId}
|
||||
releaseVersions={projectDetail.release_versions}
|
||||
owner={owner}
|
||||
projectsId={projectsId}
|
||||
releaseVersions={projectDetail.release_versions}
|
||||
history={props.history}
|
||||
baseOperate={baseOperate}
|
||||
projectType={projectDetail.type}
|
||||
distribution={distribution}
|
||||
/>
|
||||
</React.Fragment>
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@ class CoderRootCommit extends Component{
|
|||
<AlignTop>
|
||||
<div className="commitDesc"><Link to={{pathname:`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}`,query:{commitPage:page}}} className="font-14 color-grey-3 font-bd">{item.message}</Link></div>
|
||||
</AlignTop>
|
||||
<p className="f-wrap-alignCenter mt15">
|
||||
<p className="f-wrap-alignCenter mt15 pb5">
|
||||
<User
|
||||
id={item.id}
|
||||
url={(item.image_url && getImageUrl(`/${item.image_url}`)) || "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
|
||||
|
|
Loading…
Reference in New Issue