diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index a7b2c9f4..4a9d9465 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -19,7 +19,8 @@ const getClientEnvironment = require("./env"); let publicPath = "/react/build/"; const publicUrl = publicPath.slice(0, -1); -const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== "false"; +// const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== "false"; +const shouldUseSourceMap = process.env.NODE_ENV !== "production"; const env = getClientEnvironment(publicPath); // This is the production configuration. @@ -54,7 +55,8 @@ module.exports = { }, bail: true, mode: "production", - devtool: false, //测试版 + // devtool: false, //测试版 + devtool: shouldUseSourceMap?'source-map':false, entry: [require.resolve("./polyfills"), paths.appIndexJs], output: { path: paths.appBuild, diff --git a/public/css/iconfont.css b/public/css/iconfont.css index 4867f699..4498c693 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=1628649437297') format('woff2'), - url('iconfont.woff?t=1628649437297') format('woff'), - url('iconfont.ttf?t=1628649437297') format('truetype'); + src: url('iconfont.woff2?t=1630632852475') format('woff2'), + url('iconfont.woff?t=1630632852475') format('woff'), + url('iconfont.ttf?t=1630632852475') format('truetype'); } .iconfont { @@ -13,10 +13,154 @@ -moz-osx-font-smoothing: grayscale; } +.icon-gerenziliao1:before { + content: "\e8c7"; +} + +.icon-lichengbeiicon:before { + content: "\e885"; +} + +.icon-cangkushezhiicon:before { + content: "\e889"; +} + +.icon-dongtaiicon:before { + content: "\e88a"; +} + +.icon-gongzuoliuicon:before { + content: "\e88b"; +} + +.icon-yixiuicon1:before { + content: "\e89b"; +} + +.icon-a-wikiicon1:before { + content: "\e8c6"; +} + +.icon-daimakuicon1:before { + content: "\e8c5"; +} + +.icon-wodetongzhi:before { + content: "\e8c8"; +} + +.icon-tongzhiguanli:before { + content: "\e8c9"; +} + +.icon-xuanzhong3:before { + content: "\e8ca"; +} + +.icon-xitongtongzhiicon:before { + content: "\e8cb"; +} + +.icon-xiaoxi2:before { + content: "\e8cc"; +} + +.icon-sshmiyue:before { + content: "\e8cd"; +} + +.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"; } +.icon-xieyiicon:before { + content: "\e870"; +} + .icon-neicunicon:before { content: "\e891"; } @@ -25,28 +169,6 @@ content: "\e8a6"; } -.icon-dianzan_icon:before { - content: "\e8ba"; -} - -.icon-quxiaoguanzhu:before { - content: "\e8bb"; -} - - -.icon-xieyiicon:before { - content: "\e8a6"; -} - - -.icon-daimakuicon:before { - content: "\e8a9"; -} - -.icon-zhuyeicon:before { - content: "\e884"; -} - .icon-biaoqianicon:before { content: "\e882"; } @@ -55,14 +177,6 @@ content: "\e883"; } -.icon-cangkushezhiicon:before { - content: "\e885"; -} - -.icon-fuzhiicon:before { - content: "\e886"; -} - .icon-lianjieicon:before { content: "\e887"; } @@ -71,25 +185,10 @@ content: "\e888"; } -.icon-lichengbeiicon:before { - content: "\e889"; -} - -.icon-gongzuoliuicon:before { - content: "\e88a"; -} - -.icon-dongtaiicon:before { - content: "\e88b"; -} - .icon-morendianzan_icon:before { content: "\e88e"; } - - - .icon-muluicon:before { content: "\e894"; } @@ -98,10 +197,6 @@ content: "\e899"; } -.icon-wenjian5:before { - content: "\e89a"; -} - .icon-tijiaoicon:before { content: "\e89e"; } @@ -110,19 +205,10 @@ content: "\e89f"; } -.icon-wenjianjia3:before { - content: "\e8a2"; -} - .icon-xialaanniu1:before { content: "\e8a4"; } -.icon-zishuwenjian_icon:before { - content: "\e8b0"; -} - - .icon-zuohuaicon:before { content: "\e8b5"; } @@ -203,10 +289,6 @@ content: "\e898"; } -.icon-weixuanzhongqingqiuicon:before { - content: "\e89b"; -} - .icon-xiezuozheguanliicon:before { content: "\e8a1"; } @@ -251,10 +333,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 489ffc76..2aaace21 100644 --- a/public/css/iconfont.js +++ b/public/css/iconfont.js @@ -1,3 +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); ->>>>>>> d13d94e9... 代码库样式整改 +!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 65a5fd56..e78a264c 100644 --- a/public/css/iconfont.json +++ b/public/css/iconfont.json @@ -5,6 +5,251 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "24059956", + "name": "个人资料", + "font_class": "gerenziliao1", + "unicode": "e8c7", + "unicode_decimal": 59591 + }, + { + "icon_id": "24059409", + "name": "里程碑icon", + "font_class": "lichengbeiicon", + "unicode": "e885", + "unicode_decimal": 59525 + }, + { + "icon_id": "24059410", + "name": "仓库设置icon", + "font_class": "cangkushezhiicon", + "unicode": "e889", + "unicode_decimal": 59529 + }, + { + "icon_id": "24059411", + "name": "动态icon", + "font_class": "dongtaiicon", + "unicode": "e88a", + "unicode_decimal": 59530 + }, + { + "icon_id": "24059412", + "name": "工作流icon", + "font_class": "gongzuoliuicon", + "unicode": "e88b", + "unicode_decimal": 59531 + }, + { + "icon_id": "24059413", + "name": "易修icon", + "font_class": "yixiuicon1", + "unicode": "e89b", + "unicode_decimal": 59547 + }, + { + "icon_id": "24059414", + "name": "wiki icon", + "font_class": "a-wikiicon1", + "unicode": "e8c6", + "unicode_decimal": 59590 + }, + { + "icon_id": "24047186", + "name": "代码库icon", + "font_class": "daimakuicon1", + "unicode": "e8c5", + "unicode_decimal": 59589 + }, + { + "icon_id": "24047189", + "name": "我的通知", + "font_class": "wodetongzhi", + "unicode": "e8c8", + "unicode_decimal": 59592 + }, + { + "icon_id": "24047190", + "name": "通知管理", + "font_class": "tongzhiguanli", + "unicode": "e8c9", + "unicode_decimal": 59593 + }, + { + "icon_id": "24047191", + "name": "选中", + "font_class": "xuanzhong3", + "unicode": "e8ca", + "unicode_decimal": 59594 + }, + { + "icon_id": "24047192", + "name": "系统通知icon", + "font_class": "xitongtongzhiicon", + "unicode": "e8cb", + "unicode_decimal": 59595 + }, + { + "icon_id": "24047193", + "name": "消息", + "font_class": "xiaoxi2", + "unicode": "e8cc", + "unicode_decimal": 59596 + }, + { + "icon_id": "24047194", + "name": "ssh密钥", + "font_class": "sshmiyue", + "unicode": "e8cd", + "unicode_decimal": 59597 + }, + { + "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,42 +278,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": "23473801", - "name": "协议icon", - "font_class": "xieyiicon", - "unicode": "e8a6", - "unicode_decimal": 59558 - }, - { - "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", @@ -83,20 +292,6 @@ "unicode": "e883", "unicode_decimal": 59523 }, - { - "icon_id": "23472256", - "name": "仓库设置icon", - "font_class": "cangkushezhiicon", - "unicode": "e885", - "unicode_decimal": 59525 - }, - { - "icon_id": "23472257", - "name": "复制icon", - "font_class": "fuzhiicon", - "unicode": "e886", - "unicode_decimal": 59526 - }, { "icon_id": "23472258", "name": "链接icon", @@ -111,27 +306,6 @@ "unicode": "e888", "unicode_decimal": 59528 }, - { - "icon_id": "23472260", - "name": "里程碑icon", - "font_class": "lichengbeiicon", - "unicode": "e889", - "unicode_decimal": 59529 - }, - { - "icon_id": "23472261", - "name": "工作流icon", - "font_class": "gongzuoliuicon", - "unicode": "e88a", - "unicode_decimal": 59530 - }, - { - "icon_id": "23472262", - "name": "动态icon", - "font_class": "dongtaiicon", - "unicode": "e88b", - "unicode_decimal": 59531 - }, { "icon_id": "23472263", "name": "默认点赞_icon", @@ -139,14 +313,6 @@ "unicode": "e88e", "unicode_decimal": 59534 }, - { - - "icon_id": "23472264", - "name": "内存icon", - "font_class": "neicunicon", - "unicode": "e891", - "unicode_decimal": 59537 - }, { "icon_id": "23472265", "name": "目录icon", @@ -154,14 +320,6 @@ "unicode": "e894", "unicode_decimal": 59540 }, - { - - "icon_id": "23472266", - "name": "添加", - "font_class": "tianjia1", - "unicode": "e896", - "unicode_decimal": 59542 - }, { "icon_id": "23472267", "name": "设 置", @@ -169,13 +327,6 @@ "unicode": "e899", "unicode_decimal": 59545 }, - { - "icon_id": "23472268", - "name": "文件", - "font_class": "wenjian5", - "unicode": "e89a", - "unicode_decimal": 59546 - }, { "icon_id": "23472269", "name": "提交icon", @@ -190,13 +341,6 @@ "unicode": "e89f", "unicode_decimal": 59551 }, - { - "icon_id": "23472271", - "name": "文件夹", - "font_class": "wenjianjia3", - "unicode": "e8a2", - "unicode_decimal": 59554 - }, { "icon_id": "23472272", "name": "下拉按钮", @@ -204,13 +348,6 @@ "unicode": "e8a4", "unicode_decimal": 59556 }, - { - "icon_id": "23472275", - "name": "自述文件_icon", - "font_class": "zishuwenjian_icon", - "unicode": "e8b0", - "unicode_decimal": 59568 - }, { "icon_id": "23472276", "name": "左滑icon", @@ -351,13 +488,6 @@ "unicode": "e898", "unicode_decimal": 59544 }, - { - "icon_id": "23144155", - "name": "未选中请求icon", - "font_class": "weixuanzhongqingqiuicon", - "unicode": "e89b", - "unicode_decimal": 59547 - }, { "icon_id": "23144158", "name": "协作者管理icon", @@ -435,13 +565,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..a0b8934f 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..98e387c0 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..eb219c96 100644 Binary files a/public/css/iconfont.woff2 and b/public/css/iconfont.woff2 differ diff --git a/src/App.js b/src/App.js index e6f1fc3e..af5532ad 100644 --- a/src/App.js +++ b/src/App.js @@ -3,7 +3,7 @@ import './App.css'; import { ConfigProvider } from 'antd' import zhCN from 'antd/lib/locale-provider/zh_CN'; import { - BrowserRouter as Router, + // BrowserRouter as Router, Route, Switch } from 'react-router-dom'; @@ -91,6 +91,10 @@ const ProjectIndex = Loadable({ loader: () => import("./forge/Index"), loading: Loading, }); + +// 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。 +const keyWord = ["explore", "settings", "setting", "CCF", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search"]; + class App extends Component { constructor(props) { super(props); @@ -100,6 +104,51 @@ class App extends Component { mydisplay: false, occupation: 0, mygetHelmetapi: null, + pathType: null, + pathName: null, + } + } + + UNSAFE_componentWillMount() { + initAxiosInterceptors(this.props); + let pathname = window.location.pathname ? window.location.pathname.split('/')[1] : ''; + pathname && this.getPathnameType(pathname); + + // 添加路由监听,决定组织还是个人 + this.unlisten = this.props.history.listen((location) => { + let newPathname = location.pathname.split('/')[1]; + if (this.state.pathName !== newPathname) { + // this.setState({ pathType: '' }); + newPathname && this.getPathnameType(newPathname); + } + }); + } + + shouldComponentUpdate(nextProps, nextState) { + // (!keyWord.includes(this.props.location.pathname.split('/')[1])) && + if (nextProps.location.pathname.split('/')[1] !== this.props.location.pathname.split('/')[1] && nextState.pathType === this.state.pathType) { + return false; + } else { + return true; + } + } + + getPathnameType = (pathname) => { + if (!keyWord.includes(pathname)) { + let url = `/owners/${pathname}.json`; + axios.get(url).then((response) => { + if (response && response.status === 200) { + this.setState({ + pathType: response.data.type || '404', + pathName: pathname, + }) + } + }); + }else{ + this.setState({ + pathType: pathname, + pathName: pathname, + }); } } @@ -119,13 +168,19 @@ class App extends Component { componentDidMount() { document.title = "loading..."; - initAxiosInterceptors(this.props); + this.getAppdata(); window.addEventListener('error', (event) => { const msg = `${event.type}: ${event.message}`; }); + } + + componentWillUnmount() { + this.unlisten && this.unlisten(); // 执行解绑 + } + //修改登录方法 Modifyloginvalue = () => { this.setState({ @@ -196,7 +251,7 @@ class App extends Component { }; render() { - const { mygetHelmetapi } = this.state; + const { mygetHelmetapi, pathType} = this.state; let personal = mygetHelmetapi && mygetHelmetapi.personal; return ( @@ -204,87 +259,123 @@ class App extends Component { this.Modifyloginvalue()}> - - - {/* wiki预览 */} - */} + + {/* wiki预览 */} + { + return () + } + } /> + + {/*项目*/} + { - return () + return () } - } /> - - {/*项目*/} - { - return () - } - }> - - { - return () - } - }> - - {/*项目*/} - { - return () - } - }> - - { - return () - } + }> + + { + return () } - /> - {/*403*/} - + }> + - - { - return () - } - }> - - {/*404*/} - - - {/* 查询 */} - - - - {/* 个人主页 */} - { - return () - } - }> - ( - personal && personal.length > 0 ? - - : - - ) + { + return () } - /> - - - + } + /> + {/*403*/} + + + + + {/*404*/} + + + {/* 查询 */} + + + ( + + ) + } + /> + + + {/* 组织 */} + { + return () + } + }> + + + {/*新建项目等*/} + { + return () + } + }> + + + {/* 判断为用户/组织,并进入对应页面 */} + { + pathType === 'User' ? + { + return () + } + } + /> : pathType === 'Organization' ? { + return () + } + }> + : pathType === '404' ? : + ( + personal && personal.length > 0 ? + + : + + ) + } + /> + // + } + + + + {/* 个人主页 */} + { + return () + } + }> + + + + + {/* */} diff --git a/src/AppConfig.js b/src/AppConfig.js index 034612ec..825a2a3b 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -11,9 +11,9 @@ broadcastChannelOnmessage('refreshPage', () => { }) function locationurl(list) { - if (window.location.port !== "3007") { + // if (window.location.port !== "3007") { window.location.href = list - } + // } } // TODO 开发期多个身份切换 let debugType = "" @@ -85,7 +85,10 @@ export function initAxiosInterceptors(props) { } if (response.data.status === 404) { - locationurl('/nopage'); + let responseURL = response.request ? response.request.responseURL:''; + if (responseURL.indexOf('/api/users/') === -1 && responseURL.indexOf('/api/organizations/') === -1 && responseURL.indexOf('/api/owners/') === -1) { + locationurl('/nopage'); + } } if (response.data.status === 500) { diff --git a/src/college/College.js b/src/college/College.js index 85d43fb7..f7a3ab6c 100644 --- a/src/college/College.js +++ b/src/college/College.js @@ -195,7 +195,7 @@ class College extends Component { align: 'center', className: "edu-txt-center font-14 maxnamewidth105", render: (text, record) => ( - { diff --git a/src/context/TPIContextProvider.js b/src/context/TPIContextProvider.js index 22b24727..f3ea3e0f 100644 --- a/src/context/TPIContextProvider.js +++ b/src/context/TPIContextProvider.js @@ -435,11 +435,11 @@ class TPIContextProvider extends Component { image_url: "avatars/User/1" login: "innov" name: "Coder" - user_url: "/users/innov" + user_url: "/innov" */ let user = resData.user; user.username = resData.user.name; - user.user_url = `/users/${resData.user.login}`; + user.user_url = `/${resData.user.login}`; // user.image_url = resData.image_url; user.is_teacher = resData.is_teacher; resData.user = user; diff --git a/src/forge/Activity/ActivityItem.js b/src/forge/Activity/ActivityItem.js index b726a4af..2b1ad3c8 100644 --- a/src/forge/Activity/ActivityItem.js +++ b/src/forge/Activity/ActivityItem.js @@ -14,25 +14,25 @@ class ActivityItem extends Component { {/* 如果是版本发布 */} {item.trend_type === "VersionRelease" ?

