forked from Gitlink/forgeplus-react
Merge branch 'dev_chain' of http://gitea.trustie.net/jasder/forgeplus-react into dev_chain
This commit is contained in:
commit
9aa68eedd6
|
|
@ -748,6 +748,11 @@
|
|||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.1.1.tgz",
|
||||
"integrity": "sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ=="
|
||||
},
|
||||
"actioncable": {
|
||||
"version": "5.2.4-3",
|
||||
"resolved": "https://registry.npmjs.org/actioncable/-/actioncable-5.2.4-3.tgz",
|
||||
"integrity": "sha512-SrGfg2W2GKGfYOlsOUnqjdihUhIVoyb5ewsMtpfE/Z3ZK/j5Gj2e/YWp2A7Wo+aeB1aewhPxorFxIGVRowbX4w=="
|
||||
},
|
||||
"add-dom-event-listener": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/add-dom-event-listener/-/add-dom-event-listener-1.1.0.tgz",
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
"dependencies": {
|
||||
"@monaco-editor/react": "^2.3.0",
|
||||
"@novnc/novnc": "^1.1.0",
|
||||
"actioncable": "^5.2.4-3",
|
||||
"antd": "^3.26.15",
|
||||
"array-flatten": "^2.1.2",
|
||||
"autoprefixer": "7.1.6",
|
||||
|
|
|
|||
|
|
@ -1569,6 +1569,7 @@ a.edu-txt-w80,
|
|||
.font-80 {
|
||||
font-size: 80px !important;
|
||||
}
|
||||
.color-grey-b{color: #bbb !important}
|
||||
|
||||
/*a标签的下划线*/
|
||||
a.decoration {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
|
|
@ -5,6 +5,111 @@
|
|||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "15605136",
|
||||
"name": "文件",
|
||||
"font_class": "wenjian1",
|
||||
"unicode": "e78e",
|
||||
"unicode_decimal": 59278
|
||||
},
|
||||
{
|
||||
"icon_id": "15605133",
|
||||
"name": "编辑",
|
||||
"font_class": "bianji6",
|
||||
"unicode": "e78d",
|
||||
"unicode_decimal": 59277
|
||||
},
|
||||
{
|
||||
"icon_id": "15591171",
|
||||
"name": "统计",
|
||||
"font_class": "tongji2",
|
||||
"unicode": "e78c",
|
||||
"unicode_decimal": 59276
|
||||
},
|
||||
{
|
||||
"icon_id": "15591167",
|
||||
"name": "签到",
|
||||
"font_class": "qiandao",
|
||||
"unicode": "e78b",
|
||||
"unicode_decimal": 59275
|
||||
},
|
||||
{
|
||||
"icon_id": "15591165",
|
||||
"name": "分班",
|
||||
"font_class": "fenban1",
|
||||
"unicode": "e78a",
|
||||
"unicode_decimal": 59274
|
||||
},
|
||||
{
|
||||
"icon_id": "15591163",
|
||||
"name": "讨论",
|
||||
"font_class": "taolun1",
|
||||
"unicode": "e789",
|
||||
"unicode_decimal": 59273
|
||||
},
|
||||
{
|
||||
"icon_id": "15591161",
|
||||
"name": "视频直播",
|
||||
"font_class": "shipinzhibo",
|
||||
"unicode": "e788",
|
||||
"unicode_decimal": 59272
|
||||
},
|
||||
{
|
||||
"icon_id": "15591155",
|
||||
"name": "学习资源",
|
||||
"font_class": "xuexiziyuan",
|
||||
"unicode": "e787",
|
||||
"unicode_decimal": 59271
|
||||
},
|
||||
{
|
||||
"icon_id": "15591132",
|
||||
"name": "考试问卷",
|
||||
"font_class": "kaoshiwenjuan",
|
||||
"unicode": "e786",
|
||||
"unicode_decimal": 59270
|
||||
},
|
||||
{
|
||||
"icon_id": "15590984",
|
||||
"name": "考试试卷",
|
||||
"font_class": "kaoshishijuan",
|
||||
"unicode": "e785",
|
||||
"unicode_decimal": 59269
|
||||
},
|
||||
{
|
||||
"icon_id": "15590922",
|
||||
"name": "毕业作业",
|
||||
"font_class": "biyezuoye",
|
||||
"unicode": "e784",
|
||||
"unicode_decimal": 59268
|
||||
},
|
||||
{
|
||||
"icon_id": "15590919",
|
||||
"name": "分组作业",
|
||||
"font_class": "fenzuzuoye1",
|
||||
"unicode": "e783",
|
||||
"unicode_decimal": 59267
|
||||
},
|
||||
{
|
||||
"icon_id": "15590916",
|
||||
"name": "普通作业",
|
||||
"font_class": "putongzuoye1",
|
||||
"unicode": "e782",
|
||||
"unicode_decimal": 59266
|
||||
},
|
||||
{
|
||||
"icon_id": "15590913",
|
||||
"name": "实训作业",
|
||||
"font_class": "shixunzuoye",
|
||||
"unicode": "e781",
|
||||
"unicode_decimal": 59265
|
||||
},
|
||||
{
|
||||
"icon_id": "15590860",
|
||||
"name": "公告栏",
|
||||
"font_class": "gonggaolan",
|
||||
"unicode": "e780",
|
||||
"unicode_decimal": 59264
|
||||
},
|
||||
{
|
||||
"icon_id": "15465934",
|
||||
"name": "组织项目",
|
||||
|
|
|
|||
|
|
@ -20,6 +20,51 @@ Created by iconfont
|
|||
/>
|
||||
<missing-glyph />
|
||||
|
||||
<glyph glyph-name="wenjian1" unicode="" d="M574.330435-119.095652H151.373913c-44.521739 0-84.591304 40.069565-84.591304 84.591304V811.408696C66.782609 855.930435 106.852174 896 151.373913 896h681.182609c44.521739 0 84.591304-40.069565 84.591304-84.591304v-436.313044c0-26.713043-17.808696-44.521739-44.521739-44.521739s-44.521739 17.808696-44.521739 44.521739V806.956522H155.826087v-837.008696h418.504348c26.713043 0 44.521739-17.808696 44.521739-44.521739s-22.26087-44.521739-44.521739-44.521739zM249.321739 410.713043h471.930435v-66.782608H249.321739zM512 148.034783m-44.521739 0a44.521739 44.521739 0 1 1 89.043478 0 44.521739 44.521739 0 1 1-89.043478 0ZM690.086957 148.034783m-44.52174 0a44.521739 44.521739 0 1 1 89.043479 0 44.521739 44.521739 0 1 1-89.043479 0ZM850.365217 148.034783m-44.521739 0a44.521739 44.521739 0 1 1 89.043479 0 44.521739 44.521739 0 1 1-89.043479 0ZM249.321739 655.582609h471.930435v-66.782609H249.321739zM249.321739 188.104348h146.921739v-66.782609H249.321739z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="bianji6" unicode="" d="M803.044865-97.363698H154.576481c-86.802855 0-153.181508 66.378654-153.181508 153.181508V740.028546c0 86.802855 66.378654 153.181508 153.181508 153.181508h403.377971c30.636302 0 51.060503-20.424201 51.060503-51.060503s-20.424201-51.060503-51.060503-51.060502H154.576481c-30.636302 0-51.060503-20.424201-51.060503-51.060503v-684.210736c0-30.636302 20.424201-51.060503 51.060503-51.060503h648.468384c30.636302 0 51.060503 20.424201 51.060503 51.060503V438.77158c0 30.636302 20.424201 51.060503 51.060503 51.060503s51.060503-20.424201 51.060503-51.060503v-382.95377c0-86.802855-71.484704-153.181508-153.181509-153.181508zM476.257648 362.180826c-10.212101 0-25.530251 5.10605-35.742352 20.424201-20.424201 20.424201-15.318151 51.060503 5.10605 71.484704L930.696122 882.997954c20.424201 20.424201 51.060503 15.318151 71.484704-5.106051 20.424201-20.424201 15.318151-51.060503-5.10605-71.484703L512 377.498977c-10.212101-10.212101-20.424201-15.318151-35.742352-15.318151z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="tongji2" unicode="" d="M9.142857 896h1024v-1024H9.142857zM873.142857 377.6H514.742857V736c0 6.4-6.4 6.4-6.4 6.4h-25.6c-51.2 0-108.8-12.8-153.6-32-51.2-19.2-96-44.8-128-83.2S137.142857 550.4 117.942857 499.2C92.342857 448 79.542857 396.8 79.542857 345.6S92.342857 236.8 111.542857 192s51.2-89.6 83.2-128 76.8-64 128-83.2c51.2-19.2 102.4-32 153.6-32s108.8 12.8 153.6 32 89.6 51.2 128 83.2c38.4 38.4 64 76.8 83.2 128 19.2 51.2 32 102.4 32 153.6v25.6c6.4 6.4 6.4 6.4 0 6.4zM713.142857 108.8c-64-64-147.2-96-236.8-96-89.6 0-172.8 32-230.4 96-64 64-96 147.2-96 236.8S181.942857 518.4 245.942857 576c57.6 57.6 128 89.6 198.4 96v-364.8h364.8c-6.4-70.4-38.4-147.2-96-198.4z m249.6 326.4v25.6C949.942857 556.8 911.542857 640 841.142857 704 777.142857 768 687.542857 812.8 597.942857 819.2h-25.6c-6.4 0-6.4 0-6.4-6.4v-384c0-6.4 6.4-6.4 6.4-6.4h384s6.4 6.4 6.4 12.8z m-332.8 57.6v256c64-12.8 121.6-44.8 166.4-89.6s76.8-102.4 89.6-166.4h-256z" horiz-adv-x="1170" />
|
||||
|
||||
|
||||
<glyph glyph-name="qiandao" unicode="" d="M9.142857 896h1024v-1024H9.142857zM892.342857 710.4h-166.4v64c0 6.4-6.4 6.4-6.4 6.4h-57.6c-6.4 0-6.4-6.4-6.4-6.4v-64H393.142857v64c0 6.4-6.4 6.4-6.4 6.4H329.142857c-6.4 0-6.4-6.4-6.4-6.4v-64H149.942857c-12.8 0-25.6-12.8-25.6-32v-665.6c0-19.2 12.8-32 32-32h736c19.2 0 32 12.8 32 32V678.4c-6.4 19.2-19.2 32-32 32z m-44.8-652.8H194.742857V640h128v-51.2c0-6.4 6.4-6.4 6.4-6.4h57.6l6.4 6.4V640h256v-51.2c0-6.4 6.4-6.4 6.4-6.4h57.6c6.4 0 6.4 6.4 6.4 6.4V640h128v-582.4zM700.342857 473.6h-57.6c-6.4 0-12.8 0-12.8-6.4L476.342857 262.4l-64 89.6c0 6.4-6.4 6.4-12.8 6.4h-57.6c-6.4 0-12.8-6.4-6.4-12.8l128-172.8c6.4-6.4 19.2-6.4 25.6 0l211.2 294.4c6.4 0 6.4 6.4 0 6.4z" horiz-adv-x="1170" />
|
||||
|
||||
|
||||
<glyph glyph-name="fenban1" unicode="" d="M9.142857 896h1024v-1024H9.142857zM834.742857 198.4c-25.6 25.6-57.6 44.8-89.6 57.6 44.8 38.4 76.8 89.6 76.8 153.6 0 108.8-89.6 204.8-204.8 198.4-108.8 0-198.4-89.6-198.4-198.4 0-64 32-121.6 76.8-153.6-32-12.8-64-32-83.2-57.6-57.6-57.6-83.2-128-89.6-204.8 0-6.4 6.4-6.4 6.4-6.4h57.6c6.4 0 6.4 6.4 6.4 6.4 0 57.6 25.6 115.2 64 153.6 44.8 44.8 102.4 64 160 64s115.2-25.6 160-64c38.4-38.4 64-96 64-153.6 0-6.4 6.4-6.4 6.4-6.4h57.6c6.4 0 6.4 6.4 6.4 6.4 6.4 76.8-25.6 147.2-76.8 204.8zM623.542857 281.6c-38.4 0-70.4 12.8-96 38.4-19.2 25.6-32 57.6-32 96 0 32 12.8 64 38.4 89.6 19.2 19.2 51.2 32 83.2 32s64-12.8 89.6-38.4c25.6-25.6 38.4-57.6 38.4-89.6 0-32-12.8-64-38.4-89.6-19.2-25.6-51.2-38.4-83.2-38.4zM367.542857 384v25.6c0 12.8 0 32 6.4 44.8 0 6.4 0 6.4-6.4 6.4-12.8 12.8-25.6 19.2-38.4 32-25.6 25.6-38.4 57.6-38.4 96 0 32 12.8 64 38.4 83.2 25.6 25.6 57.6 38.4 96 38.4 32 0 64-12.8 83.2-32 6.4-6.4 12.8-19.2 19.2-25.6 0 0 6.4-6.4 6.4 0 19.2 6.4 38.4 12.8 57.6 12.8 6.4 0 6.4 6.4 6.4 12.8C565.942857 742.4 501.942857 787.2 425.142857 787.2 316.342857 787.2 220.342857 697.6 220.342857 588.8c0-64 32-121.6 76.8-153.6-32-19.2-64-38.4-89.6-64-57.6-57.6-83.2-128-89.6-204.8 0-6.4 6.4-6.4 6.4-6.4h57.6c6.4 0 6.4 6.4 6.4 6.4 0 57.6 25.6 115.2 64 153.6 32 32 64 51.2 102.4 57.6 12.8 0 19.2 6.4 12.8 6.4z" horiz-adv-x="1170" />
|
||||
|
||||
|
||||
<glyph glyph-name="taolun1" unicode="" d="M9.142857 896h1024v-1024H9.142857zM469.942857 384c0-25.6 19.2-51.2 51.2-51.2 25.6 0 51.2 19.2 51.2 51.2 0 25.6-19.2 51.2-51.2 51.2-25.6 0-51.2-25.6-51.2-51.2z m204.8 0c0-25.6 19.2-51.2 51.2-51.2s51.2 19.2 51.2 51.2c0 25.6-19.2 51.2-51.2 51.2s-51.2-25.6-51.2-51.2zM271.542857 384c0-25.6 19.2-51.2 51.2-51.2s44.8 25.6 44.8 51.2-19.2 51.2-51.2 51.2-44.8-25.6-44.8-51.2z m665.6 172.8c-25.6 57.6-57.6 102.4-96 147.2-38.4 38.4-89.6 76.8-140.8 96C642.742857 819.2 578.742857 832 521.142857 832 457.142857 832 399.542857 819.2 341.942857 793.6c-51.2-19.2-96-51.2-140.8-96S130.742857 608 105.142857 556.8C85.942857 499.2 73.142857 441.6 73.142857 384c0-70.4 19.2-140.8 51.2-198.4v-153.6c0-25.6 19.2-44.8 44.8-44.8h153.6c64-32 128-44.8 198.4-51.2 57.6 0 115.2 12.8 172.8 32 51.2 19.2 102.4 51.2 140.8 96 38.4 38.4 76.8 89.6 96 140.8 25.6 57.6 38.4 115.2 38.4 179.2 0 57.6-12.8 115.2-32 172.8z m-153.6-435.2C713.142857 51.2 617.142857 12.8 521.142857 12.8c-57.6 0-121.6 12.8-172.8 44.8l-6.4 6.4H194.742857V204.8l-6.4 6.4C162.742857 262.4 149.942857 320 149.942857 384c0 102.4 38.4 192 108.8 262.4C329.142857 716.8 418.742857 755.2 521.142857 755.2c51.2 0 96-12.8 147.2-32 44.8-19.2 83.2-44.8 121.6-76.8 32-32 64-76.8 76.8-121.6 19.2-44.8 32-96 32-147.2-6.4-96-44.8-185.6-115.2-256z" horiz-adv-x="1170" />
|
||||
|
||||
|
||||
<glyph glyph-name="shipinzhibo" unicode="" d="M21.333333 896h1024v-1024H21.333333zM930.133333 595.2l-128-76.8V672c0 38.4-25.6 64-64 64H149.333333c-38.4 0-64-25.6-64-64v-576c0-38.4 25.6-64 64-64h588.8c38.4 0 64 25.6 64 64V249.6l128-76.8c19.2-12.8 51.2 0 51.2 25.6V563.2c0 25.6-25.6 44.8-51.2 32z m-198.4-492.8h-576V665.6h576v-563.2z m179.2 166.4l-102.4 57.6V435.2l102.4 57.6v-224zM226.133333 537.6H341.333333c6.4 0 6.4 6.4 6.4 6.4v44.8c0 6.4-6.4 6.4-6.4 6.4H226.133333c-6.4 0-6.4-6.4-6.4-6.4v-51.2h6.4z" horiz-adv-x="1365" />
|
||||
|
||||
|
||||
<glyph glyph-name="xuexiziyuan" unicode="" d="M9.142857 896h1024v-1024H9.142857zM969.142857-19.2H73.142857V780.8h332.8l128-128c6.4-6.4 12.8-6.4 25.6-6.4H969.142857v-665.6zM143.542857 57.6h755.2V576H559.542857c-25.6 0-51.2 6.4-76.8 25.6L373.942857 710.4H143.542857v-652.8zM834.742857 710.4h-256c-19.2 0-38.4 19.2-38.4 38.4s19.2 38.4 38.4 38.4h256c19.2 0 38.4-19.2 38.4-38.4s-19.2-38.4-38.4-38.4zM937.142857 403.2H117.942857c-19.2 0-38.4 19.2-38.4 38.4s19.2 38.4 38.4 38.4h819.2c19.2 0 38.4-19.2 38.4-38.4s-19.2-38.4-38.4-38.4zM431.542857 121.6H245.942857c-19.2 0-38.4 19.2-38.4 38.4s19.2 32 38.4 32h185.6c19.2 0 38.4-19.2 38.4-38.4s-19.2-32-38.4-32z" horiz-adv-x="1170" />
|
||||
|
||||
|
||||
<glyph glyph-name="kaoshiwenjuan" unicode="" d="M18.285714 896h1024v-1024H18.285714zM709.485714 582.4v51.2c0 6.4-6.4 6.4-6.4 6.4h-384c-6.4 0-12.8-6.4-12.8-6.4v-51.2l6.4-6.4h384c6.4 0 12.8 6.4 12.8 6.4zM312.685714 499.2c-6.4 0-6.4-6.4-6.4-6.4v-51.2c0-6.4 6.4-6.4 6.4-6.4h185.6c6.4 0 6.4 6.4 6.4 6.4v44.8c0 6.4-6.4 6.4-6.4 6.4H312.685714z m147.2-454.4H223.085714v704H786.285714v-345.6c0-6.4 6.4-6.4 6.4-6.4h57.6c6.4 0 6.4 6.4 6.4 6.4v384c0 19.2-12.8 32-32 32H184.685714C165.485714 819.2 152.685714 806.4 152.685714 787.2v-780.8c0-19.2 12.8-32 32-32h268.8c6.4 0 6.4 6.4 6.4 6.4v57.6c6.4 0 0 6.4 0 6.4z m441.6-51.2l-96 96c19.2 32 38.4 64 38.4 108.8 0 96-76.8 179.2-179.2 179.2S491.885714 288 491.885714 192s76.8-179.2 179.2-179.2c38.4 0 70.4 12.8 96 32l96-96h12.8l32 32c0 6.4 0 6.4-6.4 12.8z m-230.4 83.2c-64 0-115.2 51.2-115.2 115.2s51.2 115.2 115.2 115.2S786.285714 256 786.285714 192s-51.2-115.2-115.2-115.2z" horiz-adv-x="1170" />
|
||||
|
||||
|
||||
<glyph glyph-name="kaoshishijuan" unicode="" d="M18.285714 896h1024v-1024H18.285714zM709.485714 633.6c0 6.4-6.4 6.4-6.4 6.4h-384c-6.4 0-12.8-6.4-12.8-6.4v-51.2l6.4-6.4h384c6.4 0 6.4 6.4 6.4 6.4v51.2z m-12.8-134.4h-384c-6.4 0-6.4-6.4-6.4-6.4v-51.2c0-6.4 6.4-6.4 6.4-6.4h384c6.4 0 6.4 6.4 6.4 6.4v44.8c6.4 6.4 0 12.8-6.4 12.8zM498.285714 352H312.685714c-6.4 0-6.4-6.4-6.4-6.4v-51.2c0-6.4 6.4-6.4 6.4-6.4h185.6c6.4 0 6.4 6.4 6.4 6.4v51.2s0 6.4-6.4 6.4z m-44.8-307.2H223.085714v704H786.285714v-345.6c0-6.4 6.4-6.4 6.4-6.4h57.6c6.4 0 6.4 6.4 6.4 6.4v384c0 19.2-12.8 32-32 32H184.685714C165.485714 819.2 152.685714 806.4 152.685714 787.2v-780.8c0-19.2 12.8-32 32-32h262.4c6.4 0 6.4 6.4 6.4 6.4v57.6c6.4 0 0 6.4 0 6.4z m352 76.8c32 25.6 44.8 64 44.8 108.8 0 76.8-64 140.8-140.8 140.8s-140.8-64-140.8-140.8c0-44.8 19.2-83.2 44.8-108.8-57.6-32-96-89.6-102.4-160 0-6.4 6.4-6.4 6.4-6.4h51.2c6.4 0 6.4 6.4 6.4 6.4 6.4 70.4 64 121.6 134.4 121.6s128-57.6 134.4-121.6c0-6.4 6.4-6.4 6.4-6.4h51.2c6.4 0 6.4 6.4 6.4 6.4-6.4 64-44.8 121.6-102.4 160zM709.485714 307.2c44.8 0 76.8-38.4 76.8-76.8s-38.4-76.8-76.8-76.8-76.8 38.4-76.8 76.8 32 76.8 76.8 76.8z" horiz-adv-x="1170" />
|
||||
|
||||
|
||||
<glyph glyph-name="biyezuoye" unicode="" d="M9.142857 896h1024v-1024H9.142857zM521.142857 326.4c-12.8 0-19.2 0-32 6.4L111.542857 518.4c-12.8 6.4-25.6 19.2-32 38.4-6.4 19.2-6.4 38.4 0 51.2 6.4 12.8 19.2 25.6 32 32l377.6 185.6c19.2 6.4 44.8 6.4 64 0L930.742857 640c32-19.2 44.8-57.6 32-89.6-6.4-12.8-19.2-25.6-32-32L553.142857 332.8c-12.8 0-19.2-6.4-32-6.4z m-371.2 256L521.142857 403.2l371.2 179.2L521.142857 761.6 149.942857 582.4zM783.542857 121.6c-12.8 6.4-19.2 12.8-38.4 12.8s-32 12.8-32 32 12.8 32 32 32c70.4 0 128-57.6 128-121.6 0-19.2-12.8-32-32-32s-32 12.8-32 32c0 12.8-6.4 32-12.8 38.4 0-6.4-6.4-19.2-12.8-32-64-89.6-160-147.2-275.2-147.2-115.2 0-211.2 57.6-268.8 140.8-19.2 25.6-12.8 57.6 0 44.8 70.4-57.6 166.4-102.4 268.8-102.4 108.8 0 204.8 44.8 275.2 102.4zM130.742857 217.6m-64 0a64 64 0 1 1 128 0 64 64 0 1 1-128 0ZM105.142857 544h57.6v-326.4h-57.6z" horiz-adv-x="1170" />
|
||||
|
||||
|
||||
<glyph glyph-name="fenzuzuoye1" unicode="" d="M21.333333 896h1024v-1024H21.333333zM949.333333 736H718.933333c-51.2 0-96-12.8-140.8-38.4l-44.8-32-51.2 25.6C443.733333 723.2 392.533333 736 347.733333 736H117.333333C98.133333 736 85.333333 723.2 85.333333 704v-569.6c0-19.2 12.8-32 32-32h230.4c51.2 0 96-12.8 140.8-38.4l44.8-25.6h12.8l38.4 25.6c38.4 25.6 89.6 38.4 140.8 38.4h230.4c19.2 0 32 12.8 32 32V704c-6.4 19.2-19.2 32-38.4 32zM347.733333 172.8h-192V665.6H341.333333c38.4 0 70.4-12.8 102.4-32l51.2-32 6.4-6.4v-460.8c-44.8 25.6-102.4 38.4-153.6 38.4z m563.2 0H725.333333c-57.6 0-108.8-12.8-153.6-38.4V595.2l6.4 6.4 51.2 32c32 19.2 64 32 102.4 32H917.333333v-492.8zM418.133333 537.6H232.533333c-6.4 0-6.4-6.4-6.4-6.4v-44.8c0-6.4 0-6.4 6.4-6.4h185.6c6.4 0 6.4 6.4 6.4 6.4v38.4c0 6.4 0 12.8-6.4 12.8z m224-12.8v-44.8c0-6.4 6.4-6.4 6.4-6.4h185.6c6.4 0 6.4 6.4 6.4 6.4v44.8c0 6.4-6.4 6.4-6.4 6.4H648.533333c-6.4 6.4-6.4 0-6.4-6.4z m-224-128H232.533333c-6.4 0-6.4-6.4-6.4-6.4v-44.8c0-6.4 0-6.4 6.4-6.4h185.6c6.4 0 6.4 6.4 6.4 6.4v44.8s0 6.4-6.4 6.4z m416 0H648.533333c-6.4 0-6.4-6.4-6.4-6.4v-44.8c0-6.4 6.4-6.4 6.4-6.4h185.6c6.4 0 6.4 6.4 6.4 6.4v44.8s0 6.4-6.4 6.4z" horiz-adv-x="1365" />
|
||||
|
||||
|
||||
<glyph glyph-name="putongzuoye1" unicode="" d="M4.266667 896h1024v-1024H4.266667zM650.666667 832v-70.4h-512v-755.2h652.8v320h70.4v-358.4c0-19.2-12.8-32-32-32H100.266667c-19.2 0-32 12.8-32 32v832c0 19.2 12.8 32 32 32h550.4zM420.266667 454.4H260.266667c-19.2 0-38.4 19.2-38.4 38.4s19.2 32 38.4 32h160c19.2 0 32-12.8 32-32s-12.8-38.4-32-38.4zM516.266667 601.6H260.266667c-19.2 0-38.4 19.2-38.4 38.4s19.2 32 38.4 32h256c19.2 0 38.4-19.2 38.4-38.4s-19.2-32-38.4-32zM714.666667 89.6H260.266667c-19.2 0-38.4 19.2-38.4 38.4s19.2 38.4 38.4 38.4h454.4c19.2 0 38.4-19.2 38.4-38.4s-19.2-38.4-38.4-38.4zM522.666667 185.6c-25.6 0-51.2 19.2-64 44.8-6.4 12.8-6.4 19.2-6.4 32l12.8 134.4c0 12.8 6.4 25.6 12.8 32l236.8 345.6c19.2 32 51.2 51.2 89.6 57.6 38.4 6.4 70.4 0 102.4-19.2l12.8-6.4c57.6-44.8 70.4-128 32-185.6L708.266667 268.8c-6.4-12.8-19.2-19.2-32-25.6l-134.4-51.2c-6.4 0-12.8-6.4-19.2-6.4z m300.8 576h-12.8c-19.2 0-32-12.8-38.4-25.6L535.466667 390.4l-6.4-128L644.266667 307.2l243.2 345.6c19.2 25.6 12.8 64-12.8 89.6l-6.4 6.4 19.2 25.6-25.6-25.6c-12.8 6.4-25.6 12.8-38.4 12.8z" horiz-adv-x="1092" />
|
||||
|
||||
|
||||
<glyph glyph-name="shixunzuoye" unicode="" d="M4.266667 896h1024v-1024H4.266667zM964.266667 128H68.266667V832h896v-704zM138.666667 204.8h755.2V761.6H138.666667v-556.8zM708.266667-64H324.266667c-19.2 0-38.4 19.2-38.4 38.4s19.2 38.4 38.4 38.4h384c19.2 0 38.4-19.2 38.4-38.4s-19.2-38.4-38.4-38.4zM708.266667 403.2c-12.8 0-19.2 6.4-25.6 12.8-12.8 12.8-12.8 38.4 6.4 51.2L772.266667 544 682.666667 620.8c-12.8 12.8-12.8 38.4 0 51.2 12.8 12.8 38.4 12.8 51.2 0l89.6-83.2c12.8-12.8 19.2-32 19.2-44.8 0-19.2-6.4-38.4-19.2-51.2l-6.4-6.4-83.2-76.8c-12.8 0-19.2-6.4-25.6-6.4zM330.666667 403.2c-6.4 0-19.2 0-25.6 6.4L215.466667 492.8c-25.6 25.6-25.6 70.4 0 96l89.6 83.2c12.8 12.8 38.4 12.8 51.2 0 12.8-12.8 12.8-38.4 0-51.2L266.666667 537.6l83.2-70.4c12.8-12.8 19.2-38.4 6.4-51.2-6.4-6.4-19.2-12.8-25.6-12.8zM465.066667 384H452.266667c-19.2 12.8-25.6 32-19.2 51.2l102.4 243.2c6.4 19.2 25.6 32 44.8 19.2 19.2-6.4 25.6-25.6 19.2-44.8L503.466667 409.6c-6.4-12.8-19.2-25.6-38.4-25.6zM925.866667 256H119.466667c-19.2 0-38.4 19.2-38.4 38.4s19.2 38.4 38.4 38.4h800c19.2 0 38.4-19.2 38.4-38.4s-12.8-38.4-32-38.4zM401.066667 160h70.4V-64H401.066667zM586.666667 160h70.4V-64H586.666667z" horiz-adv-x="1092" />
|
||||
|
||||
|
||||
<glyph glyph-name="gonggaolan" unicode="" d="M870.4-119.466667L426.666667 153.6c-8.533333 0-17.066667 8.533333-25.6 8.533333H0V614.4h409.6c8.533333 0 17.066667 0 25.6 8.533333L870.4 887.466667v-1006.933334zM93.866667 256h307.2c25.6 0 51.2-8.533333 68.266666-17.066667l307.2-187.733333V716.8L486.4 537.6c-25.6-17.066667-51.2-25.6-76.8-25.6H93.866667v-256zM998.4 699.733333c-17.066667 0-42.666667 17.066667-42.666667 34.133334-8.533333 25.6 8.533333 51.2 34.133334 59.733333l153.6 42.666667c25.6 8.533333 51.2-8.533333 59.733333-34.133334 8.533333-25.6-8.533333-51.2-34.133333-59.733333l-153.6-42.666667h-17.066667zM1152-59.733333h-8.533333l-153.6 42.666666c-25.6 8.533333-42.666667 34.133333-34.133334 59.733334 8.533333 25.6 34.133333 42.666667 59.733334 34.133333l153.6-42.666667c25.6-8.533333 42.666667-34.133333 34.133333-59.733333-17.066667-17.066667-34.133333-34.133333-51.2-34.133333zM1152 332.8h-153.6c-25.6 0-51.2 25.6-51.2 51.2s25.6 51.2 51.2 51.2h153.6c25.6 0 42.666667-25.6 42.666667-51.2s-17.066667-51.2-42.666667-51.2zM375.466667 554.666667h93.866666v-349.866667H375.466667z" horiz-adv-x="1205" />
|
||||
|
||||
|
||||
<glyph glyph-name="zuzhixiangmu" unicode="" d="M487.619048-128c-243.809524 0-438.857143 195.047619-438.857143 438.857143s195.047619 438.857143 438.857143 438.857143 438.857143-195.047619 438.857142-438.857143-195.047619-438.857143-438.857142-438.857143z m0 799.695238c-199.92381 0-360.838095-160.914286-360.838096-360.838095 0-199.92381 160.914286-360.838095 360.838096-360.838095 199.92381 0 360.838095 160.914286 360.838095 360.838095 0 199.92381-160.914286 360.838095-360.838095 360.838095zM195.047619 67.047619m-156.038095 0a156.038095 156.038095 0 1 1 312.07619 0 156.038095 156.038095 0 1 1-312.07619 0ZM195.047619-128c-107.27619 0-195.047619 87.771429-195.047619 195.047619s87.771429 195.047619 195.047619 195.047619 195.047619-87.771429 195.047619-195.047619-87.771429-195.047619-195.047619-195.047619z m0 312.07619c-63.390476 0-117.028571-53.638095-117.028571-117.028571s53.638095-117.028571 117.028571-117.028571 117.028571 53.638095 117.028571 117.028571-53.638095 117.028571-117.028571 117.028571zM390.095238 700.952381m-156.038095 0a156.038095 156.038095 0 1 1 312.07619 0 156.038095 156.038095 0 1 1-312.07619 0ZM390.095238 505.904762C282.819048 505.904762 195.047619 593.67619 195.047619 700.952381s87.771429 195.047619 195.047619 195.047619 195.047619-87.771429 195.047619-195.047619-87.771429-195.047619-195.047619-195.047619z m0 312.07619C326.704762 817.980952 273.066667 764.342857 273.066667 700.952381S326.704762 583.92381 390.095238 583.92381s117.028571 53.638095 117.028572 117.028571S453.485714 817.980952 390.095238 817.980952zM926.47619 310.857143m-156.038095 0a156.038095 156.038095 0 1 1 312.076191 0 156.038095 156.038095 0 1 1-312.076191 0ZM926.47619 115.809524c-107.27619 0-195.047619 87.771429-195.047619 195.047619s87.771429 195.047619 195.047619 195.047619 195.047619-87.771429 195.04762-195.047619-87.771429-195.047619-195.04762-195.047619z m0 312.07619c-63.390476 0-117.028571-53.638095-117.028571-117.028571s53.638095-117.028571 117.028571-117.028572 117.028571 53.638095 117.028572 117.028572-53.638095 117.028571-117.028572 117.028571z" horiz-adv-x="1121" />
|
||||
|
||||
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 487 KiB After Width: | Height: | Size: 502 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -29,4 +29,12 @@
|
|||
color:#fff !important;
|
||||
}
|
||||
.display-flex{display: flex !important;}
|
||||
.merge-flex1{flex:1}
|
||||
.merge-flex1{flex:1}
|
||||
.ant-tag.pr-branch-tag{
|
||||
border-radius: 12px;
|
||||
height: 24px;
|
||||
background: rgba(241,248,255,1);
|
||||
border: none;
|
||||
font-size: 13px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
|
@ -59,52 +59,14 @@ function setpostcookie() {
|
|||
}
|
||||
setpostcookie();
|
||||
|
||||
|
||||
function railsgettimes(proxy) {
|
||||
clearAllCookie()
|
||||
if (timestamp && checkSubmitFlg === false) {
|
||||
$.ajax({
|
||||
url: proxy, async: true, success: function (data) {
|
||||
if (data.status === 0) {
|
||||
timestamp = data.message;
|
||||
setpostcookie();
|
||||
}
|
||||
}
|
||||
})
|
||||
checkSubmitFlg = true
|
||||
window.setTimeout(() => {
|
||||
checkSubmitFlg = false;
|
||||
}, 2000);
|
||||
} else if (checkSubmitFlg === false) {
|
||||
$.ajax({
|
||||
url: proxy, async: true, success: function (data) {
|
||||
if (data.status === 0) {
|
||||
timestamp = data.message;
|
||||
setpostcookie();
|
||||
}
|
||||
}
|
||||
})
|
||||
checkSubmitFlg = true
|
||||
window.setTimeout(() => {
|
||||
checkSubmitFlg = false;
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
window._debugType = debugType;
|
||||
export function initAxiosInterceptors(props) {
|
||||
initOnlineOfflineListener()
|
||||
|
||||
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation
|
||||
// TODO 读取到package.json中的配置?
|
||||
var proxy = "http://localhost:3000"
|
||||
// proxy = "https://pre-newweb.educoder.net"
|
||||
var
|
||||
proxy = "http://localhost:3000"
|
||||
proxy = "https://testforgeplus.trustie.net"
|
||||
|
||||
// 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求;
|
||||
|
||||
// 如果需要支持重复的请求,考虑config里面自定义一个allowRepeat参考来控制
|
||||
const requestMap = {};
|
||||
window.setfalseInRequestMap = function (keyName) {
|
||||
requestMap[keyName] = false;
|
||||
|
|
@ -115,19 +77,13 @@ export function initAxiosInterceptors(props) {
|
|||
setpostcookie()
|
||||
clearAllCookie()
|
||||
|
||||
if (config.url.indexOf(proxy) != -1 || config.url.indexOf(':') != -1) {
|
||||
if (config.url.indexOf(proxy) !== -1 || config.url.indexOf(':') !== -1) {
|
||||
return config
|
||||
}
|
||||
requestProxy(config)
|
||||
|
||||
let url = `/api${config.url}`;
|
||||
|
||||
//qq登录去掉api
|
||||
if (config.params && config.params.redirect_uri !== undefined) {
|
||||
if (config.params.redirect_uri.indexOf('otherloginqq') !== -1) {
|
||||
url = `${config.url}`;
|
||||
}
|
||||
}
|
||||
if (`${config[0]}` !== `true`) {
|
||||
if (window.location.port === "3007") {
|
||||
config.url = `${proxy}${url}`;
|
||||
|
|
|
|||
|
|
@ -1,172 +0,0 @@
|
|||
import React , { Component } from 'react';
|
||||
import { Dropdown , Icon , Input } from 'antd';
|
||||
import { getBranch } from '../GetData/getData';
|
||||
import "./branch.css"
|
||||
import axios from 'axios';
|
||||
const $ = window.$;
|
||||
class SelectBranch extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
visible:false,
|
||||
value:undefined,
|
||||
search:"branch",
|
||||
tags:undefined,
|
||||
branchsFilter:undefined,
|
||||
data:undefined
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
this.getTagList();
|
||||
|
||||
document.body.addEventListener('click', e => {
|
||||
let v= this.state.visible;
|
||||
if(e.target.className && e.target.className.animVal!=undefined) return;
|
||||
|
||||
let s = e.target && e.target.className && e.target.className.indexOf('showtag')> -1;
|
||||
let classF =e.target && e.target.className && e.target.className.indexOf("downobject") > -1 || e.target.className==="ant-input OptionsInput";
|
||||
if(e.target && e.target.className === "ant-dropdown-trigger" || s){
|
||||
this.setState({
|
||||
visible:!v,
|
||||
value:undefined
|
||||
})
|
||||
if(!v){
|
||||
this.getBranchs();
|
||||
}
|
||||
return;
|
||||
}else if (classF) {
|
||||
return;
|
||||
} else{
|
||||
this.setState({
|
||||
visible:false,
|
||||
value:undefined
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
componentDidUpdate=(prevProps)=>{
|
||||
if(this.props.repo_id && this.props.repo_id!=prevProps.repo_id){
|
||||
this.getTagList();
|
||||
}
|
||||
}
|
||||
// 获取分支
|
||||
getBranchs=()=>{
|
||||
debugger;
|
||||
const { projectsId } = this.props;
|
||||
let result = getBranch(projectsId);
|
||||
if(result){
|
||||
this.setState({
|
||||
data:result.data
|
||||
})
|
||||
if(result.data && result.data.length>0){
|
||||
this.setState({
|
||||
search:"branch"
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
getTagList=()=>{
|
||||
const { repo_id } = this.props;
|
||||
if(repo_id){
|
||||
const url = `/repositories/${repo_id}/tags.json`;
|
||||
axios.get(url).then((result)=>{
|
||||
if(result){
|
||||
this.setState({
|
||||
tags:result.data
|
||||
})
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
InputClick=(e)=>{
|
||||
this.stopPropagations(e);
|
||||
}
|
||||
|
||||
stopPropagations=(e)=>{
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
// 输入搜索内容
|
||||
changeValue=(e)=>{
|
||||
this.setState({
|
||||
value:e.target.value
|
||||
})
|
||||
let { branchs } = this.props;
|
||||
const { tags } = this.state;
|
||||
let array = branchs;
|
||||
if(search === "tag" && tags.length>0){
|
||||
array = tags;
|
||||
}
|
||||
let branchsFilter = e.target.value ? (array && array.length>0 && array.filter(item=>item.name.indexOf(e.target.value)>-1)) : array;
|
||||
this.setState({
|
||||
branchsFilter
|
||||
})
|
||||
}
|
||||
|
||||
// 选择分支
|
||||
changeBranchs=(e,value)=>{
|
||||
e.stopPropagation();
|
||||
this.setState({
|
||||
visible:false,
|
||||
value
|
||||
})
|
||||
const { changeBranch } = this.props;
|
||||
changeBranch && changeBranch(value);
|
||||
}
|
||||
|
||||
// 切换搜索的列表
|
||||
changeSearch=(search)=>{
|
||||
this.setState({
|
||||
search
|
||||
})
|
||||
}
|
||||
|
||||
render(){
|
||||
const { visible , value , search , tags , branchsFilter , data } = this.state;
|
||||
const { branchs , branch } = this.props;
|
||||
|
||||
|
||||
console.log(data);
|
||||
const menu = (
|
||||
<div className="branchOptions" id="m-btn" onClick={this.stopPropagations}>
|
||||
<div className="downobject padding10 bor-bottom-greyE">
|
||||
<Input placeholder="请输入分支或标签名称搜索" autocomplete="off" id="input-btn" value={value} className="OptionsInput" onChange={this.changeValue} onClick={this.InputClick}/>
|
||||
<ul className="navUl" id="navUl-btn">
|
||||
<li className={search ==="branch"?"downobject active":"downobject"} onClick={()=>this.changeSearch("branch")}><i className="iconfont icon-fenzhi1 font-14 mr3"></i>分支列表</li>
|
||||
<li className={search ==="tag"?"downobject active":"downobject"} onClick={()=>this.changeSearch("tag")}><i className="iconfont icon-biaoqian3 font-14 mr3"></i>标签列表</li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul className="OptionsUl" id="ul-btn">
|
||||
{
|
||||
data && data.length> 0 ? data.map((item,key)=>{
|
||||
return(
|
||||
<li key={key}><a className="task-hide ulALink" onClick={(e)=>this.changeBranchs(e,`${item.name}`)}>{item.name}</a></li>
|
||||
)
|
||||
})
|
||||
:
|
||||
<p className="listTips">暂无{value}{search === "tag" ?"标签":"分支"}~</p>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
return(
|
||||
<div className="branchDropdown f-wrap-alignCenter" >
|
||||
<Dropdown overlay={menu} trigger={['click']} placement="bottomLeft" visible={visible}>
|
||||
<span id="down-btn">
|
||||
<span>
|
||||
<span className="color-grey-9 mr3">{search ==="branch"?"分支":"标签"}:</span>
|
||||
<a className="ant-dropdown-link">
|
||||
{branch}
|
||||
</a>
|
||||
</span>
|
||||
<i className="showtag iconfont icon-xiajiantou font-14 color-grey-9" />
|
||||
</span>
|
||||
</Dropdown>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default SelectBranch;
|
||||
|
|
@ -14,7 +14,7 @@ li.ant-menu-item{
|
|||
align-items: center;
|
||||
padding:20px 34px;
|
||||
background-color: #fff;
|
||||
margin:18px 0px;
|
||||
margin-bottom:18px;
|
||||
.img{
|
||||
margin-right: 20px;
|
||||
width: 190px;
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ export const WhiteBack = styled.div`{
|
|||
border-radius:5px;
|
||||
}`
|
||||
export const Blueline = styled.a`{
|
||||
height:32px;
|
||||
line-height:30px;
|
||||
height:30px;
|
||||
line-height:28px;
|
||||
border-radius:2px;
|
||||
border:1px solid rgba(80,145,255,1);
|
||||
color:rgba(80,145,255,1);
|
||||
|
|
@ -57,8 +57,8 @@ export const Blueline = styled.a`{
|
|||
display:inline-block;
|
||||
}`
|
||||
export const Redline = styled.a`{
|
||||
height:32px;
|
||||
line-height:32px;
|
||||
height:30px;
|
||||
line-height:28px;
|
||||
border-radius:2px;
|
||||
border:1px solid #F73030;
|
||||
color:#F73030;
|
||||
|
|
@ -68,8 +68,8 @@ export const Redline = styled.a`{
|
|||
text-align:center;
|
||||
}`
|
||||
export const Greenline = styled.a`{
|
||||
height:32px;
|
||||
line-height:32px;
|
||||
height:30px;
|
||||
line-height:28px;
|
||||
border-radius:2px;
|
||||
border:1px solid #28BD6C;
|
||||
color:#28BD6C;
|
||||
|
|
@ -78,6 +78,28 @@ export const Greenline = styled.a`{
|
|||
min-width:80px;
|
||||
text-align:center;
|
||||
}`
|
||||
export const Greenback = styled.a`{
|
||||
height:30px;
|
||||
line-height:30px;
|
||||
border-radius:2px;
|
||||
background-color:#28BD6C;
|
||||
color:#fff;
|
||||
padding:0px 12px;
|
||||
display:inline-block;
|
||||
min-width:80px;
|
||||
text-align:center;
|
||||
}`
|
||||
export const Redback = styled.a`{
|
||||
height:30px;
|
||||
line-height:30px;
|
||||
border-radius:2px;
|
||||
background-color:#F73030;
|
||||
color:#fff;
|
||||
padding:0px 12px;
|
||||
display:inline-block;
|
||||
min-width:80px;
|
||||
text-align:center;
|
||||
}`
|
||||
export const NumUl = styled.ul`{
|
||||
padding-left: 20px;
|
||||
& > li{
|
||||
|
|
@ -112,3 +134,12 @@ export const Cancel = styled.a`{
|
|||
text-align:center;
|
||||
letter-spacing: 4px;
|
||||
}`
|
||||
export const Content = styled.div`{
|
||||
width:1200px;
|
||||
margin:20px auto;
|
||||
text-align:center;
|
||||
display:flex;
|
||||
align-Items:center;
|
||||
background-color:#fff;
|
||||
justify-content: center;
|
||||
}`
|
||||
|
|
|
|||
|
|
@ -46,8 +46,9 @@ class CoderRootDirectory extends Component {
|
|||
chooseType:undefined,
|
||||
tags_count:undefined,
|
||||
commits_count:undefined,
|
||||
branches_count:undefined
|
||||
branches_count:undefined,
|
||||
|
||||
md:false
|
||||
}
|
||||
}
|
||||
changeAddress = (address) => {
|
||||
|
|
@ -122,9 +123,7 @@ class CoderRootDirectory extends Component {
|
|||
isSpin: false,
|
||||
branchLastCommit: last_commit && last_commit.commit,
|
||||
lastCommitAuthor:
|
||||
last_commit &&
|
||||
(last_commit.author ||
|
||||
(last_commit.commit && last_commit.commit.author)),
|
||||
last_commit && (last_commit.author || (last_commit.commit && last_commit.commit.author)),
|
||||
zip_url: result.data.zip_url,
|
||||
tar_url: result.data.tar_url,
|
||||
tags_count: result.data.tags_count,
|
||||
|
|
@ -243,7 +242,7 @@ class CoderRootDirectory extends Component {
|
|||
message: item.commit && item.commit.message,
|
||||
...item,
|
||||
});
|
||||
if (item.name === "README.md") {
|
||||
if (item.is_readme_file) {
|
||||
readMeContent.push({ ...item });
|
||||
readMeFile.push({ ...item });
|
||||
}
|
||||
|
|
@ -256,12 +255,21 @@ class CoderRootDirectory extends Component {
|
|||
};
|
||||
|
||||
// 点击跳转到子目录
|
||||
goToSubRoot=(path,type)=>{
|
||||
goToSubRoot=(path,type,filename)=>{
|
||||
this.setState({
|
||||
chooseType:type
|
||||
})
|
||||
const { projectsId } = this.props.match.params;
|
||||
this.props.history.push(`/projects/${projectsId}/coders?url=${path}`);
|
||||
if(filename.substring(filename.length - 3) === ".md"){
|
||||
this.setState({
|
||||
md:true
|
||||
})
|
||||
}else{
|
||||
this.setState({
|
||||
md:false
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
// readme文件内容
|
||||
|
|
@ -275,7 +283,7 @@ class CoderRootDirectory extends Component {
|
|||
<div className="commonBox">
|
||||
<div className="commonBox-title">
|
||||
<span className="mr10">
|
||||
<i className="iconfont icon-xinjianjianliwodejianli font-20 color-grey-9 fl mt3"></i>
|
||||
<i className="iconfont icon-wenjian1 font-16 color-grey-9 fl mt3"></i>
|
||||
</span>
|
||||
<span className="commonBox-title-read">
|
||||
{readMeContent[0].name}
|
||||
|
|
@ -285,7 +293,7 @@ class CoderRootDirectory extends Component {
|
|||
onClick={() => this.ChangeFile(readMeFile[0], false)}
|
||||
className="ml20 pull-right"
|
||||
>
|
||||
<i className="iconfont icon-bianji2 font-20 color-blue"></i>
|
||||
<i className="iconfont icon-bianji6 font-16 color-blue"></i>
|
||||
</a>
|
||||
) : (
|
||||
""
|
||||
|
|
@ -350,7 +358,7 @@ class CoderRootDirectory extends Component {
|
|||
dataIndex: 'name',
|
||||
width:"30%",
|
||||
render: (text,item) => (
|
||||
<a onClick={()=>this.goToSubRoot(item.path,item.type)} className="ml12">
|
||||
<a onClick={()=>this.goToSubRoot(item.path,item.type,text)} className="ml12 task-hide" style={{ display: "block", maxWidth: "345px" }}>
|
||||
<i className={ item.type === "file" ? "iconfont icon-wenjia font-15 color-green-file mr5":"iconfont icon-wenjianjia1 color-green-file font-15 mr5"}></i>{text}
|
||||
</a>
|
||||
),
|
||||
|
|
@ -484,7 +492,7 @@ class CoderRootDirectory extends Component {
|
|||
)}
|
||||
</div>
|
||||
<div className="f-wrap-alignCenter">
|
||||
{subFileType && (isManager || isDeveloper) && (
|
||||
{subFileType && parseInt(projectDetail.type) !== 2 && (isManager || isDeveloper) && (
|
||||
<div>
|
||||
<span>
|
||||
<Link
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ import { Popconfirm, Select } from "antd";
|
|||
import "./list.css";
|
||||
import axios from "axios";
|
||||
import Meditor from "../Newfile/m_editor";
|
||||
import MDEditor from "../../modules/tpm/challengesnew/tpm-md-editor";
|
||||
import RenderHtml from "../../components/render-html";
|
||||
|
||||
|
||||
function bytesToSize(bytes) {
|
||||
if (bytes === 0) return "0 B";
|
||||
|
|
@ -18,6 +21,7 @@ class CoderRootFileDetail extends Component {
|
|||
value: undefined,
|
||||
language: undefined,
|
||||
languages: undefined,
|
||||
description:props.detail.content
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -146,6 +150,12 @@ class CoderRootFileDetail extends Component {
|
|||
});
|
||||
};
|
||||
|
||||
onContentChange = (value) => {
|
||||
this.setState({
|
||||
description: value,
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
readOnly,
|
||||
|
|
@ -153,8 +163,9 @@ class CoderRootFileDetail extends Component {
|
|||
current_user,
|
||||
isManager,
|
||||
isDeveloper,
|
||||
md
|
||||
} = this.props;
|
||||
const { language, languages } = this.state;
|
||||
const { language, languages , description } = this.state;
|
||||
let flag = current_user && current_user.login && (isManager || isDeveloper);
|
||||
const Option = Select.Option;
|
||||
|
||||
|
|
@ -233,6 +244,11 @@ class CoderRootFileDetail extends Component {
|
|||
</a>
|
||||
</div>
|
||||
) : (
|
||||
md && readOnly ?
|
||||
<div className="files-md">
|
||||
<RenderHtml className="file-md" value={description} />
|
||||
</div>
|
||||
:
|
||||
<Meditor
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React, { Component } from 'react';
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import { Spin, Tooltip } from 'antd';
|
||||
import { Link, Route, Switch } from 'react-router-dom';
|
||||
|
||||
import { Content } from '../Component/layout';
|
||||
import '../css/index.scss'
|
||||
import './list.css';
|
||||
|
||||
|
|
@ -104,16 +104,16 @@ const MilepostDetail = Loadable({
|
|||
loading: Loading,
|
||||
})
|
||||
const WatchUsers = Loadable({
|
||||
loader: () => import('../UsersList/watch_users'),
|
||||
loading: Loading,
|
||||
loader: () => import('../UsersList/watch_users'),
|
||||
loading: Loading,
|
||||
})
|
||||
const PraiseUsers = Loadable({
|
||||
loader: () => import('../UsersList/praise_users'),
|
||||
loading: Loading,
|
||||
loader: () => import('../UsersList/praise_users'),
|
||||
loading: Loading,
|
||||
})
|
||||
const ForkUsers = Loadable({
|
||||
loader: () => import('../UsersList/fork_users'),
|
||||
loading: Loading,
|
||||
loader: () => import('../UsersList/fork_users'),
|
||||
loading: Loading,
|
||||
})
|
||||
|
||||
|
||||
|
|
@ -130,7 +130,6 @@ class Detail extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
isSpin: true,
|
||||
projectDetail: undefined,
|
||||
isManager: false,
|
||||
isReporter: false,
|
||||
|
|
@ -145,29 +144,79 @@ class Detail extends Component {
|
|||
author: undefined,
|
||||
branchs: undefined,
|
||||
branchList: undefined,
|
||||
project: null
|
||||
project: null,
|
||||
firstSync:false,
|
||||
secondSync:false
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
this.getProject();
|
||||
this.getDetail();
|
||||
}
|
||||
|
||||
componentDidUpdate = (prevState) => {
|
||||
if ((prevState.match.params.projectsId !== this.props.match.params.projectsId)) {
|
||||
this.getProject();
|
||||
this.getDetail();
|
||||
}
|
||||
}
|
||||
|
||||
getProject = () => {
|
||||
getProject = (num) => {
|
||||
const name = window.location.hostname === "localhost" ? "testforgeplus.trustie.net":window.location.hostname;
|
||||
console.log(`wss:${name}/cable`);
|
||||
const { projectsId } = this.props.match.params;
|
||||
const url = `/projects/${projectsId}/simple.json`;
|
||||
axios.get(url).then((result) => {
|
||||
this.setState({
|
||||
project: result.data
|
||||
})
|
||||
if (result && result.data) {
|
||||
this.setState({
|
||||
project: result.data
|
||||
})
|
||||
if (result.data.type !== 0 && result.data.mirror_status === 1) {
|
||||
console.log("--------start channel --------");
|
||||
// 是镜像项目,且未完成迁移
|
||||
this.canvasChannel();
|
||||
if(num){
|
||||
this.setState({
|
||||
secondSync:true,
|
||||
firsrtSync:false
|
||||
})
|
||||
}else{
|
||||
this.setState({
|
||||
firstSync:true,
|
||||
secondSync:false
|
||||
})
|
||||
}
|
||||
}else{
|
||||
this.getDetail();
|
||||
this.setState({
|
||||
firsrtSync:false,
|
||||
secondSync:false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
canvasChannel = () => {
|
||||
const name = window.location.hostname === "localhost" ? "http://testforgeplus.trustie.net":window.location.hostname;
|
||||
console.log(`ws:${name}/cable`);
|
||||
const actioncable = require("actioncable")
|
||||
var project = this.state.project
|
||||
var cable = actioncable.createConsumer(`ws:${name}/cable`);
|
||||
this.canvasChannel1 = cable.subscriptions.create({
|
||||
channel: `MirrorProjectChannel`,
|
||||
id: project && project.identifier
|
||||
}, {
|
||||
connected: () => {
|
||||
console.log("###### channel connected! ######");
|
||||
},
|
||||
disconnected: () => { },
|
||||
received: data => {
|
||||
console.log(`###### ---received data--- ######`);
|
||||
console.log(data);
|
||||
if (data) {
|
||||
this.getDetail();
|
||||
cable.subscriptions.consumer.disconnect();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -189,7 +238,6 @@ class Detail extends Component {
|
|||
watchers_count: result.data.watchers_count,
|
||||
praises_count: result.data.praises_count,
|
||||
forked_count: result.data.forked_count,
|
||||
isSpin:false
|
||||
})
|
||||
}
|
||||
}).catch((error) => { })
|
||||
|
|
@ -199,22 +247,22 @@ class Detail extends Component {
|
|||
focusFunc = (flag) => {
|
||||
const { project_id } = this.state;
|
||||
|
||||
axios({
|
||||
method: flag? 'delete' : 'post',
|
||||
url: `/watchers/${flag? 'unfollow' : 'follow'}.json`,
|
||||
axios({
|
||||
method: flag ? 'delete' : 'post',
|
||||
url: `/watchers/${flag ? 'unfollow' : 'follow'}.json`,
|
||||
params: {
|
||||
target_type: "project",
|
||||
id: project_id
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
if(result && result.data.status === 0){
|
||||
this.setWatchersCount(result.data.watchers_count, result.data.watched);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
})
|
||||
.then(result => {
|
||||
if (result && result.data.status === 0) {
|
||||
this.setWatchersCount(result.data.watchers_count, result.data.watched);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
// 点赞和取消点赞
|
||||
|
|
@ -250,13 +298,6 @@ class Detail extends Component {
|
|||
|
||||
// fork项目
|
||||
forkFunc = () => {
|
||||
// if (!checkIfLogin) {
|
||||
// this.props.showLoginDialog();
|
||||
// return;
|
||||
// }
|
||||
this.setState({
|
||||
isSpin: true
|
||||
})
|
||||
const { project_id } = this.state;
|
||||
const url = `/projects/${project_id}/forks.json`;
|
||||
axios.post(url).then(result => {
|
||||
|
|
@ -264,44 +305,30 @@ class Detail extends Component {
|
|||
this.props.history.push(`/projects/${result.data.id}/coders`);
|
||||
this.props.showNotification(result.data.message);
|
||||
}
|
||||
this.setState({
|
||||
isSpin: false
|
||||
})
|
||||
}).catch(error => {
|
||||
this.setState({
|
||||
isSpin: false
|
||||
})
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 同步镜像
|
||||
synchronismMirror=()=>{
|
||||
synchronismMirror = () => {
|
||||
const { repo_id } = this.state.projectDetail;
|
||||
this.setState({
|
||||
isSpin:true
|
||||
})
|
||||
const url = `/repositories/${repo_id}/sync_mirror.json`;
|
||||
axios.post(url).then(result=>{
|
||||
if(result && result.data && result.data.status === 0){
|
||||
this.props.showNotification("镜像同步成功!");
|
||||
this.getProject();
|
||||
this.getDetail();
|
||||
}else{
|
||||
const url = `/repositories/${repo_id}/sync_mirror.json`;
|
||||
axios.post(url).then(result => {
|
||||
if (result && result.data && result.data.status === 0) {
|
||||
// this.props.showNotification("镜像同步成功!");
|
||||
this.getProject(2);
|
||||
} else {
|
||||
this.props.showNotification("镜像同步失败!");
|
||||
this.setState({
|
||||
isSpin:false
|
||||
})
|
||||
}
|
||||
|
||||
}).catch(error=>{
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const { projectDetail, watchers_count, praises_count, forked_count, isSpin, isManager, watched, praised, project } = this.state;
|
||||
const { projectDetail, watchers_count, praises_count, forked_count, firstSync , secondSync , isManager, watched, praised, project } = this.state;
|
||||
const url = this.props.history.location.pathname;
|
||||
const urlArr = url.split("/");
|
||||
const urlFlag = (urlArr.length === 3);
|
||||
|
|
@ -324,54 +351,56 @@ class Detail extends Component {
|
|||
const mirror = (
|
||||
<React.Fragment>
|
||||
<span>镜像自 </span>
|
||||
<a href={projectDetail && projectDetail.mirror_url} target="_blank" style={{color:"#fff"}}>{projectDetail && projectDetail.mirror_url}</a>
|
||||
<a href={projectDetail && projectDetail.mirror_url} target="_blank" style={{ color: "#fff" }}>{projectDetail && projectDetail.mirror_url}</a>
|
||||
</React.Fragment>
|
||||
)
|
||||
const common ={
|
||||
getDetail:this.getDetail
|
||||
const common = {
|
||||
getDetail: this.getDetail
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<div className="detailHeader-wrapper">
|
||||
<div className="normal">
|
||||
<div className="f-wrap-between mb15" style={{ position: "relative" }}>
|
||||
<p className="font-18 color-white df flex-1 lineH2 mt15" style={{ alignItems: "center" }}>
|
||||
{project && project.author &&
|
||||
<Link to={`/users/${project.author.login}`} className="show-user-link color-white">
|
||||
{project.author.name}
|
||||
</Link>
|
||||
<div className="detailHeader-wrapper">
|
||||
<div className="normal">
|
||||
<div className="f-wrap-between pb15" style={{ position: "relative" }}>
|
||||
<p className="font-22 color-white df flex-1 lineH2 mt15" style={{ alignItems: "center" }}>
|
||||
{project && project.author &&
|
||||
<Link to={`/users/${project.author.login}`} className="show-user-link color-white">
|
||||
{project.author.name}
|
||||
</Link>
|
||||
}
|
||||
<span className="ml5 mr5">/</span>
|
||||
<span className="hide-1 flex-1 df">
|
||||
<Link to={`/projects/${projectsId}/coders`} className="color-white font-22">{project && project.name}</Link>
|
||||
{
|
||||
projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ?
|
||||
<Tooltip placement={'right'} title={text}>
|
||||
<Link to={`/projects/${projectDetail.forked_from_project_id}/coders`}
|
||||
className="ml10" >
|
||||
<i className="iconfont icon-fork font-18 fl mt6" style={{ color: "#8D90E3" }}></i>
|
||||
</Link>
|
||||
</Tooltip> : ""
|
||||
}
|
||||
<span className="ml5 mr5">/</span>
|
||||
<span className="hide-1 flex-1 df">
|
||||
<Link to={`/projects/${projectsId}/coders`} className="color-white font-22">{project && project.name}</Link>
|
||||
{
|
||||
projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ?
|
||||
<Tooltip placement={'right'} title={text}>
|
||||
<Link to={`/projects/${projectDetail.forked_from_project_id}/coders`}
|
||||
className="ml10" >
|
||||
<i className="iconfont icon-fork font-18 fl mt6" style={{ color: "#8D90E3" }}></i>
|
||||
</Link>
|
||||
</Tooltip> : ""
|
||||
}
|
||||
{
|
||||
projectDetail && checkLogin && projectDetail.type && projectDetail.type === 2 ?
|
||||
{
|
||||
projectDetail && checkLogin && projectDetail.type && projectDetail.type === 2 ?
|
||||
<Tooltip placement={'right'} title={mirror}>
|
||||
<i className="iconfont icon-jingxiang font-18 fl mt6 ml10" style={{ color: "#8D90E3" }}></i>
|
||||
</Tooltip>:""
|
||||
}
|
||||
</span>
|
||||
</p>
|
||||
<i className="iconfont icon-banbenku font-18 fl mt6 ml10" style={{ color: "#8D90E3" }}></i>
|
||||
</Tooltip> : ""
|
||||
}
|
||||
</span>
|
||||
</p>
|
||||
{
|
||||
firstSync ? "":
|
||||
<span className="df mt25">
|
||||
{
|
||||
projectDetail && projectDetail.type && projectDetail.type === 2 ?
|
||||
<a className="synchronism ml30" onClick={this.synchronismMirror}>同步镜像</a>:""
|
||||
<a className="synchronism ml30" onClick={this.synchronismMirror}>同步镜像</a> : ""
|
||||
}
|
||||
<span className="detail_tag_btn">
|
||||
<a className="detail_tag_btn_name" onClick={() => this.focusFunc(watched)}>
|
||||
<img src={watched ? img_focused : img_focus} alt="" width="14px" />
|
||||
{watched ? '取消关注' : '关注'}
|
||||
</a>
|
||||
<Link className="detail_tag_btn_count" to={{pathname:`/projects/${projectsId}/watch_users`, state}}>
|
||||
<Link className="detail_tag_btn_count" to={{ pathname: `/projects/${projectsId}/watch_users`, state }}>
|
||||
{watchers_count}
|
||||
</Link>
|
||||
</span>
|
||||
|
|
@ -380,223 +409,227 @@ class Detail extends Component {
|
|||
<img src={praised ? img_parised : img_parise} width="13px" alt="" />
|
||||
{praised ? '取消点赞' : '点赞'}
|
||||
</a>
|
||||
<Link className="detail_tag_btn_count" to={{pathname:`/projects/${projectsId}/praise_users`,state}}>
|
||||
<Link className="detail_tag_btn_count" to={{ pathname: `/projects/${projectsId}/praise_users`, state }}>
|
||||
{praises_count}
|
||||
</Link>
|
||||
</Link>
|
||||
</span>
|
||||
<span className="detail_tag_btn">
|
||||
<a className="detail_tag_btn_name" onClick={this.forkFunc}>
|
||||
<img src={img_fork} alt="" width="10px"/>Fork</a>
|
||||
<Link className="detail_tag_btn_count" to={{pathname:`/projects/${projectsId}/fork_users`,state}}>
|
||||
<img src={img_fork} alt="" width="10px" />Fork</a>
|
||||
<Link className="detail_tag_btn_count" to={{ pathname: `/projects/${projectsId}/fork_users`, state }}>
|
||||
{forked_count}
|
||||
</Link>
|
||||
</Link>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div className="f-wrap-between">
|
||||
}
|
||||
</div>
|
||||
{
|
||||
firstSync ? "" :
|
||||
<div className="f-wrap-between pb20">
|
||||
<ul className="headerMenu-wrapper">
|
||||
<li className={(url.indexOf("coders") > -1 || urlFlag) ? "active" : ""}>
|
||||
<Link to={{ pathname: `/projects/${projectsId}/coders`, state }}>
|
||||
<img alt="" src={img_1} width="18" />代码库
|
||||
</Link>
|
||||
</Link>
|
||||
</li>
|
||||
<li className={(url.indexOf("orders") > -1 && !(url.indexOf("Milepost") > 0 || url.indexOf("meilpost") > 0 || url.indexOf("tags") > 0)) ? "active" : ""}>
|
||||
<Link to={{ pathname: `/projects/${projectsId}/orders`, state }}>
|
||||
<img alt="" src={img_2} width="12" />任务
|
||||
{ projectDetail && projectDetail.issues_count ? <span>{projectDetail.issues_count}</span> :""}
|
||||
</Link>
|
||||
</li>
|
||||
<li className={url.indexOf("merge") > -1 ? "active" : ""}>
|
||||
<Link to={{ pathname: `/projects/${projectsId}/merge`, state }}>
|
||||
<img alt="" src={img_3} width="13" />合并请求
|
||||
{ projectDetail && projectDetail.pull_requests_count ? <span>{projectDetail.pull_requests_count}</span> : "" }
|
||||
{projectDetail && projectDetail.issues_count ? <span>{projectDetail.issues_count}</span> : ""}
|
||||
</Link>
|
||||
</li>
|
||||
{
|
||||
projectDetail && parseInt(projectDetail.type) !== 2 &&
|
||||
<li className={url.indexOf("merge") > -1 ? "active" : ""}>
|
||||
<Link to={{ pathname: `/projects/${projectsId}/merge`, state }}>
|
||||
<img alt="" src={img_3} width="13" />合并请求
|
||||
{projectDetail && projectDetail.pull_requests_count ? <span>{projectDetail.pull_requests_count}</span> : ""}
|
||||
</Link>
|
||||
</li>
|
||||
}
|
||||
<li className={(url.indexOf("Milepost") > -1 || url.indexOf("meilpost") > -1) ? "active" : ""}>
|
||||
<Link to={{ pathname: `/projects/${projectsId}/orders/Milepost`, state }}>
|
||||
<img alt="" src={img_milepost} width="16" />里程碑
|
||||
{projectDetail && projectDetail.version_count && <span>{projectDetail.version_count}</span>}
|
||||
{projectDetail && projectDetail.version_count && <span>{projectDetail.version_count}</span>}
|
||||
</Link>
|
||||
</li>
|
||||
<li className={url.indexOf("trends") > -1 ? "active" : ""}>
|
||||
<Link to={{ pathname: `/projects/${projectsId}/trends`, state }}>
|
||||
<img alt="" src={img_6} width="16" />动态
|
||||
</Link>
|
||||
</Link>
|
||||
</li>
|
||||
{
|
||||
isManager &&
|
||||
<li className={url.indexOf("setting") > 0 ? "active" : ""}><Link to={`/projects/${projectsId}/setting`}><img alt="" src={img_7} width="19" />仓库设置</Link></li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
{
|
||||
firstSync ?
|
||||
<Content className="spincontent">
|
||||
<Spin className="spinstyle" tip={project && `正在从 ${project.mirror_url} 迁移`} size="large">
|
||||
</Spin>
|
||||
</Content>
|
||||
:
|
||||
<Spin spinning={secondSync} className="spinstyle" tip="正在同步镜像" size="large">
|
||||
<Switch {...this.props}>
|
||||
{/* 新建文件 */}
|
||||
<Route path="/projects/:projectsId/coders/:branch/newfile/:path"
|
||||
render={
|
||||
(props) => (<FileNew {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/coders/:branch/uploadfile"
|
||||
render={
|
||||
(props) => (<UploadFile {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/coders/:branch/newfile"
|
||||
render={
|
||||
(props) => (<FileNew {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
|
||||
<Switch {...this.props}>
|
||||
{/* 新建文件 */}
|
||||
<Route path="/projects/:projectsId/coders/:branch/newfile/:path"
|
||||
render={
|
||||
(props) => (<FileNew {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/coders/:branch/uploadfile"
|
||||
render={
|
||||
(props) => (<UploadFile {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/coders/:branch/newfile"
|
||||
render={
|
||||
(props) => (<FileNew {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
{/* 标签列表 */}
|
||||
<Route path="/projects/:projectsId/orders/tags"
|
||||
render={
|
||||
(props) => (<TagList {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 仓库设置 */}
|
||||
<Route path="/projects/:projectsId/setting"
|
||||
render={
|
||||
(props) => (<Setting {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 任务详情 */}
|
||||
<Route path="/projects/:projectsId/orders/:orderId/detail"
|
||||
render={
|
||||
(props) => (<OrderDetail {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 里程碑 */}
|
||||
<Route path="/projects/:projectsId/orders/Milepost"
|
||||
render={
|
||||
(props) => (<OrderMilepost {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 新建里程碑 */}
|
||||
<Route path="/projects/:projectsId/orders/meilpost"
|
||||
render={
|
||||
(props) => (<OrdernewMilepost {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/*里程碑详情*/}
|
||||
<Route path="/projects/:projectsId/orders/:meilid/MilepostDetail"
|
||||
render={
|
||||
(props) => (<MilepostDetail {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/*修改里程碑*/}
|
||||
<Route path="/projects/:projectsId/orders/:meilid/meilpost"
|
||||
render={
|
||||
(props) => (<OrderupdateMilepost {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 里程碑页面新建任务 */}
|
||||
<Route path="/projects/:projectsId/orders/:milepostId/new"
|
||||
render={
|
||||
(props) => (<OrderNew {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 新建任务 */}
|
||||
<Route path="/projects/:projectsId/orders/new"
|
||||
render={
|
||||
(props) => (<OrderNew {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 修改详情 */}
|
||||
<Route path="/projects/:projectsId/orders/:orderId/updatedetail"
|
||||
render={
|
||||
(props) => (<OrderupdateDetail {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 复制详情 */}
|
||||
<Route path="/projects/:projectsId/orders/:orderId/copyetail"
|
||||
render={
|
||||
(props) => (<OrdercopyDetail {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 动态 */}
|
||||
<Route path="/projects/:projectsId/trends"
|
||||
render={
|
||||
(props) => (<TrendsIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 代码Index */}
|
||||
<Route path="/projects/:projectsId/orders"
|
||||
render={
|
||||
(props) => (<OrderIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/merge/new"
|
||||
render={
|
||||
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork={true} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/merge/:mergeId/UpdateMerge"
|
||||
render={
|
||||
(props) => (<UpdateMerge {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/merge/:mergeId/Messagecount"
|
||||
render={
|
||||
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/merge/:mergeId/MergeSubmit"
|
||||
render={
|
||||
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
|
||||
{/* 标签列表 */}
|
||||
<Route path="/projects/:projectsId/orders/tags"
|
||||
render={
|
||||
(props) => (<TagList {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
{/* 仓库设置 */}
|
||||
<Route path="/projects/:projectsId/setting"
|
||||
render={
|
||||
(props) => (<Setting {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 任务详情 */}
|
||||
<Route path="/projects/:projectsId/orders/:orderId/detail"
|
||||
render={
|
||||
(props) => (<OrderDetail {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
{/* 里程碑 */}
|
||||
<Route path="/projects/:projectsId/orders/Milepost"
|
||||
render={
|
||||
(props) => (<OrderMilepost {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
{/* 新建里程碑 */}
|
||||
<Route path="/projects/:projectsId/orders/meilpost"
|
||||
render={
|
||||
(props) => (<OrdernewMilepost {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
{/*里程碑详情*/}
|
||||
<Route path="/projects/:projectsId/orders/:meilid/MilepostDetail"
|
||||
render={
|
||||
(props) => (<MilepostDetail {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
{/*修改里程碑*/}
|
||||
<Route path="/projects/:projectsId/orders/:meilid/meilpost"
|
||||
render={
|
||||
(props) => (<OrderupdateMilepost {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
|
||||
|
||||
{/* 里程碑页面新建任务 */}
|
||||
<Route path="/projects/:projectsId/orders/:milepostId/new"
|
||||
render={
|
||||
(props) => (<OrderNew {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
{/* 新建任务 */}
|
||||
<Route path="/projects/:projectsId/orders/new"
|
||||
render={
|
||||
(props) => (<OrderNew {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
|
||||
{/* 修改详情 */}
|
||||
<Route path="/projects/:projectsId/orders/:orderId/updatedetail"
|
||||
render={
|
||||
(props) => (<OrderupdateDetail {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
|
||||
{/* 复制详情 */}
|
||||
<Route path="/projects/:projectsId/orders/:orderId/copyetail"
|
||||
render={
|
||||
(props) => (<OrdercopyDetail {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
|
||||
{/* 动态 */}
|
||||
<Route path="/projects/:projectsId/trends"
|
||||
render={
|
||||
(props) => (<TrendsIndex {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
|
||||
|
||||
{/* 代码Index */}
|
||||
<Route path="/projects/:projectsId/orders"
|
||||
render={
|
||||
(props) => (<OrderIndex {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
|
||||
<Route path="/projects/:projectsId/merge/new"
|
||||
render={
|
||||
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork= {true}/>)
|
||||
}
|
||||
></Route>
|
||||
|
||||
<Route path="/projects/:projectsId/merge/:mergeId/UpdateMerge"
|
||||
render={
|
||||
(props) => (<UpdateMerge {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
|
||||
<Route path="/projects/:projectsId/merge/:mergeId/Messagecount"
|
||||
render={
|
||||
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
|
||||
<Route path="/projects/:projectsId/merge/:mergeId/MergeSubmit"
|
||||
render={
|
||||
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
|
||||
<Route path="/projects/:projectsId/merge"
|
||||
render={
|
||||
(props) => (<MergeIndexDetail {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/coders/filesurl"
|
||||
render={
|
||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/coders"
|
||||
render={
|
||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/watch_users"
|
||||
render={
|
||||
(props) => (<WatchUsers {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/praise_users"
|
||||
render={
|
||||
(props) => (<PraiseUsers {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/fork_users"
|
||||
render={
|
||||
(props) => (<ForkUsers {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId"
|
||||
render={
|
||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
</Switch>
|
||||
<Route path="/projects/:projectsId/merge"
|
||||
render={
|
||||
(props) => (<MergeIndexDetail {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/coders/filesurl"
|
||||
render={
|
||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/coders"
|
||||
render={
|
||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/watch_users"
|
||||
render={
|
||||
(props) => (<WatchUsers {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/praise_users"
|
||||
render={
|
||||
(props) => (<PraiseUsers {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId/fork_users"
|
||||
render={
|
||||
(props) => (<ForkUsers {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:projectsId"
|
||||
render={
|
||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
</Switch>
|
||||
</Spin>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ class IndexItem extends Component {
|
|||
: ""
|
||||
}
|
||||
{
|
||||
item.type && item.type !==0 ?
|
||||
item.type ==2?
|
||||
item.type && item.type !== 0 ?
|
||||
item.type === 2 ?
|
||||
<Tooltip title="该项目是一个镜像" className="ml5">
|
||||
<i className="iconfont icon-banbenku font-18 color-green" />
|
||||
</Tooltip>:
|
||||
|
|
|
|||
|
|
@ -192,10 +192,15 @@
|
|||
margin-top: 8px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.spincontent{
|
||||
height:400px;
|
||||
}
|
||||
.spinstyle .ant-spin-text{
|
||||
margin-top:30px;
|
||||
color: #888;
|
||||
}
|
||||
/* -----------详情------------ */
|
||||
.detailHeader-wrapper{
|
||||
height: 125px;
|
||||
background:linear-gradient(82deg,rgba(82,91,215,1) 0%,rgba(34,24,171,1) 100%);
|
||||
}
|
||||
.headerMenu-wrapper{
|
||||
|
|
@ -261,6 +266,10 @@
|
|||
/* color: #1C91FF !important; */
|
||||
background: rgba(255,255,255,0.5);
|
||||
}
|
||||
.files-md{
|
||||
border:1px solid #eee;
|
||||
padding:20px;
|
||||
}
|
||||
/* 详情-代码 */
|
||||
.branch-wrapper{
|
||||
border:1px solid #eee;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React, { Component } from "react";
|
|||
import { Link } from "react-router-dom";
|
||||
import { Popconfirm, Tag } from "antd";
|
||||
import { getImageUrl } from "educoder";
|
||||
import "./merge.css"
|
||||
import "./merge.css";
|
||||
|
||||
class MergeItem extends Component {
|
||||
constructor(props) {
|
||||
|
|
@ -42,7 +42,7 @@ class MergeItem extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { issues, project_name } = this.props;
|
||||
const { issues, project_name, project_author_name } = this.props;
|
||||
const { projectsId } = this.props.match.params;
|
||||
const { current_user } = this.props;
|
||||
const renderList = () => {
|
||||
|
|
@ -60,7 +60,11 @@ class MergeItem extends Component {
|
|||
{item.name}
|
||||
</Link>
|
||||
<Tag className={`pr_tags_${item.pull_request_staus}`}>
|
||||
{item.pull_request_staus==="merged" ? "已合并" : (item.pull_request_staus === "closed"?"已拒绝" : "开启的") }
|
||||
{item.pull_request_staus === "merged"
|
||||
? "已合并"
|
||||
: item.pull_request_staus === "closed"
|
||||
? "已拒绝"
|
||||
: "开启的"}
|
||||
</Tag>
|
||||
</p>
|
||||
<p className="grid-item font-13">
|
||||
|
|
@ -92,21 +96,33 @@ class MergeItem extends Component {
|
|||
</span>
|
||||
<span className="color-grey-8">{item.pr_time}</span>
|
||||
<span className="ml15">
|
||||
<Tag>
|
||||
<Tag className="pr-branch-tag">
|
||||
<Link
|
||||
to={`projects/${projectsId}/coders?branch=${item.pull_request_head}`} className="maxW200px hide-1 ver-middle"
|
||||
to={`/projects/${
|
||||
item.is_original ? item.fork_project_id : projectsId
|
||||
}/coders?branch=${item.pull_request_head}`}
|
||||
className="maxW200px hide-1 ver-middle"
|
||||
>
|
||||
{project_name}:{item.pull_request_head}
|
||||
{item.is_original
|
||||
? item.fork_project_user
|
||||
: project_author_name}
|
||||
:{item.pull_request_head}
|
||||
</Link>
|
||||
</Tag>
|
||||
<span className="mr8 ver-middle">
|
||||
<i className={"iconfont icon-youjiang color-grey-c font-16"}></i>
|
||||
<i
|
||||
className={
|
||||
"iconfont icon-youjiang color-grey-c font-16"
|
||||
}
|
||||
></i>
|
||||
</span>
|
||||
<Tag>
|
||||
<Tag className="pr-branch-tag">
|
||||
<Link
|
||||
to={`projects/${projectsId}/coders?branch=${item.pull_request_base}`} className="maxW200px hide-1 ver-middle"
|
||||
to={`/projects/${projectsId}/coders?branch=${item.pull_request_base}`}
|
||||
className="maxW200px hide-1 ver-middle"
|
||||
>
|
||||
{project_name}:{item.pull_request_base}
|
||||
{/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */}
|
||||
{project_author_name}:{item.pull_request_base}
|
||||
</Link>
|
||||
</Tag>
|
||||
</span>
|
||||
|
|
@ -133,7 +149,7 @@ class MergeItem extends Component {
|
|||
)}
|
||||
</li>
|
||||
<li>{item.version || "--"}</li>
|
||||
|
||||
|
||||
<li>
|
||||
<div
|
||||
className="flex1 df"
|
||||
|
|
|
|||
|
|
@ -256,12 +256,12 @@ class MessageCount extends Component {
|
|||
</div>
|
||||
{
|
||||
<div className="mt15">
|
||||
<Tag>
|
||||
<Tag className="pr-branch-tag">
|
||||
<Link
|
||||
to={`projects/${projectsId}/coders?branch=${data.pull_request.head}`}
|
||||
to={`/projects/${data.pull_request.is_original?data.pull_request.fork_project_id:projectsId}/coders?branch=${data.pull_request.head}`}
|
||||
className="ver-middle"
|
||||
>
|
||||
{data.project_name}:{data.pull_request.head}
|
||||
{data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}:{data.pull_request.head}
|
||||
</Link>
|
||||
</Tag>
|
||||
<span className="mr8 ver-middle">
|
||||
|
|
@ -271,12 +271,13 @@ class MessageCount extends Component {
|
|||
}
|
||||
></i>
|
||||
</span>
|
||||
<Tag>
|
||||
<Tag className="pr-branch-tag">
|
||||
<Link
|
||||
to={`projects/${projectsId}/coders?branch=${data.pull_request.base}`}
|
||||
to={`/projects/${projectsId}/coders?branch=${data.pull_request.base}`}
|
||||
className="ver-middle"
|
||||
>
|
||||
{data.project_name}:{data.pull_request.base}
|
||||
{/* {data.pull_request.is_fork ? data.pull_request.base : `${data.pull_request.pull_request_user}:${data.pull_request.base}`} */}
|
||||
{data.issue.project_author_name}:{data.pull_request.base}
|
||||
</Link>
|
||||
</Tag>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import { Input, Select, Button, Spin, Alert } from "antd";
|
|||
import axios from "axios";
|
||||
import "../Order/order.css";
|
||||
import "./merge.css";
|
||||
import MergeForm from "./merge_form"
|
||||
import MergeFooter from "./merge_footer"
|
||||
import MergeForm from "./merge_form";
|
||||
import MergeFooter from "./merge_footer";
|
||||
const Option = Select.Option;
|
||||
class NewMerge extends Component {
|
||||
constructor(props) {
|
||||
|
|
@ -12,35 +12,91 @@ class NewMerge extends Component {
|
|||
this.state = {
|
||||
data: undefined,
|
||||
branches: undefined,
|
||||
origin_branches: undefined,
|
||||
merge: undefined,
|
||||
pull: undefined,
|
||||
merge_branches: undefined,
|
||||
merge_projects: undefined,
|
||||
merge: "master",
|
||||
pull: "master",
|
||||
is_fork: false,
|
||||
projects_names: undefined,
|
||||
isSpin: false,
|
||||
show_message: true,
|
||||
merge_head: false, // 是否向fork后的源项目发起合并请求
|
||||
default_message: "必须选择不同的分支",
|
||||
project_id: undefined, // 当前项目的id,也即开始发送合并请求的源项目id
|
||||
merge_project_user: undefined
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
this.getmergelist();
|
||||
const { projectsId } = this.props.match.params;
|
||||
|
||||
this.getmergelist(projectsId);
|
||||
};
|
||||
|
||||
//获取新建分枝数据
|
||||
getmergelist = () => {
|
||||
const { projectsId } = this.props.match.params;
|
||||
getmergelist = (projectsId) => {
|
||||
this.setState({isSpin: true})
|
||||
const url = `/projects/${projectsId}/pull_requests/new.json`;
|
||||
axios
|
||||
.get(url)
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
this.setState({
|
||||
data: result.data,
|
||||
is_fork: result.data.is_fork,
|
||||
projects_names: result.data.projects_names,
|
||||
merge_projects: result.data.merge_projects,
|
||||
branches: result.data.branches,
|
||||
origin_branches: result.data.branches,
|
||||
merge_branches: result.data.branches,
|
||||
project_id: result.data.project_id,
|
||||
});
|
||||
this.set_default_pull()
|
||||
this.set_default_merge()
|
||||
}
|
||||
this.setState({isSpin: false})
|
||||
})
|
||||
.catch((error) => {
|
||||
this.setState({isSpin: false})
|
||||
console.log(error);
|
||||
});
|
||||
};
|
||||
|
||||
set_default_pull = () => {
|
||||
const {branches} = this.state;
|
||||
let default_pull = branches.filter((e) => e.name === "master")
|
||||
if (default_pull.length > 0){
|
||||
this.state.pull = default_pull[0].name
|
||||
}else{
|
||||
this.state.pull = "master"
|
||||
}
|
||||
}
|
||||
|
||||
set_default_merge = () => {
|
||||
const {merge_branches} = this.state;
|
||||
let default_merge = merge_branches.filter((e) => e.name === "master")
|
||||
if (default_merge.length > 0){
|
||||
this.state.merge = default_merge[0].name
|
||||
}else{
|
||||
this.state.merge = "master"
|
||||
}
|
||||
this.ischeckmerge();
|
||||
}
|
||||
|
||||
newMergelist = (projectsId) => {
|
||||
this.setState({isSpin: true})
|
||||
const url = `/projects/${projectsId}/pull_requests/get_branches.json`;
|
||||
axios
|
||||
.get(url)
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
this.setState({
|
||||
merge_branches: result.data
|
||||
})
|
||||
this.set_default_merge()
|
||||
}
|
||||
this.setState({isSpin: false})
|
||||
})
|
||||
.catch((error) => {
|
||||
this.setState({isSpin: false})
|
||||
console.log(error);
|
||||
});
|
||||
};
|
||||
|
|
@ -50,18 +106,37 @@ class NewMerge extends Component {
|
|||
this.ischeckmerge();
|
||||
};
|
||||
|
||||
selectProjectName = (value) => {
|
||||
const { project_id, projects_names } = this.state;
|
||||
|
||||
let is_fork_id = parseInt(value) !== parseInt(project_id)
|
||||
this.setState({
|
||||
isSpin: true,
|
||||
merge_head: is_fork_id,
|
||||
data: {
|
||||
is_original: is_fork_id,
|
||||
fork_project_id: is_fork_id ? project_id : "",
|
||||
merge_user_login: is_fork_id ? projects_names[0].project_user_login : undefined
|
||||
}
|
||||
})
|
||||
this.props.history.push(`/projects/${value}/merge/new`);
|
||||
this.newMergelist(value);
|
||||
|
||||
};
|
||||
|
||||
//判断2分支是否可以合并
|
||||
|
||||
ischeckmerge = () => {
|
||||
this.setState({ isSpin: true });
|
||||
const { projectsId } = this.props.match.params;
|
||||
const { pull, merge } = this.state;
|
||||
const { pull, merge, project_id, merge_head } = this.state;
|
||||
const url = `/projects/${projectsId}/pull_requests/check_can_merge.json`;
|
||||
axios
|
||||
.post(url, {
|
||||
project_id: projectsId,
|
||||
head: merge ? merge : "master",
|
||||
base: pull ? pull : "master",
|
||||
head: pull,
|
||||
base: merge,
|
||||
is_original: merge_head,
|
||||
fork_project_id: merge_head ? project_id : undefined
|
||||
})
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
|
|
@ -95,20 +170,38 @@ class NewMerge extends Component {
|
|||
const {
|
||||
data,
|
||||
branches,
|
||||
origin_branches,
|
||||
merge_branches,
|
||||
merge_projects,
|
||||
pull,
|
||||
merge,
|
||||
isSpin,
|
||||
show_message,
|
||||
default_message,
|
||||
merge_head,
|
||||
projects_names,
|
||||
} = this.state;
|
||||
|
||||
const renderBrances = (list) => {
|
||||
const { projectsId } = this.props.match.params;
|
||||
const renderBrances = (list, type) => {
|
||||
if (list && list.length > 0) {
|
||||
return list.map((item, key) => {
|
||||
return (
|
||||
<Option key={key + 1} value={item}>
|
||||
{item}
|
||||
<Option
|
||||
key={key + 1}
|
||||
value={item.name}
|
||||
>
|
||||
{item.name}
|
||||
</Option>
|
||||
);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const renderProjectNames = (list) => {
|
||||
if (list && list.length > 0) {
|
||||
return list.map((item, key) => {
|
||||
return (
|
||||
<Option key={key + 1} value={item.project_id}>
|
||||
{item.project_name}
|
||||
</Option>
|
||||
);
|
||||
});
|
||||
|
|
@ -120,65 +213,77 @@ class NewMerge extends Component {
|
|||
};
|
||||
|
||||
return (
|
||||
<div >
|
||||
<div>
|
||||
<div className="main">
|
||||
<Spin spinning={isSpin}>
|
||||
<div className="merge-header width100 inline-block">
|
||||
<div className="width45 pull-left">
|
||||
<div className="color-grey-3 mb10 fwb">源分支:</div>
|
||||
<Input.Group compact className="display-flex">
|
||||
<Button className="merge-header-button maxW50 hide-1 task-hide">
|
||||
{data && data.project_author} / {data && data.project_name}
|
||||
</Button>
|
||||
<Select
|
||||
defaultValue={pull ? pull : "master"}
|
||||
onSelect={(e) => this.selectBrach("pull", e)}
|
||||
showSearch
|
||||
className="minW50 merge-flex1"
|
||||
>
|
||||
{renderBrances(branches)}
|
||||
</Select>
|
||||
</Input.Group>
|
||||
</div>
|
||||
<div className="width10 pull-left text-center mt25">
|
||||
<i className={"iconfont icon-youjiang color-grey-c font-32"}></i>
|
||||
</div>
|
||||
<div className="width45 pull-left">
|
||||
<div>
|
||||
<div className="color-grey-3 mb10 fwb">目标分支:</div>
|
||||
<Spin spinning={isSpin}>
|
||||
<div className="merge-header width100 inline-block">
|
||||
<div className="width45 pull-left">
|
||||
<div className="color-grey-3 mb10 fwb">源分支:</div>
|
||||
<Input.Group compact className="display-flex">
|
||||
<Button className="merge-header-button maxW50 hide-1 task-hide">
|
||||
{data && data.project_author} / {data && data.project_name}
|
||||
</Button>
|
||||
<Select
|
||||
defaultValue={merge ? merge : "master"}
|
||||
onSelect={(e) => this.selectBrach("merge", e)}
|
||||
defaultValue={parseInt(projectsId)}
|
||||
class=" maxW50 hide-1 task-hide"
|
||||
disabled
|
||||
>
|
||||
{renderProjectNames(projects_names)}
|
||||
</Select>
|
||||
<Select
|
||||
defaultValue={pull}
|
||||
onSelect={(e) => this.selectBrach("pull", e)}
|
||||
showSearch
|
||||
className="minW50 merge-flex1"
|
||||
>
|
||||
{renderBrances(branches)}
|
||||
{renderBrances(branches, false)}
|
||||
</Select>
|
||||
</Input.Group>
|
||||
</div>
|
||||
<div className="width10 pull-left text-center mt25">
|
||||
<i
|
||||
className={"iconfont icon-youjiang color-grey-c font-32"}
|
||||
></i>
|
||||
</div>
|
||||
<div className="width45 pull-left">
|
||||
<div>
|
||||
<div className="color-grey-3 mb10 fwb">目标分支:</div>
|
||||
<Input.Group compact className="display-flex">
|
||||
<Select
|
||||
defaultValue={parseInt(projectsId)}
|
||||
class=" maxW50 hide-1 task-hide"
|
||||
onSelect={(e) => this.selectProjectName(e)}
|
||||
>
|
||||
{renderProjectNames(merge_projects)}
|
||||
</Select>
|
||||
<Select
|
||||
defaultValue={merge}
|
||||
value={merge}
|
||||
onSelect={(e) => this.selectBrach("merge", e)}
|
||||
showSearch
|
||||
className="minW50 merge-flex1"
|
||||
>
|
||||
{renderBrances(merge_branches, merge_head)}
|
||||
</Select>
|
||||
</Input.Group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{show_message ? (
|
||||
<div className="mb50 mt50">
|
||||
<Alert
|
||||
description={withHtml(default_message)}
|
||||
type="error"
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
:
|
||||
<MergeForm {...this.props} merge_type="new" data={data} merge={merge?merge:"master"} pull={pull?pull:"master"}></MergeForm>
|
||||
}
|
||||
</Spin>
|
||||
{show_message ? (
|
||||
<div className="mb50 mt50">
|
||||
<Alert description={withHtml(default_message)} type="error" />
|
||||
</div>
|
||||
) : (
|
||||
<MergeForm
|
||||
{...this.props}
|
||||
merge_type="new"
|
||||
data={data}
|
||||
merge={merge}
|
||||
pull={pull}
|
||||
></MergeForm>
|
||||
)}
|
||||
</Spin>
|
||||
</div>
|
||||
<div className=" main">
|
||||
{/* <div className=" main">
|
||||
<MergeFooter footer_type="new" {...this.props}></MergeFooter>
|
||||
</div>
|
||||
|
||||
</div> */}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,15 +63,14 @@ class UpdateMerge extends Component {
|
|||
<div>
|
||||
<div className="merge-header width100 inline-block">
|
||||
<div className="width45 pull-left">
|
||||
<div className="color-grey-3 mb10 fwb"> 源分支: </div>{" "}
|
||||
<div className="color-grey-3 mb10 fwb">源分支:</div>
|
||||
|
||||
<Input.Group compact className="display-flex">
|
||||
<Button className="merge-header-button maxW50 hide-1 task-hide">
|
||||
{" "}
|
||||
{data && data.project_author}/{" "}
|
||||
{data && data.project_name}{" "}
|
||||
</Button>{" "}
|
||||
{data.is_original ? `${data.fork_project_user_name}/${data.fork_project_identifier}` : `${data.project_author}/${data.project_name}`}
|
||||
</Button>
|
||||
<Select
|
||||
defaultValue={pull ? pull : "master"}
|
||||
defaultValue={data.is_original ? `${data.fork_project_user}:${pull}` : `${pull}`}
|
||||
className="minW50 merge-flex1"
|
||||
disabled
|
||||
></Select>{" "}
|
||||
|
|
@ -87,12 +86,10 @@ class UpdateMerge extends Component {
|
|||
<div className="color-grey-3 mb10 fwb"> 目标分支 : </div>{" "}
|
||||
<Input.Group compact className="display-flex">
|
||||
<Button className="merge-header-button maxW50 hide-1 task-hide">
|
||||
{" "}
|
||||
{data && data.project_author}/{" "}
|
||||
{data && data.project_name}{" "}
|
||||
</Button>{" "}
|
||||
{`${data.project_author}/${data.project_name}`}
|
||||
</Button>
|
||||
<Select
|
||||
defaultValue={merge ? merge : "master"}
|
||||
defaultValue={data.is_original ? `${data.project_login}:${merge}` : `${merge}`}
|
||||
className="minW50 merge-flex1"
|
||||
disabled
|
||||
></Select>{" "}
|
||||
|
|
@ -110,14 +107,12 @@ class UpdateMerge extends Component {
|
|||
</div>
|
||||
) : (
|
||||
""
|
||||
)}{" "}
|
||||
</Spin>{" "}
|
||||
</div>{" "}
|
||||
<div className=" main">
|
||||
<MergeFooter footer_type="new" {...this.props}>
|
||||
{" "}
|
||||
</MergeFooter>{" "}
|
||||
</div>{" "}
|
||||
)}
|
||||
</Spin>
|
||||
</div>
|
||||
{/* <div className=" main">
|
||||
<MergeFooter footer_type="new" {...this.props}></MergeFooter>
|
||||
</div> */}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -417,6 +417,7 @@ class merge extends Component {
|
|||
page={select_params.page}
|
||||
limit={select_params.limit}
|
||||
project_name={data.project_name}
|
||||
project_author_name={data.project_author_name}
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
></OrderItem>
|
||||
|
|
|
|||
|
|
@ -33,12 +33,12 @@ class MergeFooter extends Component {
|
|||
</TabPane>
|
||||
}
|
||||
|
||||
<TabPane tab={<span className="ml-3 font-16">提交</span>} key="2">
|
||||
{/* <TabPane tab={<span className="ml-3 font-16">提交</span>} key="2">
|
||||
<CodesCommit {...this.props} main_class="pd10"></CodesCommit>
|
||||
</TabPane>
|
||||
<TabPane tab={<span className="ml-3 font-16">文件</span>} key="3">
|
||||
</TabPane> */}
|
||||
{/* <TabPane tab={<span className="ml-3 font-16">文件</span>} key="3">
|
||||
<Empty />
|
||||
</TabPane>
|
||||
</TabPane> */}
|
||||
</Tabs>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from "react";
|
||||
import { Button, Form, Menu, Input, Select, Tag, Checkbox } from "antd";
|
||||
import { Button, Form, Menu, Input, Select, Tag, Checkbox, Spin } from "antd";
|
||||
import axios from "axios";
|
||||
|
||||
import "../Order/order.css";
|
||||
|
|
@ -21,21 +21,54 @@ class MergeForm extends Component {
|
|||
mergedata: undefined,
|
||||
priority_id: undefined,
|
||||
title: undefined,
|
||||
members: undefined,
|
||||
issue_tags: undefined,
|
||||
issue_versions: undefined,
|
||||
issue_priories: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
this.check_is_login();
|
||||
this.get_default_selects();
|
||||
this.set_defatul();
|
||||
};
|
||||
check_is_login =() =>{
|
||||
if(!this.props.checkIfLogin()){
|
||||
this.props.history.push("/403")
|
||||
return
|
||||
}
|
||||
};
|
||||
get_default_selects = () => {
|
||||
const { projectsId } = this.props.match.params;
|
||||
this.setState({ isSpin: true });
|
||||
axios
|
||||
.get(`/projects/${projectsId}/pull_requests/create_merge_infos.json`)
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
this.setState({
|
||||
members: result.data.members,
|
||||
issue_tags: result.data.issue_tags,
|
||||
issue_versions: result.data.issue_versions,
|
||||
issue_priories: result.data.issue_priories,
|
||||
});
|
||||
}
|
||||
this.setState({ isSpin: false });
|
||||
})
|
||||
.catch((error) => {
|
||||
this.setState({ isSpin: false });
|
||||
console.log(error);
|
||||
});
|
||||
};
|
||||
set_defatul = () => {
|
||||
const { data, merge_type } = this.props;
|
||||
if (data && merge_type === "edit") {
|
||||
this.setState({
|
||||
desc: data.body,
|
||||
issue_tag_ids: data.issue_tag_ids[0],
|
||||
fixed_version_id: String(data.fixed_version_id),
|
||||
assigned_to_id: String(data.assigned_to_id),
|
||||
priority_id: String(data.priority_id),
|
||||
issue_tag_ids: data.issue_tag_ids ? data.issue_tag_ids[0] : undefined,
|
||||
fixed_version_id: data.fixed_version_id ? String(data.fixed_version_id) : undefined,
|
||||
assigned_to_id: data.assigned_to_id ? String(data.assigned_to_id) : undefined,
|
||||
priority_id: data.priority_id ? String(data.priority_id) :undefined,
|
||||
title: data.title,
|
||||
});
|
||||
}
|
||||
|
|
@ -99,13 +132,13 @@ class MergeForm extends Component {
|
|||
this.props.form.validateFieldsAndScroll((err, values) => {
|
||||
if (!err) {
|
||||
const { projectsId, mergeId } = this.props.match.params;
|
||||
const { merge, pull, merge_type } = this.props;
|
||||
const { merge, pull, merge_type, data } = this.props;
|
||||
if (values.issue_tag_ids && values.issue_tag_ids.length > 0) {
|
||||
values.issue_tag_ids = [parseInt(values.issue_tag_ids)];
|
||||
} else {
|
||||
values.issue_tag_ids = [];
|
||||
}
|
||||
const { desc } = this.state;
|
||||
const { desc } = this.state;
|
||||
if (merge_type === "new") {
|
||||
let url = `/projects/${projectsId}/pull_requests.json`;
|
||||
axios
|
||||
|
|
@ -114,6 +147,9 @@ class MergeForm extends Component {
|
|||
body: desc,
|
||||
head: pull,
|
||||
base: merge,
|
||||
is_original: data && data.is_original,
|
||||
fork_project_id: data && data.fork_project_id,
|
||||
merge_user_login: data && data.merge_user_login
|
||||
})
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
|
|
@ -121,6 +157,8 @@ class MergeForm extends Component {
|
|||
isSpin: false,
|
||||
});
|
||||
this.props.history.push(`/projects/${projectsId}/merge`);
|
||||
const { getDetail } = this.props;
|
||||
getDetail && getDetail();
|
||||
} else {
|
||||
this.setState({
|
||||
isSpin: false,
|
||||
|
|
@ -136,30 +174,32 @@ class MergeForm extends Component {
|
|||
} else {
|
||||
let url = `/projects/${projectsId}/pull_requests/${mergeId}.json`;
|
||||
axios
|
||||
.put(url, {
|
||||
...values,
|
||||
body: desc,
|
||||
head: pull,
|
||||
base: merge,
|
||||
})
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
.put(url, {
|
||||
...values,
|
||||
body: desc,
|
||||
head: pull,
|
||||
base: merge,
|
||||
})
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
this.setState({
|
||||
isSpin: false,
|
||||
});
|
||||
this.props.history.push(
|
||||
`/projects/${projectsId}/merge/${mergeId}/Messagecount`
|
||||
);
|
||||
} else {
|
||||
this.setState({
|
||||
isSpin: false,
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.setState({
|
||||
isSpin: false,
|
||||
});
|
||||
this.props.history.push(`/projects/${projectsId}/merge/${mergeId}/Messagecount`);
|
||||
} else {
|
||||
this.setState({
|
||||
isSpin: false,
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.setState({
|
||||
isSpin: false,
|
||||
console.log(error);
|
||||
});
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setState({
|
||||
|
|
@ -187,130 +227,136 @@ class MergeForm extends Component {
|
|||
desc,
|
||||
isSpin,
|
||||
title,
|
||||
members,
|
||||
issue_tags,
|
||||
issue_versions,
|
||||
issue_priories,
|
||||
} = this.state;
|
||||
return (
|
||||
<div>
|
||||
<div className="mt20 mb20">
|
||||
<span className="font-16 fwb mr10 ver-middle">
|
||||
{merge_type === "new" ? "新建" : "编辑"}合并请求:
|
||||
</span>
|
||||
<Tag color="#28BD6C" className="ver-middle">
|
||||
可合并的
|
||||
</Tag>
|
||||
</div>
|
||||
<Form>
|
||||
<div className="width100 inline-block">
|
||||
<div className="width70 pull-left">
|
||||
<Form.Item>
|
||||
{getFieldDecorator("title", {
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写请求标题",
|
||||
},
|
||||
],
|
||||
initialValue: title,
|
||||
})(<Input placeholder="标题" />)}
|
||||
</Form.Item>
|
||||
<MDEditor
|
||||
placeholder={"请输入合并请求的描述..."}
|
||||
height={350}
|
||||
mdID={"merge-new-description"}
|
||||
initValue={desc}
|
||||
onChange={this.onContentChange}
|
||||
></MDEditor>
|
||||
<p className="clearfix mt20">
|
||||
<Button
|
||||
type="primary"
|
||||
loading={isSpin}
|
||||
onClick={this.handleSubmit}
|
||||
>
|
||||
<span className="plr10">
|
||||
{merge_type === "new" ? "创建" : "提交"}
|
||||
</span>
|
||||
</Button>
|
||||
<Button
|
||||
type="default"
|
||||
className="ml30"
|
||||
href={
|
||||
merge_type === "new"
|
||||
? `/projects/${projectsId}/merge`
|
||||
: `/projects/${projectsId}/merge/${mergeId}/detail`
|
||||
}
|
||||
>
|
||||
<span className="plr10">取消</span>
|
||||
</Button>
|
||||
</p>
|
||||
</div>
|
||||
<div className="width30 pull-left">
|
||||
<div className="pl30">
|
||||
<Spin spinning={isSpin}>
|
||||
<div className="mt20 mb20">
|
||||
<span className="font-16 fwb mr10 ver-middle">
|
||||
{merge_type === "new" ? "新建" : "编辑"}合并请求:
|
||||
</span>
|
||||
<Tag color="#28BD6C" className="ver-middle">
|
||||
可合并的
|
||||
</Tag>
|
||||
</div>
|
||||
<Form>
|
||||
<div className="width100 inline-block">
|
||||
<div className="width70 pull-left">
|
||||
<Form.Item>
|
||||
{getFieldDecorator("assigned_to_id", {
|
||||
initialValue: assigned_to_id,
|
||||
})(
|
||||
<Select placeholder="审查人员" showSearch>
|
||||
{this.renderSelect(data && data.members)}
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
{getFieldDecorator("fixed_version_id", {
|
||||
initialValue: fixed_version_id,
|
||||
})(
|
||||
<Select
|
||||
placeholder={
|
||||
data && data.issue_versions.length > 0
|
||||
? "未选择里程碑"
|
||||
: "请添加里程碑"
|
||||
}
|
||||
showSearch
|
||||
>
|
||||
{this.renderSelect(data && data.issue_versions)}
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
{getFieldDecorator("issue_tag_ids", {
|
||||
initialValue: issue_tag_ids,
|
||||
})(
|
||||
<Select
|
||||
placeholder={
|
||||
data && data.issue_tags.length > 0
|
||||
? "未选择标签"
|
||||
: "请在仓库设置里添加标签"
|
||||
}
|
||||
showSearch
|
||||
>
|
||||
{this.renderSelect(data && data.issue_tags)}
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
{getFieldDecorator("priority_id", {
|
||||
initialValue: priority_id,
|
||||
})(
|
||||
<Select placeholder="优先级" showSearch>
|
||||
{this.renderSelect(data && data.issue_priories)}
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item name="checkbox-group" label="其他">
|
||||
<Checkbox.Group>
|
||||
<div>
|
||||
<Checkbox value="A">必须审查代码</Checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<Checkbox value="B">合并后删除提交分支</Checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<Checkbox value="C">合并后关闭提到的任务</Checkbox>
|
||||
</div>
|
||||
</Checkbox.Group>
|
||||
{getFieldDecorator("title", {
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写请求标题",
|
||||
},
|
||||
],
|
||||
initialValue: title,
|
||||
})(<Input placeholder="标题" />)}
|
||||
</Form.Item>
|
||||
<MDEditor
|
||||
placeholder={"请输入合并请求的描述..."}
|
||||
height={350}
|
||||
mdID={"merge-new-description"}
|
||||
initValue={desc}
|
||||
onChange={this.onContentChange}
|
||||
></MDEditor>
|
||||
<p className="clearfix mt20">
|
||||
<Button
|
||||
type="primary"
|
||||
loading={isSpin}
|
||||
onClick={this.handleSubmit}
|
||||
>
|
||||
<span className="plr10">
|
||||
{merge_type === "new" ? "创建" : "提交"}
|
||||
</span>
|
||||
</Button>
|
||||
<Button
|
||||
type="default"
|
||||
className="ml30"
|
||||
href={
|
||||
merge_type === "new"
|
||||
? `/projects/${projectsId}/merge`
|
||||
: `/projects/${projectsId}/merge/${mergeId}/detail`
|
||||
}
|
||||
>
|
||||
<span className="plr10">取消</span>
|
||||
</Button>
|
||||
</p>
|
||||
</div>
|
||||
<div className="width30 pull-left">
|
||||
<div className="pl30">
|
||||
<Form.Item>
|
||||
{getFieldDecorator("assigned_to_id", {
|
||||
initialValue: assigned_to_id,
|
||||
})(
|
||||
<Select placeholder="审查人员" showSearch>
|
||||
{this.renderSelect(members)}
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
{getFieldDecorator("fixed_version_id", {
|
||||
initialValue: fixed_version_id,
|
||||
})(
|
||||
<Select
|
||||
placeholder={
|
||||
issue_versions && issue_versions.length > 0
|
||||
? "未选择里程碑"
|
||||
: "请添加里程碑"
|
||||
}
|
||||
showSearch
|
||||
>
|
||||
{this.renderSelect(issue_versions)}
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
{getFieldDecorator("issue_tag_ids", {
|
||||
initialValue: issue_tag_ids,
|
||||
})(
|
||||
<Select
|
||||
placeholder={
|
||||
issue_tags && issue_tags.length > 0
|
||||
? "未选择标签"
|
||||
: "请在仓库设置里添加标签"
|
||||
}
|
||||
showSearch
|
||||
>
|
||||
{this.renderSelect(issue_tags)}
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
{getFieldDecorator("priority_id", {
|
||||
initialValue: priority_id,
|
||||
})(
|
||||
<Select placeholder="优先级" showSearch>
|
||||
{this.renderSelect(issue_priories)}
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item name="checkbox-group" label="其他">
|
||||
<Checkbox.Group>
|
||||
<div>
|
||||
<Checkbox value="A">必须审查代码</Checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<Checkbox value="B">合并后删除提交分支</Checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<Checkbox value="C">合并后关闭提到的任务</Checkbox>
|
||||
</div>
|
||||
</Checkbox.Group>
|
||||
</Form.Item>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Form>
|
||||
</Form>
|
||||
</Spin>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ class Nodata extends Component{
|
|||
<div className="none_panels">
|
||||
<div>
|
||||
<div className="mb15">
|
||||
<i className="iconfont icon-hebingqingqiu font-80 ver-middle color-grey-8"></i>
|
||||
<i className="iconfont icon-hebingqingqiu font-80 ver-middle color-grey-b"></i>
|
||||
</div>
|
||||
<h3>欢迎使用合并请求!</h3>
|
||||
|
||||
|
|
|
|||
|
|
@ -41,21 +41,22 @@ class Index extends Component {
|
|||
ignore_name: undefined
|
||||
}
|
||||
}
|
||||
getUserInfo = () => {
|
||||
const url = `/users/me.json`;
|
||||
axios.get(url).then(result => {
|
||||
if (result && result.data.login) {
|
||||
this.setState({
|
||||
current_user: result.data
|
||||
})
|
||||
this.getDetail();
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
// getUserInfo = () => {
|
||||
// const url = `/users/me.json`;
|
||||
// axios.get(url).then(result => {
|
||||
// if (result && result.data.login) {
|
||||
// this.setState({
|
||||
// current_user: result.data
|
||||
// })
|
||||
// this.getDetail();
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// console.log(error)
|
||||
// })
|
||||
// }
|
||||
componentDidMount = () => {
|
||||
// this.getUserInfo();
|
||||
this.check_is_login()
|
||||
// 获取项目类别
|
||||
this.getCategory();
|
||||
// 获取项目语言
|
||||
|
|
@ -64,6 +65,13 @@ class Index extends Component {
|
|||
this.getGitignore();
|
||||
// 获取开源许可证
|
||||
this.getLicenses();
|
||||
|
||||
}
|
||||
check_is_login =() =>{
|
||||
if(!this.props.checkIfLogin()){
|
||||
this.props.history.push("/403")
|
||||
return
|
||||
}
|
||||
}
|
||||
getCategory = () => {
|
||||
const url = `/project_categories.json`
|
||||
|
|
@ -216,6 +224,21 @@ class Index extends Component {
|
|||
})
|
||||
}
|
||||
|
||||
ChangeAddr=(e)=>{
|
||||
let value = e.target.value;
|
||||
if(value.indexOf("/") > -1){
|
||||
let arr = value.split("/");
|
||||
let first = arr[arr.length-1];
|
||||
if(first.indexOf(".git") > -1){
|
||||
let second = first.split('.')[0];
|
||||
if(!second)return;
|
||||
this.props.form.setFieldsValue({
|
||||
repository_name:second
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { getFieldDecorator } = this.props.form;
|
||||
// 项目类型:deposit-托管项目,mirror-镜像项目
|
||||
|
|
@ -262,7 +285,7 @@ class Index extends Component {
|
|||
required: true, message: '请填写镜像版本库地址'
|
||||
}],
|
||||
})(
|
||||
<Input placeholder="输入需要同步到本项目的镜像版本库地址" />
|
||||
<Input placeholder="输入需要同步到本项目的镜像版本库地址" onChange={this.ChangeAddr} />
|
||||
)}
|
||||
</Form.Item>
|
||||
<p className="formTip color-orange">示例:https://github.com/facebook/reack.git</p>
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@ class UserSubmitComponent extends Component {
|
|||
: `/projects/${projectsId}/coders`;
|
||||
this.props.history.push(url);
|
||||
this.props.showNotification("文件新建成功!");
|
||||
if(submitType === "1"){
|
||||
const { getDetail } = this.props;
|
||||
getDetail && getDetail();
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
.setInputAddon .ant-input-group-addon{
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
border-left: 1px solid #d9d9d9!important;
|
||||
border: 1px solid #d9d9d9!important;
|
||||
border-right: none!important;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,16 @@ class NewMilepost extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
this.check_is_login();
|
||||
};
|
||||
check_is_login =() =>{
|
||||
if(!this.props.checkIfLogin()){
|
||||
this.props.history.push("/403")
|
||||
return
|
||||
}
|
||||
};
|
||||
|
||||
onPanelChange = (time, mode) => {
|
||||
this.setState({
|
||||
value: time
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ class order extends Component {
|
|||
allValue: [],
|
||||
all: false,
|
||||
select_params: {
|
||||
status_type: "1", //开启中和关闭中,全部,默认为全部
|
||||
assigned_to_id: undefined, // 负责人
|
||||
author_id: undefined, // 发布人
|
||||
issue_tag_id: undefined, // 标签
|
||||
|
|
@ -77,7 +76,7 @@ class order extends Component {
|
|||
|
||||
componentDidMount = () => {
|
||||
this.getSelectList();
|
||||
this.getIssueList();
|
||||
this.getIssueList('1');
|
||||
};
|
||||
|
||||
getSelectList = () => {
|
||||
|
|
@ -101,7 +100,7 @@ class order extends Component {
|
|||
};
|
||||
|
||||
// 获取列表数据
|
||||
getIssueList = (begin, end) => {
|
||||
getIssueList = (status_type , begin, end) => {
|
||||
this.setState({
|
||||
isSpin: true
|
||||
})
|
||||
|
|
@ -113,7 +112,8 @@ class order extends Component {
|
|||
params: {
|
||||
...select_params,
|
||||
start_date: begin,
|
||||
due_date: end
|
||||
due_date: end,
|
||||
status_type
|
||||
}
|
||||
})
|
||||
.then((result) => {
|
||||
|
|
@ -165,7 +165,8 @@ class order extends Component {
|
|||
this.state.select_params.order_name = key_name[0];
|
||||
this.state.select_params.order_type = e.item.props.value;
|
||||
this.state.select_params.page = 1;
|
||||
this.getIssueList();
|
||||
const { status_type } = this.state;
|
||||
this.getIssueList(status_type);
|
||||
};
|
||||
|
||||
getOption = (e, id, name,toGet) => {
|
||||
|
|
@ -192,7 +193,8 @@ class order extends Component {
|
|||
assigned_to_id
|
||||
});
|
||||
if(!toGet){
|
||||
this.getIssueList();
|
||||
const { status_type } = this.state;
|
||||
this.getIssueList(status_type);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -225,8 +227,10 @@ class order extends Component {
|
|||
checkedValue: [],
|
||||
all: false
|
||||
});
|
||||
|
||||
const { status_type } = this.state;
|
||||
this.state.select_params.page = page;
|
||||
this.getIssueList();
|
||||
this.getIssueList(status_type);
|
||||
};
|
||||
|
||||
// 搜索
|
||||
|
|
@ -235,9 +239,11 @@ class order extends Component {
|
|||
search: value,
|
||||
isSpin: true,
|
||||
});
|
||||
const { status_type } = this.state;
|
||||
|
||||
this.state.select_params.search = value;
|
||||
this.state.select_params.page = 1;
|
||||
this.getIssueList();
|
||||
this.getIssueList(status_type);
|
||||
};
|
||||
|
||||
openorder = (type) => {
|
||||
|
|
@ -254,12 +260,11 @@ class order extends Component {
|
|||
paix: "排序",
|
||||
});
|
||||
this.state.select_params = {
|
||||
status_type: type,
|
||||
search: undefined,
|
||||
page: 1,
|
||||
limit: 15,
|
||||
};
|
||||
this.getIssueList();
|
||||
this.getIssueList(type);
|
||||
};
|
||||
|
||||
// 筛选:全部、指派给我、由我创建
|
||||
|
|
@ -269,7 +274,7 @@ class order extends Component {
|
|||
isSpin: true,
|
||||
});
|
||||
if (type) {
|
||||
if (current_user === undefined) {
|
||||
if (!current_user) {
|
||||
this.setState({
|
||||
isSpin: false,
|
||||
});
|
||||
|
|
@ -304,8 +309,9 @@ class order extends Component {
|
|||
this.state.select_params.assigned_to_id = undefined;
|
||||
this.state.select_params.author_id = undefined;
|
||||
}
|
||||
const { status_type } = this.state;
|
||||
|
||||
this.getIssueList();
|
||||
this.getIssueList(status_type);
|
||||
};
|
||||
|
||||
deletedetail = (id) => {
|
||||
|
|
@ -319,7 +325,9 @@ class order extends Component {
|
|||
})
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
this.getIssueList();
|
||||
const { status_type } = this.state;
|
||||
|
||||
this.getIssueList(status_type);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
|
|
@ -339,16 +347,18 @@ class order extends Component {
|
|||
|
||||
// 修改开始时间
|
||||
changeBeginTime = (data, value) => {
|
||||
const { status_type } = this.state;
|
||||
this.setState({
|
||||
begin: value
|
||||
})
|
||||
this.getIssueList(value, this.state.end);
|
||||
this.getIssueList(status_type,value, this.state.end);
|
||||
}
|
||||
changeEndTime = (data, value) => {
|
||||
const { status_type } = this.state;
|
||||
this.setState({
|
||||
end: value
|
||||
})
|
||||
this.getIssueList(this.state.begin, value);
|
||||
this.getIssueList(status_type,this.state.begin, value);
|
||||
}
|
||||
|
||||
// 选择列表里面的checkbox
|
||||
|
|
@ -395,6 +405,11 @@ class order extends Component {
|
|||
updateIssues=()=>{
|
||||
const {checkedValue , select_params} = this.state;
|
||||
const { projectsId } = this.props.match.params;
|
||||
|
||||
if(!select_params.update_author_id && !select_params.update_fixed_version_id &&!select_params.update_status_id ){
|
||||
this.resetSelectParams();
|
||||
return;
|
||||
}
|
||||
this.setState({
|
||||
isSpin:true
|
||||
})
|
||||
|
|
@ -415,6 +430,12 @@ class order extends Component {
|
|||
}
|
||||
|
||||
successFunc=()=>{
|
||||
this.resetSelectParams();
|
||||
const { status_type } = this.state;
|
||||
this.getIssueList(status_type);
|
||||
}
|
||||
|
||||
resetSelectParams=()=>{
|
||||
let select_params = this.state.select_params;
|
||||
select_params.update_author_id = undefined;
|
||||
select_params.update_fixed_version_id = undefined;
|
||||
|
|
@ -427,7 +448,6 @@ class order extends Component {
|
|||
update_status_ids:"修改状态",
|
||||
select_params
|
||||
})
|
||||
this.getIssueList();
|
||||
}
|
||||
|
||||
// 批量删除
|
||||
|
|
|
|||
|
|
@ -40,9 +40,16 @@ class order_form extends Component {
|
|||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
this.check_is_login()
|
||||
this.getSelectList();
|
||||
this.get_detail();
|
||||
};
|
||||
check_is_login =() =>{
|
||||
if(!this.props.checkIfLogin()){
|
||||
this.props.history.push("/403")
|
||||
return
|
||||
}
|
||||
}
|
||||
get_detail = () => {
|
||||
const { form_type } = this.props;
|
||||
console.log("form_type",form_type)
|
||||
|
|
|
|||
|
|
@ -56,11 +56,19 @@ class Collaborator extends Component {
|
|||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
this.check_is_login()
|
||||
if (this.props.project_id) {
|
||||
this.getMember();
|
||||
}
|
||||
};
|
||||
|
||||
check_is_login =() =>{
|
||||
if(!this.props.checkIfLogin()){
|
||||
this.props.history.push("/403")
|
||||
return
|
||||
}
|
||||
};
|
||||
|
||||
componentDidUpdate = (prevState) => {
|
||||
if (
|
||||
this.props.project_id &&
|
||||
|
|
@ -434,7 +442,7 @@ class Collaborator extends Component {
|
|||
return (
|
||||
<WhiteBack>
|
||||
<div className="flex-a-center baseForm bbr">
|
||||
<span className="font-18 fwb text-black">协作者管理</span>
|
||||
<span className="font-18 text-black">协作者管理</span>
|
||||
<div className="addPanel">
|
||||
<AutoComplete
|
||||
dataSource={source}
|
||||
|
|
@ -473,7 +481,7 @@ class Collaborator extends Component {
|
|||
|
||||
<Spin spinning={isSpin}>
|
||||
<div className="collaboratorList baseForm">
|
||||
{listData ? (
|
||||
{listData && listData.length>0 ? (
|
||||
<Table
|
||||
pagination={false}
|
||||
columns={columns}
|
||||
|
|
|
|||
|
|
@ -19,10 +19,17 @@ class Setting extends Component {
|
|||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
this.check_is_login()
|
||||
this.getCategory();
|
||||
this.getLanguage();
|
||||
this.getInfo();
|
||||
};
|
||||
check_is_login =() =>{
|
||||
if(!this.props.checkIfLogin()){
|
||||
this.props.history.push("/403")
|
||||
return
|
||||
}
|
||||
};
|
||||
getLanguage = () => {
|
||||
const url = `/project_languages.json`;
|
||||
axios
|
||||
|
|
|
|||
|
|
@ -51,8 +51,15 @@ class NewTags extends Component {
|
|||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
this.check_is_login();
|
||||
this.getList();
|
||||
};
|
||||
check_is_login =() =>{
|
||||
if(!this.props.checkIfLogin()){
|
||||
this.props.history.push("/403")
|
||||
return
|
||||
}
|
||||
};
|
||||
|
||||
getList = (page, order_name, order_type) => {
|
||||
const { projectsId } = this.props.match.params;
|
||||
|
|
@ -415,9 +422,9 @@ class NewTags extends Component {
|
|||
className="flex-a-center baseForm bbr"
|
||||
style={{ "justify-content": "space-between" }}
|
||||
>
|
||||
<span className="font-18 fwb text-black">项目标签</span>
|
||||
<span className="font-18 text-black">项目标签</span>
|
||||
{data && data.user_admin_or_member ? (
|
||||
<Button type="primary" onClick={this.newshow}>
|
||||
<Button type="primary" ghost onClick={this.newshow}>
|
||||
<Icon type="plus"></Icon>
|
||||
创建标签
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@
|
|||
.baseForm{
|
||||
padding:15px 30px!important;
|
||||
}
|
||||
.collaboratorList{
|
||||
min-height: 400px;
|
||||
}
|
||||
.iteminline{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -172,6 +175,10 @@
|
|||
}
|
||||
.ant-table-tbody > tr > td{
|
||||
border-bottom: none;
|
||||
padding:15px 8px 15px 0px;
|
||||
}
|
||||
.ant-table-tbody > tr > td:last-child{
|
||||
padding-right: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,32 +1,35 @@
|
|||
import React , { useState } from 'react';
|
||||
import { Box , Long , Short , Gap , Banner , WhiteBack } from '../../Component/layout';
|
||||
import { Box , Long , Short , Gap , WhiteBack } from '../../Component/layout';
|
||||
import Title from '../../Component/Title';
|
||||
import Setnav from '../../Component/Setnav';
|
||||
import styled from 'styled-components';
|
||||
|
||||
const Div = styled.div`{
|
||||
padding:18px 30px;
|
||||
}`
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import Loadable from "react-loadable";
|
||||
import Loading from "../../../Loading";
|
||||
|
||||
const Common = Loadable({
|
||||
loader: () => import("./SettingCommon"),
|
||||
loading: Loading,
|
||||
});
|
||||
export default (props)=>{
|
||||
const pathname = props.location.pathname;
|
||||
const organizeId = props.match.params.organizeId;
|
||||
const memberId = props.match.params.memberId;
|
||||
|
||||
function returnActive (pathname){
|
||||
let a = 0;
|
||||
if(pathname === `/organize/${organizeId}/setting/member`){
|
||||
if(pathname === `/organize/${organizeId}/member/${memberId}/setting/member`){
|
||||
a = 1;
|
||||
}else if(pathname === `/organize/${organizeId}/setting/group`){
|
||||
}else if(pathname === `/organize/${organizeId}/member/${memberId}/setting/project`){
|
||||
a = 2;
|
||||
}else if(pathname === `/organize/${organizeId}/setting/hooks`){
|
||||
a = 3;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
const active = returnActive(pathname);
|
||||
const array = {list:[
|
||||
{name:'基本设置',icon:"icon-base",href:`/organize/${organizeId}/setting`},
|
||||
{name:'团队成员管理',icon:"icon-zuzhichengyuan",href:`/organize/${organizeId}/setting/member`},
|
||||
{name:'团队项目管理',icon:"icon-zuzhixiangmu",href:`/organize/${organizeId}/setting/group`},
|
||||
{name:'基本设置',icon:"icon-base",href:`/organize/${organizeId}/member/${memberId}/setting`},
|
||||
{name:'团队成员管理',icon:"icon-zuzhichengyuan",href:`/organize/${organizeId}/member/${memberId}/setting/member`},
|
||||
{name:'团队项目管理',icon:"icon-zuzhixiangmu",href:`/organize/${organizeId}/member/${memberId}/setting/project`},
|
||||
],
|
||||
active
|
||||
}
|
||||
|
|
@ -38,10 +41,14 @@ export default (props)=>{
|
|||
<Long>
|
||||
<Gap>
|
||||
<WhiteBack>
|
||||
<Banner>团队项目管理</Banner>
|
||||
<Div>
|
||||
|
||||
</Div>
|
||||
<Switch>
|
||||
<Route
|
||||
path="/organize/:organizeId/member/:memberId/setting"
|
||||
render={() => (
|
||||
<Common {...props} />
|
||||
)}
|
||||
></Route>
|
||||
</Switch>
|
||||
</WhiteBack>
|
||||
</Gap>
|
||||
</Long>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,67 @@
|
|||
import React , { useState } from 'react';
|
||||
import { AutoComplete , Pagination } from 'antd';
|
||||
import { Banner , Blueline , FlexAJ , Greenback , Redback } from '../../Component/layout';
|
||||
import styled from 'styled-components';
|
||||
|
||||
const Option = AutoComplete.Option;
|
||||
const Div = styled.div`{
|
||||
padding:18px 30px;
|
||||
}`;
|
||||
const LIMIT = 15;
|
||||
const demoData=[{name:"Python相关",id:1},{name:"Python相关",id:2}];
|
||||
export default ()=>{
|
||||
const [ searchKey , setSearchKey ] = useState(undefined);
|
||||
const [ page , setPage ] = useState(1);
|
||||
const [ total , setTotal ] = useState(0);
|
||||
|
||||
function changeInputUser(){}
|
||||
function selectInputUser(){}
|
||||
|
||||
// 切换分页
|
||||
function ChangePage(page){
|
||||
setPage(page);
|
||||
}
|
||||
const source = demoData && demoData.map((item,key)=>{
|
||||
return(
|
||||
<Option key={key} value={`${item.id}`}>{item.name}</Option>
|
||||
)
|
||||
})
|
||||
return(
|
||||
<div>
|
||||
<Banner>团队项目管理</Banner>
|
||||
<Div>
|
||||
<FlexAJ className="actionNav">
|
||||
<div>
|
||||
<AutoComplete
|
||||
dataSource={source}
|
||||
value={searchKey}
|
||||
style={{ width: 270 }}
|
||||
onChange={changeInputUser}
|
||||
onSelect={selectInputUser}
|
||||
placeholder="搜索项目…"
|
||||
/>
|
||||
<Blueline className="ml30">+ 添加项目</Blueline>
|
||||
</div>
|
||||
<span>
|
||||
<Greenback>添加所有</Greenback>
|
||||
<Redback className="ml20">移除所有</Redback>
|
||||
</span>
|
||||
</FlexAJ>
|
||||
<div className="GSlist">
|
||||
<div>
|
||||
<span>
|
||||
caishi/前端v0.1
|
||||
</span>
|
||||
<a style={{color:"#F73030"}}>移除</a>
|
||||
</div>
|
||||
</div>
|
||||
{
|
||||
total > LIMIT ?
|
||||
<div className="edu-txt-center mt30 mb20">
|
||||
<Pagination simple defaultCurrent={page} total={total} pageSize={LIMIT} onChange={ChangePage}></Pagination>
|
||||
</div>:""
|
||||
}
|
||||
</Div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -38,6 +38,7 @@
|
|||
.teamDetail{
|
||||
width: 1200px;
|
||||
margin:0px auto;
|
||||
padding-top:18px;
|
||||
}
|
||||
.list{
|
||||
display: flex;
|
||||
|
|
@ -322,3 +323,19 @@
|
|||
|
||||
}
|
||||
}
|
||||
// 组织团队设置
|
||||
.actionNav{
|
||||
padding:20px 30px;
|
||||
background-color: #FAFAFA;
|
||||
}
|
||||
.GSlist{
|
||||
padding-top:15px;
|
||||
min-height: 400px;
|
||||
&>div{
|
||||
padding:20px 0px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,19 +31,19 @@ export default ((props)=>{
|
|||
<Switch {...props}>
|
||||
<Route
|
||||
path="/organize/:organizeId/member/:memberId/setting"
|
||||
render={(props) => {
|
||||
render={() => {
|
||||
return <GroupSetting {...props} />
|
||||
}}
|
||||
></Route>
|
||||
<Route
|
||||
path="/organize/:organizeId/setting"
|
||||
render={(props) => {
|
||||
render={() => {
|
||||
return <Setting {...props} />
|
||||
}}
|
||||
></Route>
|
||||
<Route
|
||||
path="/organize/:organizeId"
|
||||
render={(props) => {
|
||||
render={() => {
|
||||
return <DetailIndex {...props} />
|
||||
}}
|
||||
></Route>
|
||||
|
|
|
|||
Loading…
Reference in New Issue