diff --git a/src/App.css b/src/App.css index 205c64f7..8d916d39 100644 --- a/src/App.css +++ b/src/App.css @@ -60,12 +60,13 @@ body { .ant-progress-textno { color: #f5222d; } - +.CodeMirror pre.CodeMirror-line{ + font-size: 16px!important; +} /* md多空格 */ .markdown-body p { margin:10px 0px!important; font-size: 16px !important; - line-height: 2 !important; white-space: pre-wrap; } @@ -87,6 +88,10 @@ body { border-left: 1px solid rgb(221, 221, 221); /* 某些情况下,被cm盖住了 */ z-index: 99; + padding:8px 8px 50px; +} +.editormd-preview .markdown-body{ + padding:0px !important; } /* 图片点击放大的场景,隐藏图片链接 */ diff --git a/src/forge/Component/EAccount.scss b/src/forge/Component/EAccount.scss index 4bcd6b91..d0fd2ef2 100644 --- a/src/forge/Component/EAccount.scss +++ b/src/forge/Component/EAccount.scss @@ -3,7 +3,4 @@ } .ant-modal-wrap{ z-index: 1002; - .ant-form-explain{ - position: absolute; - } } \ No newline at end of file diff --git a/src/forge/Component/Releases.jsx b/src/forge/Component/Releases.jsx index 501c6b63..da984543 100644 --- a/src/forge/Component/Releases.jsx +++ b/src/forge/Component/Releases.jsx @@ -2,7 +2,7 @@ import React from 'react'; import { AlignCenter , AlignTop , FlexAJ } from '../Component/layout'; import { Link } from 'react-router-dom'; -function Releases({owner,projectsId,releaseVersions}){ +function Releases({owner,projectsId,releaseVersions , baseOperate , projectType}){ return(
@@ -10,10 +10,10 @@ function Releases({owner,projectsId,releaseVersions}){ 发行版 { releaseVersions && releaseVersions.total_count > 0 && {releaseVersions.total_count}} - { releaseVersions && releaseVersions.total_count > 0 ? + { (releaseVersions && releaseVersions.total_count > 0) || projectType ===2 ? 全部 : - 新建 + baseOperate && 新建 } { diff --git a/src/forge/DevOps/Dispose/PipelineName.jsx b/src/forge/DevOps/Dispose/PipelineName.jsx index 3cf7f96a..4acaa206 100644 --- a/src/forge/DevOps/Dispose/PipelineName.jsx +++ b/src/forge/DevOps/Dispose/PipelineName.jsx @@ -42,7 +42,7 @@ function PipelineName({visible,onCancel,onOk,value ,branchList}){
触发条件: - setBranchValue(e)}> { branchList && branchList.length>0 && branchList.map((item,key)=>{ return( @@ -51,7 +51,7 @@ function PipelineName({visible,onCancel,onOk,value ,branchList}){ }) } - {console.log(e);setEventValue(e)}}> { EVENT.map((item,key)=>{ return( diff --git a/src/forge/DevOps/ops.scss b/src/forge/DevOps/ops.scss index 024d0aa6..94838095 100644 --- a/src/forge/DevOps/ops.scss +++ b/src/forge/DevOps/ops.scss @@ -391,6 +391,9 @@ } } } +.chooseCon.ant-select-dropdown{ + z-index: 100001; +} .choosenList{ display: flex; diff --git a/src/forge/Divert/DivertModal.jsx b/src/forge/Divert/DivertModal.jsx index dd947501..a6ecdc05 100644 --- a/src/forge/Divert/DivertModal.jsx +++ b/src/forge/Divert/DivertModal.jsx @@ -152,20 +152,21 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){ } - + {getFieldDecorator("identifier", { rules:[ - {required:true,message:"请输入仓库名称"}, + {required:true,message:"请输入仓库标识!"}, { validator:checkIdentifier } ] } )( - + )} + 请输入当前项目的标识:{repo}进行确认!
diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 32121077..cfe3c6a8 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -63,6 +63,8 @@ function CoderDepot(props){ const [ readme , setReadme ] = useState(undefined); const [ defaultBranch , setDefaultBranch ] = useState(undefined); const [ editReadme , setEditReadme ] = useState(false); + const [ pullsFlag , setPullsFlag ] = useState(true); + const [ issuesFlag , setIssuesFlag ] = useState(true); const owner = props.match.params.owner; const projectsId = props.match.params.projectsId; @@ -70,6 +72,22 @@ function CoderDepot(props){ branchName = returnbar(branchName); const details = props.projectDetail; 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(()=>{ if(details){ @@ -277,6 +295,7 @@ function CoderDepot(props){ const mdFlag = n && n.substring(n.length-3,n.length) === ".md"; 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)); return( @@ -339,13 +358,19 @@ function CoderDepot(props){ -
- { - projectDetail.type !== 2 && - urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求 - } - urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务 -
+ { + baseOperate && ((projectDetail.type !== 2 && pullsFlag) || issuesFlag )&& +
+ { + projectDetail.type !== 2 && pullsFlag && + urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求 + } + { + issuesFlag && + urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务 + } +
+ } { fileOperate && @@ -370,7 +395,9 @@ function CoderDepot(props){ { hideBtn && changeHide(hide)}> } {lastCommit && lastCommit.time_from_now} - { commitCount ? {commitCount}次提交:"" } + { commitCount ? + {commitCount}次提交 + :"" } }
    @@ -464,7 +491,7 @@ function CoderDepot(props){

    实践课程

    - {lesson_url} + {lesson_url}
    } {/* 发布 */} @@ -472,7 +499,14 @@ function CoderDepot(props){ projectDetail && projectDetail.release_versions && - + } {/* 贡献者 */} diff --git a/src/forge/Main/CoderRootBranch.js b/src/forge/Main/CoderRootBranch.js index 6299adaf..8ccc5aa4 100644 --- a/src/forge/Main/CoderRootBranch.js +++ b/src/forge/Main/CoderRootBranch.js @@ -17,7 +17,7 @@ export default ((props)=>{ const [ isSpin , setIsSpin ] =useState(true); const { projectsId , owner } = props.match.params; - + const { isManager , isDeveloper , projectDetail } = props; useEffect(()=>{ getBranchs(projectsId, owner); },[projectsId]) @@ -46,7 +46,10 @@ export default ((props)=>{

    - 创建合并请求 + { + (isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) && + 创建合并请求 + } @@ -70,6 +73,7 @@ export default ((props)=>{ TAR.GZ ) + return(
    diff --git a/src/forge/Main/CoderRootCommit.js b/src/forge/Main/CoderRootCommit.js index 9b349938..b6ca0be6 100644 --- a/src/forge/Main/CoderRootCommit.js +++ b/src/forge/Main/CoderRootCommit.js @@ -9,6 +9,12 @@ import Nodata from '../Nodata'; import axios from 'axios'; 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{ constructor(props){ super(props) @@ -57,11 +63,12 @@ class CoderRootCommit extends Component{ this.setState({ isSpining:true }) + console.log(returnbar(branch)); const { projectsId , owner } = this.props.match.params; const url = `/${owner}/${projectsId}/commits.json`; axios.get(url,{ params:{ - sha:branch, + sha:returnbar(branch), page, limit } @@ -106,7 +113,7 @@ class CoderRootCommit extends Component{ const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state; const { projectDetail, commit_class , defaultBranch } = this.props; const { projectsId , owner , branchName } = this.props.match.params; - let branch = branchName || defaultBranch; + let branch = returnbar(branchName || defaultBranch); return(
    diff --git a/src/forge/Main/CoderRootIndex.js b/src/forge/Main/CoderRootIndex.js index ceff9d9f..84ab94d3 100644 --- a/src/forge/Main/CoderRootIndex.js +++ b/src/forge/Main/CoderRootIndex.js @@ -102,6 +102,11 @@ class CoderRootIndex extends Component{ (props) => () } > + () + } + > () diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index f7820f10..f6dc83e0 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -442,7 +442,7 @@ class Detail extends Component { {project.author.name} } / - {project && project.name} + {projectDetail && projectDetail.name}
    { projectDetail && projectDetail.private && 私有} diff --git a/src/forge/Merge/MergeItem.js b/src/forge/Merge/MergeItem.js index 5c08a61f..32f3f811 100644 --- a/src/forge/Merge/MergeItem.js +++ b/src/forge/Merge/MergeItem.js @@ -183,7 +183,7 @@ class MergeItem extends Component { ) : ( "" )} - {user_admin_or_member ? ( + {user_admin_or_member && item.pull_request_status === 0 ? (
    { const { project } = this.props; + const { pull } = this.state; let oldProject = preProps.project; 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_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}) }) .catch((error) => { diff --git a/src/forge/Merge/merge.js b/src/forge/Merge/merge.js index c0c7e5ce..90e35dcc 100644 --- a/src/forge/Merge/merge.js +++ b/src/forge/Merge/merge.js @@ -159,14 +159,10 @@ class merge extends Component { this.getOption(e, id, name)}> {name} - {array && - array.length > 0 && - array.map((item, key) => { + {array && array.length > 0 && array.map((item, key) => { return ( - this.getOption(e, id, item.name)} - > + ((!item.permission) || (item.permission && item.permission !== "Reporter")) && + this.getOption(e, id, item.name)}> {item.name} ); diff --git a/src/forge/Merge/merge_form.js b/src/forge/Merge/merge_form.js index 95a38d95..3481cc8f 100644 --- a/src/forge/Merge/merge_form.js +++ b/src/forge/Merge/merge_form.js @@ -346,19 +346,21 @@ class MergeForm extends Component { )} - - -
    - 必须审查代码 -
    -
    - 合并后删除提交分支 -
    -
    - 合并后关闭提到的任务 -
    -
    -
    + {/* + {getFieldDecorator("checkbox-group")( + +
    + 必须审查代码 +
    +
    + 合并后删除提交分支 +
    +
    + 合并后关闭提到的任务 +
    +
    + )} +
    */}
    diff --git a/src/forge/Notice/Index.jsx b/src/forge/Notice/Index.jsx index 94c63804..63d09748 100644 --- a/src/forge/Notice/Index.jsx +++ b/src/forge/Notice/Index.jsx @@ -70,9 +70,9 @@ function Index(props){ function deleteEvent(type,count) { let c = count; if(type==="apply"){ - setApplyCount(applyCount-count); + setTransferCount(transferCount-count); }else if(type==="undo"){ - setTransferCount(applyCount-count); + setApplyCount(applyCount-count); }else{ setMessagesCount(0); c = messagesCount; diff --git a/src/forge/Notice/UndoEvent.jsx b/src/forge/Notice/UndoEvent.jsx index c8c579dc..d93a1f83 100644 --- a/src/forge/Notice/UndoEvent.jsx +++ b/src/forge/Notice/UndoEvent.jsx @@ -53,7 +53,7 @@ function UndoEvent(props){ Axios.post(url).then(result=>{ if(result && result.data){ getList(); - props && props.deleteEvent("undo",1); + props && props.deleteEvent("apply",1); } }).catch(error=>{}) } diff --git a/src/forge/Order/Milepost.js b/src/forge/Order/Milepost.js index d87bfe0b..ede2d314 100644 --- a/src/forge/Order/Milepost.js +++ b/src/forge/Order/Milepost.js @@ -154,10 +154,10 @@ class Milepost extends Component { const { projectsId , owner } = this.props.match.params; const menu = ( - 到期日从近到远 - 到期日从远到近 - 完成度从低到高 - 完成度从高到低 + 到期日从后到先 + 到期日从先到后 + 完成度从低到高 + 完成度从高到低 任务从多到少 任务从少到多 diff --git a/src/forge/Order/UpdateMilepost.js b/src/forge/Order/UpdateMilepost.js index 49a2b8d3..88a73033 100644 --- a/src/forge/Order/UpdateMilepost.js +++ b/src/forge/Order/UpdateMilepost.js @@ -180,8 +180,8 @@ class UpdateMilepost extends Component { onTypeChange(e.target.value)} value={type}> - - + + diff --git a/src/forge/Order/order_form.js b/src/forge/Order/order_form.js index 45433631..b6f065b2 100644 --- a/src/forge/Order/order_form.js +++ b/src/forge/Order/order_form.js @@ -92,10 +92,10 @@ class order_form extends Component { const url = `/${owner}/${projectsId}/issues/new.json`; axios.get(url).then((result) => { - if (result) { + if (result && result.data) { this.setState({ issue_chosen: result.data.issue_chosen, - branches: result.data.branches, + branches: result.data.issue_chosen.branches, isSpin:false }); diff --git a/src/forge/Settings/Branch.js b/src/forge/Settings/Branch.js index d0a235d8..d345f0fc 100644 --- a/src/forge/Settings/Branch.js +++ b/src/forge/Settings/Branch.js @@ -23,6 +23,7 @@ export default ((props)=>{ const [ page , setPage ] = useState(1); let defaultBranch = props.defaultBranch; + useEffect(()=>{ if(defaultBranch){ setBranch(defaultBranch); @@ -76,6 +77,8 @@ export default ((props)=>{ .then((result) => { if (result) { props.showNotification(`分支设置成功!`); + const { getDetail } = props; + getDetail && getDetail(); } }) .catch((error) => { @@ -95,7 +98,7 @@ export default ((props)=>{ return( - 分支设置 + <span className="font-18">分支设置</span>

    默认分支

    diff --git a/src/forge/Settings/CollaboratorMember.jsx b/src/forge/Settings/CollaboratorMember.jsx index 86459d87..1104a864 100644 --- a/src/forge/Settings/CollaboratorMember.jsx +++ b/src/forge/Settings/CollaboratorMember.jsx @@ -58,8 +58,12 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification }) .then((result) => { if (result) { - setListData(result.data.members); - setTotal(result.data.total_count); + if(page > 1 && ( listData && listData.length === 1)){ + setPage(page-1); + }else{ + setListData(result.data.members); + setTotal(result.data.total_count); + } setIsSpin(false); } }) diff --git a/src/forge/Settings/Webhooks/New.jsx b/src/forge/Settings/Webhooks/New.jsx index a8201f72..28ecd0b3 100644 --- a/src/forge/Settings/Webhooks/New.jsx +++ b/src/forge/Settings/Webhooks/New.jsx @@ -302,7 +302,7 @@ function New({ form , match , showNotification , history }) { 推送、创建,删除分支事件的分支白名单,使用 glob 模式匹配指定。若为空或 *,则将报告所有分支的事件。语法文档见github.com/gobwas/glob。示例:master,{'{'}master,release*{'}'}。} colon={false} style={{marginTop:'15px'}} > diff --git a/src/forge/Version/version.js b/src/forge/Version/version.js index 99223e1d..6f81b77c 100644 --- a/src/forge/Version/version.js +++ b/src/forge/Version/version.js @@ -58,6 +58,9 @@ class version extends Component { renderList = (releases) => { 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) { return ( releases.map((item, key) => { @@ -74,7 +77,10 @@ class version extends Component {
    {item.name} - (编辑) + { + (isManager || isDeveloper) && type !==2 && + (编辑) + } this.showBody(key,item.bodyshow)}> @@ -100,14 +106,14 @@ class version extends Component { render() { 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 (
    版本发布 { - data && data.user_permission ? + data && data.user_permission && type !== 2 ? + 发布新版 : '' } diff --git a/src/forge/users/Index.scss b/src/forge/users/Index.scss index b087fa2f..3595aa84 100644 --- a/src/forge/users/Index.scss +++ b/src/forge/users/Index.scss @@ -105,6 +105,7 @@ $flex:flex; word-break: break-all; text-align: justify; font-size: 16px; + text-align: center; } .focusBox,.infoBox{ width: 100%!important; diff --git a/src/index.css b/src/index.css index 658577e5..e58df61f 100644 --- a/src/index.css +++ b/src/index.css @@ -41,9 +41,6 @@ z-index: 1000 !important; } -.markdown-body p { - margin: 0 !important -} .markdown-body img{ cursor: pointer; }