forked from Gitlink/forgeplus-react
Merge branch 'develop'
This commit is contained in:
commit
7530d3f9c4
|
@ -60,12 +60,13 @@ body {
|
||||||
.ant-progress-textno {
|
.ant-progress-textno {
|
||||||
color: #f5222d;
|
color: #f5222d;
|
||||||
}
|
}
|
||||||
|
.CodeMirror pre.CodeMirror-line{
|
||||||
|
font-size: 16px!important;
|
||||||
|
}
|
||||||
/* md多空格 */
|
/* md多空格 */
|
||||||
.markdown-body p {
|
.markdown-body p {
|
||||||
margin:10px 0px!important;
|
margin:10px 0px!important;
|
||||||
font-size: 16px !important;
|
font-size: 16px !important;
|
||||||
line-height: 2 !important;
|
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,6 +88,10 @@ body {
|
||||||
border-left: 1px solid rgb(221, 221, 221);
|
border-left: 1px solid rgb(221, 221, 221);
|
||||||
/* 某些情况下,被cm盖住了 */
|
/* 某些情况下,被cm盖住了 */
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
|
padding:8px 8px 50px;
|
||||||
|
}
|
||||||
|
.editormd-preview .markdown-body{
|
||||||
|
padding:0px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 图片点击放大的场景,隐藏图片链接 */
|
/* 图片点击放大的场景,隐藏图片链接 */
|
||||||
|
|
|
@ -3,7 +3,4 @@
|
||||||
}
|
}
|
||||||
.ant-modal-wrap{
|
.ant-modal-wrap{
|
||||||
z-index: 1002;
|
z-index: 1002;
|
||||||
.ant-form-explain{
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
import { AlignCenter , AlignTop , FlexAJ } from '../Component/layout';
|
import { AlignCenter , AlignTop , FlexAJ } from '../Component/layout';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
function Releases({owner,projectsId,releaseVersions}){
|
function Releases({owner,projectsId,releaseVersions , baseOperate , projectType}){
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div>
|
<div>
|
||||||
|
@ -10,10 +10,10 @@ function Releases({owner,projectsId,releaseVersions}){
|
||||||
<AlignCenter><span className="font-16 color-grey-6">发行版</span>
|
<AlignCenter><span className="font-16 color-grey-6">发行版</span>
|
||||||
{ releaseVersions && releaseVersions.total_count > 0 && <span className="infoCount">{releaseVersions.total_count}</span>}
|
{ releaseVersions && releaseVersions.total_count > 0 && <span className="infoCount">{releaseVersions.total_count}</span>}
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
{ releaseVersions && releaseVersions.total_count > 0 ?
|
{ (releaseVersions && releaseVersions.total_count > 0) || projectType ===2 ?
|
||||||
<Link className="font-12 color-grey-9" to={`/projects/${owner}/${projectsId}/releases`}>全部</Link>
|
<Link className="font-12 color-grey-9" to={`/projects/${owner}/${projectsId}/releases`}>全部</Link>
|
||||||
:
|
:
|
||||||
<Link className="font-12 color-blue" to={`/projects/${owner}/${projectsId}/releases/new`}>新建</Link>
|
baseOperate && <Link className="font-12 color-blue" to={`/projects/${owner}/${projectsId}/releases/new`}>新建</Link>
|
||||||
}
|
}
|
||||||
</FlexAJ>
|
</FlexAJ>
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,7 +42,7 @@ function PipelineName({visible,onCancel,onOk,value ,branchList}){
|
||||||
</div>
|
</div>
|
||||||
<div className="choosenList mt20">
|
<div className="choosenList mt20">
|
||||||
<span>触发条件:</span>
|
<span>触发条件:</span>
|
||||||
<Select value={branchValue} style={{width:"150px"}} onChange={(e)=>setBranchValue(e)}>
|
<Select value={branchValue} style={{width:"150px"}} dropdownClassName="chooseCon" onChange={(e)=>setBranchValue(e)}>
|
||||||
{
|
{
|
||||||
branchList && branchList.length>0 && branchList.map((item,key)=>{
|
branchList && branchList.length>0 && branchList.map((item,key)=>{
|
||||||
return(
|
return(
|
||||||
|
@ -51,7 +51,7 @@ function PipelineName({visible,onCancel,onOk,value ,branchList}){
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</Select>
|
</Select>
|
||||||
<Select mode="multiple" allowClear value={eventValue} style={{width:"180px",marginLeft:"10px"}} onChange={(e)=>{console.log(e);setEventValue(e)}}>
|
<Select mode="multiple" allowClear value={eventValue} dropdownClassName="chooseCon" style={{width:"180px",marginLeft:"10px"}} onChange={(e)=>{console.log(e);setEventValue(e)}}>
|
||||||
{
|
{
|
||||||
EVENT.map((item,key)=>{
|
EVENT.map((item,key)=>{
|
||||||
return(
|
return(
|
||||||
|
|
|
@ -391,6 +391,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.chooseCon.ant-select-dropdown{
|
||||||
|
z-index: 100001;
|
||||||
|
}
|
||||||
|
|
||||||
.choosenList{
|
.choosenList{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -152,20 +152,21 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
}
|
}
|
||||||
|
|
||||||
<Form.Item label="仓库名称:">
|
<Form.Item label="仓库标识:" style={{marginBottom:"0px"}}>
|
||||||
{getFieldDecorator("identifier",
|
{getFieldDecorator("identifier",
|
||||||
{
|
{
|
||||||
rules:[
|
rules:[
|
||||||
{required:true,message:"请输入仓库名称"},
|
{required:true,message:"请输入仓库标识!"},
|
||||||
{
|
{
|
||||||
validator:checkIdentifier
|
validator:checkIdentifier
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
)(
|
)(
|
||||||
<Input placeholder="请输入仓库名称" autoComplete={"off"}/>
|
<Input placeholder="请输入仓库标识" autoComplete={"off"}/>
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<span className="color-grey-9" style={{marginLeft:"120px"}}>请输入当前项目的标识:<span className="ml5 mr5 color-grey-3">{repo}</span>进行确认!</span>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -63,6 +63,8 @@ function CoderDepot(props){
|
||||||
const [ readme , setReadme ] = useState(undefined);
|
const [ readme , setReadme ] = useState(undefined);
|
||||||
const [ defaultBranch , setDefaultBranch ] = useState(undefined);
|
const [ defaultBranch , setDefaultBranch ] = useState(undefined);
|
||||||
const [ editReadme , setEditReadme ] = useState(false);
|
const [ editReadme , setEditReadme ] = useState(false);
|
||||||
|
const [ pullsFlag , setPullsFlag ] = useState(true);
|
||||||
|
const [ issuesFlag , setIssuesFlag ] = useState(true);
|
||||||
|
|
||||||
const owner = props.match.params.owner;
|
const owner = props.match.params.owner;
|
||||||
const projectsId = props.match.params.projectsId;
|
const projectsId = props.match.params.projectsId;
|
||||||
|
@ -70,6 +72,22 @@ 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;
|
||||||
|
|
||||||
|
const { bannerList } = props;
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(bannerList && bannerList.length>0){
|
||||||
|
let a = bannerList.filter(i=>i.menu_name === "pulls");
|
||||||
|
let i = bannerList.filter(i=>i.menu_name === "issues");
|
||||||
|
if(a && a.length === 0){
|
||||||
|
setPullsFlag(false);
|
||||||
|
}
|
||||||
|
if(i && i.length === 0){
|
||||||
|
setIssuesFlag(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},[bannerList])
|
||||||
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(details){
|
if(details){
|
||||||
|
@ -277,6 +295,7 @@ function CoderDepot(props){
|
||||||
const mdFlag = n && n.substring(n.length-3,n.length) === ".md";
|
const mdFlag = n && n.substring(n.length-3,n.length) === ".md";
|
||||||
|
|
||||||
const { current_user } = props;
|
const { current_user } = props;
|
||||||
|
const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter";
|
||||||
const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin));
|
const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin));
|
||||||
return(
|
return(
|
||||||
<WhiteBack>
|
<WhiteBack>
|
||||||
|
@ -339,13 +358,19 @@ function CoderDepot(props){
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
<AlignCenter>
|
<AlignCenter>
|
||||||
<div className="mr20 addOptionBtn">
|
{
|
||||||
{
|
baseOperate && ((projectDetail.type !== 2 && pullsFlag) || issuesFlag )&&
|
||||||
projectDetail.type !== 2 &&
|
<div className="mr20 addOptionBtn">
|
||||||
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求</a>
|
{
|
||||||
}
|
projectDetail.type !== 2 && pullsFlag &&
|
||||||
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务</a>
|
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求</a>
|
||||||
</div>
|
}
|
||||||
|
{
|
||||||
|
issuesFlag &&
|
||||||
|
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务</a>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
{ fileOperate &&
|
{ fileOperate &&
|
||||||
<Dropdown overlay={fileMenu()} className="mr20" trigger={['click']}>
|
<Dropdown overlay={fileMenu()} className="mr20" trigger={['click']}>
|
||||||
<Button type="default">文件 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-grey-9"></i></Button>
|
<Button type="default">文件 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-grey-9"></i></Button>
|
||||||
|
@ -370,7 +395,9 @@ function CoderDepot(props){
|
||||||
{ hideBtn && <span className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></span> }
|
{ hideBtn && <span className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></span> }
|
||||||
|
|
||||||
<span className="ml12 color-grey-9 mt3">{lastCommit && lastCommit.time_from_now}</span>
|
<span className="ml12 color-grey-9 mt3">{lastCommit && lastCommit.time_from_now}</span>
|
||||||
{ commitCount ? <Link to={`/projects/${owner}/${projectsId}/commits`} className="ml12 color-grey-9"><i className="iconfont icon-tijiao mr3 font-17 color-grey-9"></i>{commitCount}次提交</Link>:"" }
|
{ commitCount ? <Link to={`/projects/${owner}/${projectsId}/commits/branch/${turnbar(branchName || defaultBranch)}`} className="ml12 color-grey-9">
|
||||||
|
<i className="iconfont icon-tijiao mr3 font-17 color-grey-9"></i>{commitCount}次提交
|
||||||
|
</Link>:"" }
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<ul className="listtablebody">
|
<ul className="listtablebody">
|
||||||
|
@ -464,7 +491,7 @@ function CoderDepot(props){
|
||||||
<div>
|
<div>
|
||||||
<Divider />
|
<Divider />
|
||||||
<p className="font-16 color-grey-6">实践课程</p>
|
<p className="font-16 color-grey-6">实践课程</p>
|
||||||
<a href={lesson_url} target="_blank" className="color-grey-6" style={{textDecoration:"underline"}}>{lesson_url}</a>
|
<a href={lesson_url} target="_blank" className="color-grey-6" style={{textDecoration:"underline",wordBreak:"break-all"}}>{lesson_url}</a>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{/* 发布 */}
|
{/* 发布 */}
|
||||||
|
@ -472,7 +499,14 @@ function CoderDepot(props){
|
||||||
projectDetail && projectDetail.release_versions &&
|
projectDetail && projectDetail.release_versions &&
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Divider />
|
<Divider />
|
||||||
<Releases owner={owner} projectsId={projectsId} releaseVersions={projectDetail.release_versions} history={props.history}/>
|
<Releases
|
||||||
|
owner={owner}
|
||||||
|
projectsId={projectsId}
|
||||||
|
releaseVersions={projectDetail.release_versions}
|
||||||
|
history={props.history}
|
||||||
|
baseOperate={baseOperate}
|
||||||
|
projectType={projectDetail.type}
|
||||||
|
/>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
}
|
}
|
||||||
{/* 贡献者 */}
|
{/* 贡献者 */}
|
||||||
|
|
|
@ -17,7 +17,7 @@ export default ((props)=>{
|
||||||
const [ isSpin , setIsSpin ] =useState(true);
|
const [ isSpin , setIsSpin ] =useState(true);
|
||||||
|
|
||||||
const { projectsId , owner } = props.match.params;
|
const { projectsId , owner } = props.match.params;
|
||||||
|
const { isManager , isDeveloper , projectDetail } = props;
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
getBranchs(projectsId, owner);
|
getBranchs(projectsId, owner);
|
||||||
},[projectsId])
|
},[projectsId])
|
||||||
|
@ -46,7 +46,10 @@ export default ((props)=>{
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<span>
|
<span>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/pulls/new/${item.name}`} className="mr20 color-blue mr30">创建合并请求</Link>
|
{
|
||||||
|
(isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) &&
|
||||||
|
<Link to={`/projects/${owner}/${projectsId}/pulls/new/${item.name}`} className="mr20 color-blue mr30">创建合并请求</Link>
|
||||||
|
}
|
||||||
<Dropdown overlay={menu(item.zip_url,item.tar_url)} trigger={['click']} placement="bottomRight" className="color-green-file">
|
<Dropdown overlay={menu(item.zip_url,item.tar_url)} trigger={['click']} placement="bottomRight" className="color-green-file">
|
||||||
<a className="ant-dropdown-link">
|
<a className="ant-dropdown-link">
|
||||||
<Tooltip title={`下载分支${item.name}`}><Icon type="cloud-download" className="font-18"/></Tooltip>
|
<Tooltip title={`下载分支${item.name}`}><Icon type="cloud-download" className="font-18"/></Tooltip>
|
||||||
|
@ -70,6 +73,7 @@ export default ((props)=>{
|
||||||
<Menu.Item key={'1'}><a href={tar_url}>TAR.GZ</a></Menu.Item>
|
<Menu.Item key={'1'}><a href={tar_url}>TAR.GZ</a></Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
)
|
)
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div className="main">
|
<div className="main">
|
||||||
|
|
|
@ -9,6 +9,12 @@ import Nodata from '../Nodata';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import {Link} from "react-router-dom";
|
import {Link} from "react-router-dom";
|
||||||
|
|
||||||
|
function returnbar(str){
|
||||||
|
if(str && str.length>0 && str.indexOf("%2F")>-1){
|
||||||
|
return str.replaceAll('%2F','/');
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
class CoderRootCommit extends Component{
|
class CoderRootCommit extends Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
super(props)
|
super(props)
|
||||||
|
@ -57,11 +63,12 @@ class CoderRootCommit extends Component{
|
||||||
this.setState({
|
this.setState({
|
||||||
isSpining:true
|
isSpining:true
|
||||||
})
|
})
|
||||||
|
console.log(returnbar(branch));
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
const url = `/${owner}/${projectsId}/commits.json`;
|
const url = `/${owner}/${projectsId}/commits.json`;
|
||||||
axios.get(url,{
|
axios.get(url,{
|
||||||
params:{
|
params:{
|
||||||
sha:branch,
|
sha:returnbar(branch),
|
||||||
page,
|
page,
|
||||||
limit
|
limit
|
||||||
}
|
}
|
||||||
|
@ -106,7 +113,7 @@ class CoderRootCommit extends Component{
|
||||||
const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state;
|
const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state;
|
||||||
const { projectDetail, commit_class , defaultBranch } = this.props;
|
const { projectDetail, commit_class , defaultBranch } = this.props;
|
||||||
const { projectsId , owner , branchName } = this.props.match.params;
|
const { projectsId , owner , branchName } = this.props.match.params;
|
||||||
let branch = branchName || defaultBranch;
|
let branch = returnbar(branchName || defaultBranch);
|
||||||
return(
|
return(
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div className={"main"}style={{padding:"0px",border:"none"}}>
|
<div className={"main"}style={{padding:"0px",border:"none"}}>
|
||||||
|
|
|
@ -102,6 +102,11 @@ class CoderRootIndex extends Component{
|
||||||
(props) => (<FileNew {...this.props} {...props} {...this.state} getTopCount={this.getTopCount} />)
|
(props) => (<FileNew {...this.props} {...props} {...this.state} getTopCount={this.getTopCount} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
<Route path="/projects/:owner/:projectsId/commits/branch/:branchName"
|
||||||
|
render={
|
||||||
|
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
||||||
|
}
|
||||||
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/commits/:sha"
|
<Route path="/projects/:owner/:projectsId/commits/:sha"
|
||||||
render={
|
render={
|
||||||
(props) => (<Diff {...this.props} {...props} {...this.state}/>)
|
(props) => (<Diff {...this.props} {...props} {...this.state}/>)
|
||||||
|
|
|
@ -442,7 +442,7 @@ class Detail extends Component {
|
||||||
<Link to={`${project.author.type ==="Organization" ? "/organize":'/users'}/${project.author.login}`}>{project.author.name}</Link>
|
<Link to={`${project.author.type ==="Organization" ? "/organize":'/users'}/${project.author.login}`}>{project.author.name}</Link>
|
||||||
}
|
}
|
||||||
<span className="ml5 mr5">/</span>
|
<span className="ml5 mr5">/</span>
|
||||||
<Link to={`/projects/${owner}/${projectsId}`} className="projectN mt6">{project && project.name}</Link>
|
<Link to={`/projects/${owner}/${projectsId}`} className="projectN mt6">{projectDetail && projectDetail.name}</Link>
|
||||||
</div>
|
</div>
|
||||||
{ projectDetail && projectDetail.private && <span className="privateTag mt6">私有</span>}
|
{ projectDetail && projectDetail.private && <span className="privateTag mt6">私有</span>}
|
||||||
</AlignTop>
|
</AlignTop>
|
||||||
|
|
|
@ -183,7 +183,7 @@ class MergeItem extends Component {
|
||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
{user_admin_or_member ? (
|
{user_admin_or_member && item.pull_request_status === 0 ? (
|
||||||
<div
|
<div
|
||||||
className="milepostleft"
|
className="milepostleft"
|
||||||
style={{
|
style={{
|
||||||
|
|
|
@ -42,9 +42,10 @@ class NewMerge extends Component {
|
||||||
|
|
||||||
componentDidUpdate=(preProps)=>{
|
componentDidUpdate=(preProps)=>{
|
||||||
const { project } = this.props;
|
const { project } = this.props;
|
||||||
|
const { pull } = this.state;
|
||||||
let oldProject = preProps.project;
|
let oldProject = preProps.project;
|
||||||
if(project && oldProject && (oldProject.id !== project.id)){
|
if(project && oldProject && (oldProject.id !== project.id)){
|
||||||
this.compareProject(this.state.id,"master","master");
|
this.compareProject(this.state.id,pull,"master");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 页面销毁取消监听
|
// 页面销毁取消监听
|
||||||
|
@ -78,7 +79,8 @@ class NewMerge extends Component {
|
||||||
this.set_default_pull(result.data.branches);
|
this.set_default_pull(result.data.branches);
|
||||||
this.set_default_merge(result.data.merge_projects);
|
this.set_default_merge(result.data.merge_projects);
|
||||||
}
|
}
|
||||||
this.compareProject(result.data.id,"master","master");
|
const { pull } = this.state;
|
||||||
|
this.compareProject(result.data.id,pull||"master","master");
|
||||||
this.setState({isSpin: false})
|
this.setState({isSpin: false})
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|
|
@ -159,14 +159,10 @@ class merge extends Component {
|
||||||
<Menu.Item key={"all"} onClick={(e) => this.getOption(e, id, name)}>
|
<Menu.Item key={"all"} onClick={(e) => this.getOption(e, id, name)}>
|
||||||
{name}
|
{name}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
{array &&
|
{array && array.length > 0 && array.map((item, key) => {
|
||||||
array.length > 0 &&
|
|
||||||
array.map((item, key) => {
|
|
||||||
return (
|
return (
|
||||||
<Menu.Item
|
((!item.permission) || (item.permission && item.permission !== "Reporter")) &&
|
||||||
key={item.id}
|
<Menu.Item key={item.id} onClick={(e) => this.getOption(e, id, item.name)}>
|
||||||
onClick={(e) => this.getOption(e, id, item.name)}
|
|
||||||
>
|
|
||||||
{item.name}
|
{item.name}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
);
|
);
|
||||||
|
|
|
@ -346,19 +346,21 @@ class MergeForm extends Component {
|
||||||
</Select>
|
</Select>
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="checkbox-group" label="其他">
|
{/* <Form.Item label="其他">
|
||||||
<Checkbox.Group>
|
{getFieldDecorator("checkbox-group")(
|
||||||
<div>
|
<Checkbox.Group>
|
||||||
<Checkbox value="A">必须审查代码</Checkbox>
|
<div>
|
||||||
</div>
|
<Checkbox value="A">必须审查代码</Checkbox>
|
||||||
<div>
|
</div>
|
||||||
<Checkbox value="B">合并后删除提交分支</Checkbox>
|
<div>
|
||||||
</div>
|
<Checkbox value="B">合并后删除提交分支</Checkbox>
|
||||||
<div>
|
</div>
|
||||||
<Checkbox value="C">合并后关闭提到的任务</Checkbox>
|
<div>
|
||||||
</div>
|
<Checkbox value="C">合并后关闭提到的任务</Checkbox>
|
||||||
</Checkbox.Group>
|
</div>
|
||||||
</Form.Item>
|
</Checkbox.Group>
|
||||||
|
)}
|
||||||
|
</Form.Item> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -70,9 +70,9 @@ function Index(props){
|
||||||
function deleteEvent(type,count) {
|
function deleteEvent(type,count) {
|
||||||
let c = count;
|
let c = count;
|
||||||
if(type==="apply"){
|
if(type==="apply"){
|
||||||
setApplyCount(applyCount-count);
|
setTransferCount(transferCount-count);
|
||||||
}else if(type==="undo"){
|
}else if(type==="undo"){
|
||||||
setTransferCount(applyCount-count);
|
setApplyCount(applyCount-count);
|
||||||
}else{
|
}else{
|
||||||
setMessagesCount(0);
|
setMessagesCount(0);
|
||||||
c = messagesCount;
|
c = messagesCount;
|
||||||
|
|
|
@ -53,7 +53,7 @@ function UndoEvent(props){
|
||||||
Axios.post(url).then(result=>{
|
Axios.post(url).then(result=>{
|
||||||
if(result && result.data){
|
if(result && result.data){
|
||||||
getList();
|
getList();
|
||||||
props && props.deleteEvent("undo",1);
|
props && props.deleteEvent("apply",1);
|
||||||
}
|
}
|
||||||
}).catch(error=>{})
|
}).catch(error=>{})
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,10 +154,10 @@ class Milepost extends Component {
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
const menu = (
|
const menu = (
|
||||||
<Menu className="orderCondition" onClick={this.arrayList}>
|
<Menu className="orderCondition" onClick={this.arrayList}>
|
||||||
<Menu.Item key={'created_on'} value="desc">到期日从近到远</Menu.Item>
|
<Menu.Item key={'effective_date'} value="desc">到期日从后到先</Menu.Item>
|
||||||
<Menu.Item key={'created_on'} value="asc">到期日从远到近</Menu.Item>
|
<Menu.Item key={'effective_date'} value="asc">到期日从先到后</Menu.Item>
|
||||||
<Menu.Item key={'percent'} value="desc">完成度从低到高</Menu.Item>
|
<Menu.Item key={'percent'} value="asc">完成度从低到高</Menu.Item>
|
||||||
<Menu.Item key={'percent'} value="asc">完成度从高到低</Menu.Item>
|
<Menu.Item key={'percent'} value="desc">完成度从高到低</Menu.Item>
|
||||||
<Menu.Item key={'issues_count'} value="desc">任务从多到少</Menu.Item>
|
<Menu.Item key={'issues_count'} value="desc">任务从多到少</Menu.Item>
|
||||||
<Menu.Item key={'issues_count'} value="asc">任务从少到多</Menu.Item>
|
<Menu.Item key={'issues_count'} value="asc">任务从少到多</Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|
|
@ -180,8 +180,8 @@ class UpdateMilepost extends Component {
|
||||||
<Row type="flex" justify="space-between">
|
<Row type="flex" justify="space-between">
|
||||||
<Col>
|
<Col>
|
||||||
<Group size="small" onChange={e => onTypeChange(e.target.value)} value={type}>
|
<Group size="small" onChange={e => onTypeChange(e.target.value)} value={type}>
|
||||||
<Button value="month">月份</Button>
|
<Button value="month">日期</Button>
|
||||||
<Button value="year">年份</Button>
|
<Button value="year">月份</Button>
|
||||||
</Group>
|
</Group>
|
||||||
</Col>
|
</Col>
|
||||||
<Col>
|
<Col>
|
||||||
|
|
|
@ -92,10 +92,10 @@ class order_form extends Component {
|
||||||
|
|
||||||
const url = `/${owner}/${projectsId}/issues/new.json`;
|
const url = `/${owner}/${projectsId}/issues/new.json`;
|
||||||
axios.get(url).then((result) => {
|
axios.get(url).then((result) => {
|
||||||
if (result) {
|
if (result && result.data) {
|
||||||
this.setState({
|
this.setState({
|
||||||
issue_chosen: result.data.issue_chosen,
|
issue_chosen: result.data.issue_chosen,
|
||||||
branches: result.data.branches,
|
branches: result.data.issue_chosen.branches,
|
||||||
isSpin:false
|
isSpin:false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ export default ((props)=>{
|
||||||
const [ page , setPage ] = useState(1);
|
const [ page , setPage ] = useState(1);
|
||||||
let defaultBranch = props.defaultBranch;
|
let defaultBranch = props.defaultBranch;
|
||||||
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(defaultBranch){
|
if(defaultBranch){
|
||||||
setBranch(defaultBranch);
|
setBranch(defaultBranch);
|
||||||
|
@ -76,6 +77,8 @@ export default ((props)=>{
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
props.showNotification(`分支设置成功!`);
|
props.showNotification(`分支设置成功!`);
|
||||||
|
const { getDetail } = props;
|
||||||
|
getDetail && getDetail();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
@ -95,7 +98,7 @@ export default ((props)=>{
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<WhiteBack>
|
<WhiteBack>
|
||||||
<Title>分支设置</Title>
|
<Title><span className="font-18">分支设置</span></Title>
|
||||||
<Div>
|
<Div>
|
||||||
<div className="pb20" style={{borderBottom:"1px dashed #eee"}}>
|
<div className="pb20" style={{borderBottom:"1px dashed #eee"}}>
|
||||||
<p className="color-grey-3 mb10 font-18">默认分支</p>
|
<p className="color-grey-3 mb10 font-18">默认分支</p>
|
||||||
|
|
|
@ -58,8 +58,12 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
setListData(result.data.members);
|
if(page > 1 && ( listData && listData.length === 1)){
|
||||||
setTotal(result.data.total_count);
|
setPage(page-1);
|
||||||
|
}else{
|
||||||
|
setListData(result.data.members);
|
||||||
|
setTotal(result.data.total_count);
|
||||||
|
}
|
||||||
setIsSpin(false);
|
setIsSpin(false);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -302,7 +302,7 @@ function New({ form , match , showNotification , history }) {
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="分支过滤"
|
label="分支过滤"
|
||||||
className="topLine"
|
className="topLine"
|
||||||
help={'推送、创建,删除分支事件的分支白名单,使用 glob 模式匹配指定。若为空或 *,则将报告所有分支的事件。语法文档见github.com/gobwas/glob。示例:master,{master,release*}。'}
|
help={<span>推送、创建,删除分支事件的分支白名单,使用 glob 模式匹配指定。若为空或 *,则将报告所有分支的事件。语法文档见<a href="github.com/gobwas/glob" target="_blank" className="hoverLine color-blue">github.com/gobwas/glob</a>。示例:master,{'{'}master,release*{'}'}。</span>}
|
||||||
colon={false}
|
colon={false}
|
||||||
style={{marginTop:'15px'}}
|
style={{marginTop:'15px'}}
|
||||||
>
|
>
|
||||||
|
|
|
@ -58,6 +58,9 @@ class version extends Component {
|
||||||
|
|
||||||
renderList = (releases) => {
|
renderList = (releases) => {
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
|
const { isManager , isDeveloper } = this.props;
|
||||||
|
const type = this.props.projectDetail && this.props.projectDetail.type;
|
||||||
|
|
||||||
if (releases && releases.length > 0) {
|
if (releases && releases.length > 0) {
|
||||||
return (
|
return (
|
||||||
releases.map((item, key) => {
|
releases.map((item, key) => {
|
||||||
|
@ -74,7 +77,10 @@ class version extends Component {
|
||||||
<div className="versionInfo_right">
|
<div className="versionInfo_right">
|
||||||
<span className="versionName">
|
<span className="versionName">
|
||||||
<span className="task-hide">{item.name}</span>
|
<span className="task-hide">{item.name}</span>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/releases/${item.version_id}/update`} className="color-blue ml3 font-12">(编辑)</Link>
|
{
|
||||||
|
(isManager || isDeveloper) && type !==2 &&
|
||||||
|
<Link to={`/projects/${owner}/${projectsId}/releases/${item.version_id}/update`} className="color-blue ml3 font-12">(编辑)</Link>
|
||||||
|
}
|
||||||
</span>
|
</span>
|
||||||
<span className="color-grey-3">
|
<span className="color-grey-3">
|
||||||
<i className={`${item.bodyshow ? "iconfont icon-sanjiaoxing-down color-grey-8 mr3 font-14":"iconfont icon-triangle color-grey-8 mr3 font-14"}`} onClick={()=>this.showBody(key,item.bodyshow)}></i>
|
<i className={`${item.bodyshow ? "iconfont icon-sanjiaoxing-down color-grey-8 mr3 font-14":"iconfont icon-triangle color-grey-8 mr3 font-14"}`} onClick={()=>this.showBody(key,item.bodyshow)}></i>
|
||||||
|
@ -100,14 +106,14 @@ class version extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { projectsId ,owner } = this.props.match.params;
|
const { projectsId ,owner } = this.props.match.params;
|
||||||
const { data , releases , isSpin } = this.state
|
const { data , releases , isSpin } = this.state;
|
||||||
|
const type = this.props.projectDetail && this.props.projectDetail.type;
|
||||||
return (
|
return (
|
||||||
<div className="main" style={{padding:"0px"}}>
|
<div className="main" style={{padding:"0px"}}>
|
||||||
<div className="topWrapper" style={{padding:"15px 20px"}}>
|
<div className="topWrapper" style={{padding:"15px 20px"}}>
|
||||||
<span className="font-18 color-grey-3">版本发布</span>
|
<span className="font-18 color-grey-3">版本发布</span>
|
||||||
{
|
{
|
||||||
data && data.user_permission ?
|
data && data.user_permission && type !== 2 ?
|
||||||
<Link to={`/projects/${owner}/${projectsId}/releases/new`} className="topWrapper_btn_new">+ 发布新版</Link>
|
<Link to={`/projects/${owner}/${projectsId}/releases/new`} className="topWrapper_btn_new">+ 发布新版</Link>
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,6 +105,7 @@ $flex:flex;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
.focusBox,.infoBox{
|
.focusBox,.infoBox{
|
||||||
width: 100%!important;
|
width: 100%!important;
|
||||||
|
|
|
@ -41,9 +41,6 @@
|
||||||
z-index: 1000 !important;
|
z-index: 1000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-body p {
|
|
||||||
margin: 0 !important
|
|
||||||
}
|
|
||||||
.markdown-body img{
|
.markdown-body img{
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue