diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index f221492f..00000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,1190 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1584692398144 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file 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/package-lock.json b/package-lock.json index 69d6155f..628e5a3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4885,7 +4885,7 @@ }, "dom-closest": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/dom-closest/-/dom-closest-0.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/dom-closest/download/dom-closest-0.2.0.tgz", "integrity": "sha1-69n5HRvyLo1vR3h2u80+yQIWwM8=", "requires": { "dom-matches": ">=1.0.1" @@ -4929,7 +4929,7 @@ }, "dom-matches": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-matches/-/dom-matches-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/dom-matches/download/dom-matches-2.0.0.tgz", "integrity": "sha1-0nKLQWqHUzmA6wibhI0lPPI6dYw=" }, "dom-scroll-into-view": { @@ -5187,7 +5187,7 @@ }, "enquire.js": { "version": "2.1.6", - "resolved": "https://registry.npmjs.org/enquire.js/-/enquire.js-2.1.6.tgz", + "resolved": "https://registry.npm.taobao.org/enquire.js/download/enquire.js-2.1.6.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fenquire.js%2Fdownload%2Fenquire.js-2.1.6.tgz", "integrity": "sha1-PoeAybi4NQhMP2DhZtvDwqPImBQ=" }, "entities": { @@ -5706,7 +5706,7 @@ }, "eventlistener": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/eventlistener/-/eventlistener-0.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/eventlistener/download/eventlistener-0.0.1.tgz", "integrity": "sha1-7Suqu4UiJ68rz4iRUscsY8pTLrg=" }, "events": { @@ -8040,7 +8040,7 @@ }, "hammerjs": { "version": "2.0.8", - "resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz", + "resolved": "https://registry.npm.taobao.org/hammerjs/download/hammerjs-2.0.8.tgz", "integrity": "sha1-BO93hiz/K7edMPdpIJWTAiK/YPE=" }, "handle-thing": { @@ -8881,7 +8881,7 @@ }, "immutable": { "version": "3.7.6", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.7.6.tgz", + "resolved": "https://registry.npm.taobao.org/immutable/download/immutable-3.7.6.tgz", "integrity": "sha1-E7TTyxK++hVIKib+Gy665kAHHks=" }, "import-fresh": { @@ -10486,7 +10486,7 @@ }, "lodash.throttle": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/lodash.throttle/download/lodash.throttle-4.1.1.tgz", "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=" }, "lodash.uniq": { diff --git a/package.json b/package.json index b58b501d..a78351cb 100644 --- a/package.json +++ b/package.json @@ -193,6 +193,7 @@ "babel-core": "^6.26.0", "babel-plugin-import": "^1.13.0", "babel-plugin-transform-runtime": "^6.23.0", + "babel-polyfill": "^6.26.0", "babel-preset-es2015": "^6.24.1", "babel-preset-react": "^6.24.1", "babel-preset-stage-2": "^6.24.1", diff --git a/public/css/edu-common.css b/public/css/edu-common.css index 96a8277d..56790f05 100755 --- a/public/css/edu-common.css +++ b/public/css/edu-common.css @@ -114,14 +114,6 @@ a:visited { color: #898989; } -a:hover { - color: #FF7500; -} - -a:hover.fa { - color: #FF7500; -} - input, textarea, select { diff --git a/public/css/edu-main.css b/public/css/edu-main.css index 3cbe5fcb..1d995903 100644 --- a/public/css/edu-main.css +++ b/public/css/edu-main.css @@ -97,10 +97,6 @@ a:visited { color: #05101a; } -a:hover { - color: #459be5; -} - ol, ul, li { diff --git a/public/css/edu-purge.css b/public/css/edu-purge.css index f721824b..9dafcdd0 100644 --- a/public/css/edu-purge.css +++ b/public/css/edu-purge.css @@ -1307,6 +1307,7 @@ td, span { margin: 0; padding: 0; + margin-bottom: 0px!important; } table, @@ -1364,7 +1365,7 @@ a:visited { } a:hover { - color: #459be5; + color: #2A61FF!important; } ol, @@ -1473,7 +1474,7 @@ a.edu-txt-w80, /*隐藏*/ .none { - display: none + display: none!important; } .block { @@ -2436,7 +2437,7 @@ a.hoverLine:hover{ .color-grey-9 { - color: #999999 !important; + color: #333333 !important; } .color-grey-98 { @@ -2471,33 +2472,23 @@ a.hoverLine:hover{ a.color-grey-name:hover, a.color-dark:hover, a.color-grey-6:hover, -a.color-grey-3:hover { - color: #4cacff !important; -} - -a.color-grey-9:hover, -a.color-grey-8:hover, -a.color-grey-c:hover { - color: #111C24 !important; +a.color-grey-3:hover,a.color-ooo:hover { + color: #2A61FF !important; } /*蓝色*/ .color-blue { - color: #4CACFF !important; + color: #2A61FF !important; +} +.color-blue-file { + color: #0054CC!important; } /* 绿色 */ -.color-green-file{ - color: #28BD6C; -} /*主*/ .color-blue_4C { color: #4CACFF !important; } -a.color-blue:hover, -a.color-blue_4C:hover { - color: #459BE6 !important; -} /*橙色*/ .color-orange { diff --git a/public/css/iconfont.css b/public/css/iconfont.css index a15df586..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=1628841816999') format('woff2'), - url('iconfont.woff?t=1628841816999') format('woff'), - url('iconfont.ttf?t=1628841816999') 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,6 +13,146 @@ -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"; } @@ -29,22 +169,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"; } @@ -53,14 +177,6 @@ content: "\e883"; } -.icon-cangkushezhiicon:before { - content: "\e885"; -} - -.icon-fuzhiicon:before { - content: "\e886"; -} - .icon-lianjieicon:before { content: "\e887"; } @@ -69,18 +185,6 @@ content: "\e888"; } -.icon-lichengbeiicon:before { - content: "\e889"; -} - -.icon-gongzuoliuicon:before { - content: "\e88a"; -} - -.icon-dongtaiicon:before { - content: "\e88b"; -} - .icon-morendianzan_icon:before { content: "\e88e"; } @@ -93,10 +197,6 @@ content: "\e899"; } -.icon-wenjian5:before { - content: "\e89a"; -} - .icon-tijiaoicon:before { content: "\e89e"; } @@ -105,10 +205,6 @@ content: "\e89f"; } -.icon-wenjianjia3:before { - content: "\e8a2"; -} - .icon-xialaanniu1:before { content: "\e8a4"; } @@ -193,10 +289,6 @@ content: "\e898"; } -.icon-weixuanzhongqingqiuicon:before { - content: "\e89b"; -} - .icon-xiezuozheguanliicon:before { content: "\e8a1"; } @@ -241,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 94af421b..e50f44e1 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); diff --git a/public/css/iconfont.json b/public/css/iconfont.json index 7f25b322..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,34 +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": "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", @@ -75,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", @@ -103,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", @@ -145,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", @@ -166,13 +341,6 @@ "unicode": "e89f", "unicode_decimal": 59551 }, - { - "icon_id": "23472271", - "name": "文件夹", - "font_class": "wenjianjia3", - "unicode": "e8a2", - "unicode_decimal": 59554 - }, { "icon_id": "23472272", "name": "下拉按钮", @@ -320,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", @@ -404,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/college/colleagecss/colleage.css b/src/college/colleagecss/colleage.css index 9220b8ac..65f32322 100644 --- a/src/college/colleagecss/colleage.css +++ b/src/college/colleagecss/colleage.css @@ -218,7 +218,7 @@ a:hover { } .color-blue { - color: #4CACFF; + color: #2A61FF; } .color-huang { diff --git a/src/common/DateUtil.js b/src/common/DateUtil.js index 630b2d7d..8846d274 100644 --- a/src/common/DateUtil.js +++ b/src/common/DateUtil.js @@ -107,7 +107,7 @@ export function timeAgo(backDate) { try { moment(backDate); } catch (e) { - return; + return '刚刚'; } if(typeof backDate ==='number'){ backDate=backDate*1000 @@ -134,4 +134,5 @@ export function timeAgo(backDate) { if (seconds) { return seconds + "秒前"; } + return "刚刚"; } \ No newline at end of file diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index 07e141eb..f1800a75 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -18,6 +18,23 @@ export function getImageUrl(path) { return `${path}`; } +export function numFormat(num, digits){ + let d = digits || 1; + var si = [ + { value: 1, symbol: "" }, + { value: 1E3, symbol: "k" }, + { value: 1E4, symbol: "W" } + ]; + var rx = /\.0+$|(\.[0-9]*[1-9])0+$/; + var i; + for (i = si.length - 1; i > 0; i--) { + if (num >= si[i].value) { + break; + } + } + return (num / si[i].value).toFixed(d).replace(rx, "$1") + si[i].symbol; +} + export function getImage(path) { // https://www.educoder.net // https://testbdweb.trustie.net diff --git a/src/common/educoder.js b/src/common/educoder.js index c6eaf176..1a063d82 100644 --- a/src/common/educoder.js +++ b/src/common/educoder.js @@ -3,7 +3,7 @@ // export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil'; export { - getUploadLogoActionUrl as getUploadLogoActionUrl, + getUploadLogoActionUrl as getUploadLogoActionUrl,numFormat as numFormat, getImageUrl as getImageUrl,getImage as getImage, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl , getUploadActionUrl as getUploadActionUrl, getUploadActionUrltwo as getUploadActionUrltwo, getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth , getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl 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..c2e6dd74 100644 --- a/src/forge/Branch/CloneAddress.js +++ b/src/forge/Branch/CloneAddress.js @@ -1,28 +1,20 @@ 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 (

-
+
{setKey(e.key)}}>HTTP {setKey(e.key)}}>SSH
- - - +
diff --git a/src/forge/Branch/Select.jsx b/src/forge/Branch/Select.jsx index fedd288c..a44584c4 100644 --- a/src/forge/Branch/Select.jsx +++ b/src/forge/Branch/Select.jsx @@ -1,116 +1,36 @@ import React , { useState , useEffect } from 'react'; -import { Popover , Input , Spin } from 'antd'; +import { Popover , Dropdown , Input , Spin } from 'antd'; import './branch.scss'; import { getBranch , getTag } from '../GetData/getData'; +import SelectOverlay from './SelectOverlay'; export default (({ projectsId , branch , owner , changeBranch , branchList , tagflag = true })=>{ const [ showValue , setShowValue ] = useState(branch); - const [ inputValue , setInputValue] = useState(undefined); - const [ nav , setNav ] = useState(0); - const [ isSpin , setIsSpin ] = useState(true); - const [ flag , setFlag ] = useState(false); - - const [ data , setData ] = useState(undefined); - const [ datas , setDatas ] = useState(undefined); useEffect(()=>{ setShowValue(branch); },[branch]) - useEffect(()=>{ - document.body.addEventListener('click', e => { - let name = e.target.className; - let turn = name === "ant-input OptionsInput" || name === "navli active"|| name === "navli" || name === "padding10 bor-bottom-greyE"; - if(turn){ - return; - }else{ - setFlag(false); - } - }) - }) - - useEffect(()=>{ - if(branchList){ - setData(branchList); - setDatas(branchList); - setIsSpin(false); - } - },[branchList]) - - - async function getBranchs(id,owner){ - let result = await getBranch(id,owner); - setData(result); - setDatas(result); - setIsSpin(false); - } - async function getTags(id,owner){ - let result = await getTag(id,owner); - setData(result); - setDatas(result); - setIsSpin(false); - } - - function changeInputValue(e){ - setInputValue(e.target.value); - let filter = e.target.value ? data && data.length>0 && data.filter(item=>item.name.indexOf(e.target.value)>-1) : data; - setDatas(filter); - } - - function changeNav(nav){ - setNav(nav); - setIsSpin(true); - if(nav === 0){ - getBranchs(projectsId,owner); - }else{ - getTags(projectsId,owner); - } - } - function chooseitem(value){ - // setShowValue(value); - changeBranch(value); - } - - const menu = ( -
-
- -
    -
  • changeNav(0)}>分支列表
  • - { tagflag &&
  • changeNav(1)}>标签列表
  • } -
-
- -
- -
+ ); return( - setFlag(!flag)} overlayClassName="branch-tagBox-list"> +
{/* {nav === 0 ?"分支":"标签"} */} - + {showValue} - +
-
+ ) }) \ No newline at end of file diff --git a/src/forge/Branch/SelectOverlay.jsx b/src/forge/Branch/SelectOverlay.jsx new file mode 100644 index 00000000..d536d1c9 --- /dev/null +++ b/src/forge/Branch/SelectOverlay.jsx @@ -0,0 +1,84 @@ +import React , { useState , useEffect } from 'react'; +import { Input , Spin , Menu } from 'antd'; +import { getBranch , getTag } from '../GetData/getData'; + +function SelectOverlay({ changeBranch , tagflag , branchList , projectsId , owner }) { + const [ inputValue , setInputValue] = useState(undefined); + const [ nav , setNav ] = useState(0); + const [ isSpin , setIsSpin ] = useState(true); + + const [ data , setData ] = useState(undefined); + const [ datas , setDatas ] = useState(undefined); + const [ keys ,setKeys] = useState("branch"); + + useEffect(()=>{ + if(branchList){ + setData(branchList); + setDatas(branchList); + setIsSpin(false); + } + },[branchList]) + + async function getBranchs(id,owner){ + let result = await getBranch(id,owner); + setData(result); + setDatas(result); + setIsSpin(false); + } + async function getTags(id,owner){ + let result = await getTag(id,owner); + setData(result); + setDatas(result); + setIsSpin(false); + } + function chooseitem(value){ + changeBranch(value); + } + function changeInputValue(e){ + setInputValue(e.target.value); + let filter = e.target.value ? data && data.length>0 && data.filter(item=>item.name.indexOf(e.target.value)>-1) : data; + setDatas(filter); + } + + function changeNav(e){ + setKeys(e.key); + setIsSpin(true); + if(e.key === "branch"){ + getBranchs(projectsId,owner); + }else{ + getTags(projectsId,owner); + } + } + + return( +
+
+ } + placeholder="请输入分支或标签名称搜索" + autocomplete="off" className="OptionsInput" + value={inputValue} + onChange={changeInputValue} + /> +
+ + 分支 + { tagflag && 标签 } + + +
    + { + datas && datas.length>0 ? + datas.map((item,key)=>{ + return( +
  • chooseitem(item.name)}>{item.name}
  • + ) + }): +

    暂无{inputValue}{nav === 0 ?"分支":"标签"}~

    + } +
+
+
+ ) +} +export default SelectOverlay; \ No newline at end of file diff --git a/src/forge/Branch/branch.css b/src/forge/Branch/branch.css new file mode 100644 index 00000000..a1144ac1 --- /dev/null +++ b/src/forge/Branch/branch.css @@ -0,0 +1,136 @@ +.branchDropdown { + border: 1px solid #eee; + border-radius: 4px; + display: flex; + justify-content: center; + height: 40px; + line-height: 40px; + min-width: 220px; +} + +.branchDropdown .ant-dropdown-trigger { + width: 100%; + padding: 0px 15px; + display: flex; + justify-content: space-between; + align-items: center; + cursor: pointer; +} + +.branchOptions { + width: 220px; + box-shadow: 0px 0px 3px 1px rgba(134, 134, 134, 0.4); + border-radius: 3px; + background: #fff; + max-height: 300px; +} + +.OptionsUl { + max-height: 220px; + overflow-y: auto; +} + +.OptionsUl li { + height: 30px; + line-height: 30px; + cursor: pointer; + padding: 0px 20px; + margin: 5px 0px; +} + +.OptionsUl li:hover { + background-color: #F0F0F0; +} + +.OptionsUl li a { + display: block; +} + +.OptionsInput { + height: 32px; + padding-left: 4px; + line-height: 32px; + width: 100%; +} + +.branch-tagBox { + border: 1px solid #D0D0D0; + border-radius: 3px; + height: 32px; + display: flex; + align-items: center; + cursor: pointer; + min-width: 104px; +} + +.branch-tagBox:hover { + background-color: #F3F4F6; +} + +.branch-tagBox-list { + background: #FFFFFF; + box-shadow: 0px 4px 8px 2px rgba(212, 212, 212, 0.5); + border-radius: 4px; +} +.branch-tagBox-list .ant-popover-arrow { + display: none; +} +.branch-tagBox-list.ant-popover.ant-popover-placement-bottom { + padding-top: 0px; +} +.branch-tagBox-list .branch-tagBox .ant-dropdown-link { + display: block; + flex: 1; + max-width: 105px; +} +.branch-tagBox-list .ant-popover-inner-content { + padding: 0px; +} + +.overlayBranch { + width: 325px; +} +.overlayBranch .navUl { + margin-top: 8px; + height: 30px; + line-height: 30px; +} +.overlayBranch .navUl li { + height: 30px; + line-height: 30px; + padding: 0px 5px; + margin-left: 20px !important; +} + +.listTips { + padding: 20px 0px; + text-align: center; +} + +.urlMenu { + line-height: 30px; + margin-bottom: 10px; + padding: 15px 20px 0px 20px; + border-bottom: none; +} +.urlMenu li.ant-menu-item { + height: 30px; + line-height: 30px; + padding: 0px 5px; + margin-right: 20px !important; +} +.urlMenu li.ant-menu-item.ant-menu-item-selected, .urlMenu li.ant-menu-item.ant-menu-item-active { + color: #333; +} +.urlMenu li.ant-menu-item.ant-menu-item-selected { + border-color: #1890ff !important; +} +.urlMenu li.ant-menu-item.ant-menu-item-active { + 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 new file mode 100644 index 00000000..6dd42dad --- /dev/null +++ b/src/forge/Branch/branch.css.map @@ -0,0 +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;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 bdd4aa39..b0f8ca2c 100644 --- a/src/forge/Branch/branch.scss +++ b/src/forge/Branch/branch.scss @@ -27,10 +27,11 @@ overflow-y: auto; } .OptionsUl li{ - height: 35px; - line-height: 35px; + height: 30px; + line-height: 30px; cursor: pointer; - padding:0px 10px; + padding:0px 20px; + margin:5px 0px; } .OptionsUl li:hover{ background-color: #F0F0F0; @@ -45,38 +46,49 @@ width: 100%; } .branch-tagBox{ - border:1px solid #eee; + border:1px solid #D0D0D0; border-radius: 3px; - height: 40px; + height: 32px; display: flex; align-items: center; cursor: pointer; - min-width: 140px; + min-width: 104px; } -.branch-tagBox-list .ant-popover-arrow{ - display: none; +.branch-tagBox:hover{ + background-color: #F3F4F6; } -.branch-tagBox-list.ant-popover.ant-popover-placement-bottom{ - padding-top:0px; +.branch-tagBox-list{ + background: #FFFFFF; + box-shadow: 0px 4px 8px 2px rgba(212, 212, 212, 0.5); + border-radius: 4px; + .ant-popover-arrow{ + display: none; + } + &.ant-popover.ant-popover-placement-bottom{ + padding-top:0px; + } + .branch-tagBox .ant-dropdown-link{ + display: block; + flex:1; + max-width: 105px; + } + .ant-popover-inner-content{ + padding:0px; + } } -.branch-tagBox .ant-dropdown-link{ - display: block; - flex:1; -} -.branch-tagBox-list .ant-popover-inner-content{ - padding:0px; -} -.navUl{ - display: flex; - justify-content: space-between; - align-items: center; - margin-top: 5px; -} -.navUl li{ - cursor: pointer; -} -.navUl li.active{ - color:#5091FF; +.overlayBranch{ + width: 325px; + .navUl{ + margin-top: 8px; + height: 30px; + line-height: 30px; + li{ + height: 30px; + line-height: 30px; + padding:0px 5px; + margin-left: 20px!important; + } + } } .listTips{ padding:20px 0px; @@ -86,6 +98,7 @@ .urlMenu{ line-height: 30px; margin-bottom: 10px; + padding:15px 20px 0px 20px; border-bottom: none; li.ant-menu-item{ height: 30px; @@ -102,4 +115,7 @@ border-color:transparent ; } } +} +.copytool{ + margin:0px 10px; } \ No newline at end of file diff --git a/src/forge/Component/AddGroup.jsx b/src/forge/Component/AddGroup.jsx index 656175d5..feff6f37 100644 --- a/src/forge/Component/AddGroup.jsx +++ b/src/forge/Component/AddGroup.jsx @@ -55,6 +55,7 @@ function AddGroup({organizeId,getGroupID}){ function addCollaborator(){ getGroupID && getGroupID(id); + setID(undefined); } return( diff --git a/src/forge/Component/Component.scss b/src/forge/Component/Component.scss index 3a94c375..627304e1 100644 --- a/src/forge/Component/Component.scss +++ b/src/forge/Component/Component.scss @@ -113,7 +113,14 @@ li.ant-menu-item{ z-index: 10000; } .laterest{ - color: #05690d; + background-color: #EF3131; + color: #fff; + font-size: 12px; + margin-left: 10px; + padding:0px 5px; + border-radius: 2px; + height: 18px; + line-height: 18px; } @media screen and (max-width: 1800px){ @@ -157,39 +164,88 @@ li.ant-menu-item{ } .menuPanels{ - width: 240px; - height: 180px; + width: 295px; + .leftline{ + position: relative; + color: #666; + height: 16px; + &::before{ + position: absolute; + left: -10px; + top:3px; + height: 12px; + width: 1px; + background-color: #666666; + content: ""; + } + } + .ant-btn{ + height: 36px; + line-height: 34px; + width: 83px; + text-align: center; + padding:0px ; + font-weight: 500; + font-size: 14px; + &.currentBtn{ + cursor: default; + color: #333; + &:hover{ + color: #333; + border-color: #d0d0d0; + } + } + } + .ant-btn-default{ + color: #333; + border-color: #d0d0d0; + &:hover{ + background: #F3F4F6; + } + } + .ant-btn-primary{ + color: #fff; + background-color: #2A61FF; + } + .focusPanelHeadInfo{ + padding:14px 16px; + border-bottom: 1px solid #eee; + } .ant-popover-content,.ant-popover-inner{ height: 100%; width: 100%; } + .ant-popover-inner-content{ + padding:0px; + } } .halfs{ margin-top: 24px; padding:24px 0px 0px 0px; border-top: 1px solid #e8e8e8; - .attrPerson{ - padding-bottom: 24px; - } +} +.aboutSubTitle{ + display: flex; + align-items: center; } .menuinfos{ - padding:15px 0px; + padding:10px 20px; &>a{ display: flex; flex-direction: column; align-items: center; - border-right: 1px solid #eee; flex: 1; & >span:first-child{ - font-size: 18px; - font-weight: 400; + font-size: 16px; + font-weight: 500; color: #333; + line-height: 22px; } & >span:last-child{ color: #666; - } - &:last-child{ - border-right: none; + font-weight: 400; + line-height: 20px; + margin-top: 6px; } } } diff --git a/src/forge/Component/Contributors.jsx b/src/forge/Component/Contributors.jsx index 1e26354a..f878f672 100644 --- a/src/forge/Component/Contributors.jsx +++ b/src/forge/Component/Contributors.jsx @@ -1,13 +1,13 @@ import React, { useEffect, useState } from 'react'; import { AlignCenter , FlexAJ } from '../Component/layout'; import { Link } from 'react-router-dom'; -import { Popover , Spin } from 'antd'; +import { Popover , Spin , Button } from 'antd'; import { getImageUrl } from 'educoder'; import './Component.scss'; import { getUser } from '../GetData/getData'; import axios from 'axios'; -function Contributors({contributors,owner,projectsId}){ +function Contributors({contributors,owner,projectsId,currentLogin}){ const [ menuList ,setMenuList ]= useState([]); const [ list , setList ]= useState(undefined); const [ total , setTotal ]= useState(0); @@ -52,8 +52,8 @@ function Contributors({contributors,owner,projectsId}){ - - {data.name} + + {data.name} { data.is_watch ? FocusFunc(false,data.login)}>取消关注:FocusFunc(true,data.login)}>关注 @@ -73,19 +73,18 @@ function Contributors({contributors,owner,projectsId}){ 关注数 - { - data.organizations && data.organizations.length > 0 ? - - 所属组织: -
- {renderArray(data.organizations)} -
-
- :"" - } - { - data.location && 所在地址:{data.location} - } +
+ { + currentLogin && (currentLogin === data.login) + ? + + : + data.is_watch ? + + : + + } +
) setMenu(ele); @@ -137,7 +136,7 @@ function Contributors({contributors,owner,projectsId}){
贡献者{ contributors && contributors.total_count > 0 && {contributors.total_count}} - 全部 + 全部
setVisibleFunc(false)}> { @@ -145,7 +144,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 new file mode 100644 index 00000000..96f7900a --- /dev/null +++ b/src/forge/Component/CopyTool.jsx @@ -0,0 +1,50 @@ +import React, { useState, useCallback, memo } from 'react'; +import { Tooltip } from 'antd'; + +CopyTool.defaultProps = { + beforeText: '复制链接', //浮动过去显示的文字 + afterText: '复制成功', //点击后显示的文字 + className: '', //传给svg的class + inputId: 'copyText', //要复制的文本的ID + timeOut:true, //复制后将浮动的文字改为beforeText +}; + + +function CopyTool({ beforeText, afterText, className , inputId , timeOut }) { + const [title, setTitle] = useState(() => { + return beforeText; + }); + + // 复制链接 + const copyUrl = useCallback(() => { + const copyEle = document.querySelector(`#${inputId}`); // 获取要复制的节点 + if (!copyEle) { + console.error("您的CopyTool未设置正确的inputId"); + return; + } + copyEle.select(); // 执行选中元素 + if (document.execCommand('copy')) { + document.execCommand('copy'); + } + + setTitle(afterText); + if(timeOut){ + setTimeout(function(){ + setTitle(beforeText); + },1500) + } + }, []); + + return ( + { setTitle(beforeText) }} + > + + + ); +} + + +export default memo(CopyTool); \ No newline at end of file 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..e8b83420 --- /dev/null +++ b/src/forge/Component/EAccount.css @@ -0,0 +1,9 @@ +.ant-modal-mask { + z-index: 1001; +} + +.ant-modal-wrap { + z-index: 1002; +} + +/*# 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/LanguagePower.jsx b/src/forge/Component/LanguagePower.jsx index 3197309c..8d3e361b 100644 --- a/src/forge/Component/LanguagePower.jsx +++ b/src/forge/Component/LanguagePower.jsx @@ -25,7 +25,7 @@ function LanguagePower({languages}){ } return(
-

开发语言

+

开发语言

{ array && array.map((item,key)=>{ 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.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.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 da984543..4a689f5f 100644 --- a/src/forge/Component/Releases.jsx +++ b/src/forge/Component/Releases.jsx @@ -7,32 +7,32 @@ function Releases({owner,projectsId,releaseVersions , baseOperate , projectType} return(
- 发行版 + 发行版 { releaseVersions && releaseVersions.total_count > 0 && {releaseVersions.total_count}} - { (releaseVersions && releaseVersions.total_count > 0) || projectType ===2 ? - 全部 - : - baseOperate && 新建 - } + {/* { + baseOperate && projectType !==2 && 新建 + } */} { releaseVersions && releaseVersions.total_count>0 ? releaseVersions.list.map((item,key)=>{ return( key === 0 && -

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

-

{item.created_at}

+

{item.created_at}

) }) - :"" + : +
+ 您暂未发布任何版本{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 a6ecdc05..d4c1f201 100644 --- a/src/forge/Divert/DivertModal.jsx +++ b/src/forge/Divert/DivertModal.jsx @@ -41,14 +41,15 @@ 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){ + if(result && result.data.id){ onSuccess(result.data && result.data.owner); + }else{ + onSuccess(); } }).catch(error=>{}) } @@ -104,7 +105,7 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){ :
    -
  • 仓库仅可以转移到您已经加入的组织中,不可以转移到未加入的组织中
  • +
  • 仓库仅可以转移到您具有管理权限的组织中
  • 涉及到仓库改名操作,请提前做好仓库备份并且在转移后对本地仓库的remote进行修改
  • 转移仓库到组织后,你和组织创建者/管理员同时拥有对该仓库的管理操作
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.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 cfe3c6a8..78723601 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -1,6 +1,6 @@ import React , { useEffect , useState } from 'react'; import { WhiteBack , Box , LongWidth , ShortWidth , Gap , AlignCenter , FlexAJ } from '../Component/layout'; -import { Dropdown , Menu , Divider , Spin, Button } from 'antd'; +import { Dropdown , Menu , Divider , Spin, Button , Typography } from 'antd'; import { getImageUrl } from "educoder"; import { Link } from 'react-router-dom'; import CloneAddress from '../Branch/CloneAddress'; @@ -20,10 +20,11 @@ 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时不支持在线创建、在线上传、在线修改、在线删除、创建合并请求等功能) */ - + const { Paragraph } = Typography; function turnbar(str){ if(str && str.length>0 && str.indexOf("/")>-1){ return str.replaceAll('/','%2F'); @@ -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); @@ -147,6 +148,7 @@ function CoderDepot(props){ setReadme(result.data.readme); setEditReadme(false); setHide(true); + console.log("dddd:",result.data.entries); } setTimeout(function(){setIsSpin(false);},500); }).catch(error=>{setIsSpin(false);}) @@ -198,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); } @@ -208,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}`}`)}>新建文件 + ) } @@ -228,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){ @@ -241,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}`:""}`); } } @@ -253,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); }; @@ -315,7 +321,7 @@ function CoderDepot(props){ list = {mainFlag ? dirInfo : undefined} />
    setVisible(true)}> - + 目录
    @@ -328,7 +334,7 @@ function CoderDepot(props){
    -
    +
    { props && props.platform ? - + {projectDetail && projectDetail.branches && projectDetail.branches.total_count}个分支 - + {projectDetail && projectDetail.tags && projectDetail.tags.total_count}个标签 - + { baseOperate && ((projectDetail.type !== 2 && pullsFlag) || issuesFlag )&&
    { projectDetail.type !== 2 && pullsFlag && - urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求 + urlLink(`/${owner}/${projectsId}/pulls/new`)} >+ 合并请求 } { issuesFlag && - urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务 + urlLink(`/${owner}/${projectsId}/issues/new`)} >+ 任务 }
    } { fileOperate && - - + + } - +
    { - dirInfo || fileInfo ? + (dirInfo && dirInfo.length>0) || fileInfo ?
    { lastCommit && @@ -395,7 +401,7 @@ function CoderDepot(props){ { hideBtn && changeHide(hide)}> } {lastCommit && lastCommit.time_from_now} - { commitCount ? + { commitCount ? {commitCount}次提交 :"" }
    @@ -441,7 +447,7 @@ function CoderDepot(props){ : "" } { - (dirInfo && dirInfo.length === 0) && (fileInfo && fileInfo.length === 0) ? :"" + (dirInfo && dirInfo.length === 0) && !fileInfo ? :"" } {/* readme文件显示(显示文件详情时不显示readme文件) */} { dirInfo && (readme && readme.content) ? :"" } @@ -453,44 +459,47 @@ 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}

    } + {desc &&

    {desc}

    } { website && -

    - - {website} -

    +
    + + {website} +
    } -

    - - README.md -

    -

    - +

    + + README.md +
    +
    + {projectDetail && projectDetail.size} -

    +
    { projectDetail && projectDetail.license_name && -

    - - {projectDetail.license_name} -

    +
    + + {projectDetail.license_name} +
    }
    { inviteCode &&
    - +
    } { lesson_url &&
    -

    实践课程

    +

    实践课程

    {lesson_url}
    } @@ -511,11 +520,11 @@ function CoderDepot(props){ } {/* 贡献者 */} { - projectDetail && projectDetail.contributors && + projectDetail && projectDetail.contributors && projectDetail.contributors.length >0 && } {/* 语言 */} - { projectDetail && projectDetail.languages && + { projectDetail && projectDetail.languages && projectDetail.languages.length >0 && diff --git a/src/forge/Main/CoderDepotCatalogue.jsx b/src/forge/Main/CoderDepotCatalogue.jsx index fae63b3f..ff2b576b 100644 --- a/src/forge/Main/CoderDepotCatalogue.jsx +++ b/src/forge/Main/CoderDepotCatalogue.jsx @@ -4,8 +4,8 @@ import { truncateCommitId } from '../common/util'; const typeIco = { "submodule":"icon-file-submodule font-17", - "file":'icon-wenjia font-15', - "dir":"icon-wenjianjia1 font-15" + "file":'icon-wenjian5 font-15', + "dir":"icon-wenjianjia3 font-15" } function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId }){ @@ -13,11 +13,11 @@ function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId }){
  • goToSubRoot(item.path,item.type,item.name)} className={item.type === "submodule" && "submoduleStyle"}> - {item.name} + {item.name} - + {item.commit && item.commit.message} diff --git a/src/forge/Main/CoderDepotReadme.jsx b/src/forge/Main/CoderDepotReadme.jsx index 1c54663d..3b9b9f97 100644 --- a/src/forge/Main/CoderDepotReadme.jsx +++ b/src/forge/Main/CoderDepotReadme.jsx @@ -1,8 +1,9 @@ import React, { useEffect, useState } from 'react'; import RenderHtml from '../../components/render-html'; import { AlignCenter } from '../Component/layout'; -import { Dropdown , Menu , Spin } from 'antd'; -import { Link } from 'react-router-dom'; +import { Dropdown , Anchor , Spin } from 'antd'; + +import ReadmeCatelogue from './sub/ReadmeCatelogue'; const $ = window.$; function CoderDepotReadme({ operate , history , readme , ChangeFile }){ @@ -23,49 +24,45 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){ const anchor = el.id; const level = el.tagName.replace("H", ""); const href = `#${anchor}`; - return { href:`${path}${href}`,text:el.textContent , level:level } + return { href:`${href}`,text:el.textContent , level:level } }); setMenuList(items); },[content]) function menu(){ if(menuList && menuList.length > 0){ - let hash = history.location.hash; return( - - { - menuList.map((item,key)=>{ - return( - -1 ?"active":""}>{item.text} - ) - }) - } - + ) }else{ return } } + return( -
    -
    - - - - - 目录 - - - README.md - - { - operate ? - ChangeFile(readme && readme.path, false)}> - + + { content &&
    diff --git a/src/forge/Main/CoderRootBranch.js b/src/forge/Main/CoderRootBranch.js index 8ccc5aa4..4982414a 100644 --- a/src/forge/Main/CoderRootBranch.js +++ b/src/forge/Main/CoderRootBranch.js @@ -4,7 +4,7 @@ import { Dropdown , Menu , Icon , Tooltip , Spin } from 'antd'; import { truncateCommitId } from '../common/util'; import { getBranch } from '../GetData/getData'; import Nodata from '../Nodata'; -import './list.css'; +import './list.scss'; function turnbar(str){ if(str && str.length>0 && str.indexOf("/")>-1){ @@ -38,9 +38,9 @@ export default ((props)=>{ return(
  • - {item.name} + {item.name}

    - {item.last_commit && truncateCommitId(item.last_commit.sha)} + {item.last_commit && truncateCommitId(item.last_commit.sha)} {item.last_commit && item.last_commit.message} 最后更新于{item.last_commit && item.last_commit.time_from_now}

    @@ -48,7 +48,7 @@ export default ((props)=>{ { (isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) && - 创建合并请求 + 创建合并请求 } diff --git a/src/forge/Main/CoderRootCommit.js b/src/forge/Main/CoderRootCommit.js index b6ca0be6..a715fe74 100644 --- a/src/forge/Main/CoderRootCommit.js +++ b/src/forge/Main/CoderRootCommit.js @@ -101,7 +101,7 @@ class CoderRootCommit extends Component{ // 切换分支 search:tag为根据标签搜索 changeBranch=(value)=>{ const { projectsId , owner } = this.props.match.params; - this.props.history.push(`/projects/${owner}/${projectsId}/commits/branch/${value}`); + this.props.history.push(`/${owner}/${projectsId}/commits/branch/${value}`); } ChangePage=(page)=>{ @@ -141,13 +141,13 @@ class CoderRootCommit extends Component{ return(
    - {truncateCommitId(`${item.sha}`)} - {item.message} + {truncateCommitId(`${item.sha}`)} + {item.message}

    { item.id ? - + {item.image_url?:""} : diff --git a/src/forge/Main/CoderRootFileDetail.js b/src/forge/Main/CoderRootFileDetail.js index f86706e4..d5a9670c 100644 --- a/src/forge/Main/CoderRootFileDetail.js +++ b/src/forge/Main/CoderRootFileDetail.js @@ -1,6 +1,6 @@ import React, { Component } from "react"; import { Popconfirm , Select } from "antd"; -import "./list.css"; +import "./list.scss"; import axios from "axios"; import Meditor from "../Newfile/m_editor"; import RenderHtml from "../../components/render-html"; @@ -149,7 +149,7 @@ class CoderRootFileDetail extends Component { .then((result) => { if (result) { this.props.showNotification("删除成功!"); - this.props.history.push(`/projects/${owner}/${projectsId}`); + this.props.history.push(`/${owner}/${projectsId}`); } }) .catch((error) => { diff --git a/src/forge/Main/CoderRootIndex.js b/src/forge/Main/CoderRootIndex.js index 84ab94d3..0fb30c4e 100644 --- a/src/forge/Main/CoderRootIndex.js +++ b/src/forge/Main/CoderRootIndex.js @@ -87,57 +87,57 @@ class CoderRootIndex extends Component{ {/* 新建文件 */} - () } > - () } > - () } > - () } > - () } > - () } > - () } > - () } > - () } > - () } > - () } diff --git a/src/forge/Main/CoderRootTag.js b/src/forge/Main/CoderRootTag.js index a87386d5..da1fa96d 100644 --- a/src/forge/Main/CoderRootTag.js +++ b/src/forge/Main/CoderRootTag.js @@ -49,7 +49,7 @@ export default (( props, { projectDetail }) => { {item.name} - {truncateCommitId(`${item.id}`)} + {truncateCommitId(`${item.id}`)} TAR diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index f01ef2d3..0ddc5706 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -1,10 +1,11 @@ import React, { Component } from 'react'; -import { Spin, Tooltip , Button } from 'antd'; +import { Spin, Tooltip, Button } from 'antd'; import { Link, Route, Switch } from 'react-router-dom'; -import { Content , AlignTop } from '../Component/layout'; +import { Content, AlignTop } from '../Component/layout'; import DetailBanner from './sub/DetailBanner'; +import { numFormat } from 'educoder'; import '../css/index.scss' -import './list.css'; +import './list.scss'; import Loadable from 'react-loadable'; import Loading from '../../Loading'; @@ -103,12 +104,12 @@ const Contribute = Loadable({ }) const CoderRootCommit = Loadable({ - loader: () => import('./CoderRootCommit'), - loading: Loading, + loader: () => import('./CoderRootCommit'), + loading: Loading, }) const CoderDepot = Loadable({ - loader: () => import('./CoderDepot'), - loading: Loading, + loader: () => import('./CoderDepot'), + loading: Loading, }) const TrendsIndex = Loadable({ @@ -139,28 +140,28 @@ const WikiEdit = Loadable({ /** * permission:Manager:管理员,Reporter:报告人员(只有读取权限),Developer:开发人员(除不能设置仓库信息外) */ -function checkPathname(projectsId,owner,pathname){ +function checkPathname(projectsId, owner, pathname) { let name = ""; - if(pathname && pathname !== `/projects/${owner}/${projectsId}`){ - let url = pathname.split(`/projects/${owner}/${projectsId}`)[1]; - if(url.indexOf("/about")>-1){ - name="about" - }else if(url.indexOf("/issues")>-1 ||url.indexOf("Milepost") > 0){ + if (pathname && pathname !== `/${owner}/${projectsId}`) { + let url = pathname.split(`/${owner}/${projectsId}`)[1] || ""; + if (url.indexOf("/about") > -1) { + name = "about" + } else if (url.indexOf("/issues") > -1 || url.indexOf("Milepost") > 0) { name = "issues"; - }else if(url.indexOf("/pulls")>-1){ - name="pulls" - }else if(url.indexOf("/milestones")>-1){ - name="milestones" - }else if(url.indexOf("/activity")>-1){ - name="activity" - }else if(url.indexOf("/setting")>-1){ - name="setting" - }else if(url.indexOf(`/devops`)>-1){ - name="devops" - }else if(url.indexOf(`/source`)>-1){ - name="source" - }else if(url.indexOf(`/wiki`)>-1){ - name="wiki" + } else if (url.indexOf("/pulls") > -1) { + name = "pulls" + } else if (url.indexOf("/milestones") > -1) { + name = "milestones" + } else if (url.indexOf("/activity") > -1) { + name = "activity" + } else if (url.indexOf("/settings") > -1) { + name = "settings" + } else if (url.indexOf(`/devops`) > -1) { + name = "devops" + } else if (url.indexOf(`/source`) > -1) { + name = "source" + } else if (url.indexOf(`/wiki`) > -1) { + name = "wiki" } } return name; @@ -183,15 +184,15 @@ class Detail extends Component { branchs: undefined, branchList: undefined, project: null, - firstSync:false, - secondSync:false, - open_devops:false, - forkSpin:false, + firstSync: false, + secondSync: false, + open_devops: false, + forkSpin: false, // 默认分支 - defaultBranch:undefined, + defaultBranch: undefined, // 非本平台项目 - platform:false + platform: false } } @@ -208,36 +209,38 @@ class Detail extends Component { } getProject = (num) => { - const { projectsId , owner } = this.props.match.params; + const { projectsId, owner } = this.props.match.params; const url = `/${owner}/${projectsId}/simple.json`; axios.get(url).then((result) => { if (result && result.data) { this.setState({ project: result.data, - open_devops:result.data.open_devops, - platform:result.data.platform && result.data.platform !== 'educoder' + open_devops: result.data.open_devops, + platform: result.data.platform && result.data.platform !== 'educoder' }) if (result.data.type !== 0 && result.data.mirror_status === 1) { console.log("--------start channel --------"); // 是镜像项目,且未完成迁移 this.canvasChannel(); - if(num){ + if (num) { this.setState({ - secondSync:true, - firstSync:false + secondSync: true, + firstSync: false }) - }else{ + } else { this.setState({ - firstSync:true, - secondSync:false + firstSync: true, + secondSync: false }) } - }else{ + } else if (result.data.mirror_status === 2) { + this.deleteProjectBack(); + } else { this.getDetail(); this.setState({ - firstSync:false, - secondSync:false + firstSync: false, + secondSync: false }) } } @@ -245,9 +248,9 @@ class Detail extends Component { } // 工作流激活后修改状态 - changeOpenDevops=(flag)=>{ + changeOpenDevops = (flag) => { this.setState({ - open_devops:flag + open_devops: flag }) } canvasChannel = () => { @@ -265,11 +268,15 @@ class Detail extends Component { disconnected: () => { }, received: data => { console.log(`###### ---received data--- ######`); + console.log(data); if (data) { + if ( data.project && data.project.mirror_status === 2) { + this.deleteProjectBack(); + } this.getDetail(); this.setState({ - firstSync:false, - secondSync:false + firstSync: false, + secondSync: false }); cable.subscriptions.consumer.disconnect(); } @@ -277,8 +284,25 @@ class Detail extends Component { }) } + deleteProjectBack = () => { + const { history } = this.props; + const { projectsId, owner } = this.props.match.params; + axios.delete(`/${owner}/${projectsId}.json`).then(res => { + let hash = '/projects/mirror/new'; + if (res && res.data) { + history.push({ + pathname: hash, + mirror_status: 2 + }); + } + else { + window.location.hash = hash; + } + }); + } + getDetail = () => { - const { projectsId , owner } = this.props.match.params; + const { projectsId, owner } = this.props.match.params; this.getBanner(); const url = `/${owner}/${projectsId}/detail.json`; axios.get(url).then((result) => { @@ -295,29 +319,29 @@ class Detail extends Component { watchers_count: result.data.watchers_count, praises_count: result.data.praises_count, forked_count: result.data.forked_count, - defaultBranch:result.data.default_branch + defaultBranch: result.data.default_branch }) } }).catch((error) => { }) } // 获取动态导航栏菜单 - getBanner(){ - const { projectsId , owner } = this.props.match.params; + getBanner() { + const { projectsId, owner } = this.props.match.params; const url = `/${owner}/${projectsId}/menu_list.json`; - axios.get(url).then(result=>{ - if(result){ + axios.get(url).then(result => { + if (result) { this.setState({ - bannerList:result.data + bannerList: result.data }) } - }).catch(error=>{}) + }).catch(error => { }) } // 关注和取消关注 focusFunc = (flag) => { const { platform } = this.state; - if(!platform)return; + if (!platform) return; const { project_id } = this.state; axios({ @@ -332,15 +356,15 @@ class Detail extends Component { this.setWatchersCount(result.data.watchers_count, result.data.watched); } }) - .catch(error => { - console.log(error); - }); + .catch(error => { + console.log(error); + }); } // 点赞和取消点赞 pariseFunc = (flag) => { const { platform } = this.state; - if(!platform)return; + if (!platform) return; const { project_id } = this.state; axios({ method: flag ? 'delete' : 'post', @@ -350,9 +374,9 @@ class Detail extends Component { this.setPraisesCount(result.data.praises_count, result.data.praised) } }) - .catch(error => { - console.log(error); - }); + .catch(error => { + console.log(error); + }); } setWatchersCount = (count, is_watched) => { @@ -372,24 +396,24 @@ class Detail extends Component { // fork项目 forkFunc = () => { const { platform } = this.state; - if(!platform)return; + if (!platform) return; this.setState({ - forkSpin:true + forkSpin: true }) const { current_user } = this.props - const { projectsId , owner } = this.props.match.params; + const { projectsId, owner } = this.props.match.params; const url = `/${owner}/${projectsId}/forks.json`; axios.post(url).then(result => { if (result && result.data.status === 0) { - this.props.history.push(`/projects/${current_user && current_user.login}/${result.data.identifier}`); + this.props.history.push(`/${current_user && current_user.login}/${result.data.identifier}`); this.props.showNotification(result.data.message); } this.setState({ - forkSpin:false + forkSpin: false }) }).catch(error => { this.setState({ - forkSpin:false + forkSpin: false }) }) } @@ -397,8 +421,8 @@ class Detail extends Component { // 同步镜像 synchronismMirror = () => { const { platform } = this.state; - if(!platform)return; - const { projectsId , owner } = this.props.match.params; + if (!platform) return; + const { projectsId, owner } = this.props.match.params; const url = `/${owner}/${projectsId}/sync_mirror.json`; axios.post(url).then(result => { if (result && result.data && result.data.status === 0) { @@ -412,344 +436,345 @@ class Detail extends Component { }) } - textFunc = (forked_from_project_id,fork_info)=>{ + textFunc = (forked_from_project_id, fork_info) => { let type = fork_info && fork_info.fork_project_user_type; return forked_from_project_id && fork_info ?

    复刻自 - {fork_info.fork_project_user_name} + {fork_info.fork_project_user_name} / - {fork_info.fork_form_name} + {fork_info.fork_form_name}
    : "" } - + render() { - const { projectDetail, watchers_count, praises_count, - forked_count, firstSync , secondSync , - isManager, watched, praised, - project , open_devops , platform , defaultBranch , bannerList , forkSpin } = this.state; + const { projectDetail, watchers_count, praises_count, + forked_count, firstSync, secondSync, + isManager, watched, praised, + project, open_devops, platform, defaultBranch, bannerList, forkSpin } = this.state; const url = this.props.history.location.pathname; const urlArr = url.split("/"); const urlFlag = (urlArr.length === 3); - const { projectsId , owner } = this.props.match.params; + const { projectsId, owner } = this.props.match.params; const { current_user } = this.props; - let pathname = checkPathname(projectsId,owner,url); + let pathname = checkPathname(projectsId, owner, url); const { state } = this.props.history.location; - + const common = { getDetail: this.getDetail, - changeOpenDevops:this.changeOpenDevops, + changeOpenDevops: this.changeOpenDevops, defaultBranch } return (
    - +
    {project && project.author && - {project.author.name} + {project.author.name} } / - {projectDetail && projectDetail.name} + {projectDetail && projectDetail.name}
    - { projectDetail && projectDetail.private && 私有} + {projectDetail && projectDetail.private && 私有}
    { projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ? - this.textFunc(projectDetail.forked_from_project_id,projectDetail.fork_info) - :"" + this.textFunc(projectDetail.forked_from_project_id, projectDetail.fork_info) + : "" } { - projectDetail && projectDetail.type && projectDetail.type !== 0 ? - 镜像自 {projectDetail.mirror_url} - :"" + projectDetail && projectDetail.type && projectDetail.type !== 0 ? + 镜像自 {projectDetail.mirror_url} + : "" }
    { - firstSync ? "": - - { - ((current_user && current_user.admin) || isManager) && (projectDetail && projectDetail.type && projectDetail.type === 2) ? - 同步镜像 : "" - } - - - - + { + watchers_count > 0 ? + platform ? + + {watchers_count} + + : + {watchers_count} + : "" + } + + + + }
    { firstSync ? "" : - + }
    { firstSync ? - - - - : - - - {/* 资源 */} - () - } - > - {/* 主页 */} - () - } - > - {/* wiki新增文件 */} - () - } - > - {/* wiki编辑文件 */} - () - } - > - {/* wiki */} - () - } - > - {/* 工作流 */} - () - } - > - {/* 标签列表 */} - () - } - > - {/* 仓库设置 */} - () - } - > - {/* 任务详情 */} - () - } - > - {/*修改里程碑*/} - () - } - > - {/* 新建里程碑 */} - () - } - > - {/*里程碑详情*/} - () - } - > - {/* 里程碑 */} - () - } - > - {/* 里程碑页面新建任务 */} - () - } - > - {/* 新建任务 */} - () - } - > - {/* 修改详情 */} - () - } - > - {/* 复制详情 */} - () - } - > - {/* 动态 */} - () - } - > - {/* 代码Index */} - () - } - > - {/* 新建合并请求 */} - () - } - > - () - } - > - () - } - > - () - } - > - () - } - > + + + + : + + + {/* 资源 */} + () + } + > + {/* 主页 */} + () + } + > + {/* wiki新增文件 */} + () + } + > + {/* wiki编辑文件 */} + () + } + > + {/* wiki */} + () + } + > + {/* 工作流 */} + () + } + > + {/* 标签列表 */} + () + } + > + {/* 仓库设置 */} + () + } + > + + {/*修改里程碑*/} + () + } + > + {/* 新建里程碑 */} + () + } + > + {/*里程碑详情*/} + () + } + > + {/* 里程碑 */} + () + } + > + {/* 里程碑页面新建任务 */} + () + } + > + {/* 新建任务 */} + () + } + > + {/* 修改详情 */} + () + } + > + {/* 复制详情 */} + () + } + > + {/* 任务详情 */} + () + } + > + {/* 动态 */} + () + } + > + {/* 代码Index */} + () + } + > + {/* 新建合并请求 */} + () + } + > + () + } + > + () + } + > + () + } + > + () + } + > - () - } - > - () - } - > - () - } - > - () - } - > - {/* 贡献者列表 */} - () - } - > + () + } + > + () + } + > + () + } + > + () + } + > + {/* 贡献者列表 */} + () + } + > - {/* 代码库----详情页面 */} - () - } - > - () - } - > - () - } - > - () - } - > - - + {/* 代码库----详情页面 */} + () + } + > + () + } + > + () + } + > + () + } + > + + }
    ) diff --git a/src/forge/Main/DetailTop.js b/src/forge/Main/DetailTop.js index 260ff1e6..ecd5ab9f 100644 --- a/src/forge/Main/DetailTop.js +++ b/src/forge/Main/DetailTop.js @@ -12,19 +12,19 @@ class DetailTop extends Component { { platform ? - 0 ? "active" : ""}> + 0 ? "active" : ""}> {(coderCount && coderCount.commits_count) || 0}个提交 - 0 ? "active" : ""}> + 0 ? "active" : ""}> {(coderCount && coderCount.branches_count) || 0}个分支 - 0 ? "active" : ""}> + 0 ? "active" : ""}> {(coderCount && coderCount.tags_count) || 0}个标签 - 0 ? "active" : ""}> + 0 ? "active" : ""}> {(coderCount && coderCount.version_releasesed_count) || 0}个发行版 diff --git a/src/forge/Main/Diff.jsx b/src/forge/Main/Diff.jsx index a6b0b49c..0daa6319 100644 --- a/src/forge/Main/Diff.jsx +++ b/src/forge/Main/Diff.jsx @@ -59,7 +59,7 @@ export default ({ match , history }) => { {commit && commit.message &&
    {commit.message}
    } - +
    diff --git a/src/forge/Main/Index.css b/src/forge/Main/Index.css new file mode 100644 index 00000000..4cb80f0e --- /dev/null +++ b/src/forge/Main/Index.css @@ -0,0 +1,375 @@ +.recommandOri.slick-slider { + width: 1300px; + margin: 20px auto 40px; +} +.recommandOri.slick-slider .slick-track { + margin-left: 0px; +} +.recommandOri.slick-slider .slick-slide li > a { + display: flex; + align-items: center; + justify-content: center; +} + +/* recommandProjects */ +.recommandProjects.slick-slider { + width: 1230px; + margin: 20px auto 40px; +} +.recommandProjects.slick-slider .slick-track { + margin-left: 0px; +} +.recommandProjects.slick-slider .slick-arrow.slick-prev:before, .recommandProjects.slick-slider .slick-arrow.slick-next:before { + color: #999; +} +.recommandProjects.slick-slider .slick-arrow.slick-prev li.slick-active button:before, .recommandProjects.slick-slider .slick-arrow.slick-next li.slick-active button:before { + color: #999; +} +.recommandProjects.slick-slider .slick-dots { + bottom: -29px; +} +.recommandProjects.slick-slider .slick-dots li button:before { + color: #909090; +} +.recommandProjects.slick-slider .slick-slide { + padding: 0px 15px; + box-sizing: border-box; +} +.recommandProjects.slick-slider .slick-slide > div { + background-color: #fff; + border-radius: 10px; + width: 100%; + cursor: pointer; + border: 1px solid #eee; +} +.recommandProjects.slick-slider .slick-slide > div:hover { + box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.1); +} +.recommandProjects.slick-slider .baseInfo { + padding: 18px 15px; + display: flex; + font-size: 12px; + color: #888; +} +.recommandProjects.slick-slider .baseInfo .look { + margin-right: 10px; +} +.recommandProjects.slick-slider .baseInfo .look i { + margin-right: 5px; +} +.recommandProjects.slick-slider .baseInfo .type { + flex: 1; + width: 0; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + text-align: right; +} +.recommandProjects.slick-slider .mainInfo { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-height: 160px; + border-bottom: 1px solid #eee; + padding: 20px; + box-sizing: border-box; +} +.recommandProjects.slick-slider .mainInfo img { + height: 50px; + width: 50px; + border-radius: 50%; +} +.recommandProjects.slick-slider .mainInfo .name { + font-size: 13px; + color: #666; + height: 18px; + line-height: 18px; + margin-top: 12px; +} +.recommandProjects.slick-slider .mainInfo .school { + margin-top: 12px; + color: #333; + font-size: 16px; + height: 22px; + line-height: 22px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + max-width: 100%; +} + +.Panels { + max-width: 1200px; + margin: 0 auto; +} +.Panels .panelmenu { + padding-top: 30px; +} +.Panels .addOptionBtn { + height: 32px; + line-height: 30px; + display: flex; + border: 1px solid #d9d9d9; + border-radius: 2px; +} +.Panels .addOptionBtn a { + padding: 0px 13px; + color: rgba(0, 0, 0, 0.65); + cursor: pointer; +} +.Panels .addOptionBtn > a:first-child { + border-right: 1px solid #d9d9d9; +} +.Panels .addOptionBtn > a:last-child { + border-right: none; +} +.Panels .infoCount { + display: inline-block; + padding: 0px 5px; + height: 16px; + line-height: 16px; + background-color: #eee; + color: #999; + border-radius: 12px; + margin-left: 10px; + font-size: 12px; +} +.Panels .attrPerson { + padding-top: 15px; + display: flex; + flex-wrap: wrap; +} +.Panels .attrPerson a { + margin: 10px 10px 0px 0px; +} +.Panels .attrPerson a img { + border-radius: 50%; + width: 35px; + height: 35px; +} +.Panels .attrPerson a:nth-child(6) { + margin-right: 0px; +} +.Panels .progress { + display: flex; + border-radius: 10px; + height: 7px; + margin-top: 12px; +} +.Panels .progress span:first-child { + border-radius: 10px 0px 0px 10px; +} +.Panels .progress span:last-child { + border-radius: 0px 10px 10px 0px; +} +.Panels .progresstip { + margin-top: 15px; + flex-wrap: wrap; +} +.Panels .progresstip i.zero { + position: absolute; + display: block; + border-radius: 50%; + height: 8px; + width: 8px; + left: 0px; + top: 10px; +} +.Panels .progresstip > span { + padding-left: 15px; + position: relative; + min-width: 33.5%; +} +.Panels .progresstip > span span { + color: #666; +} +.Panels .progresstip > span span:last-child { + color: #999; + margin-left: 5px; +} +.Panels .listtable { + margin-top: 20px; + border: 1px solid #d9d9d9; + border-radius: 4px; +} +.Panels .listtable .listtablehead { + display: flex; + justify-content: space-between; + align-items: flex-start; + border-bottom: 1px solid #d9d9d9; + padding: 7px 20px; + border-radius: 4px 4px 0px 0px; + background-color: #FAFBFC; +} +.Panels .listtable .listtablehead .ellipsistxt { + margin-top: 6px; + margin-left: 13px; + line-height: 18px; + flex: 1; + width: 0; + color: #666; +} +.Panels .listtable .listtablehead .ellipsistxt #ptxt { + margin-bottom: 0px; + word-break: break-all; + overflow: unset; + white-space: pre-wrap; + /* css3.0 */ + white-space: -moz-pre-wrap; + /* Firefox */ + white-space: -pre-wrap; + /* Opera 4-6 */ + white-space: -o-pre-wrap; + /* Opera 7 */ + word-wrap: break-word; +} +.Panels .listtable .listtablehead .ellipsistxt.hidetxt { + height: 18px; + overflow: hidden; + position: relative; + padding-right: 8px; +} +.Panels .listtable .listtablehead .ellipsistxt.hidetxt::after { + position: absolute; + right: 0px; + bottom: 0px; + content: "..."; +} +.Panels .listtable .listtablehead .ellipsis { + margin-left: 8px; + cursor: pointer; + border-radius: 2px; + background-color: #c1c1c1; + padding: 0px 4px; + height: 14px; + line-height: 14px; + margin-top: 9px; +} +.Panels .listtable .listtablehead .ellipsis i { + font-size: 15px !important; + color: #fff; + height: 14px; + line-height: 14px; +} +.Panels .listtable .listtablebody li.listtablepath a { + color: #40a9ff; +} +.Panels .listtable .listtablebody li.listtablepath p { + margin-bottom: 0px !important; +} +.Panels .listtable .listtablebody > li { + height: 42px; + display: flex; + justify-content: space-between; + align-items: center; + border-bottom: 1px solid #d9d9d9; + padding: 0px 20px 0px 24px; +} +.Panels .listtable .listtablebody > li > span:first-child { + width: 30%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.Panels .listtable .listtablebody > li > span:nth-child(2) { + width: 60%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.Panels .listtable .listtablebody > li > span:nth-child(3) { + width: 10%; + text-align: right; +} +.Panels .listtable .listtablebody > li:last-child { + border-bottom: none; +} + +.drawerBtn { + position: fixed; + left: -13px; + border: 1px solid #cfcddf; + width: 34px; + border-radius: 0px 12px 12px 0px; + height: 70px; + top: 50%; + margin-top: -35px; + cursor: pointer; + display: flex; + flex-direction: column; + align-items: flex-end; + justify-content: center; +} +.drawerBtn:hover { + box-shadow: 1px 0px 7px rgba(0, 0, 0, 0.1); +} +.drawerBtn span { + writing-mode: vertical-lr; + color: #202429; + width: 25px; +} +.drawerBtn i { + color: #24292e; + height: 18px; + line-height: 18px; + width: 18px; +} + +.downMenu { + width: 330px; + box-shadow: 0px 0px 9px rgba(134, 134, 134, 0.4); + background-color: #fff; +} +.downMenu .ant-menu-vertical .ant-menu-item:hover { + background-color: #e6f7ff; +} + +.menuslist { + max-height: 200px; + overflow-y: auto; + padding: 10px 15px; + border-radius: 4px; +} +.menuslist .ant-dropdown-menu-item { + border-radius: 8px; + text-align: left !important; +} +.menuslist .ant-dropdown-menu-item a { + width: 350px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.menuslist .ant-dropdown-menu-item.active { + background-color: #e6f7ff; +} + +.catelogue { + border: 1px solid lightgray; + font-size: 15px; + font-weight: normal; + border-radius: 5px; + margin-right: 10px; + padding: 0px 10px; + height: 30px; + line-height: 30px; + color: #666 !important; + display: flex; + align-items: center; +} +.catelogue span { + margin-top: 1px; +} + +.submoduleStyle { + cursor: default; +} +.submoduleStyle i { + cursor: default; +} +.submoduleStyle:hover { + color: #05101a; +} + +/*# sourceMappingURL=Index.css.map */ diff --git a/src/forge/Main/Index.css.map b/src/forge/Main/Index.css.map new file mode 100644 index 00000000..35f6a1bf --- /dev/null +++ b/src/forge/Main/Index.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["Index.scss"],"names":[],"mappings":"AAAA;EACE;EACA;;AACA;EACE;;AAGA;EAEE;EACA;EACA;;;AAIN;AACA;EACE;EACA;;AACA;EACE;;AAGA;EACE;;AAEF;EACE;;AAGJ;EACE;;AACA;EACE;;AAGJ;EACE;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;;AACA;EACE;;AAIN;EACE;EACA;EACA;EACA;;AACA;EAIE;;AAHA;EACE;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAKN;EACE;EACA;;AACA;EACE;;AAEF;EACE;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;;AAEF;EACE;;AAEF;EACE;;AAGJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AACA;EACE;;AACA;EACE;EACA;EACA;;AAEF;EACE;;AAIN;EACE;EACA;EACA;EACA;;AAEE;EACE;;AAEF;EACE;;AAIN;EACE;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AACA;EACE;;AACA;EACE;EACA;;AAKR;EACE;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EAWA;EACA;EACA;EACA;EACA;;AAdA;EACE;EACA;EACA;EACA;AAAsB;EACtB;AAA2B;EAC3B;AAAuB;EACvB;AAAyB;EACzB;;AAOF;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;;AAIN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;;AAMF;EAAE;;AACF;EACE;;AAGJ;EACE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;;AAGJ;EACE;;;AAKR;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAEF;EACE;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;;AAGJ;EACE;EACA;EACA;;AACA;EACE;;;AAIJ;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;;AACA;EACE;EACA;EACA;EACA;;AAGJ;EACE;;;AAGJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;;AAGJ;EACE;;AACA;EACE;;AAEF;EACE","file":"Index.css"} \ No newline at end of file diff --git a/src/forge/Main/Index.js b/src/forge/Main/Index.js index e58ec0c0..afe10817 100644 --- a/src/forge/Main/Index.js +++ b/src/forge/Main/Index.js @@ -1,18 +1,19 @@ import React, { Component } from 'react'; -import { Link } from 'react-router-dom'; import { Menu, Input , Spin, Pagination , Popover , Select } from 'antd'; import Slider from "react-slick"; import { getImageUrl } from 'educoder'; import "slick-carousel/slick/slick.css"; import "slick-carousel/slick/slick-theme.css"; import '../css/index.scss' -import './list.css'; +import './list.scss'; import './Index.scss'; import ListItem from './IndexItem' import axios from 'axios'; import img_new from '../Images/new.png'; import img_array from '../Images/array.png'; import banner from '../Images/banner_list.jpg'; +import CheckProfile from '../Component/ProfileModal/Profile'; + const Search = Input.Search; class Index extends Component { @@ -228,7 +229,7 @@ class Index extends Component { } getoDetail=(login,identifier)=>{ - this.props.history.push(`/projects/${login}/${identifier}`); + this.props.history.push(`/${login}/${identifier}`); } // 选择语言类别 @@ -255,8 +256,12 @@ class Index extends Component { newItem = ()=>{ return( - 新建镜像项目 - 新建托管项目 + + {this.props.history.push('/projects/mirror/new')}}>新建镜像项目 + + + {this.props.history.push('/projects/deposit/new')}}>新建托管项目 + ) } diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss index cb05f1cf..e09b11be 100644 --- a/src/forge/Main/Index.scss +++ b/src/forge/Main/Index.scss @@ -108,6 +108,31 @@ margin: 0 auto; .panelmenu{ padding-top:30px; + .depotBtn{ + .mr-5{ + margin-right: -5px; + } + .ant-btn{ + height: 32px; + line-height: 32px; + width: 83px; + text-align: center; + padding:0px ; + font-weight: 500; + font-size: 14px; + } + .ant-btn-default{ + color: #333; + border-color: #d0d0d0; + &:hover{ + background: #F3F4F6; + } + } + .ant-btn-primary{ + color: #fff; + background-color: #2A61FF; + } + } } .addOptionBtn{ height: 32px; @@ -129,25 +154,27 @@ } .infoCount{ display: inline-block; - padding:0px 5px; - height: 16px; - line-height: 16px; - background-color: #eee; - color:#999; + width: 24px; + text-align: center; + height: 24px; + line-height: 24px; + background-color:rgba(153, 153, 153, 0.13);; + color:#666; border-radius: 12px; - margin-left: 10px; + margin-left: 6px; font-size: 12px; } .attrPerson{ - padding-top: 15px; + padding-top: 12px; display: flex; flex-wrap: wrap; + padding-bottom: 2px; a{ - margin: 10px 10px 0px 0px; + margin: 0px 17px 0px 0px; img{ border-radius: 50%; - width: 35px; - height: 35px; + width: 40px; + height: 40px; } &:nth-child(6){ margin-right: 0px; @@ -184,10 +211,11 @@ padding-left: 15px; position: relative; min-width: 33.5%; + font-size: 12px; + font-weight: 400; + color: #666; span{ - color: #666; &:last-child{ - color: #999; margin-left: 5px; } } @@ -195,16 +223,15 @@ } .listtable{ margin-top: 20px; - border:1px solid #d9d9d9; - border-radius: 4px; .listtablehead{ display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid #d9d9d9; - padding:7px 20px; + padding:13px 20px; border-radius: 4px 4px 0px 0px; - background-color: #FAFBFC; + border: 1px solid rgba(42, 97, 255, 0.23); + background-color: #FAFCFF; .ellipsistxt{ margin-top: 6px; #ptxt{ @@ -227,32 +254,37 @@ overflow: hidden; position: relative; padding-right:8px; - &::after{ - position: absolute; - right: 0px; - bottom: 0px; - content:"..."; - } + // &::after{ + // position: absolute; + // right: 0px; + // bottom: 0px; + // content:"..."; + // } } } .ellipsis{ margin-left: 8px; cursor: pointer; border-radius: 2px; - background-color: #c1c1c1; + height: 16px; + background: rgba(153, 153, 153, 0.2); + border-radius: 2px; padding:0px 4px; height: 14px; line-height: 14px; margin-top: 9px; i{ font-size: 15px!important; - color: #fff; + color: #333; height: 14px; line-height: 14px; } } } .listtablebody{ + border-radius:0px 0px 4px 4px ; + border: 1px solid #D0D0D0; + border-top: none; li.listtablepath{ a{color: #40a9ff;} p{ @@ -260,12 +292,15 @@ } } & > li{ - height: 42px; + height: 44px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #d9d9d9; padding:0px 20px 0px 24px; + &:hover{ + background-color: #F3F4F6; + } & > span:first-child{ width: 30%; overflow: hidden; @@ -292,8 +327,10 @@ .drawerBtn{ position: fixed; left: -13px; - border:1px solid rgb(207,205,223); - width: 34px; + width: 33px; + background: #FFFFFF; + box-shadow: 0px 0px 8px 3px rgba(0, 0, 0, 0.09); + border: 1px solid #666666; border-radius: 0px 12px 12px 0px; height: 70px; top:50%; @@ -301,63 +338,55 @@ cursor: pointer; display: flex; flex-direction: column; - align-items: flex-end; + align-items: center; justify-content: center; + padding-left: 7px; &:hover{ - box-shadow: 1px 0px 7px rgba(0,0,0,0.1); + box-shadow: 0px 0px 8px 3px rgba(0, 0, 0, 0.09); } span{ writing-mode: vertical-lr; - color: #202429; + color: #333; width: 25px; + font-size: 14px; } i{ - color: #24292e; - height: 18px; - line-height: 18px; - width: 18px; + color: #333; + height: 14px; + line-height: 14px; + width: 14px; + margin-left: 2px; + margin-bottom: 3px; } } .downMenu{ - width: 330px; - box-shadow: 0px 0px 9px rgba(134, 134, 134,0.4); + width: 329px; background-color: #fff; - .ant-menu-vertical .ant-menu-item:hover{ - background-color: #e6f7ff; + box-shadow: 0px 1px 8px 1px rgba(212, 212, 212, 0.5); + padding-bottom: 14px; + .ant-menu-item{ + height: 50px; + line-height: 50px; } } -.menuslist{ - max-height: 200px; - overflow-y: auto; - padding:10px 15px; - border-radius: 4px; - .ant-dropdown-menu-item{ - border-radius: 8px; - text-align: left!important; - a{ - width: 350px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - } - .ant-dropdown-menu-item.active{ - background-color: #e6f7ff; - } -} .catelogue{ - border:1px solid rgb(211, 211, 211); + cursor: pointer; + background: #FAFBFC; + border-radius: 4px; + border: 1px solid #D0D0D0; font-size: 15px; font-weight: normal; - border-radius: 5px; - margin-right: 10px; + margin-right: 12px; padding:0px 10px; height: 30px; line-height: 30px; color: #666!important; display: flex; align-items: center; + &:hover{ + background-color: #F3F4F6; + } span{ margin-top: 1px; } @@ -370,4 +399,24 @@ &:hover{ color: #05101a; } +} +.pinfos{ + i,a{color: #666;} + &:hover i,&:hover a{ + color: #2A61FF; + } +} +.graph{ + flex:1; + margin:0px 12px; + .ant-typography{ + white-space: pre-wrap; + margin-bottom: 0px; + } +} +.ant-anchor-wrapper{ + padding-left: 2px; + .ant-anchor-ink::before{ + background-color: #fff; + } } \ No newline at end of file diff --git a/src/forge/Main/IndexItem.js b/src/forge/Main/IndexItem.js index fcfa2d2a..d2b2c097 100644 --- a/src/forge/Main/IndexItem.js +++ b/src/forge/Main/IndexItem.js @@ -5,7 +5,7 @@ import { AlignCenter } from '../Component/layout'; import { Link } from 'react-router-dom'; import '../css/index.scss'; import Nodata from '../Nodata'; -import './list.css'; +import './list.scss'; import img_parise from '../Images/parise.png'; class IndexItem extends Component { @@ -28,14 +28,14 @@ class IndexItem extends Component { : - + }
    - + {item.author.name}/{item.name} { !item.is_public && 私有 } diff --git a/src/forge/Main/list.css b/src/forge/Main/list.css index 43df25ca..23d22d72 100644 --- a/src/forge/Main/list.css +++ b/src/forge/Main/list.css @@ -1,160 +1,193 @@ +@charset "UTF-8"; +.lineH2 { + line-height: 2; +} -.lineH2{line-height:2} .t_project_banner { /* height: 260px; background: url(../Images/banner_list.jpg) no-repeat center; */ background-color: #050d34; } -.ProjectListIndex{ + +.ProjectListIndex { width: 1200px; - margin:20px auto; + margin: 20px auto; display: flex; align-items: flex-start; - flex-wrap:wrap; + flex-wrap: wrap; } -.list-left{ + +.list-left { width: 26%; padding-right: 20px; box-sizing: border-box; margin-bottom: 20px; } -.list-left > div{ - border:1px solid #eee; -} -.list-left > div.bgcF{ - border:none; -} -.list-right{ - width:74%; - background: #fff; - padding:10px; - border:1px solid #eee; + +.list-left > div { + border: 1px solid #eee; } +.list-left > div.bgcF { + border: none; +} + +.list-right { + width: 74%; + background: #fff; + padding: 10px; + border: 1px solid #eee; +} /* 首页列表的新建和排序的下拉列表 */ -.ant-menu-inline, .ant-menu-vertical, .ant-menu-vertical-left{ - border-right: none!important; +.ant-menu-inline, .ant-menu-vertical, .ant-menu-vertical-left { + border-right: none !important; } -.ant-menu-vertical > .ant-menu-item{ - margin:0px!important; + +.ant-menu-vertical > .ant-menu-item { + margin: 0px !important; height: 35px; line-height: 35px; border-bottom: 1px solid #eee; - font-size: 14px!important; + font-size: 14px !important; } -.ant-menu-vertical > .ant-menu-item:last-child{ + +.ant-menu-vertical > .ant-menu-item:last-child { border-bottom: none; } - -.list-r-operation{ +.list-r-operation { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; - padding:25px 30px; + padding: 25px 30px; border-bottom: 1px solid #E0E0E0; } -.list-r-Search{ + +.list-r-Search { width: 400px; } -.padding0-25{ - padding:0px 25px; + +.padding0-25 { + padding: 0px 25px; } -.list-r-Search .ant-btn-lg{ + +.list-r-Search .ant-btn-lg { height: 38px; } -.list-r-Search .ant-input-group-addon{border: none !important;} -.list-r-Search .ant-input-search-button{height: 40px !important;} -.createBtn{ + +.list-r-Search .ant-input-group-addon { + border: none !important; +} + +.list-r-Search .ant-input-search-button { + height: 40px !important; +} + +.createBtn { border-radius: 4px; margin-left: 20px; display: inline-block; - padding:3px 15px; + padding: 3px 15px; background-color: #4CACFF; - color: #fff!important; + color: #fff !important; } - /* 列表 */ -.project-list{ - padding:0px 30px; +.project-list { + padding: 0px 30px; } -.border-top-grey{ - border-top: 1px solid rgba(238,238,238,1); + +.border-top-grey { + border-top: 1px solid #eeeeee; } -.p-r-Item:last-child{ - border-bottom: none !important; + +.p-r-Item:last-child { + border-bottom: none !important; } -.p-r-Item{ + +.p-r-Item { display: flex; - border-bottom:1px solid rgba(238,238,238,1); - padding:22px 0px; + border-bottom: 1px solid #eeeeee; + padding: 22px 0px; justify-content: flex-start; } -.boxShandow{ - box-shadow:0px 2px 20px 10px rgba(0,0,0,0.03); + +.boxShandow { + box-shadow: 0px 2px 20px 10px rgba(0, 0, 0, 0.03); } -.p-r-photo{ + +.p-r-photo { width: 60px; height: 60px; border-radius: 50%; margin-right: 22px; margin-top: 8px; } -.p-r-Infos{ + +.p-r-Infos { flex: 1; width: 0; } -.p-r-name{ + +.p-r-name { display: flex; justify-content: space-between; align-items: center; } -.p-r-name > p{ + +.p-r-name > p { flex: 1; width: 0; } -.p-r-btn{ + +.p-r-btn { display: flex; align-items: center; } -.p-r-btn > span{ + +.p-r-btn > span { height: 35px; line-height: 35px; - border:1px solid #f4f4f4; + border: 1px solid #f4f4f4; border-radius: 5px; display: block; margin-left: 20px; background-color: #fff; display: flex; } -.p-r-btn > span > a{ + +.p-r-btn > span > a { display: flex; align-items: center; - padding:0px 12px; - background:#ececec; + padding: 0px 12px; + background: #ececec; } -.p-r-btn > span > a:active{ + +.p-r-btn > span > a:active { background: #f4f4f4; } -.p-r-btn > span > span{ - padding:0px 8px; + +.p-r-btn > span > span { + padding: 0px 8px; } -.p-r-tags{ + +.p-r-tags { display: flex; opacity: 1; } -.p-r-tags.large > span{ + +.p-r-tags.large > span { height: 30px; line-height: 30px; font-size: 14px; } -.p-r-tags > span{ + +.p-r-tags > span { margin-left: 15px; - padding:0px 10px; - border-radius:15px; + padding: 0px 10px; + border-radius: 15px; background: #EBF4FE; color: #333; height: 24px; @@ -163,152 +196,191 @@ font-size: 12px; display: flex; } -.p-r-tags > span.pariseTag{ + +.p-r-tags > span.pariseTag { background: #FFF3DC; } -.p-r-tags.large > span >label{ - padding:0px 12px; + +.p-r-tags.large > span > label { + padding: 0px 12px; } -.p-r-tags > span >label{ - padding:0px 8px; + +.p-r-tags > span > label { + padding: 0px 8px; } -.p-r-tags.large > span >span{ - padding:0px 6px; + +.p-r-tags.large > span > span { + padding: 0px 6px; } -.pariseImg{ + +.pariseImg { width: 14px; height: 12px; margin-top: 6px; margin-right: 3px; } -.p-r-tags > span >span{ + +.p-r-tags > span > span { display: block; background: #fff; border-left: #efefef; - padding:0px 4px; + padding: 0px 4px; border-radius: 0px 4px 4px 0px; color: #999; } -.p-r-content{ - margin-top:10px; + +.p-r-content { + margin-top: 10px; color: #666; display: flex; } -.p-r-detail > span{ + +.p-r-detail > span { margin-right: 22px; color: #888; } -.p-r-detail > span > label{ + +.p-r-detail > span > label { color: #999; } -.p-r-about{ +.p-r-about { display: flex; justify-content: space-between; flex-wrap: nowrap; margin-top: 8px; color: #666; } -.spincontent{ - height:400px; + +.spincontent { + height: 400px; } -.spinstyle .ant-spin-text{ - margin-top:30px; + +.spinstyle .ant-spin-text { + margin-top: 30px; color: #888; } + /* -----------详情------------ */ -.detailHeader-wrapper{ - background-color:#FAFBFC; - /* background: url(../Images/forgeBanner.jpg) no-repeat center; */ - /* background-size:cover; */ +.detailHeader-wrapper { + background-color: #FBFCFF; + border-bottom: 1px solid #e2e2e2; } -.headerMenu-wrapper{ - font-size: 16px; + +.headerMenu-wrapper { display: flex; flex-direction: row; + cursor: pointer; } -.headerMenu-wrapper li{ +.headerMenu-wrapper li { position: relative; text-align: center; + padding: 0px; +} +.headerMenu-wrapper li > a { + font-size: 14px; height: 40px; line-height: 28px; - margin-right: 40px; -} -.headerMenu-wrapper li a{ + padding: 0px 20px; + display: block; color: #666; } -.headerMenu-wrapper li a > img{ +.headerMenu-wrapper li > a > img { margin-right: 8px; } -.headerMenu-wrapper li a > span.num{ - height: 28px; - line-height: 29px; - margin-left: 8px; +.headerMenu-wrapper li > a > span.num { + line-height: 24px; + margin-left: 5px; + margin-top: 2px; font-size: 12px; - color: #2878FF; float: right; + color: #666 !important; + background-color: rgba(153, 153, 153, 0.13); + border-radius: 50%; + width: 24px; + height: 24px; } -.headerMenu-wrapper li.active::after{ +.headerMenu-wrapper li.active a, .headerMenu-wrapper li.active a i { + color: #466AFF !important; +} +.headerMenu-wrapper li.active::after, .headerMenu-wrapper li:hover::after { position: absolute; - bottom:0px; - height:2px; - background-color: #5091FF; - content:''; + bottom: 0px; + height: 2px; + background-color: rgba(153, 153, 153, 0.2); + content: ""; left: 0px; - width:100%; + width: 100%; } -.detail_tag_btn{ - height:26px; - line-height: 26px; - border-radius:5px; - border:1px solid #f1f1f1; +.headerMenu-wrapper li.active::after { + background-color: #466AFF; +} + +.detail_tag_btn { + height: 32px; + line-height: 32px; + border-radius: 5px; + border: 1px solid #D0D0D0; display: flex; align-items: center; - margin-left: 30px; - padding:0px; - background-color: transparent; + margin-left: 10px; + padding: 0px; + background-color: #FAFBFC; box-shadow: none; } -.ant-tooltip { - max-width: fit-content!important; +.detail_tag_btn:hover { + background-color: #F3F4F6; } -.detail_tag_btn_name{ - padding:0px 10px; - color: #666!important; +.detail_tag_btn .detail_tag_btn_name { + padding: 0px 18px; + min-width: 82px; + text-align: center; } -.detail_tag_btn_name img{ +.detail_tag_btn .detail_tag_btn_name:hover > span { + color: #333 !important; +} +.detail_tag_btn .detail_tag_btn_name img { margin-right: 10px; } -.detail_tag_btn_count{ - padding:0px 10px; +.detail_tag_btn .detail_tag_btn_count { + width: 42px; + text-align: center; background: #fff; border-radius: 0px 4px 4px 0px; - font-size: 12px; - height:100%; + height: 100%; + border-left: 1px solid #D0D0D0; } -.files-md{ - padding:20px; + +.ant-tooltip { + max-width: fit-content !important; } + +.files-md { + padding: 20px; +} + /* 详情-代码 */ -.branch-wrapper{ - border:1px solid #eee; +.branch-wrapper { + border: 1px solid #eee; border-radius: 4px; display: flex; align-items: center; height: 60px; - padding:0px 30px; + padding: 0px 30px; width: 1200px; - margin:0px auto; + margin: 0px auto; background-color: #fff; margin-top: 20px; justify-content: space-between; } -.branch-wrapper > a >i{ + +.branch-wrapper > a > i { color: #5091FF; margin-right: 5px; cursor: default; } -.branch-wrapper a{ + +.branch-wrapper a { display: flex; align-items: center; justify-content: center; @@ -319,417 +391,521 @@ font-size: 16px; color: #333333; } -.branch-wrapper a > span{ + +.branch-wrapper a > span { position: relative; min-height: 20px; display: block; } -.branch-wrapper a.active > span::after{ + +.branch-wrapper a.active > span::after { position: absolute; - content: ''; + content: ""; bottom: -5px; width: 30px; height: 3px; left: 0px; - background-color:#5091FF; + background-color: #5091FF; } - -.gitAddressClone{ +.gitAddressClone { + margin: 0px 20px 14px 20px !important; display: flex; height: 40px; align-items: center; border-radius: 4px; - border:1px solid #eee; + border: 1px solid #eee; background: #fff; margin-left: 20px; position: relative; } -.gitAddressClone > span{ + +.gitAddressClone > span { display: flex; line-height: 40px; height: 40px; - padding:0px 12px; + padding: 0px 12px; cursor: pointer; align-items: center; } -.addressTips{ + +.addressTips { position: absolute; font-size: 12px; color: #FF6E21; - top:-34px; + top: -34px; left: 30px; background-color: #fff; - border:1px solid #FE881D; - padding:0px 5px; + border: 1px solid #FE881D; + padding: 0px 5px; height: 28px; line-height: 28px; } -.addressTips>span{position: relative;display: block;} -.addressTips>span::before{ + +.addressTips > span { + position: relative; + display: block; +} + +.addressTips > span::before { box-sizing: content-box; width: 0px; height: 0px; position: absolute; top: 25px; - left:50%; + left: 50%; margin-left: -4px; - padding:0; - border-top:8px solid #FFFFFF; - border-bottom:8px solid transparent; - border-left:8px solid transparent; - border-right:8px solid transparent; + padding: 0; + border-top: 8px solid #FFFFFF; + border-bottom: 8px solid transparent; + border-left: 8px solid transparent; + border-right: 8px solid transparent; display: block; - content:''; + content: ""; z-index: 12; } -.addressTips>span::after{ + +.addressTips > span::after { box-sizing: content-box; width: 0px; height: 0px; position: absolute; top: 26px; - left:50%; + left: 50%; margin-left: -4px; - padding:0; - border-top:8px solid #FE881D; - border-bottom:8px solid transparent; - border-left:8px solid transparent; - border-right:8px solid transparent; + padding: 0; + border-top: 8px solid #FE881D; + border-bottom: 8px solid transparent; + border-left: 8px solid transparent; + border-right: 8px solid transparent; display: block; - content:''; + content: ""; z-index: 11; } -.gitAddressClone > span.addressType{ + +.gitAddressClone > span.addressType { color: #4CACFF; } -.gitAddressClone > span:last-child{ + +.gitAddressClone > span:last-child { border-right: none; } -.gitAddressClone > input{ - border:none; + +.gitAddressClone > input { + border: none; outline: none; - padding:0px 8px; + padding: 0px 8px; height: 40px; line-height: 40px; border-radius: 0px; border: 1px solid #eee; - flex:1; + flex: 1; } -.wrap-commit-table .ant-table-small > .ant-table-content > .ant-table-body{ - margin:0px; + +.wrap-commit-table .ant-table-small > .ant-table-content > .ant-table-body { + margin: 0px; } -.wrap-commit-table .ant-table-title{ - background-color: rgba(241,248,255,1); - padding: 13px 16px!important; + +.wrap-commit-table .ant-table-title { + background-color: #f1f8ff; + padding: 13px 16px !important; } -.commitKey{ + +.commitKey { cursor: pointer; - border:1px solid #FD7700; - background-color:#FFF3DC; - color: #FD7700!important; - padding:0px 12px; + border: 1px solid #FD7700; + background-color: #FFF3DC; + color: #FD7700 !important; + padding: 0px 12px; height: 20px; line-height: 20px; - margin-left:15px; + margin-left: 15px; border-radius: 18px; max-width: 100%; } + /* 分支 */ -.branchTitle{ - padding:8px 10px; +.branchTitle { + padding: 8px 10px; color: #333; font-size: 16px; border-bottom: 1px solid #d9d9d9; } -.branchUl li{ + +.branchUl li { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; - padding:20px 0px; + padding: 20px 0px; border-bottom: 1px solid #eee; } -.branchUl li:last-child{ + +.branchUl li:last-child { border-bottom: none; } -.operationBtn{ - border:1px solid #f4f4f4; + +.operationBtn { + border: 1px solid #f4f4f4; border-radius: 3px; - padding:0px 6px; - background-color:#fff; - color:#666!important; + padding: 0px 6px; + background-color: #fff; + color: #666 !important; display: inline-block; } -.messages{ + +.messages { max-width: 700px; } -.leftPoint{ + +.leftPoint { margin-left: 20px; position: relative; } -.leftPoint::before{ + +.leftPoint::before { position: absolute; left: -10px; - top:8px; + top: 8px; border-radius: 50%; width: 4px; height: 4px; background-color: #dadada; - content: ''; + content: ""; } /* 文件目录、文件内容 */ -.subFileName{ +.subFileName { position: relative; margin-left: 15px; height: 22px; } -.subFileName::before{ + +.subFileName::before { position: absolute; - content: '/'; + content: "/"; left: -10px; top: 0px; color: #999; height: 22px; line-height: 22px; } -.addFile{ + +.addFile { display: flex; } -.addFile a{ + +.addFile a { display: block; - background-color: rgb(76, 172, 255,0.8); + background-color: rgba(76, 172, 255, 0.8); color: #fff; cursor: pointer; height: 32px; line-height: 32px; padding: 0px 10px; } -.addFile a:first-child{ + +.addFile a:first-child { border-radius: 4px; } -.addFile a:last-child{ + +.addFile a:last-child { /* border-radius: 0px 4px 4px 0px; */ border-left: 1px solid rgba(247, 247, 247, 0.3); } -.addFile a:active{ - background-color: rgb(76, 172, 255,1); + +.addFile a:active { + background-color: #4cacff; } - - -@media screen and (max-width: 750px){ - .list-r-Search{ +@media screen and (max-width: 750px) { + .list-r-Search { flex: 1; } - .list-left,.list-right{ + + .list-left, .list-right { width: 100%; padding: 0px; } } - -@media screen and (max-width: 400px){ - .list-r-Search{ +@media screen and (max-width: 400px) { + .list-r-Search { width: 100%; } - .headerMenu-wrapper{ + + .headerMenu-wrapper { flex-direction: column; width: 100%; } - .headerMenu-wrapper li{ + + .headerMenu-wrapper li { width: 100%; } - .gitAddressClone{ - width:100%; + + .gitAddressClone { + width: 100%; margin-left: 0px; } - .gitAddressClone > span{ - padding:0px; + + .gitAddressClone > span { + padding: 0px; } - .messages{ + + .messages { max-width: 100%; } } -.commonBox{ - border:1px solid #ddd; +.commonBox { + border: 1px solid #ddd; margin-top: 30px; border-radius: 4px; } -.commonBox .commonBox-title{ - padding:0px 20px; + +.commonBox .commonBox-title { + padding: 0px 20px; box-sizing: border-box; font-size: 16px; - background: #FAFBFC;/* F1F8FF */ + background: #FAFBFC; + /* F1F8FF */ font-weight: bold; height: 45px; line-height: 45px; border-bottom: 1px solid #d9d9d9; border-radius: 4px 4px 0px 0px; } -.commonBox .commonBox-title.boxTitle{ + +.readBox { + border: none; +} +.readBox.commonBox .commonBox-info { + border: 1px solid #D0D0D0; + border-top: none; + border-radius: 0px 0px 4px 4px; + padding: 20px 38px; +} + +.commonBox .commonBox-title.boxTitle { display: flex; justify-content: space-between; + height: 55px; + line-height: 55px; + background: #FAFCFF; + border-radius: 4px 4px 0px 0px; + border: 1px solid rgba(42, 97, 255, 0.23); } -.synchronism{ + +.synchronism { display: block; - height: 26px; - line-height: 26px; - padding:0px 15px; - color: #fff!important; + height: 34px; + line-height: 34px; + padding: 0px 15px; + color: #fff !important; background-color: #28BD6C; border-radius: 4px; } -.files_info{ + +.files_info { cursor: pointer; } -.commonBox .commonBox-info{ - padding:20px 15px; -} -.commonBox-title-read{vertical-align: middle;color: #666;} -@media screen and (max-width: 370px){ - .p-r-tags,.p-r-btn{ +.commonBox .commonBox-info { + padding: 20px 15px; +} + +.commonBox-title-read { + vertical-align: middle; + color: #000; + font-size: 14px; +} +.commonBox-title-read:hover { + color: #466AFF; +} + +@media screen and (max-width: 370px) { + .p-r-tags, .p-r-btn { opacity: 0; display: none; } - .p-r-about{ + + .p-r-about { flex-wrap: wrap; } - .commitKey{ + + .commitKey { margin-right: 0px; } - .list-r-Search{ + + .list-r-Search { width: 100%; } } -.null_data_box{ +.null_data_box { width: 100%; border: 1px solid #d4d4d5; - border-radius:3px ; + border-radius: 3px; } -.title{ + +.title { font-weight: bold; background: #f4f4f4; padding: 10px 15px; box-sizing: border-box; border-bottom: 1px solid #d4d4d5; } -.item_title{ - font-size:18px; + +.item_title { + font-size: 18px; font-weight: bold; margin-bottom: 15px; } -.item{ + +.item { padding: 15px; - border-bottom: 1px solid #dededf; + border-bottom: 1px solid #dededf; } -.item:last-child{ - border-bottom:none; + +.item:last-child { + border-bottom: none; } -.gitAddressClone{ - margin: 0 !important; -} -.item_title small{ + +.item_title small { font-weight: 400; margin-left: 10px; - } -.item_title small a{ + +.item_title small a { color: #4183c6; } -.Markdown{ + +.Markdown { background: #f7f7f7; padding: 10px 20px; } -.item .gitAddressClone input:focus{ -border: 1px solid #2185d0; -} -.content-file{margin-top: 8px;} -.content-file .CodeMirror{ +.item .gitAddressClone input:focus { + border: 1px solid #2185d0; +} + +.content-file { + margin-top: 8px; +} + +.content-file .CodeMirror { background-color: #f7f7f7; border: 1px solid #e4e4e4; border-radius: 4px; height: auto; } -.content-file.edit .CodeMirror{ + +.content-file.edit .CodeMirror { background-color: #fff; } -.content-file .CodeMirror .CodeMirror-scroll{ + +.content-file .CodeMirror .CodeMirror-scroll { min-height: 450px; } -.text-center{text-align: center;} -.fork-css{ + +.text-center { + text-align: center; +} + +.fork-css { position: absolute; left: 0; top: 50px; width: 100%; } -.color-grey-ccc{ + +.color-grey-ccc { color: #ccc !important; } -a.color-grey-ccc:hover{ + +a.color-grey-ccc:hover { color: #4cacff !important; } -.pull-right{float: right;} -.commitList{ - padding:0px 30px; +.pull-right { + float: right; +} + +.commitList { + padding: 0px 30px; min-height: 400px; } -.commitList > div{ + +.commitList > div { border-bottom: 1px solid #EEEEEE; - padding:16px 0px; + padding: 16px 0px; } -.commitList > div:last-child{ + +.commitList > div:last-child { border-bottom: none; } - /* 标签列表 */ -.div_table{ - border:1px solid #eee; +.div_table { + border: 1px solid #eee; border-radius: 2px; } -.ul_thead{ - padding:0px 30px; + +.ul_thead { + padding: 0px 30px; box-sizing: border-box; background: #FAFAFA; border-bottom: 1px solid #eee; height: 50px; line-height: 50px; } -.ul_tbody{ - padding:0px 30px; + +.ul_tbody { + padding: 0px 30px; } -.ul_thead li, .ul_tbody li{ + +.ul_thead li, .ul_tbody li { display: flex; align-items: center; - text-align: left + text-align: left; } -.ul_tbody li{ - padding:18px 0px; + +.ul_tbody li { + padding: 18px 0px; border-bottom: 1px solid #eee; } -.ul_tbody li:last-child{ + +.ul_tbody li:last-child { border-bottom: none; } -.ul_thead li > span , .ul_tbody li > span{ + +.ul_thead li > span, .ul_tbody li > span { width: 20%; padding-right: 20px; } -.ul_thead li > span:nth-child(2), .ul_tbody li > span:nth-child(2){ - flex:1; + +.ul_thead li > span:nth-child(2), .ul_tbody li > span:nth-child(2) { + flex: 1; } -.ul_tbody_third{ + +.ul_tbody_third { display: flex; flex-direction: column; align-items: flex-start; justify-content: left; } -.ul_tbody_forth{ + +.ul_tbody_forth { text-align: center; display: flex; justify-content: center; -} \ No newline at end of file +} + +.depotNum { + color: #666 !important; +} +.depotNum span:last-child { + color: #333; +} +.depotNum:hover span:last-child { + color: #2A61FF; +} + +/*# sourceMappingURL=list.css.map */ diff --git a/src/forge/Main/list.css.map b/src/forge/Main/list.css.map new file mode 100644 index 00000000..8c8094b9 --- /dev/null +++ b/src/forge/Main/list.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["list.scss"],"names":[],"mappings":";AACA;EAAQ;;;AACR;AACE;AAAA;EAEA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;EACA;;;AAIF;AACA;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAIF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EAAsC;;;AACtC;EAAwC;;;AACxC;EACE;EACA;EACA;EACA;EACA;EACA;;;AAIF;AACA;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;;;AAEF;AACA;EACE;EACA;;;AAEF;EACE;EACA;EACA;;AACA;EACE;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACE;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;;;AAIN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAEF;EACE;EACA;EACA;;AACA;EACE;;AAEF;EACE;;AAGJ;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACE;;;AAEF;EACE;;;AAEF;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAIF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EAAkB;EAAmB;;;AACrC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;AACA;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;AACA;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;AACE;EACA;;;AAEF;EACE;;;AAKF;EACE;IACE;;;EAEF;IACE;IACA;;;AAIJ;EACE;IACE;;;EAEF;IACE;IACA;;;EAEF;IACE;;;EAEF;IACE;IACA;;;EAEF;IACE;;;EAEF;IACE;;;AAGJ;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;AAAoB;EACpB;EACA;EACA;EACA;EACA;;;AAEF;EACE;;AACA;EACE;EACA;EACA;EACA;;;AAGJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAGA;EACE;;;AAGJ;EACE;EACA;EACA;;AACA;EACE;;;AAIJ;EACE;IACE;IACA;;;EAEF;IACE;;;EAEF;IACE;;;EAEF;IACE;;;AAGJ;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AAGF;EACE;EACA;;;AAGF;EACE;;;AAEF;EACE;EACA;;;AAEF;EACA;;;AAEA;EAAc;;;AAEd;EACE;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EAAa;;;AACb;EACE;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EAAY;;;AAEZ;EACE;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AAIF;AACA;EACE;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;;AACA;EACE;;AAEF;EACE","file":"list.css"} \ No newline at end of file diff --git a/src/forge/Main/list.scss b/src/forge/Main/list.scss new file mode 100644 index 00000000..5c842660 --- /dev/null +++ b/src/forge/Main/list.scss @@ -0,0 +1,786 @@ + +.lineH2{line-height:2} +.t_project_banner { + /* height: 260px; + background: url(../Images/banner_list.jpg) no-repeat center; */ + background-color: #050d34; +} +.ProjectListIndex{ + width: 1200px; + margin:20px auto; + display: flex; + align-items: flex-start; + flex-wrap:wrap; +} +.list-left{ + width: 26%; + padding-right: 20px; + box-sizing: border-box; + margin-bottom: 20px; +} +.list-left > div{ + border:1px solid #eee; +} +.list-left > div.bgcF{ + border:none; +} +.list-right{ + width:74%; + background: #fff; + padding:10px; + border:1px solid #eee; +} + + +/* 首页列表的新建和排序的下拉列表 */ +.ant-menu-inline, .ant-menu-vertical, .ant-menu-vertical-left{ + border-right: none!important; +} +.ant-menu-vertical > .ant-menu-item{ + margin:0px!important; + height: 35px; + line-height: 35px; + border-bottom: 1px solid #eee; + font-size: 14px!important; +} +.ant-menu-vertical > .ant-menu-item:last-child{ + border-bottom: none; +} + + +.list-r-operation{ + display: flex; + justify-content: space-between; + flex-wrap: wrap; + align-items: center; + padding:25px 30px; + border-bottom: 1px solid #E0E0E0; +} +.list-r-Search{ + width: 400px; +} +.padding0-25{ + padding:0px 25px; +} +.list-r-Search .ant-btn-lg{ + height: 38px; +} +.list-r-Search .ant-input-group-addon{border: none !important;} +.list-r-Search .ant-input-search-button{height: 40px !important;} +.createBtn{ + border-radius: 4px; + margin-left: 20px; + display: inline-block; + padding:3px 15px; + background-color: #4CACFF; + color: #fff!important; +} + + +/* 列表 */ +.project-list{ + padding:0px 30px; +} +.border-top-grey{ + border-top: 1px solid rgba(238,238,238,1); +} +.p-r-Item:last-child{ + border-bottom: none !important; +} +.p-r-Item{ + display: flex; + border-bottom:1px solid rgba(238,238,238,1); + padding:22px 0px; + justify-content: flex-start; +} +.boxShandow{ + box-shadow:0px 2px 20px 10px rgba(0,0,0,0.03); +} +.p-r-photo{ + width: 60px; + height: 60px; + border-radius: 50%; + margin-right: 22px; + margin-top: 8px; +} +.p-r-Infos{ + flex: 1; + width: 0; +} +.p-r-name{ + display: flex; + justify-content: space-between; + align-items: center; +} +.p-r-name > p{ + flex: 1; + width: 0; +} +.p-r-btn{ + display: flex; + align-items: center; +} +.p-r-btn > span{ + height: 35px; + line-height: 35px; + border:1px solid #f4f4f4; + border-radius: 5px; + display: block; + margin-left: 20px; + background-color: #fff; + display: flex; +} +.p-r-btn > span > a{ + display: flex; + align-items: center; + padding:0px 12px; + background:#ececec; +} +.p-r-btn > span > a:active{ + background: #f4f4f4; +} +.p-r-btn > span > span{ + padding:0px 8px; +} +.p-r-tags{ + display: flex; + opacity: 1; +} +.p-r-tags.large > span{ + height: 30px; + line-height: 30px; + font-size: 14px; +} +.p-r-tags > span{ + margin-left: 15px; + padding:0px 10px; + border-radius:15px; + background: #EBF4FE; + color: #333; + height: 24px; + line-height: 24px; + display: block; + font-size: 12px; + display: flex; +} +.p-r-tags > span.pariseTag{ + background: #FFF3DC; +} +.p-r-tags.large > span >label{ + padding:0px 12px; +} +.p-r-tags > span >label{ + padding:0px 8px; +} +.p-r-tags.large > span >span{ + padding:0px 6px; +} +.pariseImg{ + width: 14px; + height: 12px; + margin-top: 6px; + margin-right: 3px; +} +.p-r-tags > span >span{ + display: block; + background: #fff; + border-left: #efefef; + padding:0px 4px; + border-radius: 0px 4px 4px 0px; + color: #999; +} +.p-r-content{ + margin-top:10px; + color: #666; + display: flex; +} +.p-r-detail > span{ + margin-right: 22px; + color: #888; +} +.p-r-detail > span > label{ + color: #999; +} + +.p-r-about{ + display: flex; + justify-content: space-between; + flex-wrap: nowrap; + margin-top: 8px; + color: #666; +} +.spincontent{ + height:400px; +} +.spinstyle .ant-spin-text{ + margin-top:30px; + color: #888; +} +/* -----------详情------------ */ +.detailHeader-wrapper{ + background-color:#FBFCFF; + border-bottom:1px solid #e2e2e2; +} +.headerMenu-wrapper{ + display: flex; + flex-direction: row; + cursor: pointer; + li{ + position: relative; + text-align: center; + padding:0px; + & > a{ + font-size: 14px; + height: 40px; + line-height: 28px; + padding:0px 20px; + display: block; + color: #666; + &> img{ + margin-right: 8px; + } + &> span.num{ + line-height: 24px; + margin-left: 5px; + margin-top: 2px; + font-size: 12px; + float: right; + color: #666!important; + background-color: rgba(153, 153, 153, 0.13);; + border-radius: 50%; + width: 24px; + height: 24px; + } + } + &.active a,&.active a i{ + color: #2A61FF!important; + } + &.active::after,&:hover::after{ + position: absolute; + bottom:0px; + height:2px; + background-color:rgba(153, 153, 153, 0.2); + content:''; + left: 0px; + width:100%; + } + &.active::after{ + background-color: #2A61FF; + } + } +} +.detail_tag_btn{ + height:32px; + line-height: 32px; + border-radius:5px; + border:1px solid #D0D0D0; + display: flex; + align-items: center; + margin-left: 10px; + padding:0px; + background-color:#FAFBFC; + box-shadow: none; + &:hover{ + background-color: #F3F4F6; + } + .detail_tag_btn_name{ + padding:0px 18px; + min-width: 82px; + text-align: center; + &:hover>span{ + color: #333!important; + } + img{ + margin-right: 10px; + } + } + .detail_tag_btn_count{ + width: 42px; + text-align: center; + background: #fff; + border-radius: 0px 4px 4px 0px; + height:100%; + border-left: 1px solid #D0D0D0; + } +} +.ant-tooltip { + max-width: fit-content!important; +} +.files-md{ + padding:20px; +} +/* 详情-代码 */ +.branch-wrapper{ + border:1px solid #eee; + border-radius: 4px; + display: flex; + align-items: center; + height: 60px; + padding:0px 30px; + width: 1200px; + margin:0px auto; + background-color: #fff; + margin-top: 20px; + justify-content: space-between; +} +.branch-wrapper > a >i{ + color: #5091FF; + margin-right: 5px; + cursor: default; +} +.branch-wrapper a{ + display: flex; + align-items: center; + justify-content: center; + text-align: center; + height: 30px; + line-height: 30px; + cursor: pointer; + font-size: 16px; + color: #333333; +} +.branch-wrapper a > span{ + position: relative; + min-height: 20px; + display: block; +} +.branch-wrapper a.active > span::after{ + position: absolute; + content: ''; + bottom: -5px; + width: 30px; + height: 3px; + left: 0px; + background-color:#5091FF; +} + + +.gitAddressClone{ + margin:0px 20px 14px 20px!important; + display: flex; + height: 40px; + align-items: center; + border-radius: 4px; + border:1px solid #eee; + background: #fff; + margin-left: 20px; + position: relative; +} +.gitAddressClone > span{ + display: flex; + line-height: 40px; + height: 40px; + padding:0px 12px; + cursor: pointer; + align-items: center; +} +.addressTips{ + position: absolute; + font-size: 12px; + color: #FF6E21; + top:-34px; + left: 30px; + background-color: #fff; + border:1px solid #FE881D; + padding:0px 5px; + height: 28px; + line-height: 28px; +} +.addressTips>span{position: relative;display: block;} +.addressTips>span::before{ + box-sizing: content-box; + width: 0px; + height: 0px; + position: absolute; + top: 25px; + left:50%; + margin-left: -4px; + padding:0; + border-top:8px solid #FFFFFF; + border-bottom:8px solid transparent; + border-left:8px solid transparent; + border-right:8px solid transparent; + display: block; + content:''; + z-index: 12; +} +.addressTips>span::after{ + box-sizing: content-box; + width: 0px; + height: 0px; + position: absolute; + top: 26px; + left:50%; + margin-left: -4px; + padding:0; + border-top:8px solid #FE881D; + border-bottom:8px solid transparent; + border-left:8px solid transparent; + border-right:8px solid transparent; + display: block; + content:''; + z-index: 11; +} +.gitAddressClone > span.addressType{ + color: #4CACFF; +} +.gitAddressClone > span:last-child{ + border-right: none; +} +.gitAddressClone > input{ + border:none; + outline: none; + padding:0px 8px; + height: 40px; + line-height: 40px; + border-radius: 0px; + border: 1px solid #eee; + flex:1; +} +.wrap-commit-table .ant-table-small > .ant-table-content > .ant-table-body{ + margin:0px; +} +.wrap-commit-table .ant-table-title{ + background-color: rgba(241,248,255,1); + padding: 13px 16px!important; +} +.commitKey{ + cursor: pointer; + border:1px solid #FD7700; + background-color:#FFF3DC; + color: #FD7700!important; + padding:0px 12px; + height: 20px; + line-height: 20px; + margin-left:15px; + border-radius: 18px; + max-width: 100%; +} +/* 分支 */ +.branchTitle{ + padding:8px 10px; + color: #333; + font-size: 16px; + border-bottom: 1px solid #d9d9d9; +} +.branchUl li{ + display: flex; + flex-wrap: wrap; + align-items: flex-end; + justify-content: space-between; + padding:20px 0px; + border-bottom: 1px solid #eee; +} +.branchUl li:last-child{ + border-bottom: none; +} +.operationBtn{ + border:1px solid #f4f4f4; + border-radius: 3px; + padding:0px 6px; + background-color:#fff; + color:#666!important; + display: inline-block; +} +.messages{ + max-width: 700px; +} +.leftPoint{ + margin-left: 20px; + position: relative; +} +.leftPoint::before{ + position: absolute; + left: -10px; + top:8px; + border-radius: 50%; + width: 4px; + height: 4px; + background-color: #dadada; + content: ''; +} + +/* 文件目录、文件内容 */ +.subFileName{ + position: relative; + margin-left: 15px; + height: 22px; +} +.subFileName::before{ + position: absolute; + content: '/'; + left: -10px; + top: 0px; + color: #999; + height: 22px; + line-height: 22px; +} +.addFile{ + display: flex; +} +.addFile a{ + display: block; + background-color: rgba(76, 172, 255,0.8); + color: #fff; + cursor: pointer; + height: 32px; + line-height: 32px; + padding: 0px 10px; +} +.addFile a:first-child{ + border-radius: 4px; +} +.addFile a:last-child{ + /* border-radius: 0px 4px 4px 0px; */ + border-left: 1px solid rgba(247, 247, 247, 0.3); +} +.addFile a:active{ + background-color: rgba(76, 172, 255,1); +} + + + +@media screen and (max-width: 750px){ + .list-r-Search{ + flex: 1; + } + .list-left,.list-right{ + width: 100%; + padding: 0px; + } +} + +@media screen and (max-width: 400px){ + .list-r-Search{ + width: 100%; + } + .headerMenu-wrapper{ + flex-direction: column; + width: 100%; + } + .headerMenu-wrapper li{ + width: 100%; + } + .gitAddressClone{ + width:100%; + margin-left: 0px; + } + .gitAddressClone > span{ + padding:0px; + } + .messages{ + max-width: 100%; + } +} +.commonBox{ + border:1px solid #ddd; + margin-top: 30px; + border-radius: 4px; +} +.commonBox .commonBox-title{ + padding:0px 20px; + box-sizing: border-box; + font-size: 16px; + background: #FAFBFC;/* F1F8FF */ + font-weight: bold; + height: 45px; + line-height: 45px; + border-bottom: 1px solid #d9d9d9; + border-radius: 4px 4px 0px 0px; +} +.readBox{ + border:none; + &.commonBox .commonBox-info{ + border:1px solid #D0D0D0; + border-top: none; + border-radius: 0px 0px 4px 4px; + padding:20px 38px; + } +} +.commonBox .commonBox-title.boxTitle{ + display: flex; + justify-content: space-between; + height: 65px; + line-height: 65px; + background: #FAFCFF; + border-radius: 4px 4px 0px 0px; + border: 1px solid rgba(42, 97, 255, 0.23); +} +.synchronism{ + display: block; + height: 34px; + line-height: 34px; + padding:0px 15px; + color: #fff!important; + background-color: #28BD6C; + border-radius: 4px; +} +.files_info{ + cursor: pointer; +} +.commonBox { + .commonBox-info{ + padding:20px 15px; + } +} +.commonBox-title-read{ + vertical-align: middle; + color: #666; + font-size: 14px; + &:hover { + color: #466AFF; + } +} + +@media screen and (max-width: 370px){ + .p-r-tags,.p-r-btn{ + opacity: 0; + display: none; + } + .p-r-about{ + flex-wrap: wrap; + } + .commitKey{ + margin-right: 0px; + } + .list-r-Search{ + width: 100%; + } +} +.null_data_box{ + width: 100%; + border: 1px solid #d4d4d5; + border-radius:3px ; +} +.title{ + font-weight: bold; + background: #f4f4f4; + padding: 10px 15px; + box-sizing: border-box; + border-bottom: 1px solid #d4d4d5; +} +.item_title{ + font-size:18px; + font-weight: bold; + margin-bottom: 15px; +} +.item{ + padding: 15px; + border-bottom: 1px solid #dededf; +} +.item:last-child{ + border-bottom:none; +} + +.item_title small{ + font-weight: 400; + margin-left: 10px; + +} +.item_title small a{ + color: #4183c6; +} +.Markdown{ + background: #f7f7f7; + padding: 10px 20px; +} +.item .gitAddressClone input:focus{ +border: 1px solid #2185d0; +} +.content-file{margin-top: 8px;} + +.content-file .CodeMirror{ + background-color: #f7f7f7; + border: 1px solid #e4e4e4; + border-radius: 4px; + height: auto; +} +.content-file.edit .CodeMirror{ + background-color: #fff; +} +.content-file .CodeMirror .CodeMirror-scroll{ + min-height: 450px; +} +.text-center{text-align: center;} +.fork-css{ + position: absolute; + left: 0; + top: 50px; + width: 100%; +} +.color-grey-ccc{ + color: #ccc !important; +} +a.color-grey-ccc:hover{ + color: #4cacff !important; +} +.pull-right{float: right;} + +.commitList{ + padding:0px 30px; + min-height: 400px; +} +.commitList > div{ + border-bottom: 1px solid #EEEEEE; + padding:16px 0px; +} +.commitList > div:last-child{ + border-bottom: none; +} + + +/* 标签列表 */ +.div_table{ + border:1px solid #eee; + border-radius: 2px; +} +.ul_thead{ + padding:0px 30px; + box-sizing: border-box; + background: #FAFAFA; + border-bottom: 1px solid #eee; + height: 50px; + line-height: 50px; +} +.ul_tbody{ + padding:0px 30px; +} +.ul_thead li, .ul_tbody li{ + display: flex; + align-items: center; + text-align: left +} +.ul_tbody li{ + padding:18px 0px; + border-bottom: 1px solid #eee; +} +.ul_tbody li:last-child{ + border-bottom: none; +} +.ul_thead li > span , .ul_tbody li > span{ + width: 20%; + padding-right: 20px; +} +.ul_thead li > span:nth-child(2), .ul_tbody li > span:nth-child(2){ + flex:1; +} +.ul_tbody_third{ + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: left; +} +.ul_tbody_forth{ + text-align: center; + display: flex; + justify-content: center; +} +.depotNum{ + color: #666!important; + span:last-child{ + color: #333; + } + &:hover span:last-child{ + color: #2A61FF; + } +} \ No newline at end of file diff --git a/src/forge/Main/sub/Contribute.jsx b/src/forge/Main/sub/Contribute.jsx index f65b4524..76d56dc8 100644 --- a/src/forge/Main/sub/Contribute.jsx +++ b/src/forge/Main/sub/Contribute.jsx @@ -52,7 +52,7 @@ function Contribute(props){
    - {item.name} + {item.name}

    提交{item.contributions}次

    diff --git a/src/forge/Main/sub/DetailBanner.jsx b/src/forge/Main/sub/DetailBanner.jsx index e0ca4db1..1dfec532 100644 --- a/src/forge/Main/sub/DetailBanner.jsx +++ b/src/forge/Main/sub/DetailBanner.jsx @@ -1,6 +1,7 @@ import React, { useEffect, useState } from 'react'; import { Skeleton , Tooltip} from 'antd'; import { Link } from 'react-router-dom'; +import { numFormat } from 'educoder'; function DetailBanner({ history,list , owner , projectsId , isManager , url , pathname , state , urlFlag , projectDetail , platform ,open_devops }){ const [ menuName , setMenuName ] = useState(undefined); @@ -10,14 +11,14 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa if(pathname && pathname==="source"){ let a = list.filter(item=>item.menu_name === "resources"); if(a && a.length === 0){ - history.push(`/projects/${owner}/${projectsId}`); + history.push(`/${owner}/${projectsId}`); } } setMenuName(list); } },[list]); return( -
    +
    { menuName && projectDetail ?
      @@ -28,7 +29,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa { item.menu_name === "home" &&
    • - + 主页 @@ -37,7 +38,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa { item.menu_name === "code" &&
    • - + 代码库 @@ -47,10 +48,10 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa item.menu_name === "issues" &&
    • - + 易修 - {projectDetail && projectDetail.issues_count ? {projectDetail.issues_count} : ""} + {projectDetail && projectDetail.issues_count ? {numFormat(projectDetail.issues_count)} : ""}
    • @@ -58,17 +59,17 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa { item.menu_name === "pulls" && projectDetail && parseInt(projectDetail.type) !== 2 && platform ?
    • - + 合并请求 - {projectDetail && projectDetail.pull_requests_count ? {projectDetail.pull_requests_count} : ""} + {projectDetail && projectDetail.pull_requests_count ? {numFormat(projectDetail.pull_requests_count)} : ""}
    • :"" } { item.menu_name === "wiki" &&
    • - + Wiki @@ -77,7 +78,8 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa { item.menu_name === "devops" && platform ?
    • - + {/* */} + 工作流(beta版) {projectDetail && projectDetail.ops_count ? {projectDetail.ops_count} : ""} @@ -85,39 +87,39 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa :"" } { - item.menu_name === "resources" && -
    • - - - 资源库 - {projectDetail && projectDetail.source_count ? {projectDetail.source_count} :""} - -
    • + // item.menu_name === "resources" && + //
    • + // + // + // 资源库 + // {projectDetail && projectDetail.source_count ? {projectDetail.source_count} :""} + // + //
    • } { item.menu_name === "versions" &&
    • - + 里程碑 - {projectDetail && projectDetail.versions_count ? {projectDetail.versions_count} :""} + {projectDetail && projectDetail.versions_count ? {numFormat(projectDetail.versions_count)} :""}
    • } { item.menu_name === "activity" &&
    • - + 动态
    • } { - item.menu_name === "setting" && -
    • - - 0 ? "iconfont icon-cangku color-grey-3 mr5 font-14":"iconfont icon-cangku color-grey-6 font-14 mr5"}> + item.menu_name === "settings" && +
    • + + 0 ? "iconfont icon-cangku color-grey-3 mr5 font-14":"iconfont icon-cangku color-grey-6 font-14 mr5"}> 仓库设置
    • diff --git a/src/forge/Main/sub/Invite.jsx b/src/forge/Main/sub/Invite.jsx index ad2a00bd..201cee6d 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/Main/sub/ReadmeCatelogue.jsx b/src/forge/Main/sub/ReadmeCatelogue.jsx new file mode 100644 index 00000000..d1e018bb --- /dev/null +++ b/src/forge/Main/sub/ReadmeCatelogue.jsx @@ -0,0 +1,57 @@ +import React , { useState , useEffect } from 'react'; +import { Anchor , Input } from 'antd'; +import './sub.scss'; +import { Base64 } from 'js-base64'; + +const { Link } = Anchor; + +function ReadmeCatelogue({ menuList , hash }) { + const [ goHref , setGoHref ] = useState(""); + const [ value , setValue ] = useState(""); + const [ menu , setMenu] = useState(menuList); + + + function onChange(link){ + setGoHref(link); + }; + + function changeValue(e) { + setValue(e.target.value); + if(e.target.value){ + let m = menuList.filter(i=>i.text.indexOf(e.target.value)>-1); + setMenu(m); + }else{ + setMenu(menuList); + } + } + return( +
      +
      + }/> +
      + { + menu && menu.length>0? +
      + + { + menu.map((item,key)=>{ + return( +
      + +
      + ) + }) + } +
      +
      + :"" + } + +
      + ) +} +export default ReadmeCatelogue; \ No newline at end of file diff --git a/src/forge/Main/sub/UpdateDescModal.jsx b/src/forge/Main/sub/UpdateDescModal.jsx index 5039123a..b0291f34 100644 --- a/src/forge/Main/sub/UpdateDescModal.jsx +++ b/src/forge/Main/sub/UpdateDescModal.jsx @@ -53,7 +53,7 @@ function UpdateDescModal({form , visible , onCancel , onOk,desc,website,lesson_u {getFieldDecorator("lesson_url",{ rules:[] })( - + )} diff --git a/src/forge/Main/sub/sub.scss b/src/forge/Main/sub/sub.scss index aa873971..4e6a3d8a 100644 --- a/src/forge/Main/sub/sub.scss +++ b/src/forge/Main/sub/sub.scss @@ -24,7 +24,44 @@ } } -.detailsCode{ - display: flex; - justify-content: space-between; +.menuslist{ + z-index: 100; + width: 297px; + background: #FFFFFF; + box-shadow: 0px 4px 8px 2px rgba(212, 212, 212, 0.5); + border-radius: 4px; + .searchBox{ + padding:15px; + border-bottom: 1px solid #eee; + } + .ant-anchor-wrapper{ + margin-left: 0px; + padding:5px 15px; + max-height: 255px!important; + .items{ + border-radius: 4px; + margin-bottom: 5px; + cursor: pointer; + .ant-anchor-link-title{ + color: #333333!important; + } + &:hover{ + background-color: #F3F4F6; + } + &.active{ + background-color: #2A61FF; + .ant-anchor-link-title{ + color: #fff!important; + } + } + } + .ant-anchor-link{ + padding:0px; + height: 30px; + line-height: 30px; + } + .ant-anchor-ink::before{ + background-color: #fff; + } + } } \ No newline at end of file diff --git a/src/forge/Merge/Commits.jsx b/src/forge/Merge/Commits.jsx index 37c254cc..93e867ae 100644 --- a/src/forge/Merge/Commits.jsx +++ b/src/forge/Merge/Commits.jsx @@ -16,10 +16,10 @@ function Commits({ commits , projectsId , owner }){
      - {truncateCommitId(`${item.sha}`)} + {truncateCommitId(`${item.sha}`)}

      {item.message}

      - 浏览代码 + 浏览代码
      :提交于{item.time_from_now} diff --git a/src/forge/Merge/Files.jsx b/src/forge/Merge/Files.jsx index 40e617c2..82a8638c 100644 --- a/src/forge/Merge/Files.jsx +++ b/src/forge/Merge/Files.jsx @@ -47,7 +47,7 @@ function Files({data,history,owner,projectsId}){ {item.name} - + +{item.addition} -{item.deletion} diff --git a/src/forge/Merge/MergeDetail.js b/src/forge/Merge/MergeDetail.js index a7e2f33e..76c31ba0 100644 --- a/src/forge/Merge/MergeDetail.js +++ b/src/forge/Merge/MergeDetail.js @@ -228,7 +228,7 @@ class MergeDetail extends Component {
      { data && data.issue.user_permission ? - 编辑 + 编辑 : '' }
      @@ -248,8 +248,8 @@ class MergeDetail extends Component {
        -
      • 0 ? "active" : ""}>对话内容
      • -
      • 0 ? "active" : ""}>代码提交
      • +
      • 0 ? "active" : ""}>对话内容
      • +
      • 0 ? "active" : ""}>代码提交
      diff --git a/src/forge/Merge/MergeItem.js b/src/forge/Merge/MergeItem.js index 32f3f811..884c50fe 100644 --- a/src/forge/Merge/MergeItem.js +++ b/src/forge/Merge/MergeItem.js @@ -49,7 +49,7 @@ class MergeItem extends Component { }; render() { - const { issues, project_name, project_author_name , user_admin_or_member} = this.props; + const { issues, project_name, project_author_name , user_admin_or_developer} = this.props; const { projectsId , owner } = this.props.match.params; const { current_user } = this.props; const renderList = () => { @@ -62,7 +62,7 @@ class MergeItem extends Component {

      @@ -78,7 +78,7 @@ class MergeItem extends Component {

      {item && item.author_name} @@ -109,7 +109,7 @@ class MergeItem extends Component { item.pull_request_head && {item.is_original @@ -133,7 +133,7 @@ class MergeItem extends Component { item.pull_request_base && {/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */} @@ -156,7 +156,7 @@ class MergeItem extends Component {

    • {item.assign_user_name ? ( {item.assign_user_name} @@ -175,7 +175,7 @@ class MergeItem extends Component { {item.journals_count ? ( {item.journals_count} @@ -183,7 +183,7 @@ class MergeItem extends Component { ) : ( "" )} - {user_admin_or_member && item.pull_request_status === 0 ? ( + {user_admin_or_developer && item.pull_request_status === 0 ? (
      diff --git a/src/forge/Merge/MergeSubmit.js b/src/forge/Merge/MergeSubmit.js index 8f2275d8..d4b42c3b 100644 --- a/src/forge/Merge/MergeSubmit.js +++ b/src/forge/Merge/MergeSubmit.js @@ -100,7 +100,7 @@ class MergeSubmit extends Component{ width:"10%", render: (text,item) => ( - + @@ -110,7 +110,7 @@ class MergeSubmit extends Component{ title:"SHA", dataIndex: 'sha', render: (text) => ( - {text} + {text} ) },{ title:"备注", diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index f3e58657..d1b46b86 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -361,7 +361,7 @@ class MessageCount extends Component {
      {data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: {turnbar(data.pull_request && data.pull_request.head)} @@ -376,7 +376,7 @@ class MessageCount extends Component { {data.issue.project_author_name}:{data.pull_request.base} @@ -386,14 +386,14 @@ class MessageCount extends Component { }
      - + - + {data.issue.author_name} @@ -408,7 +408,7 @@ class MessageCount extends Component { 审查人员: {data.issue.assign_user_name ? ( {data.issue.assign_user_name} @@ -448,7 +448,7 @@ class MessageCount extends Component { type="green" ghost className="ml20" - onClick={()=>{this.props.history.push(`/projects/${owner}/${projectsId}/pulls/${mergeId}/UpdateMerge`);}} + onClick={()=>{this.props.history.push(`/${owner}/${projectsId}/pulls/${mergeId}/UpdateMerge`);}} > 编辑 diff --git a/src/forge/Merge/NewMerge.js b/src/forge/Merge/NewMerge.js index 97df7fb1..956be000 100644 --- a/src/forge/Merge/NewMerge.js +++ b/src/forge/Merge/NewMerge.js @@ -186,7 +186,7 @@ class NewMerge extends Component { // this.ischeckmerge(); let { id ,merge , pull } = this.state; if(type==="pull"){ - this.props.history.push(`/projects/${owner}/${projectsId}/pulls/new/${pull}`) + this.props.history.push(`/${owner}/${projectsId}/pulls/new/${pull}`) this.compareProject(id,value,merge); }else{ this.compareProject(id,pull,value); @@ -208,7 +208,7 @@ class NewMerge extends Component { merge_user_login: is_fork_id ? projects_names[0].project_user_login : undefined } }) - this.props.history.push(`/projects/${login}/${identifier}/pulls/new`); + this.props.history.push(`/${login}/${identifier}/pulls/new`); this.newMergelist(login,identifier); }; diff --git a/src/forge/Merge/merge.js b/src/forge/Merge/merge.js index 90e35dcc..1e1285e4 100644 --- a/src/forge/Merge/merge.js +++ b/src/forge/Merge/merge.js @@ -4,10 +4,11 @@ import "./merge.css"; import "../Order/order.css"; import "../Order/index.scss"; import NoneData from "./no_data"; -import OrderItem from "./MergeItem"; +import MergeItem from "./MergeItem"; import './Index.scss'; import axios from "axios"; +import CheckProfile from '../Component/ProfileModal/Profile'; const Search = Input.Search; /** @@ -212,7 +213,7 @@ class merge extends Component { checkOperation() { const { projectsId,owner } = this.props.match.params; - this.props.history.push(`/projects/${owner}/${projectsId}/pulls/new`); + this.props.history.push(`/${owner}/${projectsId}/pulls/new`); } render() { const { projectsId , owner } = this.props.match.params; @@ -255,10 +256,10 @@ class merge extends Component { />
      { - data && data.user_admin_or_member && - this.checkOperation()}> + data && data.user_admin_or_developer && + this.checkOperation()}> + 新建合并请求 - + }
      @@ -387,7 +388,7 @@ class merge extends Component { {data && data.search_count && data.search_count > 0 ? (
      - + user_admin_or_developer={data && data.user_admin_or_developer} + >
      ):""} {search_count > select_params.limit ? ( diff --git a/src/forge/Merge/merge_form.js b/src/forge/Merge/merge_form.js index 3481cc8f..9332d9b8 100644 --- a/src/forge/Merge/merge_form.js +++ b/src/forge/Merge/merge_form.js @@ -165,7 +165,7 @@ class MergeForm extends Component { this.setState({ isSpin: false, }); - this.props.history.push(`/projects/${owner}/${projectsId}/pulls`); + this.props.history.push(`/${owner}/${projectsId}/pulls`); const { getDetail } = this.props; getDetail && getDetail(); } else { @@ -195,7 +195,7 @@ class MergeForm extends Component { isSpin: false, }); this.props.history.push( - `/projects/${owner}/${projectsId}/pulls/${mergeId}/Messagecount` + `/${owner}/${projectsId}/pulls/${mergeId}/Messagecount` ); } else { this.setState({ @@ -287,7 +287,7 @@ class MergeForm extends Component { type="default" className="ml30" onClick={()=>{ - this.props.history.push(merge_type === "new" ? `/projects/${owner}/${projectsId}/pulls` : `/projects/${owner}/${projectsId}/pulls/${mergeId}/detail`) + this.props.history.push(merge_type === "new" ? `/${owner}/${projectsId}/pulls` : `/${owner}/${projectsId}/pulls/${mergeId}/detail`) }} > 取消 diff --git a/src/forge/Merge/no_data.js b/src/forge/Merge/no_data.js index 8ad550ab..d5584797 100644 --- a/src/forge/Merge/no_data.js +++ b/src/forge/Merge/no_data.js @@ -12,7 +12,7 @@ class Nodata extends Component{

      欢迎使用合并请求!

      - 合并请求可以帮助您与他人协作编写代码。在使用之前,请先创建一个 合并请求 + 合并请求可以帮助您与他人协作编写代码。在使用之前,请先创建一个 合并请求
      diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js index b0f07326..aaaab6c8 100644 --- a/src/forge/New/Index.js +++ b/src/forge/New/Index.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { Input , Form , Select , Checkbox , Button , Spin , AutoComplete } from 'antd'; +import { Input , Form , Select , Checkbox , Button , Spin , AutoComplete, Modal } from 'antd'; import { Base64 } from 'js-base64'; import '../css/index.scss'; @@ -58,6 +58,8 @@ class Index extends Component { this.getGitignore(); // 获取开源许可证 this.getLicenses(); + //判断是否为删除新建项目失败后返回,并执行对应逻辑 + this.isDeleteProjectBack(); } componentDidUpdate=(prevPros)=>{ if(prevPros && this.props && !this.props.checkIfLogin()){ @@ -69,6 +71,7 @@ class Index extends Component { getOwner=()=>{ const { OIdentifier } = this.props.match.params; const { user_id } = this.props && this.props.current_user; + const url = `/owners.json`; axios.get(url).then(result=>{ if(result && result.data){ @@ -77,16 +80,13 @@ class Index extends Component { OwnerList: owner, }) if(OIdentifier){ - owner = owner.filter(item=>item.name === OIdentifier); - this.props.form.setFieldsValue({ - user_id:OIdentifier - }) + owner = owner.filter(item=>item.login === OIdentifier); }else if(user_id){ owner = owner.filter(item=>item.id === user_id); - this.props.form.setFieldsValue({ - user_id:owner && owner[0].name - }) } + this.props.form.setFieldsValue({ + user_id:owner && owner[0].name + }) owner && this.setState({ owners_id:owner[0].id, owners_name:owner[0].name @@ -144,6 +144,31 @@ class Index extends Component { }).catch((error) => { }) } + isDeleteProjectBack = () => { + let mirror_status = this.props.history.location.mirror_status; + if (mirror_status === 2 && sessionStorage.newProjectValue) { + Modal.warning({ + title: '警告', + content: '镜像项目创建失败!请按操作规范重新创建项目!', + }); + let newProjectValue = JSON.parse(sessionStorage.newProjectValue); + if (newProjectValue) { + this.setState({ + project_language_id: newProjectValue.project_language_id, + project_category_id: newProjectValue.project_category_id, + license_id: newProjectValue.license_id, + ignore_id: newProjectValue.ignore_id + }); + delete newProjectValue.project_language_id; + delete newProjectValue.project_category_id; + delete newProjectValue.license_id; + delete newProjectValue.ignore_id; + this.props.form.setFieldsValue(newProjectValue); + } + + } + } + // 设置option setOptionsList = (data, _head, name) => { if (data && data.length > 0) { @@ -172,6 +197,8 @@ class Index extends Component { const { project_language_id, project_category_id, license_id, ignore_id , owners_id , owners_name } = this.state; const decoderPass = Base64.encode(values.password); const url = (projectsType && projectsType === "mirror") ? "/projects/migrate.json" : "/projects.json"; + // 新建项目的时候,暂存数据,如果失败,返回的时候可以重新赋值 + sessionStorage.newProjectValue=JSON.stringify({...values,project_language_id,project_category_id,license_id,ignore_id}); axios.post(url, { ...values, auth_password:decoderPass, @@ -182,17 +209,16 @@ class Index extends Component { user_id:owners_id }).then((result) => { if (result && result.data.id) { - this.setState({ - isSpin: false - }) - this.props.showNotification(`${projectsType && projectsType === "mirror" ? "镜像" : "托管"}项目创建成功!`); - this.props.history.push(`/projects/${result.data.login}/${result.data.identifier}`); + projectsType && projectsType !== "mirror" && this.props.showNotification(`托管项目创建成功!`); + this.props.history.push(`/${result.data.login}/${result.data.identifier}`); } + this.setState({ + isSpin: false + }) }).catch((error) => { this.setState({ isSpin: false }) - console.log(error); }) } else { this.setState({ @@ -337,7 +363,9 @@ class Index extends Component { { projectsType && projectsType === "mirror" && -

      需要授权验证

      +

      + 需要授权验证 + 如果源项目为公有仓库,禁止填写用户名密码。如果源项目为私有仓库,则必须填写正确的用户名和密码!

      { mirrorCheck &&
      diff --git a/src/forge/Newfile/UserSubmitComponent.js b/src/forge/Newfile/UserSubmitComponent.js index 5cba3cf6..65fa7ec2 100644 --- a/src/forge/Newfile/UserSubmitComponent.js +++ b/src/forge/Newfile/UserSubmitComponent.js @@ -86,7 +86,7 @@ class UserSubmitComponent extends Component { const { getTopCount } = this.props; getTopCount && getTopCount(values.branchname); } - let url = `/projects/${owner}/${projectsId}${values.branchname ? `/tree/${turnbar(values.branchname)}`: (branch ? `/tree/${turnbar(branch)}` : "")}`; + let url = `/${owner}/${projectsId}${values.branchname ? `/tree/${turnbar(values.branchname)}`: (branch ? `/tree/${turnbar(branch)}` : "")}`; this.props.history.push(url); } }) @@ -123,7 +123,7 @@ class UserSubmitComponent extends Component { this.setState({ isSpin: false }); if (result.data && result.data.status === 1) { let b = currentBranch || branch; - let url = `/projects/${owner}/${projectsId}${(values.branchname ? `/tree/${turnbar(values.branchname)}` : (b ? `/tree/${turnbar(b)}`:""))}`; + let url = `/${owner}/${projectsId}${(values.branchname ? `/tree/${turnbar(values.branchname)}` : (b ? `/tree/${turnbar(b)}`:""))}`; this.props.history.push(url); this.props.showNotification("文件修改成功!"); } @@ -150,7 +150,7 @@ class UserSubmitComponent extends Component { return (
      - + { - this.props.history.push(`/projects/${owner}/${projectsId}`); + this.props.history.push(`/${owner}/${projectsId}`); }} className="mr20" > diff --git a/src/forge/Notice/Apply.jsx b/src/forge/Notice/Apply.jsx index 3c77edfa..aeacd67a 100644 --- a/src/forge/Notice/Apply.jsx +++ b/src/forge/Notice/Apply.jsx @@ -63,11 +63,11 @@ function Apply(props) { { list.map((i,k)=>{ return( -
    • - +
    • +

      - {i.user && i.user.name} + {i.user && i.user.name} {i.time_ago}

      diff --git a/src/forge/Notice/Index.jsx b/src/forge/Notice/Index.jsx index 63d09748..3f61688f 100644 --- a/src/forge/Notice/Index.jsx +++ b/src/forge/Notice/Index.jsx @@ -33,7 +33,7 @@ function Index(props){ useEffect(()=>{ if((username && current_user && (current_user.login !== username))){ - props.history.push(`/users/${username}`); + props.history.push(`/${username}`); } },[current_user,username]) @@ -47,14 +47,14 @@ function Index(props){ useEffect(()=>{ if(pathname && username){ - if(pathname === `/users/${username}/notice`){ + if(pathname === `/${username}/notice`){ setMenu("notify"); changeNum(user.undo_messages); } - if(pathname === `/users/${username}/notice/undo`){ + if(pathname === `/${username}/notice/undo`){ setMenu("undo"); } - if(pathname === `/users/${username}/notice/apply`){ + if(pathname === `/${username}/notice/apply`){ setMenu("apply"); } } @@ -70,9 +70,9 @@ function Index(props){ function deleteEvent(type,count) { let c = count; if(type==="apply"){ - setTransferCount(transferCount-count); - }else if(type==="undo"){ setApplyCount(applyCount-count); + }else if(type==="undo"){ + setTransferCount(transferCount-count); }else{ setMessagesCount(0); c = messagesCount; @@ -84,19 +84,19 @@ function Index(props){
      • - + 通知 {messagesCount ? {messagesCount}:""}
      • - + 接收仓库 {transferCount ? {transferCount}:""}
      • - + 成员申请 {applyCount ? {applyCount}:""} @@ -104,19 +104,19 @@ function Index(props){
      { return ; }} > { return ; }} > { return ; }} diff --git a/src/forge/Notice/Notify.jsx b/src/forge/Notice/Notify.jsx index 761366d3..31373908 100644 --- a/src/forge/Notice/Notify.jsx +++ b/src/forge/Notice/Notify.jsx @@ -44,13 +44,13 @@ function Notify(props){ if(status){ switch(status){ case 'canceled': - return

      取消转移【{project && project.name}】仓库

      + return

      取消转移【{project && project.name}】仓库

      case 'common': - return

      正在将【{project && project.name}】仓库转移给【{owner && owner.name}】

      + return

      正在将【{project && project.name}】仓库转移给【{owner && owner.name}】

      case 'successed': - return

      {project && project.name}】仓库成功转移给【{owner && owner.name}】

      + return

      {project && project.name}】仓库成功转移给【{owner && owner.name}】

      default: - return

      拒绝转移【{project && project.name}】仓库

      + return

      拒绝转移【{project && project.name}】仓库

      } }else{ return "" @@ -62,9 +62,9 @@ function Notify(props){ if(status){ switch(status){ case 'successed': - return

      已通过你加入【{project && project.name}】项目的申请

      + return

      已通过你加入【{project && project.name}】项目的申请

      default: - return

      已拒绝你加入【{project && project.name}】项目的申请

      + return

      已拒绝你加入【{project && project.name}】项目的申请

      } }else{ return "" @@ -80,12 +80,13 @@ function Notify(props){
        { list.map((i,k)=>{ + console.log(i); return( -
      • - +
      • +

        - {i.applied_user && i.applied_user.name} + {i.applied_user && i.applied_user.name} {i.time_ago}

        { i.applied_type === "AppliedProject" ? renderApplyStatus(i.status,i.applied):renderStatus(i.status,i.applied)} diff --git a/src/forge/Notice/UndoEvent.jsx b/src/forge/Notice/UndoEvent.jsx index d93a1f83..17dcc321 100644 --- a/src/forge/Notice/UndoEvent.jsx +++ b/src/forge/Notice/UndoEvent.jsx @@ -53,7 +53,7 @@ function UndoEvent(props){ Axios.post(url).then(result=>{ if(result && result.data){ getList(); - props && props.deleteEvent("apply",1); + props && props.deleteEvent("undo",1); } }).catch(error=>{}) } @@ -61,23 +61,23 @@ function UndoEvent(props){ return(
        -
        +
        { list && list.length > 0 ?
          { list.map((i,k)=>{ return( -
        • - +
        • +

          - {i.user && i.user.name} + {i.user && i.user.name} {i.time_ago}

          -

          请求将仓库【{i.project && i.project.name}】 - 转移给【{i.owner && i.owner.name}】,是否接受?

          +

          请求将仓库【{i.project && i.project.name}】 + 转移给【{i.owner && i.owner.name}】,是否接受?

          { i.status === "common" && diff --git a/src/forge/Order/Detail.js b/src/forge/Order/Detail.js index 644a653d..8805004b 100644 --- a/src/forge/Order/Detail.js +++ b/src/forge/Order/Detail.js @@ -85,7 +85,7 @@ class Detail extends Component { }) .then((result) => { if (result) { - this.props.history.push(`/projects/${owner}/${projectsId}/issues`); + this.props.history.push(`/${owner}/${projectsId}/issues`); } }) .catch((error) => { @@ -132,7 +132,7 @@ class Detail extends Component { .then((result) => { if (result) { this.props.history.push( - `/projects/${owner}/${projectsId}/issues/${result.data.issue_id}/copyetail` + `/${owner}/${projectsId}/issues/${result.data.issue_id}/copyetail` ); } }) @@ -207,7 +207,7 @@ class Detail extends Component {
          {data && data.author_name} @@ -269,7 +269,7 @@ class Detail extends Component { 编辑 diff --git a/src/forge/Order/Milepost.js b/src/forge/Order/Milepost.js index ede2d314..48fc286b 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; @@ -118,11 +119,12 @@ class Milepost extends Component { } ChangePage = (page) => { + document.body.scrollIntoView(); this.setState({ page }) - - this.getList(page); + const { status } = this.state; + this.getList( page , status ); } // 排序 @@ -187,7 +189,7 @@ class Milepost extends Component {
        { data && data.user_admin_or_member ? - 新的里程碑 + {this.props.history.push(`/${owner}/${projectsId}/milestones/new`)}}>新的里程碑 : '' }
        @@ -204,7 +206,7 @@ class Milepost extends Component {
        - {item.name} + {item.name}
        @@ -228,7 +230,7 @@ class Milepost extends Component {
        - 编辑 + 编辑
        @@ -259,7 +261,7 @@ class Milepost extends Component { { data && data.versions_count > limit ?
        - +
        : "" }
        diff --git a/src/forge/Order/MilepostDetail.js b/src/forge/Order/MilepostDetail.js index 30526750..c1c8bdd0 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'; @@ -113,7 +114,7 @@ class MilepostDetail extends Component { this.setState({ data: result.data, issues: result.data.issues, - search_count: result.data.search_count, + search_count: params.status_type ==="1" ? result.data.open_issues_count : result.data.close_issues_count, isSpin: false }) } @@ -238,8 +239,8 @@ class MilepostDetail extends Component { {data && data.percent && data.percent.toFixed(2)}%完成
        - 编辑里程碑 - 创建易修 + 编辑里程碑 + {this.props.history.push(`/${owner}/${projectsId}/issues/${meilid}/new`)}} className="topWrapper_btn">创建易修
        diff --git a/src/forge/Order/Milepostitem.js b/src/forge/Order/Milepostitem.js index 48bf65c1..d79c66fe 100644 --- a/src/forge/Order/Milepostitem.js +++ b/src/forge/Order/Milepostitem.js @@ -31,7 +31,7 @@ class OrderItem extends Component {
        - {item.name} + {item.name}
        @@ -65,7 +65,7 @@ class OrderItem extends Component {
        - 编辑 + 编辑
        diff --git a/src/forge/Order/Nav.js b/src/forge/Order/Nav.js index 93fbc101..b5d196d6 100644 --- a/src/forge/Order/Nav.js +++ b/src/forge/Order/Nav.js @@ -7,8 +7,8 @@ class Nav extends Component{ const { projectsId , owner } = this.props.match.params; return(

        - 标签 - 里程碑 + 标签 + 里程碑

        ) } diff --git a/src/forge/Order/OrderItem.js b/src/forge/Order/OrderItem.js index 3c5e5cf8..08178864 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 && @@ -51,7 +52,7 @@ class OrderItem extends Component { {current_user && current_user.login && checkbox}

        - {item.name} + {item.name} {TagInfo(item.priority,"mr10")}

        @@ -67,7 +68,7 @@ class OrderItem extends Component {

      • { item.author_name ? - + {item.author_name} : "--" @@ -76,7 +77,7 @@ class OrderItem extends Component {
      • { item.assign_user_name ? - + {item.assign_user_name} : "--" @@ -88,15 +89,24 @@ class OrderItem extends Component {
      • {item.done_ratio || "--"}
      • - {item.journals_count} + {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/UpdateMilepost.js b/src/forge/Order/UpdateMilepost.js index 88a73033..c4f38657 100644 --- a/src/forge/Order/UpdateMilepost.js +++ b/src/forge/Order/UpdateMilepost.js @@ -79,7 +79,7 @@ class UpdateMilepost extends Component { }).then(result => { if (result) { this.setState({ isSpin: false }) - this.props.history.push(`/projects/${owner}/${projectsId}/milestones`); + this.props.history.push(`/${owner}/${projectsId}/milestones`); } diff --git a/src/forge/Order/newMilepost.js b/src/forge/Order/newMilepost.js index b9513212..b7d1102d 100644 --- a/src/forge/Order/newMilepost.js +++ b/src/forge/Order/newMilepost.js @@ -63,7 +63,7 @@ class NewMilepost extends Component { }).then(result => { if (result) { this.setState({ isSpin: false }) - this.props.history.push(`/projects/${owner}/${projectsId}/milestones`); + this.props.history.push(`/${owner}/${projectsId}/milestones`); const { getDetail } = this.props; getDetail && getDetail(); } 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 1202f41f..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/Order/order_form.js b/src/forge/Order/order_form.js index b6f065b2..6515dde8 100644 --- a/src/forge/Order/order_form.js +++ b/src/forge/Order/order_form.js @@ -165,7 +165,7 @@ class order_form extends Component { }).then((result) => { if (result && result.data.id) { this.props.showNotification("任务创建成功!"); - this.props.history.push(`/projects/${owner}/${projectsId}/issues/${result.data.id}/detail`); + this.props.history.push(`/${owner}/${projectsId}/issues/${result.data.id}`); this.setState({ description: "", isSpin: false, @@ -191,7 +191,7 @@ class order_form extends Component { ...values, }).then((result) => { if (result) { - this.props.history.push(`/projects/${owner}/${projectsId}/issues/${orderId}/detail`); + this.props.history.push(`/${owner}/${projectsId}/issues/${orderId}`); this.props.showNotification("任务更新成功!"); const { getDetail } = this.props; getDetail && getDetail(); @@ -371,7 +371,7 @@ class order_form extends Component { type="default" className="ml30" onClick={()=> - this.props.history.push(form_type === "new" ? `/projects/${owner}/${projectsId || orderId}/issues` : `/projects/${owner}/${projectsId}/issues/${orderId}/detail`)} + this.props.history.push(form_type === "new" ? `/${owner}/${projectsId || orderId}/issues` : `/${owner}/${projectsId}/issues/${orderId}`)} > 取消 diff --git a/src/forge/SecuritySetting/Index.jsx b/src/forge/SecuritySetting/Index.jsx index e314c66a..d9d4e49c 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, @@ -35,6 +39,10 @@ function Index(props){ {current_user && current_user.username}
        +
          +
        • 个人信息
        • +
        • -1 ?"active":""}>基本资料
        • +
        • 安全设置
        • -1 ?"active":""}>SSH密钥
        • @@ -49,6 +57,12 @@ function Index(props){ )} > + ( + + )} + > ( diff --git a/src/forge/SecuritySetting/Index.scss b/src/forge/SecuritySetting/Index.scss index 664ed7ab..f533f053 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; @@ -122,50 +124,6 @@ } } } -.deleteBox{ - .ant-modal-header{ - background-color: rgba(223, 0, 2, 0.06); - 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 - } - .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; - } - } - } -} .descModal{ .ant-modal-title{ text-align: left; diff --git a/src/forge/SecuritySetting/sub/DeleteBox.jsx b/src/forge/SecuritySetting/sub/DeleteBox.jsx index af8b6418..02d816b3 100644 --- a/src/forge/SecuritySetting/sub/DeleteBox.jsx +++ b/src/forge/SecuritySetting/sub/DeleteBox.jsx @@ -1,17 +1,16 @@ import React from 'react'; import { AlignCenter } from '../../Component/layout'; -import { Modal , Button } from 'antd'; +import Modals from '../../Component/PublicModal/Index'; +import { Button } from 'antd'; function DeleteBox({ visible , onCancel ,onSuccess }) { return( - @@ -19,10 +18,11 @@ function DeleteBox({ visible , onCancel ,onSuccess }) { } >
          - 您确定要删除此 SSH 密钥吗? -

          此操作将永久删除该SSH密钥,且不可恢复。如果您想再次使用该密钥,则需要您重新上传。

          + + 您确定要删除此 SSH 密钥吗? +

          此操作将永久删除该SSH密钥,且不可恢复。如果您想再次使用该密钥,则需要您重新上传。

          -
          + ) } export default DeleteBox; \ No newline at end of file diff --git a/src/forge/Settings/Branch.js b/src/forge/Settings/Branch.js index d345f0fc..3e19f37e 100644 --- a/src/forge/Settings/Branch.js +++ b/src/forge/Settings/Branch.js @@ -88,7 +88,7 @@ export default ((props)=>{ // 跳转 function settingRule(protectBranch){ - props.history.push(`/projects/${owner}/${projectsId}/setting/branch/${protectBranch}`); + props.history.push(`/${owner}/${projectsId}/settings/branches/${protectBranch}`); } // 翻页 diff --git a/src/forge/Settings/BranchRule.jsx b/src/forge/Settings/BranchRule.jsx index d15ecd00..85b9bf20 100644 --- a/src/forge/Settings/BranchRule.jsx +++ b/src/forge/Settings/BranchRule.jsx @@ -290,7 +290,7 @@ export default Form.create()( { - history.push(`/projects/${owner}/${projectsId}/setting/branch`); + history.push(`/${owner}/${projectsId}/settings/branches`); }} > 取消 diff --git a/src/forge/Settings/Collaborator.js b/src/forge/Settings/Collaborator.js index 0b94eee5..0a50cae1 100644 --- a/src/forge/Settings/Collaborator.js +++ b/src/forge/Settings/Collaborator.js @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React, { useState , useRef } from "react"; import {WhiteBack} from '../Component/layout'; import AddMember from '../Component/AddMember'; import AddGroup from '../Component/AddGroup'; @@ -8,9 +8,11 @@ import Group from './CollaboratorGroup'; function Collaborator(props){ const [ nav , setNav] = useState("1"); const [ newId , setNewId] = useState(undefined); + const [ addOperation , setAddOperation] = useState(true); const [ newGroupId , setNewGroupId] = useState(undefined); const {projectsId ,owner} = props.match.params; + const author = props && props.projectDetail && props.projectDetail.author; function getID(id){ @@ -19,6 +21,7 @@ function Collaborator(props){ function getGroupID(id){ setNewGroupId(id); } + return ( @@ -27,15 +30,17 @@ function Collaborator(props){ author && author.type === "Organization" ? {setNav("1");setNewId(undefined)}}>协作者管理 - {setNav("2");setNewId(undefined)}}>团队管理 + {setNav("2");setNewId(undefined);setNewGroupId(undefined)}}>团队管理 : 协作者管理 } { - nav === "1" ? + nav === "1" && - : + } + { + (nav !== "1" && addOperation) && }
        @@ -44,7 +49,7 @@ function Collaborator(props){ nav === "1" ? : - + }
        diff --git a/src/forge/Settings/CollaboratorGroup.jsx b/src/forge/Settings/CollaboratorGroup.jsx index c6ab6ffb..5c38b1aa 100644 --- a/src/forge/Settings/CollaboratorGroup.jsx +++ b/src/forge/Settings/CollaboratorGroup.jsx @@ -10,7 +10,7 @@ const roles = { read: "报告者", }; const limit = 15; -function CollaboratorGroup({ newGroupId, owner, projectsId }) { +function CollaboratorGroup({ newGroupId, owner, projectsId , setAddOperation }) { const [list, setList] = useState(undefined); const [isSpin, setIsSpin] = useState(true); const [page, setPage] = useState(1); @@ -34,6 +34,7 @@ function CollaboratorGroup({ newGroupId, owner, projectsId }) { setList(result.data.teams); setTotal(result.data.total_count); setIsSpin(false); + setAddOperation(result.data.can_add); } }) .catch((error) => {}); @@ -47,16 +48,15 @@ function CollaboratorGroup({ newGroupId, owner, projectsId }) { // 添加团队 function addGroup(id) { const url = `/${owner}/${projectsId}/teams.json`; - axios - .post(url, { - team_id: id, - }) - .then((result) => { - if (result && result.data) { - getData(); - } - }) - .catch((error) => {}); + axios.post(url, { + team_id: id, + }) + .then((result) => { + if (result && result.data) { + getData(); + } + }) + .catch((error) => {}); } // 删除团队 @@ -77,7 +77,11 @@ function CollaboratorGroup({ newGroupId, owner, projectsId }) { title: "团队名", dataIndex: "name", render: (value, item) => { - return {value}; + if(item.is_admin || item.is_member){ + return {value}; + }else{ + return {value}; + } }, }, { diff --git a/src/forge/Settings/CollaboratorMember.jsx b/src/forge/Settings/CollaboratorMember.jsx index 1104a864..447e3b26 100644 --- a/src/forge/Settings/CollaboratorMember.jsx +++ b/src/forge/Settings/CollaboratorMember.jsx @@ -186,7 +186,7 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification render: (text, item) => ( ( - + {text} ), diff --git a/src/forge/Settings/Index.js b/src/forge/Settings/Index.js index c8fd2f1e..3ebb5b49 100644 --- a/src/forge/Settings/Index.js +++ b/src/forge/Settings/Index.js @@ -49,25 +49,25 @@ class Index extends Component { const { projectsId , owner } = this.props.match.params; const { pathname } = this.props.history.location; - const flag = pathname === `/projects/${owner}/${projectsId}/setting`; + const flag = pathname === `/${owner}/${projectsId}/settings`; return (
        • - + 基本设置

        • -1 ? "active" : "" + pathname.indexOf("settings/collaborators") > -1 ? "active" : "" } >

          - + 协作者管理 @@ -75,11 +75,11 @@ class Index extends Component {

        • -1 ? "active" : "" + pathname.indexOf("settings/webhooks") > -1 ? "active" : "" } >

          - + Webhooks @@ -87,21 +87,21 @@ class Index extends Component {

        • -1 ? "active" : "" + pathname.indexOf("settings/branch") > -1 ? "active" : "" } >

          - + 分支设置

        • -1 ? "active" : ""} + className={pathname.indexOf("settings/labels") > -1 ? "active" : ""} >

          - + 项目标签 @@ -110,7 +110,7 @@ class Index extends Component { {/*

        • -1 ? "active" : "" + pathname.indexOf("settings/manage") > -1 ? "active" : "" } >

          @@ -127,64 +127,64 @@ class Index extends Component { {/* webhooks */} ( )} > ( )} > ( )} > {/* 协作者 */} ( )} > {/* 修改仓库信息 */} ( )} > ( )} > ( )} > ( )} > ( )} > {/* 修改仓库信息 */} ( )} diff --git a/src/forge/Settings/Setting.js b/src/forge/Settings/Setting.js index ba6e7a5a..c3150323 100644 --- a/src/forge/Settings/Setting.js +++ b/src/forge/Settings/Setting.js @@ -16,7 +16,7 @@ const menu = [ {name:"合并请求",index:"pulls"}, {name:"Wiki",index:"wiki"}, {name:"工作流(beta版)",index:"devops"}, - {name:"资源库",index:"resources"}, + // {name:"资源库",index:"resources"}, {name:"里程碑",index:"versions"}, {name:"动态",index:"activity"}, ] @@ -179,11 +179,9 @@ class Setting extends Component { content: 该操作无法撤销!且将会一并删除相关的易修、合并请求、工作流、里程碑、动态等数据。
          是否确认删除 {owner}/{projectName}({projectsId})
          , onOk: () => { const url = `/${owner}/${projectsId}.json`; - axios - .delete(url) - .then((result) => { + axios.delete(url).then((result) => { this.props.showNotification("仓库删除成功!"); - this.props.history.push("/projects"); + this.props.history.push(`/${owner}`); }) .catch((error) => { console.log(error); @@ -223,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 }) } @@ -351,7 +353,7 @@ class Setting extends Component { { is_transfering ? 此仓库正在转移给【 - {transfer && {transfer.name}} + {transfer && {transfer.name}} 】,请联系对方接收此仓库。 : `将此仓库转移给其他用户或组织` diff --git a/src/forge/Settings/Webhooks/Index.jsx b/src/forge/Settings/Webhooks/Index.jsx index c6992243..57df13b4 100644 --- a/src/forge/Settings/Webhooks/Index.jsx +++ b/src/forge/Settings/Webhooks/Index.jsx @@ -62,7 +62,7 @@ function Index(props) { if(total >= 20){ return props.showNotification("webhooks数量已到上限!请删除暂不使用的webhooks以进行添加操作"); } - props.history.push(`/projects/${owner}/${projectsId}/setting/webhooks/new`) + props.history.push(`/${owner}/${projectsId}/settings/webhooks/new`) } return( @@ -90,9 +90,9 @@ function Index(props) { return( - {i.url} + {i.url} - + diff --git a/src/forge/Settings/Webhooks/New.jsx b/src/forge/Settings/Webhooks/New.jsx index 0dedaa83..d90934f0 100644 --- a/src/forge/Settings/Webhooks/New.jsx +++ b/src/forge/Settings/Webhooks/New.jsx @@ -111,7 +111,7 @@ function New({ form , match , showNotification , history }) { }).then(result=>{ if(result){ showNotification("webhook更新成功!"); - history.push(`/projects/${owner}/${projectsId}/setting/webhooks`); + history.push(`/${owner}/${projectsId}/settings/webhooks`); } }).catch(error=>{}) }else{ @@ -125,7 +125,7 @@ function New({ form , match , showNotification , history }) { }).then(result=>{ if(result && result.data && result.data.id){ showNotification("webhook新建成功!"); - history.push(`/projects/${owner}/${projectsId}/setting/webhooks`); + history.push(`/${owner}/${projectsId}/settings/webhooks`); } }).catch(error=>{}) } @@ -157,7 +157,7 @@ function New({ form , match , showNotification , history }) { axios.delete(url).then(result=>{ if(result){ showNotification("webhook删除成功!"); - history.push(`/projects/${owner}/${projectsId}/setting/webhooks`); + history.push(`/${owner}/${projectsId}/settings/webhooks`); } }).catch(error=>{}) } @@ -180,7 +180,7 @@ function New({ form , match , showNotification , history }) { subTitle={`删除后未来事件将不会推送至此Webhook地址:${data && data.url}`} /> - Webhooks + Webhooks {id ? "更新" : "添加"}Webhook diff --git a/src/forge/Source/Index.jsx b/src/forge/Source/Index.jsx index 8ba92587..e158d7fb 100644 --- a/src/forge/Source/Index.jsx +++ b/src/forge/Source/Index.jsx @@ -217,7 +217,7 @@ function Index(props){ data.map((item,key)=>{ return(

        • - +
          diff --git a/src/forge/Team/Group/GroupDetailProject.jsx b/src/forge/Team/Group/GroupDetailProject.jsx index 0c843f0a..20284c9f 100644 --- a/src/forge/Team/Group/GroupDetailProject.jsx +++ b/src/forge/Team/Group/GroupDetailProject.jsx @@ -31,7 +31,7 @@ export default (({projects}) => { return (
          - {item.project.name} + {item.project.name}
          ) }) diff --git a/src/forge/Team/Group/GroupDetailSetting.jsx b/src/forge/Team/Group/GroupDetailSetting.jsx index fa060ee3..168ba6ff 100644 --- a/src/forge/Team/Group/GroupDetailSetting.jsx +++ b/src/forge/Team/Group/GroupDetailSetting.jsx @@ -26,18 +26,18 @@ export default (props)=>{ function returnActive (pathname){ let a = 0; - if(pathname === `/organize/${OIdentifier}/group/${groupId}/setting/member`){ + if(pathname === `/${OIdentifier}/teams/${groupId}/setting/member`){ a = 1; - }else if(pathname === `/organize/${OIdentifier}/group/${groupId}/setting/project`){ + }else if(pathname === `/${OIdentifier}/teams/${groupId}/setting/project`){ a = 2; } return a; } const active = returnActive(pathname); const array = {list:[ - {name:'基本设置',icon:"icon-base",href:`/organize/${OIdentifier}/group/${groupId}/setting`}, - {name:'团队成员管理',icon:"icon-zuzhichengyuan",href:`/organize/${OIdentifier}/group/${groupId}/setting/member`}, - {name:'团队项目管理',icon:"icon-zuzhixiangmu",href:`/organize/${OIdentifier}/group/${groupId}/setting/project`}, + {name:'基本设置',icon:"icon-base",href:`/${OIdentifier}/teams/${groupId}/setting`}, + {name:'团队成员管理',icon:"icon-zuzhichengyuan",href:`/${OIdentifier}/teams/${groupId}/setting/member`}, + {name:'团队项目管理',icon:"icon-zuzhixiangmu",href:`/${OIdentifier}/teams/${groupId}/setting/project`}, ], active } @@ -51,19 +51,19 @@ export default (props)=>{ ( )} > ( )} > ( )} diff --git a/src/forge/Team/Group/GroupDetails.jsx b/src/forge/Team/Group/GroupDetails.jsx index 75183f35..ba569386 100644 --- a/src/forge/Team/Group/GroupDetails.jsx +++ b/src/forge/Team/Group/GroupDetails.jsx @@ -87,9 +87,9 @@ export default ((props) => { if (username) { const url = `/organizations/${OIdentifier}/teams/${groupId}/team_users/quit.json`; axios.delete(url).then((result) => { - if (result && result.data) { + if (result && result.message==='success') { props.showNotification(`已成功退出团队!`); - props.history.push(`/organize/${OIdentifier}`); + props.history.push(`/${username}`); } }).catch((error) => { }); } @@ -119,7 +119,7 @@ export default ((props) => {

          管理员团队对 所有仓库 具有操作权限,且对组织具有 管理员权限

          此外,该团队拥有了 创建仓库 的权限:成员可以在组织中创建新的仓库。

          - {group.is_admin ? : ""} + {group.is_admin ? : ""}
          : diff --git a/src/forge/Team/Group/GroupForm.jsx b/src/forge/Team/Group/GroupForm.jsx index 2eb8540f..94825905 100644 --- a/src/forge/Team/Group/GroupForm.jsx +++ b/src/forge/Team/Group/GroupForm.jsx @@ -24,21 +24,25 @@ export default Form.create()( const [check_box, setCheckBox] = useState(false); const [switch_box, setSwtichBox] = useState([]); const [onwers, setOnwers] = useState(false); + const [auth, setAuth] = useState(""); const [ descNum , setDescNum ] = useState(0); const [switch_box_code, setSwtichBoxCode] = useState(false); const [switch_box_pull, setSwtichBoxPull] = useState(false); const [switch_box_issue, setSwtichBoxIssue] = useState(false); const [switch_box_release, setSwtichBoxRelease] = useState(false); + const [switch_box_wiki, setSwtichBoxWiki] = useState(false); const { getFieldDecorator, validateFields, setFieldsValue } = form; const { OIdentifier, groupId } = match.params; useEffect(() => { if (GroupDetail) { setOnwers(GroupDetail.authorize === "owner"); + setAuth(GroupDetail.authorize); setCheckBox(GroupDetail.can_create_org_project) setSwtichBox(GroupDetail.units) setFieldsValue({ - ...GroupDetail + ...GroupDetail, + includes_all_project:GroupDetail.includes_all_project ? 1 :0 }) setDescNum(GroupDetail.description ? GroupDetail.description.length : 0); } @@ -50,6 +54,7 @@ export default Form.create()( setSwtichBoxPull(switch_checked("pulls")) setSwtichBoxIssue(switch_checked("issues")) setSwtichBoxRelease(switch_checked("releases")) + setSwtichBoxWiki(switch_checked("wiki")) } }, [switch_box]) @@ -68,25 +73,28 @@ export default Form.create()( setIsSpin(true) validateFields((error, values) => { if (!error) { - values.unit_types = switch_box + // values.unit_types = switch_box + values.unit_types = ['code','pulls','issues','releases','wiki']; if (groupId) { // 表示编辑,否则为新建 const url = `/organizations/${OIdentifier}/teams/${groupId}.json`; axios.put(url, { - ...values + ...values, + includes_all_project:values.includes_all_project === 1?true:false }).then(result => { if (result && result.data) { showNotification("基本设置更新成功!"); - history.push(`/organize/${OIdentifier}/group/${groupId}`); + history.push(`/${OIdentifier}/teams/${groupId}`); } }).catch(error => { }) } else { const url = `/organizations/${OIdentifier}/teams.json`; axios.post(url, { - ...values + ...values, + includes_all_project:values.includes_all_project === 1?true:false }).then(result => { if (result && result.data) { showNotification("团队创建成功!"); - history.push(`/organize/${OIdentifier}/group/${result.data.id}`); + history.push(`/${OIdentifier}/teams/${result.data.id}`); } }).catch(error => { }) } @@ -132,14 +140,22 @@ export default Form.create()( setSwtichBoxRelease(checked) } + function switch_wiki_types(checked, event) { + switch_unit_types(checked, "wiki"); + setSwtichBoxWiki(checked); + } + function cancelEdit(){ if(groupId){ - history.push(`/organize/${OIdentifier}/group/${groupId}`); + history.push(`/${OIdentifier}/teams/${groupId}`); }else{ - history.push(`/organize/${OIdentifier}`); + history.push(`/${OIdentifier}`); } } + function changeAuth(params) { + setAuth(params.target.value) + } function checkname(rule, value, callback){ if(!value){ @@ -192,8 +208,8 @@ export default Form.create()( "includes_all_project", [], - 指定项目(团队成员将只能访问添加到团队的项目。 选择此项 将不会 自动删除已经添加的项目) - 所有项目(团队可以访问所有项目。选择此选项将 添加所有现有的 项目到指定团队) + 指定项目(团队成员将只能访问添加到团队的项目。 选择此项 将不会 自动删除已经添加的项目) + 所有项目(团队可以访问所有项目。选择此选项将 添加所有现有的 项目到指定团队) , false, 0,onwers ? "hide":"" )} {helper( @@ -202,37 +218,42 @@ export default Form.create()( [], 新建项目(成员可以在组织中新建项目。创建者将自动获得新建的项目的管理员权限), false, 20,onwers ? "hide":"" )} - {/* {helper( + {helper( '版本库权限:', "authorize", [], - + 读取权限(成员可以查看和克隆团队项目) 写入权限(成员可以查看和推送提交到团队项目) 管理员权限(成员可以拉取和推送到团队项目同时可以添加协作者) , false, 20,onwers ? "hide":"" - )} */} + )} - {/*

          允许访问项目单元:

          - - - 代码库(查看源码、文件、提交和分支) - - - - 任务(组织 bug 报告、任务和里程碑) - - - - 合并请求(启用合并请求和代码评审) - - - - 版本发布(跟踪项目版本和下载) - - */} + {/*
          +

          允许访问项目单元:

          + + + 代码库(查看源码、文件、提交和分支) + + + + 任务(组织 bug 报告、任务和里程碑) + + + + 合并请求(启用合并请求和代码评审) + + + + 版本发布(跟踪项目版本和下载) + + + + wiki(编辑此仓库的相关文档说明) + +
          */} - cancelEdit()}>取消 + cancelEdit()}>取消
      diff --git a/src/forge/Team/Group/Setting/GroupMemberSetting.jsx b/src/forge/Team/Group/Setting/GroupMemberSetting.jsx index a0d8ec78..998e7339 100644 --- a/src/forge/Team/Group/Setting/GroupMemberSetting.jsx +++ b/src/forge/Team/Group/Setting/GroupMemberSetting.jsx @@ -87,7 +87,7 @@ export default ((props) => { align: "center", render: (value, item) => { return ( - {item.user.name} + {item.user.name} ) } }, diff --git a/src/forge/Team/Group/Setting/GroupProjectSetting.jsx b/src/forge/Team/Group/Setting/GroupProjectSetting.jsx index 1762a864..9a4f3958 100644 --- a/src/forge/Team/Group/Setting/GroupProjectSetting.jsx +++ b/src/forge/Team/Group/Setting/GroupProjectSetting.jsx @@ -180,7 +180,7 @@ function GroupProjectSetting(props) { } > {item.project.owner_name}/{item.project.name}} + title={{item.project.owner_name}/{item.project.name}} /> )} diff --git a/src/forge/Team/Index.jsx b/src/forge/Team/Index.jsx index fd4afedf..1a3bfde9 100644 --- a/src/forge/Team/Index.jsx +++ b/src/forge/Team/Index.jsx @@ -26,39 +26,16 @@ const SubDetailIndex = Loadable({ loader: () => import("./Sub/SubDetail"), loading: Loading, }); +// forge项目详情 +const ProjectDetail = Loadable({ + loader: () => import("../Main/Detail"), + loading: Loading, +}); export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC( ((props)=>{ return (
      - {/* 组织团队-设置 */} - { - return - }} - > - {/* 组织团队-新建 */} - { - return - }} - > - {/* 组织团队-子级(包含组织团队列表) */} - { - return - }} - > - {/* 组织成员 */} - { - return - }} - > {/* 新建组织 */} }} > + {/* 组织团队-新建 */} + { + return + }} + > + {/* 组织团队-设置 */} + { + return + }} + > + {/* 组织团队-子级(包含组织团队列表) */} + { + return + }} + > + {/* 组织成员 */} + { + return + }} + > + + {/* 组织详情(包含组织设置) */} ( + + )} + > + + {/* 组织下的项目详情 */} + ( + + )} + > + + {/* 组织详情(包含组织设置) */} + ( )} diff --git a/src/forge/Team/Index.scss b/src/forge/Team/Index.scss index a046f99d..11237973 100644 --- a/src/forge/Team/Index.scss +++ b/src/forge/Team/Index.scss @@ -368,5 +368,5 @@ } } .hide{ - display: hidden; + display: none; } \ No newline at end of file diff --git a/src/forge/Team/List.jsx b/src/forge/Team/List.jsx index b43fb75d..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}`)}}>新建镜像项目 + ) @@ -75,7 +80,7 @@ function List(props){

      - { organizeDetail && organizeDetail.is_admin ? + { organizeDetail && organizeDetail.can_create_project ? + 新建项目 @@ -106,7 +111,13 @@ function List(props){

      }
    • - +
    ) } diff --git a/src/forge/Team/ListItem.jsx b/src/forge/Team/ListItem.jsx index 3c2cf3f4..a908f80b 100644 --- a/src/forge/Team/ListItem.jsx +++ b/src/forge/Team/ListItem.jsx @@ -7,7 +7,7 @@ function ListItem({item,key,OIdentifier}) {

    - {item.name} + {item.name} { item.forked_from_project_id && } { item.type && item.type !== 0 ? diff --git a/src/forge/Team/New.jsx b/src/forge/Team/New.jsx index 1f06dc22..414a8d15 100644 --- a/src/forge/Team/New.jsx +++ b/src/forge/Team/New.jsx @@ -49,7 +49,7 @@ export default Form.create()( }).then(result=>{ if(result && result.data){ showNotification("组织创建成功!"); - history.push(`/organize/${result.data.name}`); + history.push(`/${result.data.name}`); } }).catch(error=>{}) } diff --git a/src/forge/Team/RightBox.jsx b/src/forge/Team/RightBox.jsx index 0603a454..7616fd6c 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); @@ -67,14 +68,14 @@ function RightBox({ OIdentifier , history , admin }) {

    { memberData && memberData.organization_users && memberData.organization_users.length>0 ? - + { memberData.organization_users.map((item,key)=>{ return(
    - +
    - {item.user && item.user.name} + {item.user && item.user.name} 加入时间:{item.created_at}
    @@ -87,8 +88,16 @@ function RightBox({ OIdentifier , history , admin }) { history.push(`/organize/${OIdentifier}/group/new`)}>新建团队} - url={`/organize/${OIdentifier}/group`} + bottom={ + admin && + history.push(`/${OIdentifier}/teams/new`)} + className={"ant-btn ant-btn-primary"} + >新建团队 + } + url={`/${OIdentifier}/teams`} > { groupData && groupData.teams && groupData.teams.length>0? @@ -97,7 +106,12 @@ function RightBox({ OIdentifier , history , admin }) { return(
    - {item.name} + { + (item.is_admin || item.is_member) ? + {item.name} + : + {item.name} + } {item.num_users}名成员 {item.num_projects}个仓库 diff --git a/src/forge/Team/Setting/TeamSettingCommon.jsx b/src/forge/Team/Setting/TeamSettingCommon.jsx index 5be03db0..499a00c2 100644 --- a/src/forge/Team/Setting/TeamSettingCommon.jsx +++ b/src/forge/Team/Setting/TeamSettingCommon.jsx @@ -1,5 +1,5 @@ import React, { forwardRef , useCallback , useEffect, useState } from 'react'; -import { Form , Input , Radio ,Checkbox , Divider , Button } from 'antd'; +import { Form , Input , Radio ,Checkbox , Divider , Button , InputNumber } from 'antd'; import { WhiteBack , FlexAJ } from '../../Component/layout'; import Title from '../../Component/Title'; import styled from 'styled-components'; @@ -31,7 +31,8 @@ export default Form.create()( useEffect(()=>{ if(organizeDetail){ setFieldsValue({ - ...organizeDetail + ...organizeDetail, + max_repo_creation:organizeDetail.max_repo_creation===-1 ? "":organizeDetail.max_repo_creation }) setImage(organizeDetail.avatar_url); setDescNum(organizeDetail.description ? organizeDetail.description.length : 0); @@ -39,10 +40,10 @@ export default Form.create()( },[organizeDetail]) const helper = useCallback( - (label, name, rules, widget , isRequired , flag ) => ( + (label, name, rules, widget , isRequired , flag , help ) => (
    {label} - + {getFieldDecorator(name, { rules, validateFirst: true , valuePropName:flag ? "checked":"value" })(widget)}
    @@ -62,7 +63,7 @@ export default Form.create()( showNotification("组织信息更新成功!"); if(values.name !== organizeDetail.name){ console.log("false111"); - history.push(`/organize/${values.name}/setting`); + history.push(`/${values.name}/setting`); } updateFunc && updateFunc(values.name,values.description); } @@ -92,7 +93,7 @@ export default Form.create()( }).then(result=>{ if(result && result.data){ // 删除后跳转到个人中心的组织页面 - history.push(`/users/${current_user && current_user.login}/organizes`); + history.push(`/${current_user && current_user.login}/organizes`); } }) setVisible(false); @@ -168,14 +169,15 @@ export default Form.create()( '权限:', "repo_admin_change_team_access", [], - 仓库管理员可以添加或移除团队的访问权限,false,true + 项目管理员可以添加或移除团队的访问权限,false,true )} {helper( '最大仓库数:', "max_repo_creation", [], - + ,false,false, + "当输入栏为空时,默认数量无限制" )}

    选择头像:

    diff --git a/src/forge/Team/Setting/TeamSettingGroup.jsx b/src/forge/Team/Setting/TeamSettingGroup.jsx index 006d579c..8ebdb4af 100644 --- a/src/forge/Team/Setting/TeamSettingGroup.jsx +++ b/src/forge/Team/Setting/TeamSettingGroup.jsx @@ -3,11 +3,11 @@ import { WhiteBack , Banner } from '../../Component/layout'; import GroupItems from '../TeamGroupItems'; const limit = 8; -function TeamSettingGroup({organizeDetail,history}){ +function TeamSettingGroup({organizeDetail,history,current_user}){ return( 组织团队管理 - + ) } diff --git a/src/forge/Team/Setting/TeamSettingIndex.jsx b/src/forge/Team/Setting/TeamSettingIndex.jsx index 718f5b5f..462a92d1 100644 --- a/src/forge/Team/Setting/TeamSettingIndex.jsx +++ b/src/forge/Team/Setting/TeamSettingIndex.jsx @@ -30,21 +30,21 @@ export default (( props )=>{ function returnActive (pathname){ let a = 0; - if(pathname === `/organize/${OIdentifier}/setting/member`){ + if(pathname === `/${OIdentifier}/setting/member`){ a = 1; - }else if(pathname === `/organize/${OIdentifier}/setting/group`){ + }else if(pathname === `/${OIdentifier}/setting/group`){ a = 2; - }else if(pathname === `/organize/${OIdentifier}/setting/hooks`){ + }else if(pathname === `/${OIdentifier}/setting/hooks`){ a = 3; } return a; } const active = returnActive(pathname); const array = {list:[ - {name:'基本设置',icon:"icon-base",href:`/organize/${OIdentifier}/setting`}, - {name:'组织成员管理',icon:"icon-zuzhichengyuan",href:`/organize/${OIdentifier}/setting/member`}, - {name:'组织团队管理',icon:"icon-zuzhixiangmu",href:`/organize/${OIdentifier}/setting/group`}, - // {name:'管理web钩子',icon:"icon-zhongqingdianxinicon10",href:`/organize/${OIdentifier}/setting/hooks`} + {name:'基本设置',icon:"icon-base",href:`/${OIdentifier}/setting`}, + {name:'组织成员管理',icon:"icon-zuzhichengyuan",href:`/${OIdentifier}/setting/member`}, + {name:'组织团队管理',icon:"icon-zuzhixiangmu",href:`/${OIdentifier}/setting/group`}, + // {name:'管理web钩子',icon:"icon-zhongqingdianxinicon10",href:`/${OIdentifier}/setting/hooks`} ], active } @@ -58,25 +58,25 @@ export default (( props )=>{
    ( )} > ( )} > ( )} > ( )} diff --git a/src/forge/Team/Setting/TeamSettingMember.jsx b/src/forge/Team/Setting/TeamSettingMember.jsx index 34f0e28e..1ead66e9 100644 --- a/src/forge/Team/Setting/TeamSettingMember.jsx +++ b/src/forge/Team/Setting/TeamSettingMember.jsx @@ -64,7 +64,7 @@ export default (({organizeDetail})=>{ width:"5%", render:(value)=>{ return( - value && + value && ) } }, @@ -73,7 +73,7 @@ export default (({organizeDetail})=>{ dataIndex: 'user', width:"15%", render:(value,item)=>{ - return {value && value.name} + return {value && value.name} } }, { diff --git a/src/forge/Team/Sub/Detail.jsx b/src/forge/Team/Sub/Detail.jsx index 6e048a05..f591c864 100644 --- a/src/forge/Team/Sub/Detail.jsx +++ b/src/forge/Team/Sub/Detail.jsx @@ -38,12 +38,12 @@ function Detail(props){ // 设置页面:顶部不需要设置按钮了 useEffect(()=>{ if(pathname){ - if(pathname.indexOf(`/organize/${OIdentifier}/setting`)>-1){ + if(pathname.indexOf(`/${OIdentifier}/setting`)>-1){ setFlag(false); }else{ setFlag(true); } - if(pathname.indexOf(`/organize/${OIdentifier}/group`)>-1 || pathname.indexOf(`/organize/${OIdentifier}/member`)>-1){ + if(pathname.indexOf(`/${OIdentifier}/teams`)>-1 || pathname.indexOf(`/${OIdentifier}/members`)>-1){ setButtonflagFlag(true); }else{ setButtonflagFlag(false); @@ -77,19 +77,19 @@ function Detail(props){ { detail && {flag && !buttonflag && detail.is_admin ? - 设置 + 设置 :""} {buttonflag && - 组织成员{detail.num_users && {detail.num_users}} - 组织团队{detail.num_teams &&{detail.num_teams}} + 组织成员{detail.num_users && {detail.num_users}} + 组织团队{detail.num_teams &&{detail.num_teams}} } @@ -112,33 +112,33 @@ function Detail(props){ {/* 组织团队-详情 */} { return }} > {/* 组织成员 */} { return }} > {/* 组织团队 */} { return }} > { return }} > { return }} diff --git a/src/forge/Team/Sub/SubDetail.jsx b/src/forge/Team/Sub/SubDetail.jsx index 7b653c55..b4f1d036 100644 --- a/src/forge/Team/Sub/SubDetail.jsx +++ b/src/forge/Team/Sub/SubDetail.jsx @@ -22,7 +22,7 @@ export default ((props)=>{ // 设置页面:顶部不需要设置按钮了 useEffect(()=>{ if(pathname){ - if(pathname.indexOf(`/organize/${OIdentifier}/group/${groupId}/setting`)>-1){ + if(pathname.indexOf(`/${OIdentifier}/teams/${groupId}/setting`)>-1){ setFlag(false); }else{ setFlag(true); @@ -48,19 +48,19 @@ export default ((props)=>{
    - {OIdentifier} + {OIdentifier} {detail ? detail.name : "新建团队"}
    { detail && - 组织成员{detail.num_users && {detail.num_users}} - 组织团队{detail.num_teams &&{detail.num_teams}} + 组织成员{detail.num_users && {detail.num_users}} + 组织团队{detail.num_teams &&{detail.num_teams}} } desc={!flag && detail.description} @@ -69,7 +69,7 @@ export default ((props)=>{ {/* 组织团队-设置 */} { return }} diff --git a/src/forge/Team/TeamGroup.jsx b/src/forge/Team/TeamGroup.jsx index 38725e7d..1920caed 100644 --- a/src/forge/Team/TeamGroup.jsx +++ b/src/forge/Team/TeamGroup.jsx @@ -3,11 +3,11 @@ import { Banner } from '../Component/layout'; import GroupItems from './TeamGroupItems'; const limit = 14; -function TeamGroup({organizeDetail,history}){ +function TeamGroup({organizeDetail,history,current_user}){ return(
    组织团队 - +
    ) } diff --git a/src/forge/Team/TeamGroupItems.jsx b/src/forge/Team/TeamGroupItems.jsx index e96a310d..5a955818 100644 --- a/src/forge/Team/TeamGroupItems.jsx +++ b/src/forge/Team/TeamGroupItems.jsx @@ -17,7 +17,7 @@ const ImgContent = styled.img`{ border-radius:50%; margin:5px 10px; }` -function TeamGroupItems({organizeDetail,limit, count , history}){ +function TeamGroupItems({organizeDetail,limit, count , history ,current_user}){ const [ page , setPage ] = useState(1); const [ isSpin , setIsSpin ] = useState(true); const [ total , setTotal ] = useState(0); @@ -48,12 +48,13 @@ function TeamGroupItems({organizeDetail,limit, count , history}){ axios.delete(url).then(result =>{ if(result && result.data){ getData(); + history.push(`/${current_user && current_user.login}`); } }).catch(error=>{}) } // 团队设置 function toGroupSetting(id){ - history.push(`/organize/${organizeDetail && organizeDetail.name}/group/${id}/setting`); + history.push(`/${organizeDetail && organizeDetail.name}/teams/${id}/setting`); } // 解散团队 function disMissGroup(id){ @@ -75,7 +76,12 @@ function TeamGroupItems({organizeDetail,limit, count , history}){ return(

    - {item.nickname} + { + (item.is_admin || item.is_member) ? + {item.nickname} + : + {item.nickname} + } { item.is_admin && item.authorize!=="owner" && disMissGroup(item.id)}>解散团队} { item.is_member && } @@ -86,10 +92,10 @@ function TeamGroupItems({organizeDetail,limit, count , history}){ { item.users && item.users.map((i,k)=>{ return( - k < count ? + k < count ? : k === count ? - + :"" ) }) diff --git a/src/forge/UsersList/common_users.js b/src/forge/UsersList/common_users.js index dac45f48..e8404b38 100644 --- a/src/forge/UsersList/common_users.js +++ b/src/forge/UsersList/common_users.js @@ -93,7 +93,13 @@ class CommonUsers extends Component { {count === 0 ? ( ) : ( - + )}

    diff --git a/src/forge/UsersList/focus_button.js b/src/forge/UsersList/focus_button.js index 0d099fd6..a2e93bde 100644 --- a/src/forge/UsersList/focus_button.js +++ b/src/forge/UsersList/focus_button.js @@ -3,7 +3,7 @@ import axios from "axios"; import { Button } from "antd"; import "./list.css"; -function FocusButton({is_watch , fontClass, starText, is_block , id , successFunc}){ +function FocusButton({is_watch , fontClass, starText, is_block , id , successFunc,notReset}){ const [ isSpin , setIsSpin ] = useState(false); const [ watchFlag , setWatchFlag ] = useState(is_watch); // 关注和取消关注 @@ -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(notReset){ + setWatchFlag(!watchFlag); + } } setIsSpin(false); }) diff --git a/src/forge/UsersList/fork_users.js b/src/forge/UsersList/fork_users.js index e38f4619..23cd5bea 100644 --- a/src/forge/UsersList/fork_users.js +++ b/src/forge/UsersList/fork_users.js @@ -83,7 +83,7 @@ class ForkUsers extends Component {
    { + renderList = (users, userClass, current_user, type_title , successFunc , notReset) => { if (users && users.length > 0) { return users.map((item, key) => { return ( @@ -14,7 +14,7 @@ class UserList extends Component {
    @@ -53,9 +53,9 @@ class UserList extends Component { } } render() { - const { users, userClass, current_user , type_title , successFunc } = this.props; + const { users, userClass, current_user , type_title , successFunc , notReset , title_type } = this.props; return ( - this.renderList(users, userClass, current_user, type_title , successFunc) + this.renderList(users, userClass, current_user, type_title , successFunc , notReset , title_type) ); } } diff --git a/src/forge/Version/New.jsx b/src/forge/Version/New.jsx index f2e7ae61..0678a345 100644 --- a/src/forge/Version/New.jsx +++ b/src/forge/Version/New.jsx @@ -103,7 +103,7 @@ export default Form.create()( .then(result => { if (result) { showNotification("版本修改成功!"); - history.push(`/projects/${owner}/${projectsId}/releases`); + history.push(`/${owner}/${projectsId}/releases`); } }); } else { @@ -116,7 +116,7 @@ export default Form.create()( .then(result => { if (result) { showNotification("版本发布成功!"); - history.push(`/projects/${owner}/${projectsId}/releases`); + history.push(`/${owner}/${projectsId}/releases`); } }); } @@ -233,7 +233,7 @@ export default Form.create()(
    diff --git a/src/forge/Wiki/EditWiki.jsx b/src/forge/Wiki/EditWiki.jsx index ae30b446..a7b4911d 100644 --- a/src/forge/Wiki/EditWiki.jsx +++ b/src/forge/Wiki/EditWiki.jsx @@ -126,7 +126,7 @@ export default Form.create()(({ form, history, showNotification, projectDetail, } function goBack() { - history.push(`/projects/${owner}/${projectsId}/wiki`); + history.push(`/${owner}/${projectsId}/wiki`); } function changeModal(e) { diff --git a/src/forge/Wiki/Index.css b/src/forge/Wiki/Index.css new file mode 100644 index 00000000..9649763a --- /dev/null +++ b/src/forge/Wiki/Index.css @@ -0,0 +1,348 @@ +body { + width: 100% !important; +} + +.ant-spin-nested-loading > div > .ant-spin.opacitySpin { + max-height: 100vh; + background: white; +} + +.wiki-main { + width: 1200px; + min-height: 400px; + margin: 20px auto; +} +.wiki-main .ant-btn-primary { + background-color: #466aff; + border-color: #466aff; +} +.wiki-main .ant-btn-primary:hover, .wiki-main .ant-btn-primary:focus, .wiki-main .ant-btn-primary:active { + background-color: #6482ff; +} +.wiki-main .ant-btn-default:hover, +.wiki-main .ant-btn-default:active, +.wiki-main .ant-btn-default:focus { + background: #f3f4f6; + color: #333; + border-color: #d0d0d0; +} +.wiki-main .wiki-head { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 20px; + height: 64px; + background: #fafcff; + box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.13); + border-radius: 4px; + border-bottom-left-radius: 0; +} +.wiki-main .wiki-head .ant-btn .anticon { + margin: 0 -3px 0 0; +} +.wiki-main .head-title { + font-size: 20px; + color: #05101a; + line-height: 30px; + font-weight: 500; +} +.wiki-main .head-title .anticon-right { + color: #666; + font-size: 0.9rem; +} +.wiki-main .back-wiki { + color: #466aff; + cursor: pointer; +} +.wiki-main .back-wiki:hover { + color: #6482ff; +} +.wiki-main .head-log-middle { + width: 3rem; + height: 3rem; + margin-right: 0.35rem; + border-radius: 50%; +} +.wiki-main .head-log-small { + width: 1.25rem; + height: 1.25rem; + margin-right: 0.35rem; + border-radius: 50%; +} +.wiki-main .user-box { + font-size: 12px; + font-family: "PingFangSC-Medium"; + color: #466aff; + cursor: pointer; +} +.wiki-main .user-box:hover { + color: #6482ff; +} +.wiki-main .user-box .head-log-small { + position: relative; + top: -2px; +} +.wiki-main .time-ago { + font-size: 12px; + color: #333; + letter-spacing: 0; + line-height: 17px; + font-weight: 400; + font-family: "PingFangSC-Regular"; +} +.wiki-main .has-error .ant-form-explain, +.wiki-main .has-error .ant-form-split { + position: absolute; +} +.wiki-main .wiki-nav { + max-height: 60vh; +} +.wiki-main .wiki-nav .wiki-search { + padding: 0 14px; +} +.wiki-main .wiki-nav .wiki-search .ant-input { + padding-left: 30px; +} +.wiki-main .wiki-nav .wiki-search .ant-input-suffix { + left: 26px; + right: auto; +} +.wiki-main .wiki-nav .wiki-search:hover .ant-input, .wiki-main .wiki-nav .wiki-search:focus .ant-input { + border-color: #466aff !important; +} +.wiki-main .wiki-nav-parent { + width: 260px; + flex: none; +} +.wiki-main .ant-form-item-children .ant-input:hover { + border-color: #466aff !important; +} +.wiki-main .ant-checkbox-checked .ant-checkbox-inner { + background-color: #466aff; + border-color: #466aff; +} +.wiki-main .ant-radio-checked .ant-radio-inner, +.wiki-main .ant-radio-checked::after { + border-color: #466aff; +} +.wiki-main .ant-radio-inner::after { + background-color: #466aff; +} +.wiki-main .ant-radio-group { + display: block; + margin: 10px 0 0 30px; +} +.wiki-main .ant-radio-wrapper:hover .ant-radio, +.wiki-main .ant-radio:hover .ant-radio-inner, +.wiki-main .ant-radio-input:focus + .ant-radio-inner { + border-color: #466aff; +} + +#wikiUrl:focus { + border-right: 1px solid #d9d9d9 !important; +} + +.wiki-body { + display: flex; +} + +.wiki-content { + flex: auto; + width: 75%; +} + +.wiki-content-detail { + padding: 0 20px; + word-break: break-all; +} + +.ant-input-group.ant-input-group-compact.copy-url { + display: flex; + margin-top: 20px; +} +.ant-input-group.ant-input-group-compact.copy-url .ant-select-selection__rendered { + margin: 0 14px 0 5px; + width: 3rem; + font-size: 12px; +} +.ant-input-group.ant-input-group-compact.copy-url .ant-select-arrow { + right: 4px; +} +.ant-input-group.ant-input-group-compact.copy-url .ant-input { + font-size: 12px; + font-family: "PingFangSC-Regular"; + color: #666; + letter-spacing: 0; + font-weight: 400; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + word-break: break-all; +} +.ant-input-group.ant-input-group-compact.copy-url .copy-svg { + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0 5px; + background: #fff; + font-size: 1rem !important; + border: 1px solid #d9d9d9; + border-left: 0; + color: #466aff; + cursor: pointer; +} + +.wiki-url-type .ant-select-dropdown-menu-item { + font-size: 12px; +} + +.wiki-nav { + min-height: 300px; + padding: 20px 0; + background: #ffffff; + border: 1px solid rgba(153, 153, 153, 0.22); + overflow-y: scroll; + flex: none; + color: #333; +} + +.wiki-nav-title { + display: flex; + justify-content: space-between; + align-items: center; + height: 50px; + padding: 0 10px 0 10px; + font-size: 14px; + letter-spacing: 0; + font-weight: 400; + font-family: "PingFangSC-Regular"; + border-bottom: 1px solid #eee; + line-height: 16px; + cursor: pointer; +} +.wiki-nav-title .delete-title-icon { + display: none; +} +.wiki-nav-title:hover { + background-color: #fbfbfb; +} +.wiki-nav-title:hover .delete-title-icon { + display: inline-block; +} + +.wiki-nav-title-parent { + padding: 0 14px; +} +.wiki-nav-title-parent:hover { + background: #fbfbfb; +} + +.wiki-nav-title.active { + color: #466aff; +} + +.wiki-content-head { + margin: 20px 0 20px 20px; + padding: 0 20px 20px 0; + display: flex; + justify-content: space-between; + align-items: center; + border-bottom: 1px solid #eee; +} + +.wiki-content-head-left { + width: 90%; +} + +.nav-title-left { + display: inline-flex; + max-width: 90%; +} +.nav-title-left svg { + margin-right: 0.5rem; + flex: none; +} +.nav-title-left .nav-title-left-text { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.wiki-detail-title { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.wiki-preview { + overflow-y: scroll; + height: 100%; +} +.wiki-preview .wiki-body { + width: 90%; +} +.wiki-preview .ant-btn-primary { + background-color: #466aff; + border-color: #466aff; +} +.wiki-preview .ant-btn-primary:hover, .wiki-preview .ant-btn-primary:focus, .wiki-preview .ant-btn-primary:active { + background-color: #6482ff; +} +.wiki-preview .preview-head { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 12rem 0 2rem; + width: 100%; + height: 80px; + background: #272f4c; + color: #fff; +} +.wiki-preview .preview-head-left { + display: inline-flex; + align-items: center; + font-size: 24px; + cursor: pointer; +} +.wiki-preview .preview-head-left .icon-wendangyulan_icon { + font-size: 24px !important; + font-weight: 700; +} +.wiki-preview .preview-head-right { + display: flex; +} +.wiki-preview .preview-head-right .copy-url { + margin-top: 0; +} +.wiki-preview .preview-head-right .copy-desc { + width: 6rem; + padding-top: 1px; +} +.wiki-preview .wiki-nav-title { + padding: 0 10px 0 40px; +} +.wiki-preview .wiki-nav-title.active { + background-color: #f3f4f6; +} +.wiki-preview .wiki-content-head { + padding: 10px 20px 10px 20px; +} +.wiki-preview .wiki-nav { + padding: 20px 0; + width: 20vw; + border-bottom: 0; + height: 80vh; +} +.wiki-preview .wiki-content-detail { + padding: 0 40px; +} +.wiki-preview .wiki-content-detail img { + max-width: 100%; +} +.wiki-preview .ant-btn:hover { + background: #f3f4f6; + color: #333; + border-color: #d0d0d0; +} + +/*# sourceMappingURL=Index.css.map */ diff --git a/src/forge/Wiki/Index.css.map b/src/forge/Wiki/Index.css.map new file mode 100644 index 00000000..eaa14087 --- /dev/null +++ b/src/forge/Wiki/Index.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["Index.scss"],"names":[],"mappings":"AAEA;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;;AAEA;EACE,kBAfQ;EAgBR,cAhBQ;;AAiBR;EAGE,kBAnBY;;AAuBhB;AAAA;AAAA;EAGE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAIJ;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAIJ;EACE,OA5DQ;EA6DR;;AACA;EACE,OA9DY;;AAkEhB;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA,OApFQ;EAqFR;;AACA;EACE,OAtFY;;AAwFd;EACE;EACA;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;AAAA;EAEE;;AAEF;EACE;;AACA;EACE;;AACA;EACE;;AAEF;EACE;EACA;;AAEF;EAEE;;AAKN;EACE;EACA;;AAGF;EACE;;AAGF;EACE,kBAxIQ;EAyIR,cAzIQ;;AA2IV;AAAA;EAEE,cA7IQ;;AAgJV;EACE,kBAjJQ;;AAoJV;EACE;EACA;;AAGF;AAAA;AAAA;EAGE,cA5JQ;;;AAgKZ;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;;AACA;EACE;EACA;EACA;;AAEF;EACE;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAlNQ;EAmNR;;;AAKF;EACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AACA;EACE;;;AAKN;EACE;;AACA;EACE;;;AAIJ;EACE,OAzQU;;;AA4QZ;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;;AACA;EACE;EACA;;AAEF;EACE;EACA;EACA;;;AAIJ;EACE;EACA;EACA;;;AAGF;EACE;EACA;;AACA;EACE;;AAEF;EACE,kBApTQ;EAqTR,cArTQ;;AAsTR;EAGE,kBAxTY;;AA2ThB;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAIJ;EACE;;AAEA;EACE;;AAEF;EACE;EACA;;AAIJ;EACE;;AAEF;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;;AAEF;EACE;;AACA;EACE;;AAIJ;EACE;EACA;EACA","file":"Index.css"} \ No newline at end of file diff --git a/src/forge/Wiki/Index.jsx b/src/forge/Wiki/Index.jsx index ed5c4899..f15b1968 100644 --- a/src/forge/Wiki/Index.jsx +++ b/src/forge/Wiki/Index.jsx @@ -2,7 +2,7 @@ import React, { useEffect, useCallback, useState } from 'react'; import { Button, Dropdown, Icon, Input, Menu, Tooltip, Select, Upload, message, Spin } from 'antd'; import { getImageUrl, timeAgo } from 'educoder'; import cookie from 'react-cookies'; -// import Loading from "../../Loading"; +import CopyTool from '../Component/CopyTool'; import DelModal from './components/ModalFun'; import Welcome from './Welcome'; import { wikiPages, getWiki, deleteWiki } from './api'; @@ -14,15 +14,12 @@ const InputGroup = Input.Group; const { Option } = Select; export default (props) => { - const { match, current_user, history, showNotification, project, projectDetail } = props; - // const permission = projectDetail && projectDetail.permission !== "Reporter"; + const { match, history, showNotification, project, projectDetail } = props; const permission = projectDetail && projectDetail.permission && projectDetail.permission !== "Reporter"; let projectsId = match.params.projectsId; let owner = match.params.owner; - console.log(project); - const [fileArrInit, setFileArrInit] = useState(null); const [checkItem, setCheckItem] = useState({}); const [itemDetail, setItemDetail] = useState({}); @@ -85,7 +82,7 @@ export default (props) => { DelModal({ title: '删除页面', contentTitle: `您确定要删除“${item.name}”此页面吗?`, - content: '此操作将删除该页面,请进行确认以防文件的丢失。', + content: '此操作将删除该页面,请进行确认以防文件的丢失', onOk: () => { deleteWiki({ owner: owner, @@ -106,30 +103,19 @@ export default (props) => { function goUser(login) { - window.location.href = `/users/${login}`; + window.location.href = `/${login}`; } - // 复制链接 - const copyUrl = useCallback(() => { - let wikiUrl = document.getElementById("wikiUrl"); - wikiUrl.select(); - if (document.execCommand('copy')) { - document.execCommand('copy'); - } - message.success('复制成功'); - wikiUrl.blur(); - }, []) - function addFile() { - history.push(`/projects/${owner}/${projectsId}/wiki/add`); + history.push(`/${owner}/${projectsId}/wiki/add`); } function goEdit() { - history.push(`/projects/${owner}/${projectsId}/wiki/edit/${encodeURI(checkItem.name)}`); + history.push(`/${owner}/${projectsId}/wiki/edit/${encodeURI(checkItem.name)}`); } function preview() { - window.open(`/projects/${owner}/${projectsId}/wiki/preview/${encodeURI(project.name)}/${project.id}`); + window.open(`/${owner}/${projectsId}/wiki/preview/${encodeURI(project.name)}/${project.id}`); } // 支持 Markdown,Html,Pdf格式文件 @@ -231,6 +217,7 @@ export default (props) => { +
    @@ -246,8 +233,8 @@ export default (props) => { { fileArr.map(item => { - return
    -
    { setCheckItem(item) }}> + return
    +
    { setCheckItem(item) }}>
    {item.name} @@ -266,9 +253,7 @@ export default (props) => { - - - + }
    @@ -277,11 +262,11 @@ export default (props) => {

    {checkItem.name}

    - { goUser(current_user.login) }}> + { checkItem.commit && goUser(checkItem.commit.author.name) }}> {itemDetail.image_url && 头像} - {checkItem.commit ? checkItem.commit.author.name : ''} + {itemDetail.userName} - 上次修改于{checkItem.commit && timeAgo(checkItem.commit.author.when)} + 上次修改于{checkItem.commit ? timeAgo(checkItem.commit.author.when):'刚刚'}
    {permission && }
    diff --git a/src/forge/Wiki/Index.scss b/src/forge/Wiki/Index.scss index c571da25..e40de299 100644 --- a/src/forge/Wiki/Index.scss +++ b/src/forge/Wiki/Index.scss @@ -199,7 +199,7 @@ body { word-break: break-all; } - .copy-svg { + .copy-wiki { display: inline-flex; align-items: center; justify-content: center; diff --git a/src/forge/Wiki/Preview.jsx b/src/forge/Wiki/Preview.jsx index 20645246..93ebe2e8 100644 --- a/src/forge/Wiki/Preview.jsx +++ b/src/forge/Wiki/Preview.jsx @@ -1,5 +1,6 @@ import React, { useEffect, useCallback, useState } from 'react'; -import { Input, Button, Tooltip, Select, Dropdown, Icon, Menu, message } from 'antd'; +import { Input, Button, Select, Dropdown, Icon, Menu, message } from 'antd'; +import CopyTool from '../Component/CopyTool'; import { wikiPages, getWiki, } from './api'; import { httpUrl } from './fetch'; import './Index.scss'; @@ -59,22 +60,12 @@ export default (props) => { }); }, [project, checkItem]); - const copyUrl = useCallback(() => { - let wikiUrl = document.getElementById("wikiUrl"); - wikiUrl.select(); - if (document.execCommand('copy')) { - document.execCommand('copy'); - } - message.success('复制成功'); - wikiUrl.blur(); - }, []); - function goEdit() { - history.push(`/projects/${owner}/${projectsId}/wiki/edit/${checkItem.name}`); + history.push(`/${owner}/${projectsId}/wiki/edit/${checkItem.name}`); } function goBack() { - history.push(`/projects/${owner}/${projectsId}/wiki`); + history.push(`/${owner}/${projectsId}/wiki`); } // 支持 Markdown,Html,Pdf格式文件 @@ -113,9 +104,7 @@ export default (props) => { - - - + } diff --git a/src/forge/Wiki/Welcome/index.css b/src/forge/Wiki/Welcome/index.css new file mode 100644 index 00000000..d146549c --- /dev/null +++ b/src/forge/Wiki/Welcome/index.css @@ -0,0 +1,51 @@ +.welcome-main { + display: flex; + flex-flow: column nowrap; + justify-content: center; + align-items: center; + width: 1200px; + min-height: 400px; + padding: 20px; + margin: 20px auto; + background: #fafcff; + font-family: "PingFangSC-Medium"; + border-radius: 4px; + border: 1px solid rgba(42, 97, 255, 0.23); +} +.welcome-main .icon-huanying_icon { + font-size: 48px !important; + font-weight: 700; +} +.welcome-main .welcome-title { + display: inline-flex; + align-items: center; + margin: 10px 0; + font-size: 26px; + color: #333333; + font-weight: 500; +} +.welcome-main .wiki-title { + display: inline-block; + max-width: 20em; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.welcome-main .welcome-content { + font-size: 14px; + color: #333333; + font-weight: 400; +} +.welcome-main .wiki-line { + margin: 50px 0 40px; + width: 400px; + height: 1px; + background: #eeeeee; +} +.welcome-main .welcome-des { + font-size: 16px; + color: #333333; + font-weight: 500; +} + +/*# sourceMappingURL=index.css.map */ diff --git a/src/forge/Wiki/Welcome/index.css.map b/src/forge/Wiki/Welcome/index.css.map new file mode 100644 index 00000000..2dcfff0d --- /dev/null +++ b/src/forge/Wiki/Welcome/index.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["index.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA","file":"index.css"} \ No newline at end of file diff --git a/src/forge/Wiki/Welcome/index.jsx b/src/forge/Wiki/Welcome/index.jsx index 78cd34e4..fc3af6ef 100644 --- a/src/forge/Wiki/Welcome/index.jsx +++ b/src/forge/Wiki/Welcome/index.jsx @@ -27,7 +27,7 @@ export default ({ project, isManager, history, showNotification, match, reloadLi // } function addFile() { - history.push(`/projects/${owner}/${projectsId}/wiki/add`); + history.push(`/${owner}/${projectsId}/wiki/add`); } return ( diff --git a/src/forge/Wiki/components/FolderTree/index.css b/src/forge/Wiki/components/FolderTree/index.css new file mode 100644 index 00000000..58d79c6b --- /dev/null +++ b/src/forge/Wiki/components/FolderTree/index.css @@ -0,0 +1,32 @@ +.hide-file-icon.ant-tree.ant-tree-directory li span.ant-tree-switcher { + display: none !important; +} +.hide-file-icon.ant-tree.ant-tree-directory .ant-tree-node-content-wrapper { + display: inline-flex; + width: 100%; +} +.hide-file-icon.ant-tree.ant-tree-directory .tree-title-icon { + display: none; +} +.hide-file-icon.ant-tree.ant-tree-directory .ant-tree-node-content-wrapper:hover .tree-title-icon { + transition: all 0.3s; + display: inline-block; +} +.hide-file-icon.ant-tree.ant-tree-directory.ant-tree.ant-tree-directory > li.ant-tree-treenode-selected > span.ant-tree-node-content-wrapper::before, .hide-file-icon.ant-tree.ant-tree-directory.ant-tree.ant-tree-directory .ant-tree-child-tree > li.ant-tree-treenode-selected > span.ant-tree-node-content-wrapper::before { + background: #fff; + margin-top: -3px; +} +.hide-file-icon.ant-tree.ant-tree-directory.ant-tree.ant-tree-directory > li span.ant-tree-node-content-wrapper::before, .hide-file-icon.ant-tree.ant-tree-directory.ant-tree.ant-tree-directory .ant-tree-child-tree > li span.ant-tree-node-content-wrapper::before { + margin-top: -3px; +} +.hide-file-icon.ant-tree.ant-tree-directory > li span.ant-tree-node-content-wrapper.ant-tree-node-selected, +.hide-file-icon.ant-tree.ant-tree-directory .ant-tree-child-tree > li span.ant-tree-node-content-wrapper.ant-tree-node-selected { + color: #2a61ff; +} +.hide-file-icon.ant-tree.ant-tree-directory .ant-tree-title { + display: inline-flex; + justify-content: space-between; + flex: auto; +} + +/*# sourceMappingURL=index.css.map */ diff --git a/src/forge/Wiki/components/FolderTree/index.css.map b/src/forge/Wiki/components/FolderTree/index.css.map new file mode 100644 index 00000000..8f0725b1 --- /dev/null +++ b/src/forge/Wiki/components/FolderTree/index.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["index.scss"],"names":[],"mappings":"AACE;EACE;;AASF;EACE;EACA;;AAGF;EACE;;AAGF;EACE;EACA;;AAGF;EAOE;EACA;;AAGF;EAKE;;AAGF;AAAA;EAIE;;AAKF;EACE;EACA;EACA","file":"index.css"} \ No newline at end of file diff --git a/src/forge/Wiki/components/Login/index.css b/src/forge/Wiki/components/Login/index.css new file mode 100644 index 00000000..448243d6 --- /dev/null +++ b/src/forge/Wiki/components/Login/index.css @@ -0,0 +1,56 @@ +.delete-modal .ant-modal-header { + padding: 9px 24px; + background: #f8f8f8; + border-bottom: 1px solid #eee; +} +.delete-modal .ant-modal-title { + text-align: left; +} +.delete-modal .ant-modal-close { + top: 0px !important; +} +.delete-modal .ant-modal-close-x { + font-size: 24px; +} +.delete-modal .ant-modal-body { + text-align: center; +} +.delete-modal .delete-title { + display: flex; + justify-content: center; + align-items: center; + margin: 2rem 0 1rem !important; + font-size: 16px; + color: #333; + letter-spacing: 0; + line-height: 29px; + font-weight: 400; +} +.delete-modal .red-circle { + align-self: flex-start; + color: #ca0002; + font-size: 1.5rem !important; +} +.delete-modal .delete-descibe { + font-size: 14px; + color: #666; + line-height: 33px; + font-weight: 400; +} +.delete-modal .ant-modal-footer { + padding: 2rem 0; + text-align: center; + border: 0; +} +.delete-modal .ant-modal-footer .ant-btn { + width: 6rem; +} +.delete-modal .foot-submit { + margin-left: 3rem; + color: #df0002; +} +.delete-modal .foot-submit:hover { + border-color: #df0002; +} + +/*# sourceMappingURL=index.css.map */ diff --git a/src/forge/Wiki/components/Login/index.css.map b/src/forge/Wiki/components/Login/index.css.map new file mode 100644 index 00000000..a770694c --- /dev/null +++ b/src/forge/Wiki/components/Login/index.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["index.scss"],"names":[],"mappings":"AACE;EACE;EACA;EACA;;AAEF;EACE;;AAEF;EACE;;AAEF;EACE;;AAEF;EACE;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AACA;EACE;;AAGJ;EACE;EACA;;AACA;EACE","file":"index.css"} \ No newline at end of file diff --git a/src/forge/Wiki/components/Login/index.jsx b/src/forge/Wiki/components/Login/index.jsx index 9574a9a5..abfa5295 100644 --- a/src/forge/Wiki/components/Login/index.jsx +++ b/src/forge/Wiki/components/Login/index.jsx @@ -1,10 +1,9 @@ import React, { useState } from 'react'; import * as ReactDOM from 'react-dom'; import LoginDialog from '../../../../modules/login/LoginDialog'; -import './index.scss'; -// 使用函数调用删除组件 -export default function DelModal(props) { +// 使用函数调用登录组件 +export default function Login(props) { const div = document.createElement('div'); document.body.appendChild(div); @@ -16,9 +15,6 @@ export default function DelModal(props) { } function render() { - /** - * Sync render blocks React event. Let's make this async. - */ setTimeout(() => { ReactDOM.render( diff --git a/src/forge/Wiki/components/Login/index.scss b/src/forge/Wiki/components/Login/index.scss deleted file mode 100644 index 13d16066..00000000 --- a/src/forge/Wiki/components/Login/index.scss +++ /dev/null @@ -1,56 +0,0 @@ -.delete-modal { - .ant-modal-header { - padding: 9px 24px; - background: #f8f8f8; - border-bottom: 1px solid #eee; - } - .ant-modal-title { - text-align: left; - } - .ant-modal-close { - top: 0px !important; - } - .ant-modal-close-x { - font-size: 24px; - } - .ant-modal-body { - text-align: center; - } - .delete-title { - display: flex; - justify-content: center; - align-items: center; - margin: 2rem 0 1rem !important; - font-size: 16px; - color: #333; - letter-spacing: 0; - line-height: 29px; - font-weight: 400; - } - .red-circle { - align-self: flex-start; - color: #ca0002; - font-size: 1.5rem !important; - } - .delete-descibe { - font-size: 14px; - color: #666; - line-height: 33px; - font-weight: 400; - } - .ant-modal-footer { - padding: 2rem 0; - text-align: center; - border: 0; - .ant-btn { - width: 6rem; - } - } - .foot-submit { - margin-left: 3rem; - color: #df0002; - &:hover { - border-color: #df0002; - } - } -} \ No newline at end of file diff --git a/src/forge/Wiki/components/ModalFun/index.css b/src/forge/Wiki/components/ModalFun/index.css new file mode 100644 index 00000000..0f7ef948 --- /dev/null +++ b/src/forge/Wiki/components/ModalFun/index.css @@ -0,0 +1,56 @@ +.myself-modal .ant-modal-header { + padding: 9px 24px; + background: #f8f8f8; + border-bottom: 1px solid #eee; +} +.myself-modal .ant-modal-title { + text-align: left; +} +.myself-modal .ant-modal-close { + top: 0px !important; +} +.myself-modal .ant-modal-close-x { + font-size: 24px; +} +.myself-modal .ant-modal-body { + text-align: center; +} +.myself-modal .delete-title { + display: flex; + justify-content: center; + align-items: center; + margin: 2rem 0 1rem !important; + font-size: 16px; + color: #333; + letter-spacing: 0; + line-height: 29px; + font-weight: 400; +} +.myself-modal .red-circle { + align-self: flex-start; + color: #ca0002; + font-size: 1.5rem !important; +} +.myself-modal .delete-descibe { + font-size: 14px; + color: #666; + line-height: 33px; + font-weight: 400; +} +.myself-modal .ant-modal-footer { + padding: 2rem 0; + text-align: center; + border: 0; +} +.myself-modal .ant-modal-footer .ant-btn { + width: 6rem; +} +.myself-modal .foot-submit { + margin-left: 3rem; + color: #df0002; +} +.myself-modal .foot-submit:hover { + border-color: #df0002; +} + +/*# sourceMappingURL=index.css.map */ diff --git a/src/forge/Wiki/components/ModalFun/index.css.map b/src/forge/Wiki/components/ModalFun/index.css.map new file mode 100644 index 00000000..a770694c --- /dev/null +++ b/src/forge/Wiki/components/ModalFun/index.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["index.scss"],"names":[],"mappings":"AACE;EACE;EACA;EACA;;AAEF;EACE;;AAEF;EACE;;AAEF;EACE;;AAEF;EACE;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AACA;EACE;;AAGJ;EACE;EACA;;AACA;EACE","file":"index.css"} \ No newline at end of file diff --git a/src/forge/Wiki/components/ModalFun/index.jsx b/src/forge/Wiki/components/ModalFun/index.jsx index 661eca31..d9a62e8f 100644 --- a/src/forge/Wiki/components/ModalFun/index.jsx +++ b/src/forge/Wiki/components/ModalFun/index.jsx @@ -1,23 +1,33 @@ +/* eslint-disable react/jsx-no-duplicate-props */ import React, { useState } from 'react'; import * as ReactDOM from 'react-dom'; import { Modal, Button } from 'antd'; import './index.scss'; +InitModal.defaultProps = { + okText: '确认', //确定按钮的文字 + cancelText: '取消', //取消按钮的文字 + className: '', // + inputId: 'copyText', //要复制的文本的ID +}; + // 使用函数调用删除组件 export default function DelModal(props) { renderModal({ ...props, type: 'delete' }) } -export function confirmModal(props) { +// 使用函数调用选择模态框组件 +export function Confirm(props) { renderModal({ ...props, type: 'confirm' }) } function renderModal(props) { - const type = props.type; + const { type, afterClose } = props; const div = document.createElement('div'); document.body.appendChild(div); function destroy() { + afterClose && afterClose(); const unmountResult = ReactDOM.unmountComponentAtNode(div); if (unmountResult && div.parentNode) { div.parentNode.removeChild(div); @@ -26,18 +36,26 @@ function renderModal(props) { function modalType(type) { if (type === 'delete') { - return + return + + {props.contentTitle} + } + /> } else if (type === 'confirm') { - return + return } else { - return + return } } function render() { - /** - * Sync render blocks React event. Let's make this async. - */ setTimeout(() => { ReactDOM.render( modalType(type), @@ -48,16 +66,17 @@ function renderModal(props) { render(); } -// 真正的删除组件 -function DeleteModal({ +// 选择模态框组件 +function InitModal({ onCancel, onOk, title, contentTitle, content, - afterClose, okText, cancelText, + afterClose, + className, }) { const [visible, setVisible] = useState(true); @@ -78,71 +97,20 @@ function DeleteModal({ onCancel={onCancelModal} afterClose={afterClose} title={title} - className="myself-modal" + className={`myself-modal ${className}`} centered footer={[ - , , ]} >
    -

    - - {contentTitle}

    -

    {content}

    -
    - - ) -} - -// 选择组件 -function ConfirmModal({ - onCancel, - onOk, - title, - contentTitle, - content, - okText, - cancelText, - afterClose, -}) { - - const [visible, setVisible] = useState(true); - - function onCancelModal() { - setVisible(false); - onCancel && onCancel() - } - - function onSuccess() { - setVisible(false); - onOk && onOk(); - } - - return ( - - {cancelText||'取消'} - , - , - ]} - > -
    - {contentTitle &&

    {contentTitle}

    } -

    {content}

    + {contentTitle &&

    {contentTitle}

    } +

    {content}

    ) diff --git a/src/forge/Wiki/components/ModalFun/index.scss b/src/forge/Wiki/components/ModalFun/index.scss index a598d2bf..24f7b021 100644 --- a/src/forge/Wiki/components/ModalFun/index.scss +++ b/src/forge/Wiki/components/ModalFun/index.scss @@ -16,7 +16,7 @@ .ant-modal-body { text-align: center; } - .delete-title { + .content-title { display: flex; justify-content: center; align-items: center; @@ -32,7 +32,7 @@ color: #ca0002; font-size: 1.5rem !important; } - .delete-descibe { + .content-descibe { font-size: 14px; color: #666; line-height: 33px; @@ -53,4 +53,11 @@ border-color: #df0002; } } + .ant-btn-default:hover, + .ant-btn-default:active, + .ant-btn-default:focus { + background: #f3f4f6; + color: #333; + border-color: #d0d0d0; + } } \ No newline at end of file diff --git a/src/forge/comments/children_comments.js b/src/forge/comments/children_comments.js index 8a8ccbc8..450a30f1 100644 --- a/src/forge/comments/children_comments.js +++ b/src/forge/comments/children_comments.js @@ -113,7 +113,7 @@ class children_comments extends Component {
    {item && item.user_name} diff --git a/src/forge/comments/children_journals.js b/src/forge/comments/children_journals.js index e293c9f3..2337ce87 100644 --- a/src/forge/comments/children_journals.js +++ b/src/forge/comments/children_journals.js @@ -77,7 +77,7 @@ class children_journals extends Component {
    {item && item.user_name} diff --git a/src/forge/comments/comments.js b/src/forge/comments/comments.js index 93925da6..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({ @@ -304,7 +309,7 @@ class comments extends Component { return (
    {item && item.user_name} diff --git a/src/forge/css/index.scss b/src/forge/css/index.scss index 00e46b6f..e1986728 100644 --- a/src/forge/css/index.scss +++ b/src/forge/css/index.scss @@ -11,7 +11,10 @@ ul,ol,dl{ font-size: 22px; font-weight: normal; line-height: 30px; - max-width: 850px; + max-width: 690px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; .projectN{ word-break: break-all; } diff --git a/src/forge/users/CIList.jsx b/src/forge/users/CIList.jsx index a4e0331c..f4540412 100644 --- a/src/forge/users/CIList.jsx +++ b/src/forge/users/CIList.jsx @@ -62,7 +62,7 @@ function CIList(props){ return(
  • - {item.name} + {item.name} { item.open_devops ? 已激活 : @@ -79,7 +79,7 @@ function CIList(props){ : - + }
  • ) diff --git a/src/forge/users/GeneralView/Activity.jsx b/src/forge/users/GeneralView/Activity.jsx index ce09e885..1f6b46d1 100644 --- a/src/forge/users/GeneralView/Activity.jsx +++ b/src/forge/users/GeneralView/Activity.jsx @@ -11,10 +11,10 @@ function Activity({list}) { list.map((i,k)=>{ return(
  • - +
    - {i.user_name} + {i.user_name} {i.action_time} {i.priority && TagInfo(`${i.priority}`,"")} {i.issue_status && {i.issue_status} } diff --git a/src/forge/users/GeneralView/ConcentrateBox.jsx b/src/forge/users/GeneralView/ConcentrateBox.jsx index 3ee94194..78573984 100644 --- a/src/forge/users/GeneralView/ConcentrateBox.jsx +++ b/src/forge/users/GeneralView/ConcentrateBox.jsx @@ -2,10 +2,11 @@ import React, { useEffect, useState } from 'react'; import { Modal , Checkbox , Spin , Input } from 'antd'; import Axios from 'axios'; import { Link } from 'react-router-dom'; +import CheckProfile from '../../Component/ProfileModal/Profile'; const { Search } = Input; const limit = 20; -function ConcentrateBox({ visible , onCancel , onSure , username , choosed }) { +function ConcentrateBox({ visible , onCancel , onSure , username , choosed , history , showCompeleteDialog , completeProfile }) { const [ page , setPage ]= useState(1); const [ total , setTotal ]= useState(0); const [ pageSize , setPageSize ] = useState(false); @@ -164,7 +165,16 @@ function ConcentrateBox({ visible , onCancel , onSure , username , choosed }) {
    { total > limit && page < pageSize &&
    setPage(page+1)}>查看更多
    } - { (list && list.length === 0) && (copyList && copyList.length === 0) &&
    您还没有公开的{search && `“${search}”`}项目,先去新建项目
    } + { + (list && list.length === 0) && (copyList && copyList.length === 0) && +
    您还没有公开的{search && `“${search}”`}项目,先去 + {history.push(`/projects/deposit/new`)}} + className="color-blue">新建项目 +
    + } ) diff --git a/src/forge/users/GeneralView/ConcentrateProject.jsx b/src/forge/users/GeneralView/ConcentrateProject.jsx index bfcf290d..48875221 100644 --- a/src/forge/users/GeneralView/ConcentrateProject.jsx +++ b/src/forge/users/GeneralView/ConcentrateProject.jsx @@ -4,7 +4,7 @@ import { Link } from 'react-router-dom'; import axios from 'axios'; import Box from './ConcentrateBox'; -function ConcentrateProject({userLogin,current}) { +function ConcentrateProject({userLogin,current,showCompeleteDialog,completeProfile}) { const [ list , setList ] = useState(undefined); const [ visible , setVisible ] = useState(false); const [ value , setValue ] = useState([]); @@ -45,7 +45,15 @@ function ConcentrateProject({userLogin,current}) { } return( - setVisible(false)} onSure={onSure} username={userLogin} choosed={value}/> + setVisible(false)} + onSure={onSure} + username={userLogin} + choosed={value} + completeProfile={completeProfile} + showCompeleteDialog={showCompeleteDialog} + /> { list && list.length>0 &&
    @@ -58,8 +66,8 @@ function ConcentrateProject({userLogin,current}) { { list.map((i,k)=>{ return( -
  • - {i.name} +
  • + {i.name}

    {i.description}

    { i.category && {i.category.name} } diff --git a/src/forge/users/GeneralView/Index.jsx b/src/forge/users/GeneralView/Index.jsx index ded43582..24efe37c 100644 --- a/src/forge/users/GeneralView/Index.jsx +++ b/src/forge/users/GeneralView/Index.jsx @@ -99,7 +99,11 @@ function Index(props) { return(
    - +

    近期活动统计

    diff --git a/src/forge/users/Index.css b/src/forge/users/Index.css new file mode 100644 index 00000000..280cce1b --- /dev/null +++ b/src/forge/users/Index.css @@ -0,0 +1,247 @@ +.headerbox { + padding: 20px; + border-bottom: 1px solid #E0E0E0; + display: flex; + align-items: center; + justify-content: space-between; +} +.headerbox > div { + width: 400px; +} +.headerbox > p { + display: flex; + align-items: center; +} +.headerbox > p a { + color: #5091FF; + margin-left: 30px; + font-size: 16px; + display: flex; + align-items: center; +} +.headerbox .ant-btn.ant-input-search-button { + margin-top: -1px; + margin-right: -1px; +} + +.echartBox { + border: 1px solid #DEDEDE; +} +.echartBox > p { + color: #999; + padding: 15px 20px; + text-align: center; +} + +.contentBox { + padding: 20px 20px 0px 20px; +} +.contentBox > div { + margin-bottom: 20px; + display: flex; + align-items: center; + padding: 20px 25px; + background-color: #fafafa; +} +.contentBox > div .imgBox { + width: 190px; + height: 90px; + display: flex; + align-items: center; + justify-content: center; + margin-right: 20px; + background-color: #fff; +} +.contentBox > div .imgBox img { + max-width: 90%; + max-height: 90%; +} +.contentBox .item-news { + display: flex; + justify-content: space-between; + font-size: 12px; + color: #888; + margin-top: 3px; + margin-bottom: 0px; +} +.contentBox .teamdesc { + word-break: break-all; + line-height: 20px; +} + +.infosType { + padding: 20px 30px 0px 20px; + display: flex; + justify-content: space-between; +} +.infosType .infoStatus { + height: 30px; + background: white; + border-radius: 15px; + border: 1px solid #dddddd; + line-height: 30px; + font-size: 12px; + color: #888; + display: flex; +} +.infosType .infoStatus > span { + display: block; + padding: 0px 12px; + border-radius: 15px; + cursor: pointer; +} +.infosType .infoStatus > span.active { + background-color: #5091FF; + color: #fff; + padding: 0px 15px; +} +.infosType .infoStatus .statusDivider { + margin: 8px 0 0 0 !important; +} + +.userDescription { + color: #666666; + line-height: 18px; + text-align: left; + margin: 10px 0px; + word-break: break-all; + text-align: justify; + font-size: 16px; + text-align: center; +} + +.focusBox, .infoBox { + width: 100% !important; + display: inline-block; + margin-top: 30px; + padding-top: 30px; + border-top: 1px solid #f1f1f1; +} + +.infoBox { + padding-bottom: 10px; + text-align: left; + line-height: 28px; + color: #666; + margin-top: 20px; +} +.infoBox > div { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.infoBox i { + color: #DEDEDE; + font-size: 15px !important; +} +.infoBox span { + margin-left: 10px; +} + +.headimg { + position: relative; + display: block; +} +.headimg img { + width: 110px; + height: 110px; + border-radius: 50%; +} +.headimg span { + position: absolute; + bottom: -6px; + right: 0px; + left: 65px; +} +.headimg span i { + font-size: 25px !important; + border-radius: 50%; + color: #fff; +} +.headimg span i.icon-nan1 { + background-color: #1890FF; +} +.headimg span i.icon-nv1 { + background-color: pink; +} + +ul.ant-menu.menuStyle { + padding: 0px 30px; + font-size: 16px; +} +ul.ant-menu.menuStyle li { + height: 70px; + line-height: 70px; + padding: 0px; + margin-right: 30px !important; + border-bottom: transparent !important; +} + +.disposeInfo { + padding: 0px 30px; + min-height: 400px; +} +.disposeInfo .disposeItem { + display: flex; + justify-content: space-between; + padding: 30px 0px; + border-bottom: 1px solid #eee; +} + +.authTag { + display: inline-block; + padding: 0px 10px; + border-radius: 12px; + font-size: 12px; + height: 22px; + line-height: 22px; +} +.authTag.red { + border: 1px solid #F73030; + color: #F73030; +} +.authTag.green { + border: 1px solid #28BD6C; + color: #28BD6C; +} + +.CIList { + padding: 0px 30px; + min-height: 400px; +} +.CIList li { + display: flex; + justify-content: space-between; + padding: 28px 0px; + border-bottom: 1px solid #eee; +} + +.infosRightMenu .ant-menu-item { + padding: 0px; + margin: 0px 20px !important; + font-size: 17px; + height: 32px; + line-height: 0px; + border-bottom: 2px solid transparent !important; + position: relative; +} +.infosRightMenu .ant-menu-item a > i { + font-size: 15px !important; + margin-right: 8px; +} +.infosRightMenu .ant-menu-item .menuNum { + font-size: 12px; + margin-left: 3px; + color: #FF6E21; +} +.infosRightMenu .ant-menu-item.ant-menu-item-selected::before { + position: absolute; + width: 100%; + bottom: -1px; + height: 2px; + left: 0px; + background-color: #1890ff; + content: ""; +} + +/*# sourceMappingURL=Index.css.map */ diff --git a/src/forge/users/Index.css.map b/src/forge/users/Index.css.map new file mode 100644 index 00000000..356d318b --- /dev/null +++ b/src/forge/users/Index.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["Index.scss"],"names":[],"mappings":"AACA;EACE;EACA;EACA,SAJI;EAKJ;EACA;;AACA;EACE;;AAEF;EACE,SAXE;EAYF;;AAEF;EACE;EACA;EACA;EACA,SAlBE;EAmBF;;AAEF;EACE;EACA;;;AAIJ;EACE;;AACA;EACE;EACA;EACA;;;AAGJ;EACE;;AACA;EACE;EACA,SAvCE;EAwCF;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;;AAIN;EACE,SA1DE;EA2DF;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;;;AAGJ;EACE;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAEF;EACE;;;AAIN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;;AAEF;EACE;EACA;;AAEF;EACE;;;AAGJ;EACE;EACA;;AACA;EACE;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;;AACA;EACE;;AAEF;EACE;;;AAKR;EACE;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;;;AAGJ;EACE;EACA;;AACA;EACE;EACA;EACA;EACA;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;;AAEF;EACE;EACA;;;AAGJ;EACE;EACA;;AACA;EACE;EACA;EACA;EACA;;;AAKF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEE;EACE;EACA;;AAGJ;EACE;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA","file":"Index.css"} \ No newline at end of file diff --git a/src/forge/users/Index.jsx b/src/forge/users/Index.jsx index ce5aeda7..04c867f7 100644 --- a/src/forge/users/Index.jsx +++ b/src/forge/users/Index.jsx @@ -10,19 +10,37 @@ const Infos = Loadable({ loader: () => import("./Infos"), loading: Loading, }); +// forge项目详情 +const ProjectDetail = Loadable({ + loader: () => import("../Main/Detail"), + loading: Loading, +}); export default withRouter( - (CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((props)=>{ - return( -
    - - ( - - )} - > - -
    + (CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((props) => { + + // 个人中心新增的二级目录都需在此添加一次。将项目放组织和个人名下后,此处根据二级目录作判断, + let secondRouter = ''; + if (props.location.pathname) { + secondRouter = props.location.pathname.split('/')[2]; + } + + let userRouterArr = ['statistics', 'projects', 'notice', 'devops', 'organizes', 'info', 'following', 'followers', 'password']; + return ( + + + {secondRouter && (!userRouterArr.includes(secondRouter)) ? ( + + )} + > : ( + + )} + >} + + ) })))) ) \ No newline at end of file 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 a588cb8b..1cd3969d 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -72,22 +72,22 @@ class Infos extends Component { renderPath=(pathname)=>{ const { username } = this.props.match.params; - if(pathname === `/users/${username}`){ + if(pathname === `/${username}`){ this.setState({menuKey:"0",route_type:undefined}); - }else if(pathname === `/users/${username}/statistics`){ + }else if(pathname === `/${username}/statistics`){ this.setState({menuKey:"1",route_type:undefined}); - }else if(pathname.indexOf(`/users/${username}/projects`)>-1){ + }else if(pathname.indexOf(`/${username}/projects`)>-1){ this.setState({menuKey:"2",route_type:undefined}); - }else if(pathname.indexOf(`/users/${username}/notice`)>-1){ + }else if(pathname.indexOf(`/${username}/notice`)>-1){ this.setState({menuKey:"3",route_type:undefined}); - }else if(pathname.indexOf(`/users/${username}/devops`)>-1){ + }else if(pathname.indexOf(`/${username}/devops`)>-1){ this.setState({menuKey:"4",route_type:undefined}); - }else if(pathname === `/users/${username}/organizes`){ + }else if(pathname === `/${username}/organizes`){ this.setState({menuKey:"5",route_type:undefined}); - }else if(pathname === `/users/${username}/watchers`){ - this.setState({menuKey:undefined,route_type:"watchers"}); - }else if(pathname === `/users/${username}/fan_users`){ - this.setState({menuKey:undefined,route_type:"fan_users"}); + }else if(pathname === `/${username}/following`){ + this.setState({menuKey:undefined,route_type:"following"}); + }else if(pathname === `/${username}/followers`){ + this.setState({menuKey:undefined,route_type:"followers"}); }else{ this.setState({menuKey:undefined,route_type:undefined}); } @@ -146,7 +146,7 @@ class Infos extends Component { project_type: type , route_type: undefined }) - this.props.history.push(`/users/${user && user.login}/devops/${type}`); + this.props.history.push(`/${user && user.login}/devops/${type}`); } undo_link = () => { @@ -155,7 +155,7 @@ class Infos extends Component { route_type: undefined, project_type:"notice", },()=>{ - this.props.history.push(`/users/${user && user.login}/notice`); + this.props.history.push(`/${user && user.login}/notice`); this.fetchUser(); }) } @@ -172,7 +172,7 @@ class Infos extends Component { route_type: undefined, project_type:"organizes" }) - this.props.history.push(`/users/${user && user.login}/organizes`) + this.props.history.push(`/${user && user.login}/organizes`) } resetUser=()=>{ @@ -221,12 +221,12 @@ 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 && (
    )}
    this.route_link("watchers")} + to={`/${user && user.login}/following`} + className={`with50 text-center pull-left ${route_type === "following" ? "text-primary" : ""}`} + onClick={() =>this.route_link("following")} >
    {current_user && user && user.login === current_user.login ? "我关注的" : "TA关注的"}
    {user && user.watching_count} this.route_link("fan_users")} - className={`with50 text-center pull-left ${route_type === "fan_users" ? "text-primary" : ""}`} + to={`/${user && user.login}/followers`} + onClick={() =>this.route_link("followers")} + className={`with50 text-center pull-left ${route_type === "followers" ? "text-primary" : ""}`} >
    {current_user && user && user.login === current_user.login ? "关注我的" : "关注TA的"}
    {user && user.watched_count} @@ -280,13 +281,13 @@ class Infos extends Component {
    { !route_type && menuKey && - 概览 - 数据统计 - 项目 + 概览 + 数据统计 + 项目 { current_user && user && user.login === current_user.login ? - + 待办事项 {undo_events && undo_events >0 ? ({undo_events}):""} @@ -294,11 +295,11 @@ class Infos extends Component { } { current_user && current_user.login && current_user.login === username ? - DevOps工作流 + DevOps工作流 :"" } - + 组织 { user && user.user_org_count && user.user_org_count > 0 ? ({user.user_org_count}):""} @@ -308,68 +309,68 @@ class Infos extends Component { {user && ( { return ; }} > { return ; }} > { return ; }} > { return ; }} > { return ; }} > { return ; }} > { return ; }} > - { return ; }} - > - */} + {/* { return ; }} - > + > */} { return ; }} > { return ; }} diff --git a/src/forge/users/InfosUser.js b/src/forge/users/InfosUser.js index e79e1021..276a0b1f 100644 --- a/src/forge/users/InfosUser.js +++ b/src/forge/users/InfosUser.js @@ -1,6 +1,6 @@ import React, { Component } from "react"; -import { Link } from "react-router-dom"; import { Menu, Input, Spin, Pagination, Popover, Button, Divider } from "antd"; +import CheckProfile from '../Component/ProfileModal/Profile'; import axios from "axios"; import ListItem from "../Main/IndexItem"; @@ -74,6 +74,7 @@ class InfosUser extends Component { //切换种类 changeCategory = (cate) => { + 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(`/users/${username}`) + resetUserInfo && resetUserInfo(); } }).catch(error=>{}) } @@ -68,10 +68,10 @@ export default Form.create()( )} - {getFieldDecorator("real_name",{ + {getFieldDecorator("nickname",{ rules:[{required:true,message:"请输入姓名"}] })( - + )}
    @@ -90,7 +90,7 @@ export default Form.create()( {getFieldDecorator("custom_department",{ rules:[{required:true,message:"请输入单位名称"}] })( - + )} @@ -120,13 +120,13 @@ export default Form.create()( {getFieldDecorator("description",{ rules:[] })( -