Merge pull request '发行版' (#107) from durian/forgeplus-react:feature_repo_second_page_xiesi into feature_repo_second_page

This commit is contained in:
jasder 2021-09-30 20:33:26 +08:00
commit 464b9a2be2
2 changed files with 18 additions and 5 deletions

View File

@ -67,6 +67,7 @@ function CoderDepot(props){
const [ editReadme , setEditReadme ] = useState(false); const [ editReadme , setEditReadme ] = useState(false);
const [ pullsFlag , setPullsFlag ] = useState(true); const [ pullsFlag , setPullsFlag ] = useState(true);
const [ issuesFlag , setIssuesFlag ] = useState(true); const [ issuesFlag , setIssuesFlag ] = useState(true);
const [ releaseVersions , setReleaseVersions] = useState(undefined);
const owner = props.match.params.owner; const owner = props.match.params.owner;
const projectsId = props.match.params.projectsId; const projectsId = props.match.params.projectsId;
@ -130,6 +131,18 @@ function CoderDepot(props){
} }
},[projectsId,owner,pathname,defaultBranch]) },[projectsId,owner,pathname,defaultBranch])
useEffect(()=>{
axios.get(`/${owner}/${projectsId}/releases.json`).then((result)=>{
if(result && result.data){
const release = {
"list":result.data.releases,
"total_count":result.data.releases.length
}
setReleaseVersions(release);
}
})
},[])
// readme // readme
function getReadmeInfo(path, ref) { function getReadmeInfo(path, ref) {
axios.get(`/${owner}/${projectsId}/readme.json`, { axios.get(`/${owner}/${projectsId}/readme.json`, {
@ -542,13 +555,13 @@ function CoderDepot(props){
} }
{/* 发布 */} {/* 发布 */}
{ {
projectDetail && projectDetail.release_versions && releaseVersions &&
<React.Fragment> <React.Fragment>
<Divider /> <Divider />
<Releases <Releases
owner={owner} owner={owner}
projectsId={projectsId} projectsId={projectsId}
releaseVersions={projectDetail.release_versions} releaseVersions={releaseVersions}
history={props.history} history={props.history}
distribution={distribution} distribution={distribution}
/> />

View File

@ -63,7 +63,7 @@ function version(props) {
<span className={`${item.draft === "稳定" ?"versionTag green":"versionTag orange"}`}>{item.draft}</span> <span className={`${item.draft === "稳定" ?"versionTag green":"versionTag orange"}`}>{item.draft}</span>
<span className="color-grey-3 mt15 font-12"> <span className="color-grey-3 mt15 font-12">
<i className="iconfont icon-biaoqianicon mr3 font-14"></i> <i className="iconfont icon-biaoqianicon mr3 font-14"></i>
<Link className="hover" to={`/${owner}/${projectsId}/tree/${item.name}`} >{item.tag_name}</Link> <Link className="hover" to={`/${owner}/${projectsId}/tree/${item.tag_name}`} >{item.tag_name}</Link>
</span> </span>
<span className="color-grey-3 font-12"> <span className="color-grey-3 font-12">
<img src={Tree} width="16px" color="#333333" className="mr3"/> <img src={Tree} width="16px" color="#333333" className="mr3"/>