- {item.name} + {item.name} {item.trend_type}

: // 如果是任务 item.trend_type === "Issue" ?

- {item.name} + {item.name} {item.trend_type}

: // 如果是合并请求

- {item.name} + {item.name} {item.trend_type}

}

- + {item.user_name} 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.css b/src/forge/Branch/branch.css index 34843512..3d6c0d0f 100644 --- a/src/forge/Branch/branch.css +++ b/src/forge/Branch/branch.css @@ -128,4 +128,8 @@ border-color: transparent; } +.copytool { + margin: 0px 10px; +} + /*# sourceMappingURL=branch.css.map */ diff --git a/src/forge/Branch/branch.css.map b/src/forge/Branch/branch.css.map index 271dc35a..2e130e98 100644 --- a/src/forge/Branch/branch.css.map +++ b/src/forge/Branch/branch.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["branch.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACG;;;AAEH;EACE;;;AAEF;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;;AACA;EACE;;AAEF;EACE;;AAEF;EACE;EACA;EACA;;AAEF;EACE;;;AAGJ;EACE;;AACA;EACE;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;;;AAIN;EACE;EACA;;;AAGF;EACE;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;;AACA;EACE;;AAEF;EACE;;AAEF;EACE","file":"branch.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["branch.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACG;;;AAEH;EACE;;;AAEF;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;;AACA;EACE;;AAEF;EACE;;AAEF;EACE;EACA;EACA;;AAEF;EACE;;;AAGJ;EACE;;AACA;EACE;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;;;AAIN;EACE;EACA;;;AAGF;EACE;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;;AACA;EACE;;AAEF;EACE;;AAEF;EACE;;;AAIN;EACE","file":"branch.css"} \ No newline at end of file diff --git a/src/forge/Branch/branch.scss b/src/forge/Branch/branch.scss index 04c77666..dd9c7b14 100644 --- a/src/forge/Branch/branch.scss +++ b/src/forge/Branch/branch.scss @@ -114,4 +114,7 @@ border-color:transparent ; } } +} +.copytool{ + margin:0px 10px; } \ No newline at end of file diff --git a/src/forge/Component/Contributors.jsx b/src/forge/Component/Contributors.jsx index 20276ef6..2f67b3ab 100644 --- a/src/forge/Component/Contributors.jsx +++ b/src/forge/Component/Contributors.jsx @@ -52,8 +52,8 @@ function Contributors({contributors,owner,projectsId}){ - - {data.name} + + {data.name} { data.is_watch ? FocusFunc(false,data.login)}>取消关注:FocusFunc(true,data.login)}>关注 @@ -136,10 +136,8 @@ function Contributors({contributors,owner,projectsId}){ return(
- - 贡献者 - { contributors && contributors.total_count > 0 && {contributors.total_count}} - + 贡献者{ contributors && contributors.total_count > 0 && {contributors.total_count}} + 全部
setVisibleFunc(false)}> { @@ -147,7 +145,7 @@ function Contributors({contributors,owner,projectsId}){ list.map((item,key)=>{ return( - + setVisibleFunc(true,item.login,key)}/> diff --git a/src/forge/Component/CopyTool.jsx b/src/forge/Component/CopyTool.jsx index e659c077..86fb32da 100644 --- a/src/forge/Component/CopyTool.jsx +++ b/src/forge/Component/CopyTool.jsx @@ -6,27 +6,33 @@ CopyTool.defaultProps = { afterText: '复制成功', //点击后显示的文字 className: '', //传给svg的class inputId: 'copyText', //要复制的文本的ID + timeOut:true, //复制后将浮动的文字改为beforeText }; -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(); + copyEle.select(); // 执行选中元素 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/DeleteModal/Index.scss b/src/forge/Component/DeleteModal/Index.scss deleted file mode 100644 index 7df79ebf..00000000 --- a/src/forge/Component/DeleteModal/Index.scss +++ /dev/null @@ -1,45 +0,0 @@ -.deleteBox{ - .ant-modal-header{ - background-color: #f8f8f8; - border-bottom: none; - .ant-modal-title{ - text-align: left; - font-size: 20px; - } - } - .ant-modal-body{ - padding:30px 50px; - p{ - font-size: 16px; - line-height: 26px; - color:#666; - word-break: break-all; - } - .desc{ - .descMain{ - align-items: center; - justify-content: center; - font-size: 20px; - margin-bottom: 10px; - i{ - font-size: 38px!important; - color:#DF0002 - } - } - } - } - .ant-modal-footer{ - border-top: none; - text-align: center; - padding-bottom: 40px; - button{ - width: 120px; - margin:0px 20px; - &.ant-btn-danger{ - background-color: #fff; - color: #DF0002; - border-color: #D0D0D0; - } - } - } -} \ No newline at end of file diff --git a/src/forge/Component/DrawerPanel.jsx b/src/forge/Component/DrawerPanel.jsx index 0e604d59..fa99e6c6 100644 --- a/src/forge/Component/DrawerPanel.jsx +++ b/src/forge/Component/DrawerPanel.jsx @@ -78,7 +78,7 @@ function DrawerPanel({visible,onClose,branch,owner,projectsId,history, name , li if(dataref.type==="file"){ onClose(); let value = turnbar(branch); - history.push(`/projects/${owner}/${projectsId}/tree/${value}/${dataref.path}`); + history.push(`/${owner}/${projectsId}/tree/${value}/${dataref.path}`); } } diff --git a/src/forge/Component/EAccount.css b/src/forge/Component/EAccount.css new file mode 100644 index 00000000..39269943 --- /dev/null +++ b/src/forge/Component/EAccount.css @@ -0,0 +1,9 @@ +.ant-modal-mask { + z-index: 1031; +} + +.ant-modal-wrap { + z-index: 1032; +} + +/*# sourceMappingURL=EAccount.css.map */ diff --git a/src/forge/Component/EAccount.css.map b/src/forge/Component/EAccount.css.map new file mode 100644 index 00000000..7260caa4 --- /dev/null +++ b/src/forge/Component/EAccount.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["EAccount.scss"],"names":[],"mappings":"AAAA;EACE;;;AAEF;EACE","file":"EAccount.css"} \ 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/MemberCards.jsx b/src/forge/Component/MemberCards.jsx index 393ddbb1..48d90e13 100644 --- a/src/forge/Component/MemberCards.jsx +++ b/src/forge/Component/MemberCards.jsx @@ -45,15 +45,15 @@ const Div = styled.div`{ export default (({ user , img, name, time, focusStatus, is_current_user, login , successFunc }) => { return (
- +
- {name} + {name} { is_current_user ? : - + }
diff --git a/src/forge/Component/ProfileModal/Index.css b/src/forge/Component/ProfileModal/Index.css new file mode 100644 index 00000000..521f0d89 --- /dev/null +++ b/src/forge/Component/ProfileModal/Index.css @@ -0,0 +1,21 @@ +.contents { + display: flex; + align-items: center; + justify-content: center; + margin: 10px auto 0px; +} +.contents img { + margin-right: 13px; + width: 44px; +} +.contents p { + line-height: 29px; + max-width: 327px; + font-size: 16px !important; +} + +.font-44 { + font-size: 44px !important; +} + +/*# sourceMappingURL=Index.css.map */ diff --git a/src/forge/Component/ProfileModal/Index.css.map b/src/forge/Component/ProfileModal/Index.css.map new file mode 100644 index 00000000..d379d7a8 --- /dev/null +++ b/src/forge/Component/ProfileModal/Index.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["Index.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;;AAEF;EACE;EACA;EACA;;;AAGJ;EACE","file":"Index.css"} \ 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..7cead761 --- /dev/null +++ b/src/forge/Component/ProfileModal/Index.jsx @@ -0,0 +1,72 @@ +import React , { useEffect , useState } from 'react'; +import Modals from '../PublicModal/Index'; +import { Button } from 'antd'; +import axios from 'axios'; + +import ProfileImg from './images/profile.png'; +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..cf13121e --- /dev/null +++ b/src/forge/Component/ProfileModal/Index.scss @@ -0,0 +1,18 @@ +.contents{ + display: flex; + align-items: center; + justify-content: center; + margin:10px auto 0px; + img{ + margin-right: 13px; + width: 44px; + } + p{ + line-height: 29px; + max-width: 327px; + font-size: 16px!important; + } +} +.font-44{ + font-size: 44px!important; +} \ No newline at end of file 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/ProfileModal/images/profile.png b/src/forge/Component/ProfileModal/images/profile.png new file mode 100644 index 00000000..6dbed21f Binary files /dev/null and b/src/forge/Component/ProfileModal/images/profile.png differ diff --git a/src/forge/Component/PublicModal/Index.css b/src/forge/Component/PublicModal/Index.css new file mode 100644 index 00000000..fb4784bc --- /dev/null +++ b/src/forge/Component/PublicModal/Index.css @@ -0,0 +1,75 @@ +.deleteBox { + z-index: 1033; +} +.deleteBox .ant-modal-close-x { + font-size: 17px !important; +} +.deleteBox .ant-modal-header { + background-color: #f8f8f8; + padding: 10px 30px; +} +.deleteBox .ant-modal-header .ant-modal-title { + text-align: left; + font-size: 16px; + font-weight: bold; +} +.deleteBox .ant-modal-close { + top: 0px !important; + font-size: 24px !important; +} +.deleteBox .ant-modal-body { + padding: 30px 50px; +} +.deleteBox .ant-modal-body p { + font-size: 14px; + line-height: 26px; + color: #666; + word-break: break-all; +} +.deleteBox .ant-modal-body .desc .descMain { + align-items: center; + justify-content: center; + font-size: 20px; + margin-bottom: 10px; +} +.deleteBox .ant-modal-body .desc .descMain i.red { + color: #DF0002; +} +.deleteBox .ant-modal-footer { + border-top: none; + text-align: center; + padding-bottom: 40px; +} +.deleteBox .ant-modal-footer button, .deleteBox .ant-modal-footer a { + width: 96px; + height: 32px; + margin: 0px 20px; + font-weight: 400; + font-size: 14px; +} +.deleteBox .ant-modal-footer button.ant-btn, .deleteBox .ant-modal-footer a.ant-btn { + border-color: #D0D0D0; + color: #666; +} +.deleteBox .ant-modal-footer button.ant-btn:hover, .deleteBox .ant-modal-footer button.ant-btn:active, .deleteBox .ant-modal-footer button.ant-btn:focus, .deleteBox .ant-modal-footer a.ant-btn:hover, .deleteBox .ant-modal-footer a.ant-btn:active, .deleteBox .ant-modal-footer a.ant-btn:focus { + background: #f3f4f6; +} +.deleteBox .ant-modal-footer button.ant-btn-danger, .deleteBox .ant-modal-footer a.ant-btn-danger { + background-color: #fff; + color: #DF0002; + border-color: #D0D0D0; +} +.deleteBox .ant-modal-footer button.ant-btn-danger:hover, .deleteBox .ant-modal-footer button.ant-btn-danger:active, .deleteBox .ant-modal-footer button.ant-btn-danger:focus, .deleteBox .ant-modal-footer a.ant-btn-danger:hover, .deleteBox .ant-modal-footer a.ant-btn-danger:active, .deleteBox .ant-modal-footer a.ant-btn-danger:focus { + border-color: #DF0002; + background-color: #fff; +} +.deleteBox .ant-modal-footer button.ant-btn.ant-btn-primary, .deleteBox .ant-modal-footer a.ant-btn.ant-btn-primary { + background-color: #466AFF; + color: #fff; + border-color: #466AFF; +} +.deleteBox .ant-modal-footer button.ant-btn.ant-btn-primary:hover, .deleteBox .ant-modal-footer button.ant-btn.ant-btn-primary:focus, .deleteBox .ant-modal-footer button.ant-btn.ant-btn-primary:active, .deleteBox .ant-modal-footer a.ant-btn.ant-btn-primary:hover, .deleteBox .ant-modal-footer a.ant-btn.ant-btn-primary:focus, .deleteBox .ant-modal-footer a.ant-btn.ant-btn-primary:active { + background-color: rgba(70, 106, 255, 0.85); +} + +/*# sourceMappingURL=Index.css.map */ diff --git a/src/forge/Component/PublicModal/Index.css.map b/src/forge/Component/PublicModal/Index.css.map new file mode 100644 index 00000000..24166958 --- /dev/null +++ b/src/forge/Component/PublicModal/Index.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["Index.scss"],"names":[],"mappings":"AAAA;EACE;;AACA;EACE;;AAEF;EACE;EACA;;AACA;EACE;EACA;EACA;;AAGJ;EACE;EACA;;AAEF;EACE;;AACA;EACE;EACA;EACA;EACA;;AAGA;EACE;EACA;EACA;EACA;;AACA;EACE;;AAKR;EACE;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;;AACA;EACE;;AAGJ;EACE;EACA;EACA;;AACA;EACE;EACA;;AAGJ;EACE;EACA;EACA;;AACA;EACE","file":"Index.css"} \ 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..c12e12b1 --- /dev/null +++ b/src/forge/Component/PublicModal/Index.jsx @@ -0,0 +1,20 @@ +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/PublicModal/Index.scss b/src/forge/Component/PublicModal/Index.scss new file mode 100644 index 00000000..1a0fbf31 --- /dev/null +++ b/src/forge/Component/PublicModal/Index.scss @@ -0,0 +1,75 @@ +.deleteBox{ + z-index: 1033; + .ant-modal-close-x{ + font-size: 17px!important; + } + .ant-modal-header{ + background-color: #f8f8f8; + padding:10px 30px; + .ant-modal-title{ + text-align: left; + font-size: 16px; + font-weight: bold; + } + } + .ant-modal-close{ + top:0px !important; + font-size: 24px !important; + } + .ant-modal-body{ + padding:30px 50px; + p{ + font-size: 14px; + line-height: 26px; + color:#666; + word-break: break-all; + } + .desc{ + .descMain{ + align-items: center; + justify-content: center; + font-size: 20px; + margin-bottom: 10px; + i.red{ + color:#DF0002; + } + } + } + } + .ant-modal-footer{ + border-top: none; + text-align: center; + padding-bottom: 40px; + button,a{ + width: 96px; + height: 32px; + margin:0px 20px; + font-weight: 400; + font-size: 14px; + &.ant-btn{ + border-color: #D0D0D0; + color: #666; + &:hover,&:active,&:focus{ + background: #f3f4f6; + } + } + &.ant-btn-danger{ + background-color: #fff; + color: #DF0002; + border-color: #D0D0D0; + &:hover,&:active,&:focus{ + border-color: #DF0002; + background-color: #fff; + } + } + &.ant-btn.ant-btn-primary{ + background-color: #466AFF; + color: #fff; + border-color: #466AFF; + &:hover,&:focus,&:active{ + background-color: rgba(70,106,255,0.85); + } + } + } + } +} \ No newline at end of file diff --git a/src/forge/Component/Releases.jsx b/src/forge/Component/Releases.jsx index c7ff4ea1..bf8caebd 100644 --- a/src/forge/Component/Releases.jsx +++ b/src/forge/Component/Releases.jsx @@ -7,12 +7,14 @@ function Releases({owner,projectsId,releaseVersions , baseOperate , projectType} return(
- 发行版 + 发行版 { releaseVersions && releaseVersions.total_count > 0 && {releaseVersions.total_count}} - {/* { - baseOperate && projectType !==2 && 新建 - } */} + { (releaseVersions && releaseVersions.total_count > 0) || projectType ===2 ? + 全部 + : + baseOperate && 新建 + } { releaseVersions && releaseVersions.total_count>0 ? @@ -22,7 +24,7 @@ function Releases({owner,projectsId,releaseVersions , baseOperate , projectType}

- {item.name} + {item.name} 最新

{item.created_at}

@@ -30,10 +32,7 @@ function Releases({owner,projectsId,releaseVersions , baseOperate , projectType} ) }) - : -
- 您暂未发布任何版本{baseOperate && projectType !==2 && 创建新版本} -
+ :"" }
diff --git a/src/forge/Component/User.jsx b/src/forge/Component/User.jsx index 4d22c77b..bc652dcf 100644 --- a/src/forge/Component/User.jsx +++ b/src/forge/Component/User.jsx @@ -20,7 +20,7 @@ export default ({ url , name , column , id , login })=>{ `; return( id? - + { url && } {name} diff --git a/src/forge/DevOps/About.jsx b/src/forge/DevOps/About.jsx index b9524d54..31ced220 100644 --- a/src/forge/DevOps/About.jsx +++ b/src/forge/DevOps/About.jsx @@ -149,7 +149,7 @@ function About(props, ref) { axios.post(url).then(result=>{ setIsSpining(false); if(result && result.data.status === 0){ - props.history.push(`/projects/${owner}/${projectsId}/devops/dispose`); + props.history.push(`/${owner}/${projectsId}/devops`); // 需要将顶部的open_devops修改 let { changeOpenDevops } = props; changeOpenDevops && changeOpenDevops(true); diff --git a/src/forge/DevOps/Dispose.jsx b/src/forge/DevOps/Dispose.jsx index 2211dbb5..1e08cdab 100644 --- a/src/forge/DevOps/Dispose.jsx +++ b/src/forge/DevOps/Dispose.jsx @@ -96,7 +96,7 @@ function Dispose(props){ setVisible(false); if(result && result.data){ props.showNotification("流水线新增成功,请进行工作流配置!"); - props.history.push(`/projects/${owner}/${projectsId}/devops/dispose/${result.data.id}`); + props.history.push(`/${owner}/${projectsId}/devops/${result.data.id}`); }else{ props.showNotification("流水线新增失败,请稍后再试!"); } @@ -134,12 +134,12 @@ function Dispose(props){ // 模板管理 function toModalManage(){ - props.history.push(`/projects/${owner}/${projectsId}/devops/mould`); + props.history.push(`/${owner}/${projectsId}/devops/mould`); } // 参数管理 function toparameter(){ - props.history.push(`/projects/${owner}/${projectsId}/devops/params`); + props.history.push(`/${owner}/${projectsId}/devops/params`); } const operate = current_user && (permission && permission !== "Reporter"); diff --git a/src/forge/DevOps/Dispose/List.jsx b/src/forge/DevOps/Dispose/List.jsx index 4c077452..297c5556 100644 --- a/src/forge/DevOps/Dispose/List.jsx +++ b/src/forge/DevOps/Dispose/List.jsx @@ -73,7 +73,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){ render:(value,item)=>{ let v = turnbar(item.branch); return( - {value} + {value} ) } }, @@ -117,7 +117,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){ return( { operate ? - + 编辑 :"" } { operate ? @@ -125,7 +125,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){ 删除 :"" } - 查看运行记录 + 查看运行记录 ) } diff --git a/src/forge/DevOps/Index.jsx b/src/forge/DevOps/Index.jsx index c3a29a3e..3302f603 100644 --- a/src/forge/DevOps/Index.jsx +++ b/src/forge/DevOps/Index.jsx @@ -36,39 +36,37 @@ export default ((props)=>{ return( - () - } - > - () } > - () } > - () } > - () - } - > - () } > - () + (p) => () + } + > + {/* 原本的两种合为一个 */} + {return( p.location.state.open_devops?:)} } > diff --git a/src/forge/DevOps/Infos.jsx b/src/forge/DevOps/Infos.jsx index b5220138..99029cde 100644 --- a/src/forge/DevOps/Infos.jsx +++ b/src/forge/DevOps/Infos.jsx @@ -26,7 +26,7 @@ export default ((props)=>{ return(
- { permission !=="Reporter" && 工作流配置} + { permission !=="Reporter" && 工作流配置}
diff --git a/src/forge/DevOps/Manage/Params.jsx b/src/forge/DevOps/Manage/Params.jsx index 7cb55276..6df62dd4 100644 --- a/src/forge/DevOps/Manage/Params.jsx +++ b/src/forge/DevOps/Manage/Params.jsx @@ -104,7 +104,7 @@ function Params(props){ 工作流 - 参数管理 - 返回 + 返回
diff --git a/src/forge/DevOps/Mould.jsx b/src/forge/DevOps/Mould.jsx index 933299d6..204fd161 100644 --- a/src/forge/DevOps/Mould.jsx +++ b/src/forge/DevOps/Mould.jsx @@ -126,7 +126,7 @@ function Mould(props){
childRef.current = f} ref={childRef} visible={visible} onCancel={()=>setVisible(false)} onOk={onOk}> - 工作流 - 模板管理返回 + 工作流 - 模板管理返回
diff --git a/src/forge/DevOps/Structure.jsx b/src/forge/DevOps/Structure.jsx index 52ac1682..99040d38 100644 --- a/src/forge/DevOps/Structure.jsx +++ b/src/forge/DevOps/Structure.jsx @@ -198,7 +198,7 @@ function Structure(props,ref){ } function clickRows(event,e){ - props.history.push(`/projects/${owner}/${projectsId}/devops/${e.number}/detail`); + props.history.push(`/${owner}/${projectsId}/devops/${e.number}/detail`); } const column = [ { @@ -290,7 +290,7 @@ function Structure(props,ref){ 构建列表 - 返回 + 返回
diff --git a/src/forge/DevOps/disposePipeline.jsx b/src/forge/DevOps/disposePipeline.jsx index 1da142f6..deabc149 100644 --- a/src/forge/DevOps/disposePipeline.jsx +++ b/src/forge/DevOps/disposePipeline.jsx @@ -275,7 +275,7 @@ function disposePipeline(props){ ...params }).then(result=>{ if(result){ - props.history.push(`/projects/${owner}/${projectsId}/devops/dispose`); + props.history.push(`/${owner}/${projectsId}/devops`); } setLoading(false); }).catch(error=>{ diff --git a/src/forge/DevOps/opsDetail.jsx b/src/forge/DevOps/opsDetail.jsx index 6ac3dc44..1944dfe6 100644 --- a/src/forge/DevOps/opsDetail.jsx +++ b/src/forge/DevOps/opsDetail.jsx @@ -48,7 +48,7 @@ export default (props) => { axios.post(url).then((result) => { if (result && result.data) { props.showNotification("工作流正在重新构建!"); - props.history.push(`/projects/${owner}/${projectId}/devops/${result.data.number}/detail`); + props.history.push(`/${owner}/${projectId}/devops/${result.data.number}/detail`); } }) .catch((error) => { @@ -87,7 +87,7 @@ export default (props) => { 退出 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 7364ebd3..be36d6db 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} + ) }) } - + + +
) @@ -245,7 +260,7 @@ class NewHeader extends Component { return( - {current_user && current_user.username} + {current_user && current_user.username} { personal && personal.length > 0 && personal.map((item,key)=>{ @@ -254,7 +269,7 @@ class NewHeader extends Component { ) }) } -
  • 设置
  • +
  • 设置
  • this.educoderloginysl()}>退出
    ) @@ -347,7 +362,7 @@ class NewHeader extends Component { }) } - // let search_url = settings && settings.common && settings.common.search; + let search_url = settings && settings.common && settings.common.search; let notice_url = settings && settings.common && settings.common.notice; return (
    @@ -385,16 +400,16 @@ class NewHeader extends Component { if (new_link && (new_link.indexOf("courses") > -1 || new_link.indexOf("contests") > -1)) { if (user_login) { if (new_link.indexOf("courses") > -1) { - new_link = new_link.replace(/courses/g, "users/" + user_login + "/courses") + new_link = new_link.replace(/courses/g, user_login + "/courses") } else if (new_link.indexOf("contests") > -1) { - new_link = new_link.replace(/contests/g, "users/" + user_login + "/contests") + new_link = new_link.replace(/contests/g, user_login + "/contests") } } else { is_hidden = true } } if (user_login && (new_link && new_link.indexOf("homes") > -1)) { - new_link = new_link.replace(/homes/g, "users/" + user_login + "/user_activities") + new_link = new_link.replace(/homes/g, user_login + "/user_activities") } var waiLian = (new_link && str.filter(item=>new_link.indexOf(item)>-1) ); @@ -412,7 +427,7 @@ class NewHeader extends Component {
    {/* {search_url ? this.SearchInput(openSearch,search_url):""} */} - + { search_url && } { current_user && (current_user.main_site || current_user.login) && (settings && settings.add && settings.add.length>0)? @@ -442,7 +457,7 @@ class NewHeader extends Component { : - + 头像 diff --git a/src/forge/Head/header.css b/src/forge/Head/header.css new file mode 100644 index 00000000..f35cd0e3 --- /dev/null +++ b/src/forge/Head/header.css @@ -0,0 +1,133 @@ +.dropdownFlex { + display: flex; + background: #fff; + border-radius: 3px; +} +.dropdownFlex .ant-menu-vertical > .ant-menu-item { + border: none; + height: 35px; + line-height: 35px; + margin: 0px; +} +.dropdownFlex .ant-menu-vertical > .ant-menu-item.ant-menu-item-selected { + background-color: #fff; +} +.dropdownFlex .ant-menu-vertical > .ant-menu-item.ant-menu-item-selected a { + color: rgba(0, 0, 0, 0.65) !important; +} +.dropdownFlex .ant-menu-vertical > .ant-menu-item.ant-menu-item-active a { + color: #4cacff !important; +} +.dropdownFlex .ant-menu-vertical { + border: none; +} + +.currentImg { + width: 34px; + height: 34px; + border-radius: 50%; + margin-left: 30px; +} + +.currentMenu { + width: 120px; + text-align: center; + padding: 0px; +} +.currentMenu .currentName { + padding: 0px 8px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + display: block; +} +.currentMenu li { + height: 40px; + line-height: 40px; + padding: 0px !important; + cursor: default; +} +.currentMenu li:hover { + background-color: #fff; +} +.currentMenu li:first-child { + border-bottom: 1px solid #eee; +} +.currentMenu li:last-child { + border-top: 1px solid #eee; +} +.currentMenu li:last-child a { + border-radius: 0px 0px 4px 4px; +} +.currentMenu li a { + padding: 0px; + margin: 0px; + display: block; + color: #666; +} +.currentMenu li a:hover { + color: #fff; + background: #4CACFF; +} + +.newFooter { + position: absolute; + bottom: 0; + width: 100%; + background: #323232; + clear: both; + min-width: 1200px; + z-index: 8; + left: 0px; +} +.newFooter p { + margin-top: 0; + margin-bottom: 0px !important; +} +.newFooter .footerInfos { + display: flex; + max-width: 1200px; + margin: 0px auto; + justify-content: space-around; + padding: 60px 0px; +} +.newFooter .footerInfos > ul { + padding: 0px 40px; + box-sizing: border-box; + max-width: 25%; + text-align: left; +} +.newFooter .footerInfos > ul li { + color: #fff; + font-weight: 300; +} +.newFooter .footerInfos > ul li:first-child { + font-size: 17px; +} +.newFooter .footerInfos > ul li > a, .newFooter .footerInfos > ul li > span { + color: #bbb; +} +.newFooter .footerInfos > ul li > a:hover { + color: #4cacff; +} +.newFooter .footerCopy { + color: #bbb; + border-top: 1px solid #4e4e4e; + padding: 10px 0px; +} +.newFooter .footerCopy a { + color: #bbb; +} +.newFooter .footerCopy a:hover { + color: #4cacff; +} + +.inviteForm .ant-form-item { + margin-right: 0px; +} +.inviteForm .ant-form-item-label { + width: 110px; + text-align: right; +} + +/*# sourceMappingURL=header.css.map */ diff --git a/src/forge/Head/header.css.map b/src/forge/Head/header.css.map new file mode 100644 index 00000000..20e0dece --- /dev/null +++ b/src/forge/Head/header.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["header.scss"],"names":[],"mappings":"AACA;EACE;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;;AACA;EACE;;AACA;EAAE;;AAGF;EAAE;;AAGN;EACE;;;AAGJ;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AACA;EACE;;AAEF;EACE;;AAEF;EACE;;AACA;EACE;;AAGJ;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;;;AAMR;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;;AACA;EACE;;AAEF;EACE;;AAEF;EACE;;AAKR;EACE;EACA;EACA;;AACA;EACE;;AACA;EACE;;;AAMN;EACE;;AAEF;EACE;EACA","file":"header.css"} \ No newline at end of file diff --git a/src/forge/Head/header.scss b/src/forge/Head/header.scss index 0246658a..fc8ca9d6 100644 --- a/src/forge/Head/header.scss +++ b/src/forge/Head/header.scss @@ -30,6 +30,13 @@ width: 120px; text-align: center; padding:0px; + .currentName{ + padding:0px 8px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + display: block; + } li{ height: 40px; line-height: 40px; diff --git a/src/forge/Index.js b/src/forge/Index.js index 3870c088..c2e36916 100644 --- a/src/forge/Index.js +++ b/src/forge/Index.js @@ -12,8 +12,9 @@ import Loadable from "react-loadable"; import Loading from "../Loading"; import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC"; + const ProjectNew = Loadable({ - loader: () => import("./New/Index"), + loader: () => import("./New/Index"), loading: Loading, }); const ProjectIndex = Loadable({ @@ -21,21 +22,23 @@ const ProjectIndex = Loadable({ loading: Loading, }); -const ProjectDetail = Loadable({ - loader: () => import("./Main/Detail"), - loading: Loading, -}); +// 项目详情放在用户和组织下作为二级菜单存在 +// const ProjectDetail = Loadable({ +// loader: () => import("./Main/Detail"), +// loading: Loading, +// }); class Index extends Component { - componentDidUpdate=()=>{ - this.props.history.listen(()=>{ + componentDidUpdate = () => { + this.props.history.listen(() => { if (document.body.scrollTop || document.documentElement.scrollTop > 0) { window.scrollTo(0, 0) } }) } render() { + return (
    @@ -52,23 +55,24 @@ class Index extends Component { )} > ( )} > - ( )} - > + > */} ( )} > + ( @@ -86,3 +90,10 @@ export default withRouter( parentSelector: ".newMain", })(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Index)))) ); + +// export default withRouter( +// ImageLayerOfCommentHOC({ +// imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget", +// parentSelector: ".newMain", +// })(Index) +// ); diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 12c0b9f9..e2dbc49d 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时不支持在线创建、在线上传、在线修改、在线删除、创建合并请求等功能) */ @@ -112,7 +113,7 @@ function CoderDepot(props){ useEffect(()=>{ if (projectsId && owner && defaultBranch){ let b = turnbar(branchName) ; - if(pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${b}/`) > -1) { + if(pathname.indexOf(`/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${b}/`) > -1) { let url = pathname.split(`/tree/${b}/`)[1]; setTreeValue(url); getFileInfo(url,branchName); @@ -199,7 +200,7 @@ function CoderDepot(props){ // 切换分支或者标签 function changeBranch(value){ let checkvalue = turnbar(value); - let url = `/projects/${owner}/${projectsId}${value && `/tree/${checkvalue}`}${treeValue ? `/${treeValue}`:""}`; + let url = `/${owner}/${projectsId}${value && `/tree/${checkvalue}`}${treeValue ? `/${treeValue}`:""}`; props.history.push(url); } @@ -209,8 +210,12 @@ function CoderDepot(props){ let checkvalue = turnbar(b); return ( - urlLink(`/projects/${owner}/${projectsId}/${checkvalue}/uploadfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>上传文件 - urlLink(`/projects/${owner}/${projectsId}/${checkvalue}/newfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>新建文件 + + urlLink(`/${owner}/${projectsId}/${checkvalue}/uploadfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>上传文件 + + + urlLink(`/${owner}/${projectsId}/${checkvalue}/newfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>新建文件 + ) } @@ -229,12 +234,12 @@ function CoderDepot(props){ setTreeValue(undefined); let branch = branchName || defaultBranch; let checkvalue = turnbar(branch); - props.history.push(`/projects/${owner}/${projectsId}/tree/${checkvalue}`); + props.history.push(`/${owner}/${projectsId}/tree/${checkvalue}`); }; // 子目录路径返回链接 function returnUlr(url){ let enBranch = turnbar(branchName); - props.history.push(`/projects/${owner}/${projectsId}/tree${enBranch?`/${enBranch}`:""}/${url}`); + props.history.push(`/${owner}/${projectsId}/tree${enBranch?`/${enBranch}`:""}/${url}`); } // 点击跳转到子目录 function goToSubRoot(path,type,filename){ @@ -242,7 +247,7 @@ function CoderDepot(props){ let enBranch = branchName || defaultBranch; let checkvalue = turnbar(enBranch); setType(type); - props.history.push(`/projects/${owner}/${projectsId}${`/tree/${checkvalue}`}${path?`/${path}`:""}`); + props.history.push(`/${owner}/${projectsId}${`/tree/${checkvalue}`}${path?`/${path}`:""}`); } } @@ -254,7 +259,7 @@ function CoderDepot(props){ //点击直接跳转页面 加载一次路由 let enBranch = branchName || defaultBranch; let checkvalue = turnbar(enBranch); - props.history.push(`/projects/${owner}/${projectsId}/tree/${checkvalue}/${path}`); + props.history.push(`/${owner}/${projectsId}/tree/${checkvalue}/${path}`); setType("file"); setEditReadme(true); }; @@ -346,31 +351,34 @@ function CoderDepot(props){ }
    - - - 分支 - {projectDetail && projectDetail.branches && projectDetail.branches.total_count} + + + {projectDetail && projectDetail.branches && projectDetail.branches.total_count}个分支 - - - 标签 - {projectDetail && projectDetail.tags && projectDetail.tags.total_count} + + + {projectDetail && projectDetail.tags && projectDetail.tags.total_count}个标签 { - baseOperate && projectDetail.type !== 2 && pullsFlag && - - } - { - baseOperate && issuesFlag && - + baseOperate && ((projectDetail.type !== 2 && pullsFlag) || issuesFlag )&& +
    + { + projectDetail.type !== 2 && pullsFlag && + urlLink(`/${owner}/${projectsId}/pulls/new`)} >+ 合并请求 + } + { + issuesFlag && + urlLink(`/${owner}/${projectsId}/issues/new`)} >+ 任务 + } +
    } { fileOperate && - + } @@ -392,13 +400,10 @@ function CoderDepot(props){
    { hideBtn && changeHide(hide)}> } - {lastCommit && lastCommit.time_from_now} - { - commitCount ? - - {commitCount}次提交 - :"" - } + {lastCommit && lastCommit.time_from_now} + { commitCount ? + {commitCount}次提交 + :"" } }