diff --git a/public/css/iconfont.css b/public/css/iconfont.css index a15df586..ef7acc5d 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=1628841816999') format('woff2'), - url('iconfont.woff?t=1628841816999') format('woff'), - url('iconfont.ttf?t=1628841816999') format('truetype'); + src: url('iconfont.woff2?t=1630465334247') format('woff2'), + url('iconfont.woff?t=1630465334247') format('woff'), + url('iconfont.ttf?t=1630465334247') format('truetype'); } .iconfont { @@ -13,6 +13,90 @@ -moz-osx-font-smoothing: grayscale; } +.icon-gerenziliao:before { + content: "\e8c4"; +} + +.icon-xinshouzhiyin:before { + content: "\e8e4"; +} + +.icon-xinjianxiangmu:before { + content: "\e8e6"; +} + +.icon-jiaruketang1:before { + content: "\e8e9"; +} + +.icon-xiangmugonggao:before { + content: "\e8c2"; +} + +.icon-chengguo:before { + content: "\e8c3"; +} + +.icon-chengjiaogonggao:before { + content: "\e8c0"; +} + +.icon-jishuzichan:before { + content: "\e8c1"; +} + +.icon-feibiaogonggao:before { + content: "\e8bc"; +} + +.icon-zhongbiaogonggao:before { + content: "\e8bd"; +} + +.icon-gengzhenggonggao:before { + content: "\e8be"; +} + +.icon-zhaobiaogonggao:before { + content: "\e8bf"; +} + +.icon-wenjian6:before { + content: "\e8ba"; +} + +.icon-wenjianjia4:before { + content: "\e8bb"; +} + +.icon-quxiaoguanzhu:before { + content: "\e89a"; +} + +.icon-dianzan_icon:before { + content: "\e8a2"; +} + +.icon-wenjian5:before { + content: "\e896"; +} + +.icon-wenjianjia3:before { + content: "\e8a9"; +} + +.icon-fuzhiicon:before { + content: "\e886"; +} + +.icon-zhuye-fill:before { + content: "\e876"; +} + +.icon-daimakuicon:before { + content: "\e884"; +} + .icon-xinjian2:before { content: "\e8b0"; } @@ -29,22 +113,6 @@ content: "\e8a6"; } -.icon-dianzan_icon:before { - content: "\e8ba"; -} - -.icon-quxiaoguanzhu:before { - content: "\e8bb"; -} - -.icon-daimakuicon:before { - content: "\e8a9"; -} - -.icon-zhuyeicon:before { - content: "\e884"; -} - .icon-biaoqianicon:before { content: "\e882"; } @@ -57,10 +125,6 @@ content: "\e885"; } -.icon-fuzhiicon:before { - content: "\e886"; -} - .icon-lianjieicon:before { content: "\e887"; } @@ -93,10 +157,6 @@ content: "\e899"; } -.icon-wenjian5:before { - content: "\e89a"; -} - .icon-tijiaoicon:before { content: "\e89e"; } @@ -105,10 +165,6 @@ content: "\e89f"; } -.icon-wenjianjia3:before { - content: "\e8a2"; -} - .icon-xialaanniu1:before { content: "\e8a4"; } @@ -241,10 +297,6 @@ content: "\e875"; } -.icon-fuzhi_icon:before { - content: "\e876"; -} - .icon-shanchuicon:before { content: "\e877"; } diff --git a/public/css/iconfont.js b/public/css/iconfont.js index 94af421b..3ac5acaa 100644 --- a/public/css/iconfont.js +++ b/public/css/iconfont.js @@ -1 +1 @@ -!function(c){var l,a,h,i,o,z='',t=(t=document.getElementsByTagName("script"))[t.length-1].getAttribute("data-injectcss"),p=function(c,l){l.parentNode.insertBefore(c,l)};if(t&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}function v(){o||(o=!0,h())}function m(){try{i.documentElement.doScroll("left")}catch(c){return void setTimeout(m,50)}v()}l=function(){var c,l;(l=document.createElement("div")).innerHTML=z,z=null,(c=l.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",l=c,(c=document.body).firstChild?p(l,c.firstChild):c.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(l,0):(a=function(){document.removeEventListener("DOMContentLoaded",a,!1),l()},document.addEventListener("DOMContentLoaded",a,!1)):document.attachEvent&&(h=l,i=c.document,o=!1,m(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,v())})}(window); +!function(c){var l,a,h,i,o,z='',t=(t=document.getElementsByTagName("script"))[t.length-1].getAttribute("data-injectcss"),p=function(c,l){l.parentNode.insertBefore(c,l)};if(t&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}function v(){o||(o=!0,h())}function m(){try{i.documentElement.doScroll("left")}catch(c){return void setTimeout(m,50)}v()}l=function(){var c,l;(l=document.createElement("div")).innerHTML=z,z=null,(c=l.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",l=c,(c=document.body).firstChild?p(l,c.firstChild):c.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(l,0):(a=function(){document.removeEventListener("DOMContentLoaded",a,!1),l()},document.addEventListener("DOMContentLoaded",a,!1)):document.attachEvent&&(h=l,i=c.document,o=!1,m(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,v())})}(window); \ No newline at end of file diff --git a/public/css/iconfont.json b/public/css/iconfont.json index 7f25b322..5f14bf58 100644 --- a/public/css/iconfont.json +++ b/public/css/iconfont.json @@ -5,6 +5,153 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "24014152", + "name": "个人资料", + "font_class": "gerenziliao", + "unicode": "e8c4", + "unicode_decimal": 59588 + }, + { + "icon_id": "23655968", + "name": "新手指引", + "font_class": "xinshouzhiyin", + "unicode": "e8e4", + "unicode_decimal": 59620 + }, + { + "icon_id": "23655969", + "name": "新建项目", + "font_class": "xinjianxiangmu", + "unicode": "e8e6", + "unicode_decimal": 59622 + }, + { + "icon_id": "23658111", + "name": "加入课堂", + "font_class": "jiaruketang1", + "unicode": "e8e9", + "unicode_decimal": 59625 + }, + { + "icon_id": "23791639", + "name": "项目公告", + "font_class": "xiangmugonggao", + "unicode": "e8c2", + "unicode_decimal": 59586 + }, + { + "icon_id": "23791640", + "name": "成果", + "font_class": "chengguo", + "unicode": "e8c3", + "unicode_decimal": 59587 + }, + { + "icon_id": "23791410", + "name": "成交公告", + "font_class": "chengjiaogonggao", + "unicode": "e8c0", + "unicode_decimal": 59584 + }, + { + "icon_id": "23791411", + "name": "技术资产", + "font_class": "jishuzichan", + "unicode": "e8c1", + "unicode_decimal": 59585 + }, + { + "icon_id": "23790928", + "name": "废标公告", + "font_class": "feibiaogonggao", + "unicode": "e8bc", + "unicode_decimal": 59580 + }, + { + "icon_id": "23790929", + "name": "中标公告", + "font_class": "zhongbiaogonggao", + "unicode": "e8bd", + "unicode_decimal": 59581 + }, + { + "icon_id": "23790930", + "name": "更正公告", + "font_class": "gengzhenggonggao", + "unicode": "e8be", + "unicode_decimal": 59582 + }, + { + "icon_id": "23790931", + "name": "招标公告", + "font_class": "zhaobiaogonggao", + "unicode": "e8bf", + "unicode_decimal": 59583 + }, + { + "icon_id": "23732532", + "name": "文件", + "font_class": "wenjian6", + "unicode": "e8ba", + "unicode_decimal": 59578 + }, + { + "icon_id": "23732533", + "name": "文件夹", + "font_class": "wenjianjia4", + "unicode": "e8bb", + "unicode_decimal": 59579 + }, + { + "icon_id": "23642443", + "name": "取消关注", + "font_class": "quxiaoguanzhu", + "unicode": "e89a", + "unicode_decimal": 59546 + }, + { + "icon_id": "23642444", + "name": "点赞_icon", + "font_class": "dianzan_icon", + "unicode": "e8a2", + "unicode_decimal": 59554 + }, + { + "icon_id": "23639530", + "name": "文件", + "font_class": "wenjian5", + "unicode": "e896", + "unicode_decimal": 59542 + }, + { + "icon_id": "23639533", + "name": "文件夹", + "font_class": "wenjianjia3", + "unicode": "e8a9", + "unicode_decimal": 59561 + }, + { + "icon_id": "23639440", + "name": "复制icon", + "font_class": "fuzhiicon", + "unicode": "e886", + "unicode_decimal": 59526 + }, + { + "icon_id": "23639422", + "name": "主页-fill", + "font_class": "zhuye-fill", + "unicode": "e876", + "unicode_decimal": 59510 + }, + { + "icon_id": "23639423", + "name": "代码库icon", + "font_class": "daimakuicon", + "unicode": "e884", + "unicode_decimal": 59524 + }, { "icon_id": "23572260", "name": "新建", @@ -33,34 +180,6 @@ "unicode": "e8a6", "unicode_decimal": 59558 }, - { - "icon_id": "23492900", - "name": "点赞_icon", - "font_class": "dianzan_icon", - "unicode": "e8ba", - "unicode_decimal": 59578 - }, - { - "icon_id": "23492901", - "name": "取消关注", - "font_class": "quxiaoguanzhu", - "unicode": "e8bb", - "unicode_decimal": 59579 - }, - { - "icon_id": "23473151", - "name": "代码库icon", - "font_class": "daimakuicon", - "unicode": "e8a9", - "unicode_decimal": 59561 - }, - { - "icon_id": "23473104", - "name": "主页icon", - "font_class": "zhuyeicon", - "unicode": "e884", - "unicode_decimal": 59524 - }, { "icon_id": "23472253", "name": "标签icon", @@ -82,13 +201,6 @@ "unicode": "e885", "unicode_decimal": 59525 }, - { - "icon_id": "23472257", - "name": "复制icon", - "font_class": "fuzhiicon", - "unicode": "e886", - "unicode_decimal": 59526 - }, { "icon_id": "23472258", "name": "链接icon", @@ -145,13 +257,6 @@ "unicode": "e899", "unicode_decimal": 59545 }, - { - "icon_id": "23472268", - "name": "文件", - "font_class": "wenjian5", - "unicode": "e89a", - "unicode_decimal": 59546 - }, { "icon_id": "23472269", "name": "提交icon", @@ -166,13 +271,6 @@ "unicode": "e89f", "unicode_decimal": 59551 }, - { - "icon_id": "23472271", - "name": "文件夹", - "font_class": "wenjianjia3", - "unicode": "e8a2", - "unicode_decimal": 59554 - }, { "icon_id": "23472272", "name": "下拉按钮", @@ -404,13 +502,6 @@ "unicode": "e875", "unicode_decimal": 59509 }, - { - "icon_id": "23046262", - "name": "复制_icon", - "font_class": "fuzhi_icon", - "unicode": "e876", - "unicode_decimal": 59510 - }, { "icon_id": "23046268", "name": "删除icon", diff --git a/public/css/iconfont.ttf b/public/css/iconfont.ttf index 484348ba..7a179243 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 bfdd0b9c..d6c8b2fa 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 386dde00..a0420500 100644 Binary files a/public/css/iconfont.woff2 and b/public/css/iconfont.woff2 differ diff --git a/src/forge/Branch/CloneAddress.js b/src/forge/Branch/CloneAddress.js index 38ddf5a0..e936bb70 100644 --- a/src/forge/Branch/CloneAddress.js +++ b/src/forge/Branch/CloneAddress.js @@ -1,16 +1,10 @@ import React, { useState } from 'react'; -import { Dropdown, Menu, Tooltip } from 'antd'; +import { Menu } from 'antd'; import "./branch.scss"; +import CopyTool from '../Component/CopyTool'; function CloneAddress({http_url , ssh_url , zip_url , tar_url}) { const [ key , setKey ] = useState("HTTP"); - // 点击按钮复制功能 - function jsCopy(){ - var e = document.getElementById("copy_rep_content"); - e.select(); - document.execCommand("Copy"); - } - return (
@@ -20,9 +14,7 @@ function CloneAddress({http_url , ssh_url , zip_url , tar_url}) {
- - - +
diff --git a/src/forge/Branch/branch.scss b/src/forge/Branch/branch.scss index bdd4aa39..0c7e136a 100644 --- a/src/forge/Branch/branch.scss +++ b/src/forge/Branch/branch.scss @@ -102,4 +102,7 @@ border-color:transparent ; } } +} +.copytool{ + margin:0px 10px; } \ No newline at end of file diff --git a/src/forge/Component/CopyTool.jsx b/src/forge/Component/CopyTool.jsx index e659c077..df813c0e 100644 --- a/src/forge/Component/CopyTool.jsx +++ b/src/forge/Component/CopyTool.jsx @@ -9,24 +9,32 @@ CopyTool.defaultProps = { }; -function CopyTool({ beforeText, afterText, className,inputId }) { +function CopyTool({ beforeText, afterText, className , inputId , timeOut }) { const [title, setTitle] = useState(() => { return beforeText; }); // 复制链接 const copyUrl = useCallback(() => { - let inputDom = document.getElementById(inputId); - if (!inputDom) { + const copyEle = document.querySelector(`#${inputId}`); // 获取要复制的节点 + if (!copyEle) { console.error("您的CopyTool未设置正确的inputId"); return; } - inputDom.select(); + const range = document.createRange(); // 创造range + window.getSelection().removeAllRanges(); //清除页面中已有的selection + range.selectNode(copyEle); // 选中需要复制的节点 + window.getSelection().addRange(range); // 执行选中元素 + if (document.execCommand('copy')) { document.execCommand('copy'); } setTitle(afterText); - inputDom.blur(); + if(timeOut){ + setTimeout(function(){ + setTitle(beforeText); + },1500) + } }, []); return ( diff --git a/src/forge/Component/DeleteModal/Index.jsx b/src/forge/Component/DeleteModal/Index.jsx index 7e631dac..c3c13689 100644 --- a/src/forge/Component/DeleteModal/Index.jsx +++ b/src/forge/Component/DeleteModal/Index.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { AlignCenter } from '../layout'; -import { Modal , Button } from 'antd'; -import './Index.scss'; +import { Button } from 'antd'; +import Modals from '../PublicModal/Index'; function DeleteBox({ visible , @@ -12,24 +12,22 @@ function DeleteBox({ content }) { return( -
- } + } + onCancel={onCancel} + visible={visible} >
{content} -

