Merge pull request '代码库页面创建发行版权限控制' (#105) from durian/forgeplus-react:feature_repo_second_page_xiesi into feature_repo_second_page

This commit is contained in:
baladiwei 2021-09-30 19:52:35 +08:00
commit 29ced2aded
3 changed files with 10 additions and 11 deletions

View File

@ -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>
}

View File

@ -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);
@ -551,8 +550,7 @@ function CoderDepot(props){
projectsId={projectsId}
releaseVersions={projectDetail.release_versions}
history={props.history}
baseOperate={baseOperate}
projectType={projectDetail.type}
distribution={distribution}
/>
</React.Fragment>
}

View File

@ -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"}