forked from Gitlink/forgeplus-react
Merge pull request '代码库页面创建发行版权限控制' (#105) from durian/forgeplus-react:feature_repo_second_page_xiesi into feature_repo_second_page
This commit is contained in:
commit
29ced2aded
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
import { AlignTop } from '../Component/layout';
|
import { AlignTop } from '../Component/layout';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
function Releases({owner,projectsId,releaseVersions , baseOperate , projectType}){
|
function Releases({ owner, projectsId, releaseVersions, distribution }) {
|
||||||
return(
|
return(
|
||||||
<div>
|
<div>
|
||||||
<Link to={`/${owner}/${projectsId}/releases`} className="font-16 color-ooo hoverA">
|
<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">
|
<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>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,8 @@ function CoderDepot(props){
|
||||||
branchName = returnbar(branchName);
|
branchName = returnbar(branchName);
|
||||||
const details = props.projectDetail;
|
const details = props.projectDetail;
|
||||||
let pathname = props.history.location.pathname;
|
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;
|
const { bannerList } = props;
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
|
@ -139,7 +140,6 @@ function CoderDepot(props){
|
||||||
ref:ref || branchName
|
ref:ref || branchName
|
||||||
}
|
}
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
console.log('getReadmeInfo', result)
|
|
||||||
if (result) {
|
if (result) {
|
||||||
setReadme(result.data);
|
setReadme(result.data);
|
||||||
} else {
|
} else {
|
||||||
|
@ -197,7 +197,6 @@ function CoderDepot(props){
|
||||||
}
|
}
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
console.log(result)
|
|
||||||
let en = result.data.entries;
|
let en = result.data.entries;
|
||||||
if(en.type){
|
if(en.type){
|
||||||
setDirInfo(undefined);
|
setDirInfo(undefined);
|
||||||
|
@ -547,12 +546,11 @@ function CoderDepot(props){
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Divider />
|
<Divider />
|
||||||
<Releases
|
<Releases
|
||||||
owner={owner}
|
owner={owner}
|
||||||
projectsId={projectsId}
|
projectsId={projectsId}
|
||||||
releaseVersions={projectDetail.release_versions}
|
releaseVersions={projectDetail.release_versions}
|
||||||
history={props.history}
|
history={props.history}
|
||||||
baseOperate={baseOperate}
|
distribution={distribution}
|
||||||
projectType={projectDetail.type}
|
|
||||||
/>
|
/>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ class CoderRootCommit extends Component{
|
||||||
<AlignTop>
|
<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>
|
<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>
|
</AlignTop>
|
||||||
<p className="f-wrap-alignCenter mt15">
|
<p className="f-wrap-alignCenter mt15 pb5">
|
||||||
<User
|
<User
|
||||||
id={item.id}
|
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"}
|
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