diff --git a/public/css/iconfont.css b/public/css/iconfont.css index 9518a831c..07c91dd4d 100644 --- a/public/css/iconfont.css +++ b/public/css/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 2340181 */ - src: url('iconfont.woff2?t=1757896728868') format('woff2'), - url('iconfont.woff?t=1757896728868') format('woff'), - url('iconfont.ttf?t=1757896728868') format('truetype'); + src: url('iconfont.woff2?t=1768876676007') format('woff2'), + url('iconfont.woff?t=1768876676007') format('woff'), + url('iconfont.ttf?t=1768876676007') format('truetype'); } .iconfont { @@ -13,6 +13,122 @@ -moz-osx-font-smoothing: grayscale; } +.icon-zhuangtai:before { + content: "\e9c5"; +} + +.icon-fuzhi-shanchu1:before { + content: "\e9c6"; +} + +.icon-mobanguanli:before { + content: "\e9c7"; +} + +.icon-svg_jiantou1:before { + content: "\e9c3"; +} + +.icon-zuojiantou1:before { + content: "\e9c4"; +} + +.icon-jiantou4:before { + content: "\e9c2"; +} + +.icon-hezuohuoban:before { + content: "\e9bf"; +} + +.icon-xiangmugongxian:before { + content: "\e9c1"; +} + +.icon-sijiaoxing:before { + content: "\e9c0"; +} + +.icon-a-zu15512:before { + content: "\e9be"; +} + +.icon-wendangbangong-01:before { + content: "\e9bd"; +} + +.icon-wendangsousuo:before { + content: "\e9b7"; +} + +.icon-jieyakelu:before { + content: "\e9b0"; +} + +.icon-tuxingtuxiang1:before { + content: "\e9b6"; +} + +.icon-xiazaigongju:before { + content: "\e9bc"; +} + +.icon-shipinchuli:before { + content: "\e9b2"; +} + +.icon-liulanqi:before { + content: "\e9b8"; +} + +.icon-shejiaoliaotian:before { + content: "\e9b9"; +} + +.icon-shurufa:before { + content: "\e9ba"; +} + +.icon-quanbuleibie:before { + content: "\e9bb"; +} + +.icon-tuxingtuxiang:before { + content: "\e9af"; +} + +.icon-xitonggongju:before { + content: "\e9b1"; +} + +.icon-wendangbangong:before { + content: "\e9b3"; +} + +.icon-zhuomiankongzhi:before { + content: "\e9b4"; +} + +.icon-Npm:before { + content: "\e9ad"; +} + +.icon-Maven:before { + content: "\e9ac"; +} + +.icon-Python:before { + content: "\e9ae"; +} + +.icon-a-xiazai3:before { + content: "\e9ab"; +} + +.icon-xiala4:before { + content: "\e9a9"; +} + .icon-tufaxingzhongdasuanlixuqiuyingjixiangying:before { content: "\e9a0"; } diff --git a/public/css/iconfont.js b/public/css/iconfont.js index e8e3aa48a..317ae31ee 100644 --- a/public/css/iconfont.js +++ b/public/css/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_2340181='',(c=>{var a=(l=(l=document.getElementsByTagName("script"))[l.length-1]).getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var h,i,o,z,t,p=function(a,l){l.parentNode.insertBefore(a,l)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}h=function(){var a,l=document.createElement("div");l.innerHTML=c._iconfont_svg_string_2340181,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?p(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=h,z=c.document,t=!1,m(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,v())})}function v(){t||(t=!0,o())}function m(){try{z.documentElement.doScroll("left")}catch(a){return void setTimeout(m,50)}v()}})(window); \ No newline at end of file +window._iconfont_svg_string_2340181='',(c=>{var a=(l=(l=document.getElementsByTagName("script"))[l.length-1]).getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var h,i,o,z,t,p=function(a,l){l.parentNode.insertBefore(a,l)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}h=function(){var a,l=document.createElement("div");l.innerHTML=c._iconfont_svg_string_2340181,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?p(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=h,z=c.document,t=!1,m(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,v())})}function v(){t||(t=!0,o())}function m(){try{z.documentElement.doScroll("left")}catch(a){return void setTimeout(m,50)}v()}})(window); \ No newline at end of file diff --git a/public/css/iconfont.json b/public/css/iconfont.json index f7322132b..7dcb87101 100644 --- a/public/css/iconfont.json +++ b/public/css/iconfont.json @@ -5,6 +5,209 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "46593376", + "name": "状态", + "font_class": "zhuangtai", + "unicode": "e9c5", + "unicode_decimal": 59845 + }, + { + "icon_id": "46593375", + "name": "复制-删除", + "font_class": "fuzhi-shanchu1", + "unicode": "e9c6", + "unicode_decimal": 59846 + }, + { + "icon_id": "46593374", + "name": "模版管理", + "font_class": "mobanguanli", + "unicode": "e9c7", + "unicode_decimal": 59847 + }, + { + "icon_id": "46370299", + "name": "svg_箭头1", + "font_class": "svg_jiantou1", + "unicode": "e9c3", + "unicode_decimal": 59843 + }, + { + "icon_id": "46370300", + "name": "左箭头", + "font_class": "zuojiantou1", + "unicode": "e9c4", + "unicode_decimal": 59844 + }, + { + "icon_id": "46329189", + "name": "箭头", + "font_class": "jiantou4", + "unicode": "e9c2", + "unicode_decimal": 59842 + }, + { + "icon_id": "46248622", + "name": "合作伙伴", + "font_class": "hezuohuoban", + "unicode": "e9bf", + "unicode_decimal": 59839 + }, + { + "icon_id": "46248621", + "name": "项目贡献", + "font_class": "xiangmugongxian", + "unicode": "e9c1", + "unicode_decimal": 59841 + }, + { + "icon_id": "46245203", + "name": "四角星", + "font_class": "sijiaoxing", + "unicode": "e9c0", + "unicode_decimal": 59840 + }, + { + "icon_id": "46244977", + "name": "组 15512", + "font_class": "a-zu15512", + "unicode": "e9be", + "unicode_decimal": 59838 + }, + { + "icon_id": "46034062", + "name": "文档办公-01", + "font_class": "wendangbangong-01", + "unicode": "e9bd", + "unicode_decimal": 59837 + }, + { + "icon_id": "46033728", + "name": "文档搜索", + "font_class": "wendangsousuo", + "unicode": "e9b7", + "unicode_decimal": 59831 + }, + { + "icon_id": "46033639", + "name": "解压刻录", + "font_class": "jieyakelu", + "unicode": "e9b0", + "unicode_decimal": 59824 + }, + { + "icon_id": "46033573", + "name": "图形图像", + "font_class": "tuxingtuxiang1", + "unicode": "e9b6", + "unicode_decimal": 59830 + }, + { + "icon_id": "46033572", + "name": "下载工具", + "font_class": "xiazaigongju", + "unicode": "e9bc", + "unicode_decimal": 59836 + }, + { + "icon_id": "46033597", + "name": "视频处理", + "font_class": "shipinchuli", + "unicode": "e9b2", + "unicode_decimal": 59826 + }, + { + "icon_id": "46033165", + "name": "浏览器", + "font_class": "liulanqi", + "unicode": "e9b8", + "unicode_decimal": 59832 + }, + { + "icon_id": "46033154", + "name": "社交聊天", + "font_class": "shejiaoliaotian", + "unicode": "e9b9", + "unicode_decimal": 59833 + }, + { + "icon_id": "46033153", + "name": "输入法", + "font_class": "shurufa", + "unicode": "e9ba", + "unicode_decimal": 59834 + }, + { + "icon_id": "46032783", + "name": "全部类别", + "font_class": "quanbuleibie", + "unicode": "e9bb", + "unicode_decimal": 59835 + }, + { + "icon_id": "46032622", + "name": "图形图像", + "font_class": "tuxingtuxiang", + "unicode": "e9af", + "unicode_decimal": 59823 + }, + { + "icon_id": "46032621", + "name": "系统工具", + "font_class": "xitonggongju", + "unicode": "e9b1", + "unicode_decimal": 59825 + }, + { + "icon_id": "46032619", + "name": "文档办公", + "font_class": "wendangbangong", + "unicode": "e9b3", + "unicode_decimal": 59827 + }, + { + "icon_id": "46032616", + "name": "桌面控制", + "font_class": "zhuomiankongzhi", + "unicode": "e9b4", + "unicode_decimal": 59828 + }, + { + "icon_id": "46032217", + "name": "Npm", + "font_class": "Npm", + "unicode": "e9ad", + "unicode_decimal": 59821 + }, + { + "icon_id": "46032121", + "name": "Maven", + "font_class": "Maven", + "unicode": "e9ac", + "unicode_decimal": 59820 + }, + { + "icon_id": "46032118", + "name": "Python", + "font_class": "Python", + "unicode": "e9ae", + "unicode_decimal": 59822 + }, + { + "icon_id": "46031753", + "name": "下载 (3)", + "font_class": "a-xiazai3", + "unicode": "e9ab", + "unicode_decimal": 59819 + }, + { + "icon_id": "46031290", + "name": "下拉", + "font_class": "xiala4", + "unicode": "e9a9", + "unicode_decimal": 59817 + }, { "icon_id": "45509718", "name": "突发性重大算力需求应急响应", diff --git a/public/css/iconfont.ttf b/public/css/iconfont.ttf index bb7ff74ad..5e4a2d46e 100644 Binary files a/public/css/iconfont.ttf and b/public/css/iconfont.ttf differ diff --git a/public/css/iconfont.woff b/public/css/iconfont.woff index 0e4b1416b..6d8d8a286 100644 Binary files a/public/css/iconfont.woff and b/public/css/iconfont.woff differ diff --git a/public/css/iconfont.woff2 b/public/css/iconfont.woff2 index 56a4f7b7c..8c92b7d01 100644 Binary files a/public/css/iconfont.woff2 and b/public/css/iconfont.woff2 differ diff --git a/src/AppConfig.js b/src/AppConfig.js index 185f98cbc..5f8a5d7bb 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -48,9 +48,9 @@ export function initAxiosInterceptors(props) { if (window.location.port === "3007") { config.url = `${proxy}${url}`; if (config.url.indexOf('?') === -1) { - config.url = `${config.url}`; + config.url = `${config.url}?debug=admin`; } else { - config.url = `${config.url}`; + config.url = `${config.url}&debug=admin`; } } else { config.url = url; diff --git a/src/forge/Issues/Component/chooseMenu.jsx b/src/forge/Issues/Component/chooseMenu.jsx index 4da6c5e4d..6ccc75723 100644 --- a/src/forge/Issues/Component/chooseMenu.jsx +++ b/src/forge/Issues/Component/chooseMenu.jsx @@ -3,6 +3,7 @@ import { findDOMNode } from 'react-dom'; import { Dropdown , Menu , Input , Button, Form , Tooltip } from 'antd'; import { getImageUrl } from 'educoder'; import AddTagsBox from './addTagsBox'; +import "../index.scss"; const { Search } = Input; /** @@ -39,9 +40,13 @@ function ChooseMenu({ const [ valuesId , setValuesId ] = useState([]); const [ count , setCount ] = useState(double); const [ content , setContent ] = useState(false); - + const [ filterMenus, setFilterMenus ] = useState([]); const [ saveList , setSaveList ] = useState(undefined); + useEffect(()=>{ + setFilterMenus(menus); + },[menus]) + const refFa = useRef(null); const refBox = useRef(null); @@ -81,7 +86,7 @@ function ChooseMenu({ } if(!visible){ setSearchValue(undefined); - searchFunc(undefined); + // searchFunc && searchFunc(undefined); } },[selectValueList,visible]) @@ -95,7 +100,13 @@ function ChooseMenu({ // 搜索 function changeSearchvalue(e){ setSearchValue(e.target.value); - searchFunc(e.target.value); + // searchFunc(e.target.value); + if(!e.target.value){ + setFilterMenus(menus); + return + } + let filter = menus && menus.length>0 ? menus.filter(i=>i.name.indexOf(e.target.value)>-1):[]; + setFilterMenus(filter); } function renderNames(nameArrs){ return @@ -196,7 +207,7 @@ function ChooseMenu({ onAdd(); } return( -
  • +
  • {placeholder} { @@ -238,10 +249,10 @@ function ChooseMenu({ } { - menus && menus.length >0? + filterMenus && filterMenus.length >0? { - menus.map((i,k)=>{ + filterMenus.map((i,k)=>{ return( chooseMenu(i)}> { diff --git a/src/forge/Issues/Component/comments/list.jsx b/src/forge/Issues/Component/comments/list.jsx index 42f2bd82d..3020a260d 100644 --- a/src/forge/Issues/Component/comments/list.jsx +++ b/src/forge/Issues/Component/comments/list.jsx @@ -124,7 +124,9 @@ function IssueCommentList(props){ {/* 评论/操作日志 展示列表 */}
    - {journals && (journals.length > 0 && journals.map(item=>{return item.is_journal_detail ? (!item.closeAndSpan || item.id === item.start || open === item.start) ?
    + {journals && (journals.length > 0 && + journals.map(item=>{return item.is_journal_detail ? (!item.closeAndSpan || item.id === item.start || open === item.start) ? +
    {/* 操作日志 */}
    diff --git a/src/forge/Issues/Component/date.jsx b/src/forge/Issues/Component/date.jsx index bd4f00a9a..f8e8aa30d 100644 --- a/src/forge/Issues/Component/date.jsx +++ b/src/forge/Issues/Component/date.jsx @@ -136,7 +136,7 @@ function Date({name , today , setDate , editFlag},ref){ visible={visible} trigger={['click']} > -
  • +
  • {name} {!editFlag && setVisible(visible ? false : true)}> } diff --git a/src/forge/Issues/Component/dropMenu.jsx b/src/forge/Issues/Component/dropMenu.jsx index 962243c0a..04d19c336 100644 --- a/src/forge/Issues/Component/dropMenu.jsx +++ b/src/forge/Issues/Component/dropMenu.jsx @@ -40,6 +40,7 @@ function DropMenu({ const refFa = useRef(null); const refBox = useRef(null); + // 根据选中的列表循环出id数组 useEffect(()=>{ if(selectValueList && selectValueList.length > 0 ){ @@ -80,7 +81,7 @@ function DropMenu({ } function chooseMenu(i){ - let list = selectValueList; + let list = selectValueList||[]; let re = []; re = list && list.length > 0 ? list:[]; let filter = []; @@ -153,7 +154,7 @@ function DropMenu({ } return( -
  • +
  • {placeholder} {!editFlag && diff --git a/src/forge/Issues/Component/menus.jsx b/src/forge/Issues/Component/menus.jsx index b5c13120a..885a413b2 100644 --- a/src/forge/Issues/Component/menus.jsx +++ b/src/forge/Issues/Component/menus.jsx @@ -62,7 +62,7 @@ function Menus({className,name, ids , lists , size , imgControl , searchFunc , c function menu(data){ return
    { size !== "small" && -
    searchFunc(e.target.value)}/>
    +
    searchFunc(e.target.value)}/>
    } { data && data.length>0 ? @@ -86,7 +86,7 @@ function Menus({className,name, ids , lists , size , imgControl , searchFunc , c
  • {showValue || (update ? `更换${name}` : name) } - +
  • ) diff --git a/src/forge/Issues/index.scss b/src/forge/Issues/index.scss index a1f4c7b80..ff5770f4b 100644 --- a/src/forge/Issues/index.scss +++ b/src/forge/Issues/index.scss @@ -448,69 +448,69 @@ .shortwidth{ width: 330px; padding-left: 50px; - &>li{ - border-bottom: 1px solid rgba(172, 176, 191, 0.17); - padding-bottom: 8px; - margin-bottom: 22px!important; - &>span{ - font-size: 15px; - position: relative; - color: #40424a; - display: flex; - width: 100%; +} +li.dropliComponent{ + border-bottom: 1px solid rgba(172, 176, 191, 0.17); + padding-bottom: 8px; + margin-bottom: 22px!important; + &>span{ + font-size: 15px; + position: relative; + color: #40424a; + display: flex; + width: 100%; + height: 20px; + line-height: 20px; + font-weight: 600; + a{ + position: absolute; + right: 0px; + } + } + .operatevalue{ + line-height: 30px; + color: #acb0bf; + margin-top: 10px; + display: flex; + flex-wrap: wrap; + .colorsborder{ + padding: 0px 8px; + height: 20px; + line-height: 18px; + border-radius: 4px; + text-align: center; + border:1px solid ; + font-size: 13px; + } + .colorsquare{ + padding: 0px 8px; height: 20px; line-height: 20px; - font-weight: 600; - a{ - position: absolute; - right: 0px; + border-radius: 4px; + text-align: center; + color: #fff; + font-size: 13px; + } + &>p{ + margin-top: 5px!important; + position: relative; + padding-right: 15px; + &.removeFlag>span{ + max-width: 230px; + } + .removeicon{ + display: none; } } - .operatevalue{ - line-height: 30px; - color: #acb0bf; - margin-top: 10px; - display: flex; - flex-wrap: wrap; - .colorsborder{ - padding: 0px 8px; - height: 20px; - line-height: 18px; - border-radius: 4px; - text-align: center; - border:1px solid ; - font-size: 13px; - } - .colorsquare{ - padding: 0px 8px; - height: 20px; - line-height: 20px; - border-radius: 4px; - text-align: center; - color: #fff; - font-size: 13px; - } - &>p{ - margin-top: 5px!important; - position: relative; - padding-right: 15px; - &.removeFlag>span{ - max-width: 230px; - } - .removeicon{ - display: none; - } - } - .removeFlag:hover{ - border-radius:2px; - .removeicon{ - display: block; - } - } - &>p:first-child{ - margin-top: 0px; + .removeFlag:hover{ + border-radius:2px; + .removeicon{ + display: block; } } + &>p:first-child{ + margin-top: 0px; + } } } .addTags_form{ diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 1c29f5842..8d7b5f66c 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -931,6 +931,11 @@ class Detail extends Component { (props) => () } > + () + } + > () diff --git a/src/forge/Merge/MergeLinkFooter.jsx b/src/forge/Merge/MergeLinkFooter.jsx index 8a8271d88..9a3e64903 100644 --- a/src/forge/Merge/MergeLinkFooter.jsx +++ b/src/forge/Merge/MergeLinkFooter.jsx @@ -6,6 +6,7 @@ import axios from 'axios'; import Commits from './Commits'; import Comments from '../comments/comments'; import Files from './Files'; +import OperateDate from './components/operateDate'; import '../Order/order.scss'; import './merge.css'; @@ -72,6 +73,8 @@ class MergeFooter extends Component { } else if (pathname.indexOf('files') > -1) { activeKey = '3'; this.getFile(owner, projectsId, mergeId); + }else if (pathname.indexOf('date') > -1) { + activeKey = '4'; } if (isTabChange && activeKey === '1') { this.refreshComment(); @@ -235,6 +238,15 @@ class MergeFooter extends Component {
    )} + + 操作日志 + + } + key="4"> + +
    diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index a44ea8f76..5488cff2e 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -546,7 +546,6 @@ class MessageCount extends Component { onClick={this.codeReview} > 代码评审 -
    )} {cancelOperate && ( diff --git a/src/forge/Merge/components/operateDate.jsx b/src/forge/Merge/components/operateDate.jsx new file mode 100644 index 000000000..fa7e26253 --- /dev/null +++ b/src/forge/Merge/components/operateDate.jsx @@ -0,0 +1,69 @@ +import React , { useState ,useEffect} from 'react'; +import axios from 'axios'; +import { Link } from 'react-router-dom'; +import { getImageUrl , timeAgo } from 'educoder'; +import "../../Issues/Component/comments/list.scss"; + +function OperateDate(props){ + // 一个合并请求就是一个issue,order_id是pull详情接口中返回的issue的详情 + const { order_id , match } = props; + const { mergeId, owner , projectsId } = match.params; + const [journals , setJournals ] =useState([]) + const journalsIcon ={ + 'issue': 'icon-chuangjianqianbao', + 'branch_name': 'icon-fenzhi3', + 'assigner': 'icon-chengyuan2', + 'status_id': 'icon-xiugaibaobiaomoban', + 'fixed_version_id': 'icon-lichengbeiicon2', + 'due_date': 'icon-riqi', + 'issue_tag': 'icon-biaoji2', + 'description': 'icon-xiugaibaobiaomoban', + 'subject': 'icon-xiugaibaobiaomoban', + 'start_date': 'icon-riqi', + 'priority_id': 'icon-youxian', + 'attachment': 'icon-xiugaibaobiaomoban' + } + + useEffect(()=>{ + if(order_id && mergeId){ + getDate(); + } + },[order_id,mergeId]) + + function getDate(){ + const url = `/v1/${owner}/${projectsId}/issues/${order_id}/journals`; + axios.get(url,{ + params:{ + category:"operate", + page:1, + limit:50 + } + }).then(response=>{ + if(response){ + setJournals(response.data.journals); + } + }).catch(error=>{}) + } + return( +
    + { journals.map(item=>{ + return
    + {/* 操作日志 */} +
    +
    +
    + +
    + + {item.user.name}  + {(item.user.name.length + item.operate_content.length) > 62 ? {item.user.name}
    }> : } +
    + {timeAgo(item.created_at)} +
    +
    +
    } + )} +
    + ) +} +export default OperateDate; \ No newline at end of file diff --git a/src/forge/Merge/merge.js b/src/forge/Merge/merge.js index d8d83e155..f02456d04 100644 --- a/src/forge/Merge/merge.js +++ b/src/forge/Merge/merge.js @@ -1,4 +1,4 @@ -import React, { Component } from "react"; +import React, { useEffect, useState } from "react"; import { Input, Dropdown, Menu, Icon, Pagination, Spin } from "antd"; import "./merge.css"; import "../Order/order.scss"; @@ -7,6 +7,7 @@ import NoneData from "./no_data"; import MergeItem from "./MergeItem"; import './Index.scss'; import { turnbar } from "educoder"; +import Menus from '../Issues/Component/menus'; import axios from "axios"; import CheckProfile from '../Component/ProfileModal/Profile'; @@ -25,99 +26,63 @@ const { Search } = Input; * search_count:列表总条数 * issue_type:搜索条件 */ -class merge extends Component { - constructor(props) { - super(props); - this.state = { - issue_chosen: undefined, - data: undefined, - issues: undefined, - isSpin: false, - search: undefined, - author_id: undefined, - assigned_to_id: undefined, - // limit: 15, - // page: 1, - search_count: undefined, - issue_type: undefined, - status_type: "1", - //设置选择高亮 - openselect: 1, - closeselect: undefined, - issue_tag_ids: "标记", - fixed_version_ids: "里程碑", - assigned_to_ids: "审查人员", - paix: "排序", - priority_ids: "优先级", - has_created_pull_requests:false, - select_params: { - status_type: "1", //开启中和关闭中,默认为开启中的 - assigned_to_id: undefined, // 指派人 - fixed_version_id: undefined, - priority_id: undefined, - order_name: undefined, - order_type: undefined, - search: undefined, - page: 1, - limit: 15, - }, - disable_pr_vew:false //访问pr的权限 - }; - } +function merge(props){ + const [ tag , setTag ] = useState(""); + const [ tagList , setTagList ] = useState([]); + const [ millstoneList , setMillstoneList ] = useState(undefined); + const [ millstone , setMillstone ] = useState(undefined); + const [ prioritiesList , setPrioritiesList ] = useState(undefined); + const [ chargeList , setChargeList ] = useState(undefined); + const [ charge , setCharge ] = useState(undefined); + const [ data , setData ] = useState(undefined) + const [ issues , setIssues ] = useState([]) + const [ isSpin , setIsSpin ] = useState(false) + const [ search , setSearch ] = useState(undefined) + const limit = 15; + const [ page , setPage ] = useState(1) + const [ total , setTotal ] = useState(0) + const [ status_type , setStatus_type ] = useState("1")//1:开启,11:已合并,2:已拒绝 + const [ order , setOrder ] = useState({order_name:undefined,order_type:undefined}) + const [ assigned , setAssigned ] = useState({}) + const [ priority , setPriority ] = useState({}) + const [ fixed_version , setFixedVersion ] = useState({}) + const [ issue_tag , setIssueTag ] = useState({}) - componentDidMount = () => { - this.getSelectList(); - this.getIssueList(); - }; - - componentDidUpdate(){ - this.updateDocumentTitle(); - } + const { projectsId , owner } = props.match.params; + const { project , projectDetail , defaultBranch } = props; + const open_blockchain = project && project.open_blockchain; + useEffect(()=>{ + setPage(1); + getIssueList(search,1); + },[status_type,assigned,priority,fixed_version,issue_tag,order]) + // 更新网页标题 - updateDocumentTitle(){ - const {projectDetail} = this.props; + useEffect(()=>{ if(projectDetail){ const { author, name} = projectDetail; document.title = `合并请求-${author.name}/${name}`; } - } + },[projectDetail]) - getSelectList = () => { - const { projectsId,owner } = this.props.match.params; - - const url = `/${owner}/${projectsId}/issues/index_chosen.json`; - axios - .get(url) - .then((result) => { - if (result) { - this.setState({ - issue_chosen: result.data.issue_chosen, - }); - } - }) - .catch((error) => { - console.log(error); - }); - }; // 获取列表数据 - getIssueList = () => { - const { select_params } = this.state; - const { projectsId , owner } = this.props.match.params; + const getIssueList = (searchvalue,page) => { const url = `/${owner}/${projectsId}/pulls.json`; axios.get(url, { - params: select_params, + params: { + limit, + page, + search:searchvalue,status_type, + order_name:order.order_name,order_type:order.order_type, + priority_id:priority.id,assigned_to_id:assigned.id,fixed_version_id:fixed_version.id,issue_tag_id:issue_tag.id + }, }).then((result) => { if (result) { - this.setState({ - data: result.data, - issues: result.data.issues, - search_count: result.data.search_count, - isSpin: false, - has_created_pull_requests:result.data.has_created_pull_requests, - disable_pr_vew:result.data.disable_pr_vew - }); + setTotal(result.data.search_count); + setData(result.data); + setIssues(result.data.issues) + setIsSpin(false) } }) .catch((error) => { @@ -125,335 +90,404 @@ class merge extends Component { }); }; - getMenu = (e, id, name) => { - this.setState({ - isSpin: true, - }); - let key_name = e.key.split("-"); - if (key_name[0] === "created_on") { - if (e.item.props.value === "desc") { - this.setState({ - paix: "最新创建", - }); - } else { - this.setState({ - paix: "最早创建", - }); - } - this.state.select_params.order_name = e.key; - } else if (key_name[0] === "updated_on") { - if (e.item.props.value === "desc") { - this.setState({ - paix: "最新更新", - }); - } else { - this.setState({ - paix: "最早更新", - }); - } - } - this.state.select_params.order_name = key_name[0]; - this.state.select_params.order_type = e.item.props.value; - this.state.select_params.page = 1; - this.getIssueList(); - }; + // getMenu = (e, id, name) => { + // this.setState({ + // isSpin: true, + // }); + // let key_name = e.key.split("-"); + // if (key_name[0] === "created_on") { + // if (e.item.props.value === "desc") { + // this.setState({ + // paix: "最新创建", + // }); + // } else { + // this.setState({ + // paix: "最早创建", + // }); + // } + // this.state.select_params.order_name = e.key; + // } else if (key_name[0] === "updated_on") { + // if (e.item.props.value === "desc") { + // this.setState({ + // paix: "最新更新", + // }); + // } else { + // this.setState({ + // paix: "最早更新", + // }); + // } + // } + // this.state.select_params.order_name = key_name[0]; + // this.state.select_params.order_type = e.item.props.value; + // this.state.select_params.page = 1; + // this.getIssueList(); + // }; - getOption = (e, id, name) => { - this.setState({ - isSpin: true, - }); - let option_id = e.key === "all" ? undefined : e.key; - this.setState({ - ["${id}s"]: name, - }); - this.state.select_params[`${id}`] = option_id; - this.state.select_params.page = 1; - this.state[`${id}s`] = name; - this.getIssueList(); - }; + // getOption = (e, id, name) => { + // this.setState({ + // isSpin: true, + // }); + // let option_id = e.key === "all" ? undefined : e.key; + // this.setState({ + // ["${id}s"]: name, + // }); + // this.state.select_params[`${id}`] = option_id; + // this.state.select_params.page = 1; + // this.state[`${id}s`] = name; + // this.getIssueList(); + // }; - renderMenu = (array, name, id) => { - return ( - - this.getOption(e, id, name)}> - {name} - - {array && array.length > 0 && array.map((item, key) => { - return ( - ((!item.permission) || (item.permission && item.permission !== "Reporter")) && - this.getOption(e, id, item.name)}> - {item.name} - - ); - })} - - ); - }; + // renderMenu = (array, name, id) => { + // return ( + // + // this.getOption(e, id, name)}> + // {name} + // + // {array && array.length > 0 && array.map((item, key) => { + // return ( + // ((!item.permission) || (item.permission && item.permission !== "Reporter")) && + // this.getOption(e, id, item.name)}> + // {item.name} + // + // ); + // })} + // + // ); + // }; // 翻页 - ChangePage = (page) => { - this.setState({ - isSpin: true, - }); - this.state.select_params.page = page; - this.getIssueList(); + const ChangePage = (page) => { + setIsSpin(true); + setPage(page); + getIssueList(search,1); }; // 搜索 - searchFunc = (value) => { - this.setState({ - search: value, - isSpin: true, - }); - this.state.select_params.search = value; - this.state.select_params.page = 1; - this.getIssueList(); + const searchFunc = (value) => { + setIsSpin(true); + setSearch(value); + setPage(1); + getIssueList(value,1); }; - openorder = (type) => { - this.setState({ - isSpin: true, - }); - this.setState({ - status_type: type, - issue_tag_ids: "标记", - fixed_version_ids: "里程碑", - assigned_to_ids: "审查人员", - paix: "排序", - priority_ids: "优先级", - }); - this.state.select_params.status_type = type; - this.state.select_params.page=1; - this.state.select_params.limit=15; - - this.getIssueList(); + const openorder = (type) => { + setIsSpin(true); + setStatus_type(type); + setPage(1); + clearFunc(); }; - checkOperation() { - const { defaultBranch,projectDetail } = this.props; - const { projectsId,owner } = this.props.match.params; + const clearFunc=()=>{ + setAssigned({}); + setPriority({}); + setFixedVersion({}); + setIssueTag({}); + setOrder({}); + } + function checkOperation() { let branch = turnbar(defaultBranch) || "master"; if (projectDetail && projectDetail.fork_info) { - this.props.history.push(`/${projectDetail.fork_info.fork_project_user_login}/${projectDetail.fork_info.fork_project_identifier}/compare/${branch}...${owner + '/' + projectsId +':' + branch}`) + props.history.push(`/${projectDetail.fork_info.fork_project_user_login}/${projectDetail.fork_info.fork_project_identifier}/compare/${branch}...${owner + '/' + projectsId +':' + branch}`) } else { - this.props.history.push(`/${owner}/${projectsId}/compare/${branch}...${branch}`); + props.history.push(`/${owner}/${projectsId}/compare/${branch}...${branch}`); } } - render() { - const { projectsId , owner } = this.props.match.params; - const { project } = this.props; - const open_blockchain = project && project.open_blockchain; - const { - issue_chosen, - issues, - limit, - page, - search_count, - data, - isSpin, - status_type, - select_params,has_created_pull_requests,disable_pr_vew - } = this.state; - const menu = ( - this.getMenu(e)}> - - 最新创建 - - - 最早创建 - - - 最新更新 - - - 最早更新 - - - ); - return ( -
    -
    - - { - data && data.user_admin_or_developer && - this.checkOperation()}> - + 新建合并请求 - - } -
    -
    -
    -
      -
    • this.openorder(undefined)} - > - - {data && data.search_count} -
    • -
    • this.openorder("1")} - > - - - {data && data.open_count} -
    • -
    • this.openorder("11")} - > - - - {data && data.merged_issues_size} -
    • -
    • this.openorder("2")} - > - - - {data && data.close_count} -
    • -
    -
    -
      - { open_blockchain &&
    • 关联疑修
    • } -
    • - - - {this.state.priority_ids} - - - -
    • -
    • - - - {this.state.issue_tag_ids} - - - -
    • -
    • - - - {this.state.assigned_to_ids} - - - -
    • + + // 获取标记列表 + useEffect(()=>{ + getSign(); + },[tag]) -
    • - - - {this.state.fixed_version_ids} - - - -
    • + function getSign(){ + const url = `/v1/${owner}/${projectsId}/issue_tags`; + axios.get(url,{params:{keyword:tag,only_name:true}}).then(result=>{ + if(result && result.data){ + let list = [{id:-1,name:"无标记"}]; + list = [...list,...result.data.issue_tags]; + setTagList(list); + } + }) + } + // 获取里程碑列表 + useEffect(()=>{ + getMillstone(); + },[millstone]) -
    • - - - {this.state.paix} - - - + function getMillstone(){ + const url = `/v1/${owner}/${projectsId}/milestones`; + axios.get(url,{params:{keyword:millstone,only_name:true}}).then(result=>{ + if(result && result.data){ + let list = [{id:-1,name:"无里程碑"}]; + list = [...list,...result.data.milestones]; + setMillstoneList(list); + } + }) + } + // 获取优先级列表 + useEffect(()=>{ + getPriorities(); + },[]) + + function getPriorities(){ + const url = `/v1/${owner}/${projectsId}/issue_priorities`; + axios.get(url).then(result=>{ + if(result && result.data){ + setPrioritiesList(result.data.priorities); + } + }) + } + // 获取负责人列表 + useEffect(()=>{ + getCharge(); + },[charge]) + + function getCharge(){ + let list = [{id:-1,name:"未指派负责人"}]; + const url = `/v1/${owner}/${projectsId}/collaborators`; + axios.get(url,{params:{keyword:charge,only_name:true}}).then(result=>{ + if(result && result.data){ + list = [...list,...result.data.collaborators]; + setChargeList(list); + } + }) + } + const orderList=[ + {order_name:"created_on",order_type:"desc",name:"最新创建",id:"1"}, + {order_name:"created_on",order_type:"asc",name:"最早创建",id:"2"}, + {order_name:"updated_on",order_type:"desc",name:"最新更新",id:"3"}, + {order_name:"updated_on",order_type:"asc",name:"最早更新",id:"4"} + ] + return ( +
      +
      + {setSearch(e.target.value)}} + placeholder="输入关键字搜索合并请求" + style={{ width: 354 , height : 32 }} + onSearch={searchFunc} + allowClear + /> + { + (search || fixed_version.id || assigned.id || issue_tag.id || priority.id) && + {clearFunc();setSearch(undefined)}} style={{display:"flex",alignItems:"center",marginRight:"auto"}}> + 清除筛选条件 + + } + { + data && data.user_admin_or_developer && + + + 新建合并请求 + + } +
      +
      +
      +
        +
      • openorder(undefined)} + > + + {total} +
      • +
      • openorder("1")} + > + + + {data && data.open_count} +
      • +
      • openorder("11")} + > + + + {data && data.merged_issues_size} +
      • +
      • openorder("2")} + > + + + {data && data.close_count}
      +
      + { open_blockchain &&
    • 关联疑修
    • } + {setPriority({id:id.join(","),name});}} + /> + setTag(value)} + chooseFunc={(id,name)=>{setIssueTag({id:id.join(","),name});}} + /> + setCharge(value)} + chooseFunc={(id,name)=>{setAssigned({id:id.join(","),name});}} + /> + setMillstone(value)} + chooseFunc={(id,name)=>{setFixedVersion({id:id.join(","),name});}} + /> + {let filter=orderList.filter(i=>String(i.id)===id.join(","));setOrder(filter && filter.length>0 ? filter[0]:{});}} + /> + {/*
    • + + + {this.state.priority_ids} + + + +
    • +
    • + + + {this.state.issue_tag_ids} + + + +
    • +
    • + + + {this.state.assigned_to_ids} + + + +
    • + +
    • + + + {this.state.fixed_version_ids} + + + +
    • + +
    • + + + {this.state.paix} + + + +
    • */} +
    +
    + { data &&
    - {data && data.search_count && data.search_count > 0 ? ( + {total > 0 ? (
    ):""} - {search_count > select_params.limit ? ( + {total > limit ? (
    ) : ( "" )} - { data && data.issues && data.issues.length === 0 ? + { issues && issues.length === 0 ?
    + has_created_pull_requests={data.has_created_pull_requests} + projectsId={projectsId} + owner={owner} + defaultBranch={props && turnbar(props.defaultBranch) }/>
    :"" - }
    -
    - ); - } + } + + ); } export default merge; diff --git a/src/forge/Merge/merge_form.js b/src/forge/Merge/merge_form.js index 2525cd5f0..e7ed802fb 100644 --- a/src/forge/Merge/merge_form.js +++ b/src/forge/Merge/merge_form.js @@ -1,59 +1,49 @@ -import React, { Component } from "react"; -import { Button, Form, Menu, Input, Select, Tag, Checkbox, Spin } from "antd"; +import React, { useEffect, useState } from "react"; +import { Button, Form, Menu, Input, Select, Tag, Spin } from "antd"; import axios from "axios"; - +import ChooseMenu from '../Issues/Component/chooseMenu'; +import DropMenu from '../Issues/Component/dropMenu'; import "../Order/order.scss"; import "./merge.css"; import MDEditor from "../../modules/tpm/challengesnew/tpm-md-editor"; const Option = Select.Option; -class MergeForm extends Component { - constructor(props) { - super(props); - this.state = { - desc: undefined, - issue_tag_ids: undefined, - fixed_version_id: undefined, - assigned_to_id: undefined, - titledata: undefined, - isSpin: false, - mergedata: undefined, - priority_id: undefined, - title: undefined, - members: undefined, - issue_tags: undefined, - issue_versions: undefined, - issue_priories: undefined, - atWhoLoginList:undefined, - issue_lists:undefined, - issue_id:undefined, - disable_pr_vew:false//是否有权限访问pr - }; - } +function MergeForm(props){ + const [ desc , setDesc ] = useState(undefined); + const [issue_tag_ids , setIssueTagIds] = useState(undefined); + const [fixed_version_id , setFixedVersionId] = useState(undefined); + const [assigned_to_id , setAssignedToId] = useState(undefined); + const [isSpin , setIsSpin ] = useState(false); + const [priority_id, setPriorityId] = useState(undefined); + const [title,setTitle] = useState(undefined); + const [members,setMembers] = useState(undefined); + const [issue_tags,setIssueTags] = useState(undefined); + const [issue_versions,setIssueVersions] = useState(undefined); + const [issue_priories,setIssuePriories] = useState(undefined); + const [atWhoLoginList,setAtWhoLoginList] = useState(undefined); + const [issue_lists,setIssuelists] = useState(undefined); + const [issue_id,setIssueId] = useState(undefined); + const [disable_pr_vew,setDisableprview] = useState(undefined); + const { projectsId, mergeId ,owner } = props.match.params; + const { checkIfLogin , form , merge_type , project ,data , merge , files_count , commits_count ,pull } = props; + const open_blockchain = project && project.open_blockchain; + const permission = props && props.projectDetail && props.projectDetail.permission; + const { getFieldDecorator } = props.form; - componentDidMount = () => { - // this.check_is_login(); - this.get_default_selects(); - this.set_defatul(); - this.getIssueList(); - }; - componentDidUpdate=(prevPros)=>{ - const { projectsId ,owner } = this.props.match.params; - const pId = prevPros.match.params.projectsId; - const oId = prevPros.match.params.owner; - if(pId !== projectsId || oId !== owner ){ - // console.log("切换了项目分支···········"); - this.get_default_selects(); - } - if(prevPros && this.props && !this.props.checkIfLogin()){ - this.props.history.push("/403") + useEffect(()=>{ + getIssueList(); + },[]) + + useEffect(()=>{ + if(!checkIfLogin()){ + props.history.push("/403"); return } - } + get_default_selects(); + },[projectsId,owner]) - getIssueList=()=>{ - const { projectsId ,owner } = this.props.match.params; + const getIssueList=()=>{ const url = `/v1/${owner}/${projectsId}/issues`; axios.get(url,{ params:{ @@ -61,119 +51,69 @@ class MergeForm extends Component { } }).then(result=>{ if(result && result.data){ - this.setState({ - issue_lists:result.data.issues - }) + setIssuelists(result.data.issues) } }) } - get_default_selects = () => { - const { projectsId ,owner } = this.props.match.params; - this.setState({ isSpin: true }); - axios - .get(`/${owner}/${projectsId}/pulls/create_merge_infos.json`) - .then((result) => { - if (result) { - this.setState({ - members: result.data.members, - issue_tags: result.data.issue_tags, - issue_versions: result.data.issue_versions, - issue_priories: result.data.issue_priories, - disable_pr_vew:result.data.disable_pr_vew - }); + function get_default_selects(){ + setIsSpin(true); + axios.get(`/${owner}/${projectsId}/pulls/create_merge_infos.json`).then((result) => { + if (result && result.data) { + setIssueTags(result.data.issue_tags); + setIssueVersions(result.data.issue_versions); + setDisableprview(result.data.disable_pr_vew); + + let priorities = result.data.issue_priories; + let array =[]; + let colors = ["#1abcb1","#28be6c","#e67e22","#db3d1d"]; + if(priorities && priorities.length>0){ + array = priorities.map((i,k)=>{ + let arr = {...i,color:colors[k]} + return arr; + }) } - this.setState({ isSpin: false }); - }) - .catch((error) => { - this.setState({ isSpin: false }); - console.log(error); - }); - }; - set_defatul = () => { - const { data, merge_type } = this.props; - if (data && merge_type === "edit") { - this.setState({ - desc: data.body, - issue_tag_ids: data.issue_tag_ids ? data.issue_tag_ids[0] : undefined, - fixed_version_id: data.fixed_version_id ? String(data.fixed_version_id) : undefined, - assigned_to_id: data.assigned_to_id ? String(data.assigned_to_id) : undefined, - priority_id: data.priority_id ? String(data.priority_id) :undefined, - issue_id:data.attached_issues && data.attached_issues.length>0 ? String(data.attached_issues[0].id) :undefined, - title: data.title, - },()=>{ - this.InitData(); - }); - } - }; - InitData = () => { - console.log(this.state.issue_id); - this.props.form.setFieldsValue({ - ...this.state, + setIssuePriories(array); + let mem = result.data.members; + mem = mem && mem.length > 0 && mem.map(i=>{return {...i,image_url:i.avatar_url}}); + setMembers(mem); + if (data && merge_type === "edit") { + set_defatul(result.data.issue_tags,mem,array,result.data.issue_versions); + } + } + setIsSpin(false); + }).catch((error) => { + setIsSpin(false) }); }; - - onPanelChange = (time, mode) => { - this.setState({ - value: time, - }); - }; - - onSelect = (time) => { - this.setState({ - value: time, - selectedValue: time, - }); - }; - - renderMenu = (array, id) => { - return ( - - {array && - array.length > 0 && - array.map((item, key) => { - return ( - this.getOption(item, id)}> - {item} - - ); - })} - - ); - }; - - renderSelect = (list) => { - if (list && list.length > 0) { - return list.map((item, key) => { - return ( - - ); - }); - } + function set_defatul(tag,member,priority,version){ + setDesc(data.body); + setIssueTagIds(tag.filter(i=>data.issue_tag_ids.includes(String(i.id)))); + setFixedVersionId(version.filter(i=>String(i.id)===String(data.fixed_version_id))); + setAssignedToId(member.filter(i=>String(i.id)===String(data.assigned_to_id))); + setPriorityId(priority.filter(i=>String(i.id)===String(data.priority_id))); + setIssueId(data.attached_issues); + setTitle(data.title); + form.setFieldsValue({title:data.title}) }; //创建合并请求 - - handleSubmit = () => { - this.setState({ - isSpin: true, - }); - this.props.form.validateFieldsAndScroll((err, values) => { + const handleSubmit = () => { + setIsSpin(true); + form.validateFieldsAndScroll((err, values) => { if (!err) { - const { projectsId, mergeId , owner } = this.props.match.params; - const { merge, pull, merge_type, data , commits_count , files_count } = this.props; - if (values.issue_tag_ids && values.issue_tag_ids.length > 0) { - values.issue_tag_ids = [parseInt(values.issue_tag_ids)]; - } else { - values.issue_tag_ids = []; + let params={ + priority_id:priority_id ? priority_id.map(i=>i.id).join(",") : undefined, + issue_tag_ids:issue_tag_ids ? issue_tag_ids.map(i=>i.id) : undefined, + fixed_version_id:fixed_version_id ? fixed_version_id.map(i=>i.id).join(",") : undefined, + assigned_to_id:assigned_to_id ? assigned_to_id.map(i=>i.id).join(",") : undefined, } - const { desc , atWhoLoginList , disable_pr_vew } = this.state; + console.log(params); if (merge_type === "new") { let url = `/${owner}/${projectsId}/pulls.json`; axios.post(url, { ...values, + ...params, body: desc, head: pull, base: merge, @@ -184,273 +124,174 @@ class MergeForm extends Component { files_count, commits_count, receivers_login:atWhoLoginList, - attached_issue_ids:values.issue_id ? [values.issue_id] :undefined + attached_issue_ids:issue_id && issue_id.length > 0 ? issue_id.map(i=>i.id) :undefined }) .then((result) => { if (result) { - this.setState({ - isSpin: false, - }); + setIsSpin(false); const { pull_request_number } = result.data; - this.props.history.push({pathname: disable_pr_vew ? `/${owner}/${projectsId}/pulls`:`/${owner}/${projectsId}/pulls/${pull_request_number}`, query:{showNps: true}}); - const { getDetail } = this.props; + props.history.push({pathname: disable_pr_vew ? `/${owner}/${projectsId}/pulls`:`/${owner}/${projectsId}/pulls/${pull_request_number}`, query:{showNps: true}}); + const { getDetail } = props; getDetail && getDetail(); } else { - this.setState({ - isSpin: false, - }); + setIsSpin(false); } - }) - .catch((error) => { - this.setState({ - isSpin: false, - }); + }).catch((error) => { + setIsSpin(false); }); } else { let url = `/${owner}/${projectsId}/pulls/${mergeId}.json`; axios .put(url, { ...values, + ...params, body: desc, head: pull, base: merge, receivers_login:atWhoLoginList, - attached_issue_ids:values.issue_id ? [values.issue_id] :undefined + attached_issue_ids:issue_id && issue_id.length > 0 ? issue_id.map(i=>i.id) :undefined }) .then((result) => { if (result) { - this.setState({ - isSpin: false, - }); - // , query:{showNps: true} - this.props.history.push({pathname: `/${owner}/${projectsId}/pulls/${mergeId}`}); + setIsSpin(false); + props.history.push({pathname: `/${owner}/${projectsId}/pulls/${mergeId}`}); } else { - this.setState({ - isSpin: false, - }); + setIsSpin(false) } - }) - .catch((error) => { - this.setState({ - isSpin: false, - }); - console.log(error); + }).catch((error) => { + setIsSpin(false) }); } } else { - this.setState({ - isSpin: false, - }); + setIsSpin(false) } }); }; - onContentChange = (value) => { - this.setState({ - desc: value, - }); + const onContentChange = (value) => { + setDesc(value) }; //合并请求中at谁列表(存储:login) - changeAtWhoLoginList = (loginList) =>{ - this.setState({ - atWhoLoginList:loginList, - }); + const changeAtWhoLoginList = (loginList) =>{ + setAtWhoLoginList(loginList) }; - render() { - const { merge_type , project } = this.props; - const open_blockchain = project && project.open_blockchain; - const { getFieldDecorator } = this.props.form; - const { projectsId, mergeId ,owner } = this.props.match.params; - const { - issue_tag_ids, - fixed_version_id, - assigned_to_id, - priority_id, - desc, - isSpin, - title, - members, - issue_tags, - issue_versions, - issue_priories, - issue_lists, - issue_id - } = this.state; - return ( -
    - -
    - - {merge_type === "new" ? "新建" : "编辑"}合并请求: - - - 可合并的 - -
    -
    -
    -
    - - {getFieldDecorator("title", { - rules: [ - { - required: true, - message: "请填写请求标题", - }, - ], - initialValue: title, - })()} - -
    - -
    -

    - - -

    + return ( +
    + +
    + + {merge_type === "new" ? "新建" : "编辑"}合并请求: + + + 可合并的 + +
    + +
    +
    + + {getFieldDecorator("title", { + rules: [ + { + required: true, + message: "请填写请求标题", + }, + ], + initialValue: title, + })()} + +
    +
    -
    -
    - - {getFieldDecorator("assigned_to_id", { - initialValue: assigned_to_id, - })( - - )} - - - {getFieldDecorator("fixed_version_id", { - initialValue: fixed_version_id, - })( - - )} - - - {getFieldDecorator("issue_tag_ids", { - initialValue: issue_tag_ids, - })( - - )} - - - {getFieldDecorator("priority_id", { - initialValue: priority_id, - })( - - )} - - - {getFieldDecorator("issue_id", { - initialValue: issue_id, - })( - - )} - - {/* - {getFieldDecorator("checkbox-group")( - -
    - 必须审查代码 -
    -
    - 合并后删除提交分支 -
    -
    - 合并后关闭提到的任务 -
    -
    - )} -
    */} +

    + + +

    +
    +
    +
    + {console.log(value)}} + headImg + selectValueList={assigned_to_id} + chooseFunc={(list)=>{setAssignedToId(list);}} + removeFlag + /> + {setFixedVersionId(value)}} + selectValueList={fixed_version_id} + chooseFunc={(list)=>{setFixedVersionId(list);}} + /> + {}} + selectValueList={issue_tag_ids} + chooseFunc={(list)=>{setIssueTagIds(list);}} + colorFlag="2" + removeFlag + double={3} + onAdd={permission && permission !== "Reporter" ? ()=>{getSign();} :false} + owner={owner} + projectsId={projectsId} + /> + {setPriorityId(list);}} + /> +
    + {setIssueId(value)}} + selectValueList={issue_id} + chooseFunc={(list)=>{setIssueId(list);}} + />
    - - -
    - ); - } +
    + + +
    + ); } -const WrappedNewMerge = Form.create({ name: "NewMergeForm" })(MergeForm); -export default WrappedNewMerge; +export default Form.create({ name: "NewMergeForm" })(MergeForm); diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js index c0ff747e4..9fc55de35 100644 --- a/src/forge/New/Index.js +++ b/src/forge/New/Index.js @@ -606,7 +606,7 @@ class Index extends Component { {getFieldDecorator('repository_name', { rules: [{ required: true, message: '请填写项目标识' - }], + },{pattern: /^(?!.*\.git$).*$/, message: `项目标识不能以.git结尾`}], })( )} diff --git a/src/forge/Order/order.scss b/src/forge/Order/order.scss index 912ce6e80..aefa4a333 100644 --- a/src/forge/Order/order.scss +++ b/src/forge/Order/order.scss @@ -172,6 +172,27 @@ display: flex; flex-wrap: wrap; align-items: center; + li{ + min-width: 88px; + display: flex!important; + justify-content: flex-end; + cursor: default; + margin-left: 12px; + color: #898d9d; + &.minwidth { + min-width: 70px; + } + } + .dropspan{ + display: flex; + align-items: center; + cursor: pointer; + } + .dropspan > span { + max-width: 80px; + display: inline-block; + text-align: right; + } } .topWrapper .ant-btn.ant-input-search-button { height: 30px; @@ -187,22 +208,13 @@ .topWrapper_select.wrapperStyle li{ width:90px; } -.topWrapper_select li { - text-align: center; - cursor: pointer; - color: #666; - width: 86px; - text-align: center; - display: inline-block; - overflow: hidden; - white-space: nowrap; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; -} -.topWrapper_select li:active { - background: #f4f4f4; - border-radius: 4px; +.topWrapper_select{ + padding-right: 20px; } +// .topWrapper_select li:active { +// background: #f4f4f4; +// border-radius: 4px; +// } .no-cursor li { cursor: default !important; } diff --git a/src/forge/Settings/Setting.js b/src/forge/Settings/Setting.js index ef3c7c95b..939d7bcb6 100644 --- a/src/forge/Settings/Setting.js +++ b/src/forge/Settings/Setting.js @@ -357,8 +357,9 @@ class Setting extends Component { rules: [ { required: true, - message: "请输入项目标识", + message: "请输入项目标识", }, + {pattern: /^(?!.*\.git$).*$/, message: `项目标识不能以.git结尾`} ], })( diff --git a/src/forge/css/index.scss b/src/forge/css/index.scss index c4d4c07ed..e482af97c 100644 --- a/src/forge/css/index.scss +++ b/src/forge/css/index.scss @@ -406,24 +406,6 @@ button.btngrey{ } } -.newContainer { - .newTab,.newBtn { - position: relative; - } - .newBtnImg { - background-image: url('../Images/newIcon.svg'); - background-size: 100% 100%; - width: 29px; - height: 13px; - position: absolute; - right: -14px; - top: -7px; - } - .newTab .newBtnImg { - right: -19px; - } -} - // 操作按钮-蓝色 .operateButton{