{subTitle}

+

{subTitle}

- + ) } export default DeleteBox; \ No newline at end of file diff --git a/src/forge/Component/EAccount.scss b/src/forge/Component/EAccount.scss index d0fd2ef2..6fe44ab3 100644 --- a/src/forge/Component/EAccount.scss +++ b/src/forge/Component/EAccount.scss @@ -1,6 +1,6 @@ .ant-modal-mask{ - z-index: 1001; + z-index: 1031; } .ant-modal-wrap{ - z-index: 1002; + z-index: 1032; } \ No newline at end of file diff --git a/src/forge/Component/ProfileModal/Index.jsx b/src/forge/Component/ProfileModal/Index.jsx new file mode 100644 index 00000000..225b7594 --- /dev/null +++ b/src/forge/Component/ProfileModal/Index.jsx @@ -0,0 +1,68 @@ +import React , { useEffect , useState } from 'react'; +import Modals from '../PublicModal/Index'; +import { Button } from 'antd'; +import axios from 'axios'; + +import './Index.scss'; + +function ProfileModal({visible,onCancel,history}) { + const [ modalVis , setModalVis ] = useState(visible); + const [ addMemberCheck , setAddMemberCheck ] = useState(false); + + useEffect(()=>{ + axios.interceptors.response.use((response) => { + if (response && (response.data.status === 411 || response.data.status === 412)) { + setModalVis(true); + if(response.data.status === 412){ + setAddMemberCheck(true); + } + } + return response; + }, (error) => { + }); + },[]) + + useEffect(()=>{ + setModalVis(visible); + },[visible]) + + function onOk(){ + onCancel(); + setModalVis(false); + setTimeout(function(){ + window.open(`/settings/profile`,"_blank"); + },200) + } + + function onNo() { + onCancel(); + setModalVis(false); + } + + return( + + + + : +
+ + +
+ } + > + { + addMemberCheck ? +

目标用户个人资料不完整,需提醒目标用户补充资料后以进行后续操作

+ : +

您目前的个人资料不完整,需要补充资料以进行后续操作。是否前往补充个人信息?

+ } +
+ ) +} +export default ProfileModal; \ No newline at end of file diff --git a/src/forge/Component/ProfileModal/Index.scss b/src/forge/Component/ProfileModal/Index.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/forge/Component/ProfileModal/Profile.jsx b/src/forge/Component/ProfileModal/Profile.jsx new file mode 100644 index 00000000..e63c1286 --- /dev/null +++ b/src/forge/Component/ProfileModal/Profile.jsx @@ -0,0 +1,17 @@ +import React from 'react'; + +function Profile({children,sureFunc,showCompeleteDialog , completeProfile, className}) { + + function checkProfile() { + if(!completeProfile){ + showCompeleteDialog && showCompeleteDialog(); + }else{ + sureFunc(); + } + } + + return( + {children} + ) +} +export default Profile; \ No newline at end of file diff --git a/src/forge/Component/PublicModal/Index.jsx b/src/forge/Component/PublicModal/Index.jsx new file mode 100644 index 00000000..d0fb8c5e --- /dev/null +++ b/src/forge/Component/PublicModal/Index.jsx @@ -0,0 +1,19 @@ +import React from 'react'; +import { Modal } from 'antd'; +import './Index.scss'; + +function Modals({title,children,btn,onCancel,visible}) { + return( + + {children} + + ) +} +export default Modals; \ No newline at end of file diff --git a/src/forge/Component/DeleteModal/Index.scss b/src/forge/Component/PublicModal/Index.scss similarity index 78% rename from src/forge/Component/DeleteModal/Index.scss rename to src/forge/Component/PublicModal/Index.scss index 7df79ebf..a147125e 100644 --- a/src/forge/Component/DeleteModal/Index.scss +++ b/src/forge/Component/PublicModal/Index.scss @@ -32,14 +32,23 @@ border-top: none; text-align: center; padding-bottom: 40px; - button{ + button,a{ width: 120px; margin:0px 20px; + &.ant-btn{ + border-color: #D0D0D0; + color: #666; + } &.ant-btn-danger{ background-color: #fff; color: #DF0002; border-color: #D0D0D0; } + &.ant-btn.ant-btn-primary{ + background-color: #fff; + color: #466AFF; + border-color: #D0D0D0; + } } } } \ No newline at end of file diff --git a/src/forge/Divert/DivertModal.jsx b/src/forge/Divert/DivertModal.jsx index 40dd6829..acf88117 100644 --- a/src/forge/Divert/DivertModal.jsx +++ b/src/forge/Divert/DivertModal.jsx @@ -41,15 +41,19 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){ // 确认转移 function onOk(){ validateFields((error,values)=>{ - console.log(...values); if(!error){ const url = `/${owner}/${repo}/applied_transfer_projects.json`; Axios.post(url,{ ...values }).then(result=>{ if(result){ - onSuccess(result.data && result.data.owner); + if(result.data.status === 0){ + onSuccess(result.data && result.data.owner); + }else{ + onSuccess(); + } } + }).catch(error=>{}) } }) diff --git a/src/forge/Head/AddProjectModal.jsx b/src/forge/Head/AddProjectModal.jsx index 8e3073e3..81f1d27c 100644 --- a/src/forge/Head/AddProjectModal.jsx +++ b/src/forge/Head/AddProjectModal.jsx @@ -1,6 +1,7 @@ import React, { useState , forwardRef, useEffect } from 'react'; import { Form , Modal , Input , Radio } from 'antd'; import Axios from 'axios'; +import CheckProfile from '../Component/ProfileModal/Profile'; export default Form.create()( forwardRef((props)=>{ @@ -77,7 +78,7 @@ export default Form.create()( - setVisible(true)}>加入项目 + setVisible(true)}>加入项目 ) }) diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js index 628c3f3f..447d17f5 100644 --- a/src/forge/Head/Header.js +++ b/src/forge/Head/Header.js @@ -10,6 +10,7 @@ import HeadSearch from '../Component/HeadSearch'; import AddProjectModal from './AddProjectModal'; import '../../modules/tpm/TPMIndex.css'; +import CheckProfile from '../Component/ProfileModal/Profile'; import './header.scss'; const $ = window.$ @@ -222,6 +223,15 @@ class NewHeader extends Component { } } } + + checkProfile=(url)=>{ + const { showCompeleteDialog , completeProfile } = this.props; + if(!completeProfile){ + showCompeleteDialog && showCompeleteDialog(); + }else{ + window.location.href(url); + } + } addMenu=(list)=>{ return( @@ -231,11 +241,16 @@ class NewHeader extends Component { { list.map((item,key)=>{ return( - (item.name !=="加入课堂" && item.name !=="加入开发项目") && {item.name} + (item.name !=="加入课堂" && item.name !=="加入开发项目") && + + {window.location.href=item.url}}>{item.name} + ) }) } - + + + ) diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index dd6e8c8a..6087317e 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -20,6 +20,7 @@ import DrawerPanel from '../Component/DrawerPanel'; import UpdateDescModal from './sub/UpdateDescModal'; import Nodata from '../Nodata'; import Invite from './sub/Invite'; +import CheckProfile from '../Component/ProfileModal/Profile'; /** * projectDetail.type:0是托管项目,1是镜像项目,2是同步镜像项目(为2时不支持在线创建、在线上传、在线修改、在线删除、创建合并请求等功能) */ @@ -364,11 +365,11 @@ function CoderDepot(props){
{ projectDetail.type !== 2 && pullsFlag && - urlLink(`/${owner}/${projectsId}/pulls/new`)} >+ 合并请求 + urlLink(`/${owner}/${projectsId}/pulls/new`)} >+ 合并请求 } { issuesFlag && - urlLink(`/${owner}/${projectsId}/issues/new`)} >+ 任务 + urlLink(`/${owner}/${projectsId}/issues/new`)} >+ 任务 }
} @@ -454,7 +455,10 @@ function CoderDepot(props){
简介 - {projectDetail.permission && (projectDetail.permission==="Admin" || projectDetail.permission==="Owner") && setOpenModal(true)} className="iconfont icon-anquanshezhi color-grey-9 font-15">} + { + projectDetail.permission && (projectDetail.permission==="Admin" || projectDetail.permission==="Owner" || projectDetail.permission==="Manager") && + setOpenModal(true)} className="iconfont icon-anquanshezhi color-grey-9 font-15"> + } {desc &&

{desc}

} { diff --git a/src/forge/Main/sub/Invite.jsx b/src/forge/Main/sub/Invite.jsx index ad2a00bd..844a4992 100644 --- a/src/forge/Main/sub/Invite.jsx +++ b/src/forge/Main/sub/Invite.jsx @@ -1,26 +1,15 @@ import React from 'react'; -import { Tooltip , message } from 'antd'; import './sub.scss'; +import CopyTool from '../../Component/CopyTool'; function Invite({code,className}) { - function jsCopy(id) { - const copyEle = document.querySelector(id); // 获取要复制的节点 - const range = document.createRange(); // 创造range - window.getSelection().removeAllRanges(); //清除页面中已有的selection - range.selectNode(copyEle); // 选中需要复制的节点 - window.getSelection().addRange(range); // 执行选中元素 - document.execCommand("Copy"); // 执行copy操作 - message.success('复制成功'); - } return(
邀请码
{code} - 可以通过邀请码邀请成员加入项目
点击复制邀请码。

} placement={"bottom"}> - jsCopy("#devitecode")}> -
+ 可以通过邀请码邀请成员加入项目
点击复制邀请码。

} className="ml8 font-16" inputId="devitecode"/>
) diff --git a/src/forge/Merge/merge.js b/src/forge/Merge/merge.js index 03b3b74b..1e1285e4 100644 --- a/src/forge/Merge/merge.js +++ b/src/forge/Merge/merge.js @@ -8,6 +8,7 @@ import MergeItem from "./MergeItem"; import './Index.scss'; import axios from "axios"; +import CheckProfile from '../Component/ProfileModal/Profile'; const Search = Input.Search; /** @@ -256,9 +257,9 @@ class merge extends Component {
{ data && data.user_admin_or_developer && - this.checkOperation()}> + this.checkOperation()}> + 新建合并请求 - + }
diff --git a/src/forge/Order/Milepost.js b/src/forge/Order/Milepost.js index d25657b7..5f6efeeb 100644 --- a/src/forge/Order/Milepost.js +++ b/src/forge/Order/Milepost.js @@ -4,6 +4,7 @@ import { Dropdown, Icon, Menu, Pagination, Typography, Popconfirm, Spin } from ' import NoneData from '../Nodata'; import axios from 'axios'; import './order.css'; +import CheckProfile from '../Component/ProfileModal/Profile'; const { Text } = Typography; @@ -187,7 +188,7 @@ class Milepost extends Component { { data && data.user_admin_or_member ? - 新的里程碑 + {this.props.history.push(`/${owner}/${projectsId}/milestones/new`)}}>新的里程碑 : '' }
diff --git a/src/forge/Order/MilepostDetail.js b/src/forge/Order/MilepostDetail.js index d77675c8..1fcd1b44 100644 --- a/src/forge/Order/MilepostDetail.js +++ b/src/forge/Order/MilepostDetail.js @@ -2,7 +2,8 @@ import React, { Component } from "react"; import { Link } from 'react-router-dom'; import { Dropdown, Menu, Icon, Pagination, Spin } from 'antd'; import './order.css'; -import { FlexAJ } from '../Component/layout' +import { FlexAJ } from '../Component/layout'; +import CheckProfile from '../Component/ProfileModal/Profile'; import NoneData from '../Nodata'; import OrderItem from './OrderItem'; @@ -239,7 +240,7 @@ class MilepostDetail extends Component {
编辑里程碑 - 创建易修 + {this.props.history.push(`/${owner}/${projectsId}/issues/${meilid}/new`)}} className="topWrapper_btn">创建易修
diff --git a/src/forge/Order/OrderItem.js b/src/forge/Order/OrderItem.js index 2f9ac185..30918535 100644 --- a/src/forge/Order/OrderItem.js +++ b/src/forge/Order/OrderItem.js @@ -44,6 +44,7 @@ class OrderItem extends Component { render() { const { item , checkbox , mile , user_admin_or_member } = this.props; const { projectsId , owner } = this.props.match.params; + const { orderid , isdisplay } = this.state; const { current_user } = this.props; return ( item && @@ -91,12 +92,21 @@ class OrderItem extends Component { {item.journals_count} { user_admin_or_member ? -
+
- + + +
- document.getElementById("hoverBox")} title={'您确定要删除当前易修吗?'} okText="是" cancelText="否" onConfirm={() => this.deletedetail(item.id)}> + this.deletedetail(item.id)} + >
diff --git a/src/forge/Order/order.css b/src/forge/Order/order.css index 6a0f029e..0abd116f 100644 --- a/src/forge/Order/order.css +++ b/src/forge/Order/order.css @@ -20,6 +20,9 @@ .overlayBox{ width: 230px; } +.hideOverlay{ + display: none; +} .topmilepost { box-sizing: border-box; display: flex; diff --git a/src/forge/Order/order.js b/src/forge/Order/order.js index 82cc40fe..290bb03e 100644 --- a/src/forge/Order/order.js +++ b/src/forge/Order/order.js @@ -1,12 +1,12 @@ import React, { Component } from "react"; import { Input, Dropdown, Menu, Icon, Pagination, Spin, DatePicker, Checkbox } from "antd"; -import { Link } from 'react-router-dom'; import "./order.css"; import './index.scss'; import moment from 'moment'; import NoneData from "../Nodata"; import OrderItem from "./OrderItem"; +import CheckProfile from '../Component/ProfileModal/Profile'; import axios from "axios"; @@ -351,9 +351,9 @@ class order extends Component { if(data && data.user_admin_or_member){ const { projectsId , owner } = this.props.match.params; return( - + {window.open(`/${owner}/${projectsId}/issues/new`,'_blank')}}> + 创建易修 - + ) } } diff --git a/src/forge/SecuritySetting/Index.jsx b/src/forge/SecuritySetting/Index.jsx index e314c66a..d965be7e 100644 --- a/src/forge/SecuritySetting/Index.jsx +++ b/src/forge/SecuritySetting/Index.jsx @@ -18,6 +18,10 @@ const SSHNew = Loadable({ loader: () => import("./sub/New"), loading: Loading, }); +const Profile = Loadable({ + loader: () => import("../users/Material/Index"), + loading: Loading, +}); const SSHIndex = Loadable({ loader: () => import("./sub/SSH"), loading: Loading, @@ -39,6 +43,10 @@ function Index(props){
  • 安全设置
  • -1 ?"active":""}>SSH密钥
  • +
      +
    • 个人信息
    • +
    • -1 ?"active":""}>基本资料
    • +
    @@ -49,6 +57,12 @@ function Index(props){ )} > + ( + + )} + > ( diff --git a/src/forge/SecuritySetting/Index.scss b/src/forge/SecuritySetting/Index.scss index 664ed7ab..1024ec2a 100644 --- a/src/forge/SecuritySetting/Index.scss +++ b/src/forge/SecuritySetting/Index.scss @@ -36,6 +36,8 @@ .securityUl{ padding:20px 16px; color: #333; + margin-bottom: 0px; + padding-bottom: 0px; li{ margin-bottom: 10px; height: 27px; @@ -124,7 +126,6 @@ } .deleteBox{ .ant-modal-header{ - background-color: rgba(223, 0, 2, 0.06); border-bottom: none; .ant-modal-title{ text-align: left; diff --git a/src/forge/Settings/Setting.js b/src/forge/Settings/Setting.js index 9b2df136..c3150323 100644 --- a/src/forge/Settings/Setting.js +++ b/src/forge/Settings/Setting.js @@ -221,10 +221,14 @@ class Setting extends Component { } // 确定转移仓库 onSuccess=(owner)=>{ + if(owner){ + this.setState({ + is_transfering:true, + transfer:owner + }) + } this.setState({ - is_transfering:true, - divertVisible:false, - transfer:owner + divertVisible:false }) } diff --git a/src/forge/Team/List.jsx b/src/forge/Team/List.jsx index 8cf96587..7e64c5de 100644 --- a/src/forge/Team/List.jsx +++ b/src/forge/Team/List.jsx @@ -6,6 +6,7 @@ import './Index.scss'; import Item from './ListItem'; import Right from './RightBox'; import NoData from '../Nodata'; +import CheckProfile from '../Component/ProfileModal/Profile'; import { Menu , Pagination , Dropdown , Spin } from 'antd'; import axios from 'axios'; @@ -61,8 +62,12 @@ function List(props){ ) const menu_new=( - 新建托管项目 - 新建镜像项目 + + {props.history.push(`/projects/deposit/new/${OIdentifier}`)}}>新建托管项目 + + + {props.history.push(`/projects/mirror/new/${OIdentifier}`)}}>新建镜像项目 + ) @@ -106,7 +111,13 @@ function List(props){
    } - + ) } diff --git a/src/forge/Team/RightBox.jsx b/src/forge/Team/RightBox.jsx index 57239d38..467f45a5 100644 --- a/src/forge/Team/RightBox.jsx +++ b/src/forge/Team/RightBox.jsx @@ -1,5 +1,4 @@ import React , { useEffect , useState } from 'react'; -import { Button } from 'antd'; import styled from 'styled-components'; import Box from './Box'; import axios from 'axios'; @@ -7,6 +6,8 @@ import { getImageUrl } from 'educoder'; import { Link } from 'react-router-dom'; import Nodata from '../Nodata'; +import CheckProfile from '../Component/ProfileModal/Profile'; + const Span = styled.span`{ color:#888; font-size:12px; @@ -36,7 +37,7 @@ const Img = styled.img`{ height:45px; margin-right:12px; }` -function RightBox({ OIdentifier , history , admin }) { +function RightBox({ OIdentifier , history , admin , showCompeleteDialog ,completeProfile }) { const [ memberData, setMemberData ] = useState(undefined); const [ groupData, setGroupData ] = useState(undefined); @@ -87,7 +88,15 @@ function RightBox({ OIdentifier , history , admin }) { history.push(`/${OIdentifier}/group/new`)}>新建团队} + bottom={ + admin && + history.push(`/${OIdentifier}/group/new`)} + className={"ant-btn ant-btn-primary"} + >新建团队 + } url={`/${OIdentifier}/group`} > { diff --git a/src/forge/UsersList/focus_button.js b/src/forge/UsersList/focus_button.js index 0d099fd6..3a04207a 100644 --- a/src/forge/UsersList/focus_button.js +++ b/src/forge/UsersList/focus_button.js @@ -19,7 +19,9 @@ function FocusButton({is_watch , fontClass, starText, is_block , id , successFun }).then((result) => { if (result && result.data.status === 0) { successFunc && successFunc(); - setWatchFlag(!watchFlag); + if(!flag){ + setWatchFlag(!watchFlag); + } } setIsSpin(false); }) diff --git a/src/forge/comments/comments.js b/src/forge/comments/comments.js index a66ea03a..7de4bdbd 100644 --- a/src/forge/comments/comments.js +++ b/src/forge/comments/comments.js @@ -76,6 +76,8 @@ class comments extends Component { content: "", reply_content: undefined, }); + this.state.new_journal_id = result.data.id; + this.getjournalslist(page, limit); this.setState({ showFiles: false, content: "", @@ -86,10 +88,13 @@ class comments extends Component { journal_spin: false, attachment_clean: false, }); - this.state.new_journal_id = result.data.id; - this.getjournalslist(page, limit); } - this.props.showNotification(result.data.message); + this.setState({ + journal_spin: false + }); + if(result && result.data.status !== 411){ + this.props.showNotification(result.data.message); + } }) .catch((error) => { this.setState({ diff --git a/src/forge/users/Index.scss b/src/forge/users/Index.scss index 3595aa84..8139ebae 100644 --- a/src/forge/users/Index.scss +++ b/src/forge/users/Index.scss @@ -218,6 +218,7 @@ ul.ant-menu.menuStyle{ border-bottom: 2px solid transparent!important; position: relative; a{ + font-size: 16px; & >i{ font-size: 15px!important; margin-right: 8px; diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js index bfe0b6b8..44bf2f39 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -221,7 +221,7 @@ class Infos extends Component { {user && user.description}
    - {user && current_user && user.login === current_user.login && ( + {/* {user && current_user && user.login === current_user.login && (
    - )} + )} */} {current_user && user && user.login !== current_user.login && (
    ; }} > - { return ; }} - > - */} + {/* { return ; }} - > + > */} { + this.state.page = 1; this.state.category = cate.target.value; this.get_projects(); }; @@ -115,14 +116,15 @@ class InfosUser extends Component { newItem =()=> ( - 新建镜像项目 + {this.props.history.push('/projects/mirror/new')}}>新建镜像项目 - 新建托管项目 + {this.props.history.push('/projects/deposit/new')}} >新建托管项目 ); + category_button=(category)=>{ const { current_user, user } = this.props; const button_lists = @@ -187,7 +189,7 @@ class InfosUser extends Component { {current_user && user && current_user.login === user.login && ( @@ -235,7 +237,7 @@ class InfosUser extends Component {
    { const { getFieldDecorator, validateFields , setFieldsValue } = props && props.form; - const { username } = props && props.match && props.match.params; - const { user , resetUser , current_user } = props; + // const { username } = props && props.match && props.match.params; + const { resetUserInfo , current_user } = props; + console.log(props); useEffect(()=>{ if(current_user && current_user.login){ @@ -30,10 +31,10 @@ export default Form.create()( } function submitFunc(values) { - const url = `/users/${username}.json`; + const url = `/users/${current_user && current_user.login}.json`; const params={ user: { - nickname: values.real_name, + nickname: values.nickname, user_extension_attributes: { province: values.location && values.location[0], city: values.location && values.location[1], @@ -44,8 +45,7 @@ export default Form.create()( Axios.put(url,params).then(result=>{ if(result && result.data){ props.showNotification("资料修改成功!") - resetUser && resetUser(result.data); - props.history.push(`/${username}`) + resetUserInfo && resetUserInfo(); } }).catch(error=>{}) } @@ -68,7 +68,7 @@ export default Form.create()( )} - {getFieldDecorator("real_name",{ + {getFieldDecorator("nickname",{ rules:[{required:true,message:"请输入姓名"}] })( @@ -126,7 +126,7 @@ export default Form.create()( - + {/* */} ) diff --git a/src/forge/users/Material/Index.jsx b/src/forge/users/Material/Index.jsx index 5c7ed8b8..2ea0ecc1 100644 --- a/src/forge/users/Material/Index.jsx +++ b/src/forge/users/Material/Index.jsx @@ -6,21 +6,16 @@ import Base from './Base'; import Password from './Password'; function Index(props){ - const { username } = props && props.match && props.match.params; + // const { username } = props && props.match && props.match.params; const { pathname } = props && props.location; - const { current_user } = props; + // const { current_user } = props; - useEffect(()=>{ - if((username && current_user && (current_user.login !== username))){ - props.history.push(`/${username}`); - } - },[current_user,username]) const [ key , setKey ] = useState("0"); useEffect(()=>{ if(pathname){ - if(pathname === `/${username}/info`){ + if(pathname === `/settings/profile`){ setKey("0"); }else{ setKey("1"); @@ -32,7 +27,7 @@ function Index(props){ return(
    - 基本资料 + 基本资料 {/* 密码管理 */}
    diff --git a/src/forge/users/Material/Index.scss b/src/forge/users/Material/Index.scss index 07fcc18e..b24d3eb1 100644 --- a/src/forge/users/Material/Index.scss +++ b/src/forge/users/Material/Index.scss @@ -6,9 +6,19 @@ .ant-form-explain{ position: absolute; } + .ant-row.ant-form-item{ + margin-bottom: 12px; + } } .formBase.passMan{ .ant-form-item-label{ width: 92px; } +} +.infosRightMenu{ + .ant-menu-item{ + a{ + font-size: 16px; + } + } } \ No newline at end of file diff --git a/src/forge/users/Team.jsx b/src/forge/users/Team.jsx index bf401d2c..4cebde63 100644 --- a/src/forge/users/Team.jsx +++ b/src/forge/users/Team.jsx @@ -5,7 +5,7 @@ import Search from '../Component/Search'; import Item from './Team-item'; import Nodata from '../Nodata'; import axios from 'axios'; -import { Link } from 'react-router-dom'; +import CheckProfile from '../Component/ProfileModal/Profile'; const limit = 15; function Team(props){ @@ -48,6 +48,7 @@ function Team(props){ ) + return(
    @@ -57,7 +58,7 @@ function Team(props){

    { checkIfLogin() && - 新建组织 + {props.history.push('/organize/new')}}>新建组织 } 排序 diff --git a/src/forge/users/watch_users.js b/src/forge/users/watch_users.js index fe8a7926..76a6e8e6 100644 --- a/src/forge/users/watch_users.js +++ b/src/forge/users/watch_users.js @@ -4,9 +4,13 @@ class WatcherUsers extends Component { render() { const {user, current_user , fetchUser } = this.props; return ( -

    - {user && user.login && } -
    + user && user.login && + ); } } diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index fb49e7be..b9215568 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -6,6 +6,7 @@ import { Spin } from 'antd'; import './TPMIndex.css'; import LoginDialog from '../login/LoginDialog'; import EducoderAccount from '../../forge/Component/EducoderAccount'; +import ProfileModal from '../../forge/Component/ProfileModal/Index'; export function TPMIndexHOC(WrappedComponent) { return class II extends React.Component { @@ -24,7 +25,9 @@ export function TPMIndexHOC(WrappedComponent) { isloginCancel: undefined, mygetHelmetapi: null, giteaVisible:false, - email:undefined + email:undefined, + completeProfile:false, + showCP:false } } @@ -151,7 +154,8 @@ export function TPMIndexHOC(WrappedComponent) { if (response && response.data) { this.initCommonState(response.data) this.setState({ - tpmLoading: false + tpmLoading: false, + completeProfile:response.data.profile_completed }) if (this.props.match.path === "/" && response.data.login) { this.props.history.push(`/${response.data.login}`); @@ -204,23 +208,35 @@ export function TPMIndexHOC(WrappedComponent) { }).catch(error=>{}) } + showCompeleteDialog=()=>{ + this.setState({ + showCP:true + }) + } + render() { - let { isRender , current_user , giteaVisible , email } = this.state; + let { isRender , current_user , giteaVisible , email , completeProfile , showCP } = this.state; const common = { showLoginDialog: this.showLoginDialog, checkIfLogin: this.checkIfLogin, - resetUserInfo:this.fetchUsers + resetUserInfo:this.fetchUsers, + showCompeleteDialog:this.showCompeleteDialog }; return (
    + {this.setState({showCP:false})}} + history={this.props.history} + /> {isRender === true ? this.hideLoginDialog()} {...this.props} {...this.state} /> : ""} -
    +