Merge branch 'gitlink_server' of http://106.75.45.236:3000/Gitlink/forgeplus-react into feature_wiki

This commit is contained in:
谢思 2023-03-28 18:46:27 +08:00
commit 5f381a9f42
8 changed files with 60 additions and 30 deletions

View File

@ -62,6 +62,7 @@ function CoderDepot(props){
branchName = returnbar(branchName);
const details = props.projectDetail;
let pathname = props.history.location.pathname;
const { platform } = props ;
//distribution
const distribution = details && details.type !== 2 && ( details.permission && details.permission !== "Reporter");
const { bannerList } = props;
@ -139,17 +140,19 @@ function CoderDepot(props){
},[projectsId,owner,pathname,defaultBranch])
useEffect(()=>{
setReadOnly(props.history.location.search.indexOf('edit') !== -1);
axios.get(`/${owner}/${projectsId}/releases.json`).then((result)=>{
if(result && result.data){
const release = {
"list":result.data.releases,
"total_count":result.data.releases && result.data.releases.length
if(platform){
setReadOnly(props.history.location.search.indexOf('edit') !== -1);
axios.get(`/${owner}/${projectsId}/releases.json`).then((result)=>{
if(result && result.data){
const release = {
"list":result.data.releases,
"total_count":result.data.releases && result.data.releases.length
}
setReleaseVersions(release);
}
setReleaseVersions(release);
}
})
},[])
})
}
},[platform])
// readme
function getReadmeInfo(path, ref) {
@ -623,7 +626,7 @@ function CoderDepot(props){
}
{/* 发布 */}
{
releaseVersions && props.platform &&
releaseVersions &&
<React.Fragment>
<Divider />
<Releases

View File

@ -195,6 +195,7 @@ class Detail extends Component {
}
}
componentDidMount = () => {
this.getProject();
let history = this.props.location;

View File

@ -144,7 +144,7 @@ function version(props) {
} else if (releases && releases.length === 0) {
return (
<Empty
operation={data && data.user_admin_permission && type !== 2}
operation={data && data.user_permission && type !== 2}
addFunc={addFunc}
/>
)

View File

@ -108,4 +108,8 @@
margin-top: 60px;
padding-top: 20px;
border-top: 1px solid #F3F4F6;
}
.mergeBox{
margin:0px auto;
width: 1200px;
}

View File

@ -49,6 +49,7 @@ class merge extends Component {
assigned_to_ids: "审查人员",
paix: "排序",
priority_ids: "优先级",
has_created_pull_requests:false,
select_params: {
status_type: "1", //开启中和关闭中,默认为开启中的
assigned_to_id: undefined, // 指派人
@ -113,6 +114,7 @@ class merge extends Component {
issues: result.data.issues,
search_count: result.data.search_count,
isSpin: false,
has_created_pull_requests:result.data.has_created_pull_requests
});
}
})
@ -247,7 +249,7 @@ class merge extends Component {
data,
isSpin,
status_type,
select_params,
select_params,has_created_pull_requests
} = this.state;
const menu = (
<Menu onClick={(e) => this.getMenu(e)}>
@ -266,8 +268,8 @@ class merge extends Component {
</Menu>
);
return (
<div className="main mt20" style={{padding:"0px"}}>
<div className="topWrapper" style={{borderBottom:"none",padding:"20px"}}>
<div className="mt30 mergeBox">
<div className="topWrapper">
<Search
placeholder="输入关键字搜索合并请求"
style={{ width: 354 , height : 32 }}
@ -406,7 +408,7 @@ class merge extends Component {
<div style={{minHeight:"470px"}}>
<Spin spinning={isSpin}>
{data && data.search_count && data.search_count > 0 ? (
<div>
<div className="mergeData">
<MergeItem
issues={issues}
search_count={search_count}
@ -434,7 +436,14 @@ class merge extends Component {
) : (
""
)}
{ data && data.issues && data.issues.length === 0 ? <NoneData _html="暂时还没有相关数据!" user_admin_or_developer={data.user_admin_or_developer} projectsId={projectsId} owner={owner} defaultBranch={this.props && turnbar(this.props.defaultBranch) }/> :""}
{ data && data.issues && data.issues.length === 0 ?
<NoneData _html="暂时还没有相关数据!"
user_admin_or_developer={data.user_admin_or_developer}
has_created_pull_requests={has_created_pull_requests}
projectsId={projectsId} owner={owner}
defaultBranch={this.props && turnbar(this.props.defaultBranch) }/>
:""
}
</Spin>
</div>
</div>

View File

@ -3,22 +3,26 @@ import { Link } from "react-router-dom";
import None from '../Images/emp.png'
class Nodata extends Component{
render(){
const { _html, projectsId , owner , user_admin_or_developer , defaultBranch} = this.props;
const { has_created_pull_requests , projectsId , owner , user_admin_or_developer , defaultBranch} = this.props;
return(
<div className="none_panels">
<div>
<div className="mb15">
{/* <i className="iconfont icon-hebingqingqiu font-80 ver-middle color-grey-b"></i> */}
<img src={None} alt=""/>
{/* <i className="iconfont icon-hebingqingqiu font-80 ver-middle color-grey-b"></i> */}
<img src={None} alt=""/>
</div>
<p className="font-20">欢迎使用合并请求</p>
<div className="color-grey-8 mt10">
合并请求可以帮助您与他人协作编写代码请先创建一个合并请求
</div>
{ user_admin_or_developer &&
<div className="empBtn">
<span><Link className="operateButton" to={`/${owner}/${projectsId}/compare/${defaultBranch}...${defaultBranch}`}>合并请求</Link></span>
{
!has_created_pull_requests &&
<div>
<p className="font-20">欢迎使用合并请求</p>
<div className="color-grey-8 mt10">
合并请求可以帮助您与他人协作编写代码请先创建一个合并请求
</div>
{ user_admin_or_developer &&
<div className="empBtn">
<span><Link className="operateButton" to={`/${owner}/${projectsId}/compare/${defaultBranch}...${defaultBranch}`}>去创建合并请求</Link></span>
</div>
}
</div>
}
</div>

View File

@ -1,9 +1,14 @@
.screenWrap{
background:#fafcff;
border-top:1px solid rgba(221,221,221,1);
border-bottom:1px solid rgba(221,221,221,1);
border:1px solid rgba(42, 97, 255, 0.23);
padding-left: 20px;
box-sizing: border-box;
border-radius: 4px 4px 0px 0px;
}
.mergeData{
border:1px solid #d0d0d0;
border-top: none;
border-radius: 0px 0px 2px 2px;
}
.attachment-list-div:hover {
background-color: #e6f7ff;

View File

@ -163,6 +163,10 @@ ul,ol,dl{
text-align: center;
min-height: 320px;
padding:40px 0px;
border:1px solid rgba(42, 97, 255, 0.23);
border-top: none;
border-radius: 0px 0px 2px 2px;
margin-bottom: 50px;
display: flex;
justify-content: center;
align-items: center;