forked from Gitlink/forgeplus-react
项目详情新版
This commit is contained in:
parent
ad8a127170
commit
c3eb6edddc
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,55 @@
|
|||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "991344",
|
||||
"name": "提交",
|
||||
"font_class": "tijiao",
|
||||
"unicode": "e860",
|
||||
"unicode_decimal": 59488
|
||||
},
|
||||
{
|
||||
"icon_id": "1852052",
|
||||
"name": "数据库",
|
||||
"font_class": "dataBase",
|
||||
"unicode": "e85a",
|
||||
"unicode_decimal": 59482
|
||||
},
|
||||
{
|
||||
"icon_id": "4165948",
|
||||
"name": "文件",
|
||||
"font_class": "wenjian4",
|
||||
"unicode": "e85b",
|
||||
"unicode_decimal": 59483
|
||||
},
|
||||
{
|
||||
"icon_id": "17165148",
|
||||
"name": "链接",
|
||||
"font_class": "lianjie2",
|
||||
"unicode": "e85c",
|
||||
"unicode_decimal": 59484
|
||||
},
|
||||
{
|
||||
"icon_id": "17463741",
|
||||
"name": "分支",
|
||||
"font_class": "fenzhi2",
|
||||
"unicode": "e85d",
|
||||
"unicode_decimal": 59485
|
||||
},
|
||||
{
|
||||
"icon_id": "17972521",
|
||||
"name": "分支-3",
|
||||
"font_class": "fenzhi-3",
|
||||
"unicode": "e85e",
|
||||
"unicode_decimal": 59486
|
||||
},
|
||||
{
|
||||
"icon_id": "18682391",
|
||||
"name": "天平",
|
||||
"font_class": "tianping",
|
||||
"unicode": "e85f",
|
||||
"unicode_decimal": 59487
|
||||
},
|
||||
{
|
||||
"icon_id": "1770896",
|
||||
"name": "撤销",
|
||||
|
|
|
@ -20,6 +20,27 @@ Created by iconfont
|
|||
/>
|
||||
<missing-glyph />
|
||||
|
||||
<glyph glyph-name="tijiao" unicode="" d="M776.340596 759.889666l-369.442335 0c-7.573056 0-14.839097-2.967819-20.263042-8.187088L201.197681 571.177294c-5.526284-5.423946-8.801119-12.997002-8.801119-20.774735l-1.023386-513.637418c0-7.777733 2.967819-15.043774 8.494104-20.570058 5.526284-5.526284 12.792325-8.494104 20.570058-8.494104L382.746352 7.700979c12.485309 0 22.514491 10.029182 22.514491 22.514491s-10.029182 22.514491-22.514491 22.514491L236.402159 52.729962l0.921047 467.687388 194.03398 0c16.681191 0 30.189886 13.508695 30.189886 30.189886L461.547072 714.860684l298.828703 0 0-665.200879L621.195283 49.659804c-12.485309 0-22.514491-10.029182-22.514491-22.514491s10.029182-22.514491 22.514491-22.514491l155.145313 0c16.06716 0 29.064162 12.997002 29.064162 29.064162L805.404757 730.825505C805.404757 746.892664 792.407755 759.889666 776.340596 759.889666zM416.518089 565.446332 259.837697 565.446332l153.610234 149.414351 3.172497 0L416.620428 565.446332zM713.30002 434.452928c0 12.485309-10.029182 22.514491-22.514491 22.514491L326.460124 456.96742c-12.485309 0-22.514491-10.029182-22.514491-22.514491l0 0c0-12.485309 10.029182-22.514491 22.514491-22.514491l364.325405 0C703.270837 411.938437 713.30002 421.967619 713.30002 434.452928L713.30002 434.452928zM713.30002 357.698981c0 12.485309-10.029182 22.514491-22.514491 22.514491L326.460124 380.213472c-12.485309 0-22.514491-10.029182-22.514491-22.514491l0 0c0-12.485309 10.029182-22.514491 22.514491-22.514491l364.325405 0C703.270837 335.184489 713.30002 345.213672 713.30002 357.698981L713.30002 357.698981zM713.30002 279.921647c0 12.485309-10.029182 22.514491-22.514491 22.514491L326.460124 302.436138c-12.485309 0-22.514491-10.029182-22.514491-22.514491l0 0c0-12.485309 10.029182-22.514491 22.514491-22.514491l364.325405 0C703.270837 257.407156 713.30002 267.436338 713.30002 279.921647L713.30002 279.921647zM501.970818 220.155906c-1.535079 1.535079-4.093544 1.43274-5.526284-0.102339l-54.853488-59.458725c-2.251449-2.456126-0.511693-6.447332 2.865481-6.447332L479.968019 154.147511l0-88.829902c0-2.251449 1.842095-4.298221 4.093544-4.298221l36.841895 0c2.251449 0 4.093544 2.046772 4.093544 4.298221L524.997002 154.045173l35.511493 0c3.479512 0 5.219268 4.195882 2.660804 6.652009L501.970818 220.155906z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="dataBase" unicode="" d="M512 793.4c110.7 0 215-12.3 293.9-34.7 35.8-10.2 65-22.1 84.5-34.7 18.6-12 21.3-19.7 21.6-20.6-0.2-0.9-3-8.6-21.6-20.6-19.5-12.5-48.7-24.5-84.5-34.7-78.9-22.3-183.2-34.7-293.9-34.7s-215 12.3-293.9 34.7c-35.8 10.2-65 22.1-84.5 34.7-18.6 12-21.3 19.7-21.6 20.6 0.2 0.9 3 8.6 21.6 20.6 19.5 12.5 48.7 24.5 84.5 34.7 78.9 22.4 183.2 34.7 293.9 34.7M512 833.4c-243 0-440-58.2-440-130s197-130 440-130 440 58.2 440 130-197 130-440 130zM112 705.6h-40v-641h40v641zM952 705.9h-40v-641h40v641zM912 65v-0.5c-0.2-0.9-3-8.6-21.6-20.6-19.5-12.5-48.7-24.5-84.5-34.7-78.9-22.3-183.2-34.6-293.9-34.6s-215 12.3-293.9 34.7c-35.8 10.2-65 22.1-84.5 34.7-18.6 12-21.3 19.7-21.6 20.6v0.3l-40-0.3v-0.1c0-71.8 197-130 440-130s440 58.2 440 130v0.4l-40 0.1zM912 275.5v-0.5c-0.2-0.9-3-8.6-21.6-20.6-19.5-12.5-48.7-24.5-84.5-34.7-78.9-22.3-183.2-34.7-293.9-34.7s-215 12.3-293.9 34.7c-35.8 10.2-65 22.1-84.5 34.7-18.6 12-21.3 19.7-21.6 20.6v0.3l-40-0.3v-0.1c0-71.8 197-130 440-130s440 58.2 440 130v0.4l-40 0.2zM912 497v-0.5c-0.2-0.9-3-8.6-21.6-20.6-19.5-12.5-48.7-24.5-84.5-34.7-78.9-22.3-183.2-34.7-293.9-34.7s-215 12.3-293.9 34.7c-35.8 10.2-65 22.1-84.5 34.7-18.6 12-21.3 19.7-21.6 20.6v0.3l-40-0.3v-0.1c0-71.8 197-130 440-130s440 58.2 440 130v0.4l-40 0.2z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="wenjian4" unicode="" d="M751.3-61.4H274.7c-82.7 0-150 67.3-150 150V679.8c0 82.7 67.3 150 150 150h138.9c13.8 0 25-11.2 25-25s-11.2-25-25-25H274.7c-55.1 0-100-44.9-100-100v-591.2c0-55.1 44.9-100 100-100h476.6c55.1 0 100 44.9 100 100v390H653.6c-32.4 0-62.8 12.6-85.7 35.6-22.9 23-35.4 53.5-35.2 85.9l0.9 204.9c0 10 6 19 15.2 22.9 9.2 3.9 19.8 2 27-4.8l317.7-301.2 0.3-0.3 0.5-0.5c4.3-4.5 6.9-10.6 6.9-17.2v-415c0.1-83-67.2-150.3-149.9-150.3z m-168 808.3l-0.6-147.1c-0.1-19 7.3-36.9 20.7-50.4 13.4-13.5 31.3-20.9 50.3-20.9h160L583.3 746.9zM701.4 298H324.6c-13.8 0-25 11.2-25 25s11.2 25 25 25h376.8c13.8 0 25-11.2 25-25s-11.2-25-25-25zM701.4 148.7H324.6c-13.8 0-25 11.2-25 25s11.2 25 25 25h376.8c13.8 0 25-11.2 25-25s-11.2-25-25-25z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="lianjie2" unicode="" d="M427.392 259.328a40.448 40.448 0 0 0-31.168 13.376c-93.44 93.44-93.44 244.864 0 342.784l209.28 209.28c93.44 93.44 249.344 93.44 342.784 0a243.264 243.264 0 0 0 71.232-169.216c0-62.272-26.688-124.608-71.232-169.152L832.64 361.728c-17.856-17.792-44.544-17.792-57.92 0-17.792 17.792-17.792 44.544 0 57.856l120.256 120.256a155.904 155.904 0 0 1 0 222.592 155.904 155.904 0 0 1-222.656 0l-209.28-209.28a155.904 155.904 0 0 1 0-222.592c17.856-17.792 17.856-44.48 0-57.856-8.832-4.48-22.208-13.376-35.584-13.376zM240.448-128c-66.816 0-124.672 26.688-169.216 71.232A243.264 243.264 0 0 0 0 112.448c0 62.272 26.688 124.608 71.232 169.152l120.192 120.192c17.856 17.856 44.544 17.856 57.92 0 17.792-17.792 17.792-44.48 0-57.856l-120.256-120.192a155.904 155.904 0 0 1 0-222.656 158.08 158.08 0 0 1 111.36-44.48 158.08 158.08 0 0 1 111.296 44.48l209.28 209.28a158.08 158.08 0 0 1 44.48 111.36c0 44.48-17.792 80.064-44.544 111.232-17.792 17.792-17.792 44.544 0 57.92 17.792 17.792 44.544 17.792 57.92 0a243.264 243.264 0 0 0 71.232-169.216c0-66.752-26.752-124.672-71.232-169.152l-209.28-209.28C365.056-101.312 307.2-128 240.448-128z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="fenzhi2" unicode="" d="M737.792 811.2a128 128 0 0 0 36.352-250.752C761.6 440.96 690.176 374.08 567.936 369.28l-14.208-0.256c-104.704 0-179.456-21.12-225.472-61.312l0.064-121.6a128 128 0 1 0-76.8 0V561.024a128 128 0 1 0 76.8 0l-0.128-160.96c53.44 28.352 121.6 43.264 203.84 45.44l21.76 0.32c88.064 0 133.248 35.456 143.36 115.968a128 128 0 0 0 40.64 249.344zM289.92 128a64 64 0 1 1 0-128 64 64 0 0 1 0 128z m0 619.2a64 64 0 1 1 0-128 64 64 0 0 1 0 128z m447.872 0a64 64 0 1 1 0-128 64 64 0 0 1 0 128z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="fenzhi-3" unicode="" d="M199.095774 895.999795a170.536926 170.536926 0 0 0 59.166708-330.526654c30.719994-284.446663 286.719943-339.046332 406.753199-349.85977a170.577886 170.577886 0 1 0 159.866848-229.826514 171.622366 171.622366 0 0 0-161.566688 113.786857c-241.766352 11.386878-325.406655 102.973419-407.326639 205.373399v-101.273579a170.659806 170.659806 0 1 0-113.786857 0V564.346742A170.721246 170.721246 0 0 0 199.095774 895.999795m0-113.786857a56.893429 56.893429 0 1 1 56.893428-56.893429 57.057269 57.057269 0 0 1-56.893428 56.893429m0-682.659704a56.893429 56.893429 0 1 1 56.893428-56.893428 57.057269 57.057269 0 0 1-56.893428 56.893428m625.766275 113.786858a56.893429 56.893429 0 1 1 56.893428-56.893429 57.057269 57.057269 0 0 1-56.893428 56.893429z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="tianping" unicode="" d="M669.5 495.5c0-74.4 60.5-134.9 134.9-134.9s134.9 60.5 134.9 134.9c0 30.3-21.4 84.9-63.7 162.3-31 56.8-62.5 105.9-62.8 106.4v0.1c-0.2 0.3-0.4 0.6-0.7 0.9 0 0.1-0.1 0.1-0.1 0.2-0.2 0.2-0.4 0.5-0.6 0.7-0.1 0.1-0.2 0.2-0.3 0.2-0.2 0.2-0.4 0.3-0.6 0.5-0.1 0.1-0.2 0.1-0.3 0.2-0.6 0.4-1.3 0.8-2 1.1-0.1 0-0.2 0.1-0.2 0.1l-0.9 0.3c-0.1 0-0.2 0.1-0.3 0.1-0.3 0.1-0.6 0.1-0.9 0.2h-0.3c-0.4 0-0.8 0.1-1.2 0.1H556.6c-4.6 20.4-22.8 35.7-44.6 35.7s-40-15.3-44.6-35.7H221.6c-0.4 0-0.8 0-1.2-0.1h-0.3c-0.3 0-0.6-0.1-0.9-0.2-0.1 0-0.2-0.1-0.3-0.1l-0.9-0.3c-0.1 0-0.2-0.1-0.2-0.1-0.7-0.3-1.4-0.7-2-1.1-0.1-0.1-0.2-0.1-0.3-0.2-0.2-0.2-0.4-0.3-0.6-0.5-0.1-0.1-0.2-0.2-0.3-0.2l-0.7-0.7-0.1-0.1c-0.2-0.3-0.5-0.6-0.7-0.9v-0.1c-0.3-0.5-31.8-49.5-62.8-106.4-42.3-77.4-63.7-132-63.7-162.3 0-74.4 60.5-134.9 134.9-134.9s134.9 60.5 134.9 134.9c0 30.3-21.4 84.9-63.7 162.3-20.6 37.7-41.4 72-53.1 91h227.7c3.9-17.2 17.4-30.7 34.6-34.6v-587.9H315.7c-5.5 0-10-4.5-10-10V55H172.9c-5.5 0-10-4.5-10-10v-71.4c0-5.5 4.5-10 10-10h678.2c5.5 0 10 4.5 10 10V45c0 5.5-4.5 10-10 10H718.3v61.4c0 5.5-4.5 10-10 10H522V714.2c17.2 3.9 30.7 17.4 34.6 34.6h229.7c-11.7-18.9-32.5-53.2-53.2-91-42.2-77.3-63.6-131.9-63.6-162.3z m171.6-512H182.9v51.4h658.3v-51.4z m-142.8 71.4H325.7v51.4h372.7v-51.4zM221.6 380.6c-63.4 0-114.9 51.6-114.9 114.9 0 1.1 0 2.2 0.1 3.4h229.7c0.1-1.2 0.1-2.3 0.1-3.4-0.1-63.3-51.6-114.9-115-114.9z m111.3 138.3H110.2c6.3 24.4 22.1 64.2 57.6 129.2 21.1 38.6 42.4 73.6 53.7 91.9 11.4-18.3 32.7-53.3 53.7-91.9 35.6-65 51.5-104.8 57.7-129.2zM512 733.1c-14.2 0-25.7 11.5-25.7 25.7s11.5 25.7 25.7 25.7 25.7-11.5 25.7-25.7-11.5-25.7-25.7-25.7z m292.4-352.5c-63.4 0-114.9 51.6-114.9 114.9 0 1.1 0 2.3 0.1 3.5 0.6-0.1 1.1-0.2 1.7-0.2h227.9c0.1-1.2 0.1-2.3 0.1-3.4 0.1-63.2-51.5-114.8-114.9-114.8z m0 359.4c11.4-18.3 32.7-53.3 53.7-91.9 35.5-65 51.3-104.9 57.6-129.2H693.1c6.3 24.4 22.1 64.2 57.6 129.2 21.1 38.7 42.3 73.7 53.7 91.9z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="chexiao" unicode="" d="M530.496 524.928h-6.144V661.632c0 51.136-29.312 72.448-65.472 43.328L122.816 434.624c-36.096-28.992-36.096-76.48 0.128-105.472l333.504-267.648c36.16-28.992 67.968 0.448 67.968 43.584v144.256h50.496c145.856 0 257.152-62.976 325.248-184.576 13.376-22.08 27.456-17.28 27.456 0-2.944 216.576-186.368 460.16-397.12 460.16z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
|
|
Before Width: | Height: | Size: 724 KiB After Width: | Height: | Size: 733 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -104,7 +104,8 @@ export default (({ projectsId , branch , owner , changeBranch , branchList , tag
|
|||
return(
|
||||
<Popover placement="bottom" visible={flag} content={menu} onClick={()=>setFlag(!flag)} overlayClassName="branch-tagBox-list">
|
||||
<div className="branch-tagBox">
|
||||
<span className="color-grey-9 mr3 ml8">{nav === 0 ?"分支":"标签"}:</span>
|
||||
{/* {nav === 0 ?"分支":"标签"} */}
|
||||
<span className="color-grey-9 mr3 ml8"><i className="iconfont icon-fenzhi2 font-18"></i></span>
|
||||
<a className="ant-dropdown-link">
|
||||
{showValue}
|
||||
</a>
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
min-width: 240px;
|
||||
min-width: 140px;
|
||||
}
|
||||
.branch-tagBox-list .ant-popover-arrow{
|
||||
display: none;
|
||||
|
|
|
@ -135,4 +135,18 @@ li.ant-menu-item{
|
|||
.handleBox{
|
||||
right:0px;
|
||||
}
|
||||
}
|
||||
.ant-drawer{
|
||||
z-index: 10000!important;
|
||||
}
|
||||
.ant-drawer-body{
|
||||
padding:0px!important;
|
||||
.drawerHead{
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
padding:15px 20px;
|
||||
}
|
||||
.ant-tree{
|
||||
margin:0px 20px!important;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
import React from 'react';
|
||||
import { AlignCenter , FlexAJ } from '../Component/layout';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { getImageUrl } from 'educoder';
|
||||
|
||||
function Contributors({contributors}){
|
||||
return(
|
||||
<div>
|
||||
<FlexAJ>
|
||||
<AlignCenter><span className="font-16 color-grey-6">贡献者</span>{ contributors && contributors.total_count > 0 && <span className="infoCount">{contributors.total_count}</span>}</AlignCenter>
|
||||
<Link className="font-12 color-grey-9" to={``}>全部</Link>
|
||||
</FlexAJ>
|
||||
<div className="attrPerson">
|
||||
{
|
||||
contributors && contributors.total_count > 0 ?
|
||||
contributors.list.map((item,key)=>{
|
||||
return(
|
||||
<Link key={key} to={`/users/${item.login}`}><img src={getImageUrl(`images/${item.image_url}`)} alt=""/></Link>
|
||||
)
|
||||
})
|
||||
:""
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default Contributors;
|
|
@ -0,0 +1,94 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { Drawer , Tree , Spin } from 'antd';
|
||||
import './Component.scss';
|
||||
import axios from 'axios';
|
||||
const { TreeNode , DirectoryTree } = Tree;
|
||||
|
||||
function DrawerPanel({visible,onClose,branch,owner,projectsId,history, name}){
|
||||
const [ treeData , setTreeData ] = useState(undefined);
|
||||
const [ isSpin , setIsSpin ] = useState(true);
|
||||
const [first , setFirst ] = useState(true);
|
||||
useEffect(()=>{
|
||||
if(visible && first){
|
||||
getMenulist();
|
||||
setFirst(false);
|
||||
}
|
||||
},[visible])
|
||||
|
||||
function getMenulist(){
|
||||
const url = `/${owner}/${projectsId}/entries.json`;
|
||||
axios.get(url,{ params: { ref: branch } }).then(result=>{
|
||||
if(result){
|
||||
setTreeData(result.data.entries);
|
||||
}
|
||||
setIsSpin(false);
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
function renderTreeNodes(data) {
|
||||
return data && data.length > 0 && data.map((item) => {
|
||||
return (
|
||||
<TreeNode title={item.name} key={item.key} dataRef={item} isLeaf={item.type === "file"}>
|
||||
{renderTreeNodes(item.children)}
|
||||
</TreeNode>
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function onLoadData(tr){
|
||||
return new Promise((resolve) => {
|
||||
if (tr.props.children) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
let en = [];
|
||||
const url = `/${owner}/${projectsId}/sub_entries.json`;
|
||||
axios.get(url, {
|
||||
params:{
|
||||
filepath:tr.props.dataRef.path,
|
||||
ref:branch,
|
||||
type:"dir"
|
||||
}
|
||||
}).then((result) => {
|
||||
if(result){
|
||||
en = result.data.entries;
|
||||
}
|
||||
}).catch(error=>{})
|
||||
setTimeout(() => {
|
||||
tr.props.dataRef.children = en;
|
||||
setTreeData([...treeData]);
|
||||
resolve();
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
|
||||
function selectTree(keys,event){
|
||||
let dataref = event.node.props.dataRef;
|
||||
if(dataref.type==="file"){
|
||||
onClose();
|
||||
history.push(`/projects/${owner}/${projectsId}/tree/${branch}/${dataref.path}`);
|
||||
}
|
||||
}
|
||||
|
||||
return(
|
||||
<Drawer
|
||||
placement="left"
|
||||
visible={visible}
|
||||
closable={false}
|
||||
onClose={onClose}
|
||||
width={"320px"}
|
||||
maskStyle={{backgroundColor:'rgba(0,0,0,0.09)'}}
|
||||
>
|
||||
<Spin spinning={isSpin}>
|
||||
<div className="drawerHead">
|
||||
<p className="font-20">{name}</p>
|
||||
<p><i class="iconfont icon-fenzhi2 font-18 color-grey-9 mr3"></i>{branch}</p>
|
||||
</div>
|
||||
<DirectoryTree loadData={onLoadData} onSelect={selectTree}>
|
||||
{treeData && renderTreeNodes(treeData)}
|
||||
</DirectoryTree>
|
||||
</Spin>
|
||||
</Drawer>
|
||||
)
|
||||
}
|
||||
export default DrawerPanel;
|
|
@ -0,0 +1,54 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { FlexAJ } from '../Component/layout';
|
||||
|
||||
function LanguagePower({languages}){
|
||||
const [ array , setArray ] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
if(languages){
|
||||
let arr = [];
|
||||
Object.keys(languages).map((item,key)=>{
|
||||
arr.push({name:item,percent:languages[item],color:getColor()});
|
||||
})
|
||||
setArray(arr);
|
||||
}
|
||||
},[languages])
|
||||
|
||||
function getColor(){
|
||||
let str = "#";
|
||||
let arr = ["1","2","3","4","4","5","6","7","8","9","a","b","c","d","e","f"];
|
||||
for(var i=0;i<6;i++){
|
||||
let num = parseInt(Math.random() * 16);
|
||||
str+=arr[num];
|
||||
}
|
||||
return str;
|
||||
}
|
||||
return(
|
||||
<div>
|
||||
<p className="font-16 color-grey-6">语言能力</p>
|
||||
<div className="progress">
|
||||
{
|
||||
array && array.map((item,key)=>{
|
||||
return(
|
||||
<span style={{width:item.percent,backgroundColor:item.color}}></span>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
{
|
||||
array && array.length > 0 &&
|
||||
<FlexAJ className="progresstip">
|
||||
{
|
||||
array.map((item,key)=>{
|
||||
return(
|
||||
<span><i className="zero" style={{backgroundColor:`${item.color}`}}></i><span>{item.name}</span><span>{item.percent}</span></span>
|
||||
)
|
||||
})
|
||||
}
|
||||
</FlexAJ>
|
||||
}
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default LanguagePower;
|
|
@ -0,0 +1,38 @@
|
|||
import React from 'react';
|
||||
import { AlignCenter , AlignTop , FlexAJ } from '../Component/layout';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
function Releases({owner,projectsId,releaseVersions}){
|
||||
|
||||
return(
|
||||
<div>
|
||||
<FlexAJ>
|
||||
<AlignCenter><span className="font-16 color-grey-6">发行版</span>
|
||||
{ releaseVersions && releaseVersions.total_count > 0 && <span className="infoCount">{releaseVersions.total_count}</span>}
|
||||
</AlignCenter>
|
||||
{ releaseVersions && releaseVersions.total_count > 0 ?
|
||||
<Link className="font-12 color-grey-9" to={`/projects/${owner}/${projectsId}/releases`}>全部</Link>
|
||||
:
|
||||
<Link className="font-12 color-blue" to={`/projects/${owner}/${projectsId}/releases/new`}>新建</Link>
|
||||
}
|
||||
</FlexAJ>
|
||||
{
|
||||
releaseVersions && releaseVersions.total_count>0 ?
|
||||
releaseVersions.list.map((item,key)=>{
|
||||
return(
|
||||
<AlignTop className="mt10">
|
||||
<i className="iconfont icon-biaoqian3 color-grey-6 font-18 mr10"></i>
|
||||
<div>
|
||||
<p className="font-16 color-grey-6"><Link to={`/projects/${owner}/${projectsId}/releases/8/update`}>{item.name}</Link></p>
|
||||
<p className="color-grey-9 font-13">{item.created_at}</p>
|
||||
</div>
|
||||
</AlignTop>
|
||||
)
|
||||
})
|
||||
:""
|
||||
}
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default Releases;
|
|
@ -24,18 +24,32 @@ export const AlignCenter = styled.div`{
|
|||
display:flex;
|
||||
align-items: center;
|
||||
}`
|
||||
export const AlignTop = styled.div`{
|
||||
display:flex;
|
||||
align-items: flex-start;
|
||||
}`
|
||||
// 左右结构
|
||||
export const Box = styled.div`{
|
||||
display:flex;
|
||||
align-item:flex-start;
|
||||
}`
|
||||
export const LongWidth = styled.div`{
|
||||
flex:1;
|
||||
border-radius:5px;
|
||||
margin-bottom:30px;
|
||||
}`
|
||||
export const Long = styled.div`{
|
||||
width:72%;
|
||||
width:78%;
|
||||
border-radius:5px;
|
||||
margin-bottom:30px;
|
||||
}`
|
||||
export const ShortWidth = styled.div`{
|
||||
width:300px;
|
||||
border-radius:5px;
|
||||
margin-bottom:30px;
|
||||
}`
|
||||
export const Short = styled.div`{
|
||||
width:28%;
|
||||
flex:1;
|
||||
border-radius:5px;
|
||||
margin-bottom:30px;
|
||||
}`
|
||||
|
|
|
@ -66,7 +66,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
|
|||
ellipsis:true,
|
||||
render:(value,item)=>{
|
||||
return(
|
||||
<Link to={`/projects/${owner}/${projectsId}/branch/${item.branch}/tree/${value}`} className="color-blue">{value}</Link>
|
||||
<Link to={`/projects/${owner}/${projectsId}/tree/${item.branch}/${value}`} className="color-blue">{value}</Link>
|
||||
)
|
||||
}
|
||||
},
|
||||
|
|
|
@ -10,4 +10,8 @@ export const getTag = async (id,owner)=>{
|
|||
// 获取hooks(仓库设置-管理web钩子)列表
|
||||
export const getHooks = async (id,params)=>{
|
||||
return (await axios.get(`/projects/${id}/hooks.json`,{params})).data;
|
||||
}
|
||||
// 获取子目录列表
|
||||
export const getSubEntries = async (owner,projectsId,params)=>{
|
||||
return (await axios.get(`/${owner}/${projectsId}/sub_entries.json`,{params})).data;
|
||||
}
|
|
@ -0,0 +1,375 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import { WhiteBack , Box , LongWidth , ShortWidth , Gap , AlignCenter , FlexAJ } from '../Component/layout';
|
||||
import { Dropdown , Menu , Divider , Spin } from 'antd';
|
||||
import { getImageUrl } from "educoder";
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import SelectBranch from '../Branch/Select';
|
||||
import User from '../Component/User';
|
||||
import axios from 'axios';
|
||||
import Path from './CoderDepotPath';
|
||||
import Catalogue from './CoderDepotCatalogue';
|
||||
import ReadMe from './CoderDepotReadme';
|
||||
import CoderRootFileDetail from './CoderRootFileDetail';
|
||||
import './Index.scss';
|
||||
import Releases from '../Component/Releases';
|
||||
import Contributors from '../Component/Contributors';
|
||||
import LanguagePower from '../Component/LanguagePower';
|
||||
import DrawerPanel from '../Component/DrawerPanel';
|
||||
import Nodata from '../Nodata';
|
||||
|
||||
|
||||
function CoderDepot(props){
|
||||
const [ projectDetail , setProjectDetail ]= useState(undefined);
|
||||
const [ treeValue , setTreeValue ] = useState(undefined);
|
||||
const [ treeValuePath , setTreeValuePath ] = useState(undefined);
|
||||
const [ lastCommit,setLastCommit ] = useState(undefined);
|
||||
const [ lastCommitAuthor,setLastCommitAuthor ] = useState(undefined);
|
||||
const [ type ,setType ] = useState('dir');
|
||||
const [ hide , setHide ] = useState(true);
|
||||
const [ hideBtn , setHideBtn ] = useState(false);
|
||||
const [ commitCount ,setCommitCount ] = useState(0);
|
||||
const [ dirInfo ,setDirInfo ] = useState(undefined);//文件夹目录列表
|
||||
const [ fileInfo ,setFileInfo ] = useState(undefined);//文件内容信息
|
||||
const [ zip_url , setZip_url ] = useState(undefined);
|
||||
const [ tar_url , setTar_url ] = useState(undefined);
|
||||
const [ readOnly , setReadOnly] = useState(true);
|
||||
const [ isSpin , setIsSpin] = useState(true);
|
||||
const [ visible ,setVisible ] = useState(false);
|
||||
|
||||
const owner = props.match.params.owner;
|
||||
const projectsId = props.match.params.projectsId;
|
||||
const branchName = props.match.params.branchName;
|
||||
let pathname = props.history.location.pathname;
|
||||
|
||||
useEffect(()=>{
|
||||
if(props.projectDetail){
|
||||
setProjectDetail(props.projectDetail);
|
||||
}
|
||||
},[props])
|
||||
|
||||
useEffect(()=>{
|
||||
if(treeValue){
|
||||
setTreeValuePath(treeValue.split('/'));
|
||||
}else{
|
||||
setTreeValuePath(undefined);
|
||||
}
|
||||
},[treeValue])
|
||||
|
||||
useEffect(()=>{
|
||||
if (pathname){
|
||||
if(pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${branchName}/`) > -1) {
|
||||
let url = pathname.split(`/tree/${branchName}/`)[1];
|
||||
setTreeValue(url);
|
||||
getFileInfo(url,branchName);
|
||||
}else{
|
||||
setTreeValue(undefined);
|
||||
getDirInfo(branchName ||(projectDetail && projectDetail.default_branch));
|
||||
}
|
||||
}
|
||||
},[pathname])
|
||||
|
||||
// 获取主目录列表
|
||||
function getDirInfo(branch){
|
||||
setIsSpin(true);
|
||||
const url = `/${owner}/${projectsId}/entries.json`;
|
||||
axios.get(url, {
|
||||
params: { ref: branch }
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
setCommitCount(result.data.commits_count);
|
||||
setDirInfo(result.data.entries);
|
||||
setFileInfo(undefined);
|
||||
setTar_url(result.data.tar_url);
|
||||
setZip_url(result.data.zip_url);
|
||||
let c = result.data.last_commit
|
||||
setLastCommit(c && c.commit);
|
||||
setLastCommitAuthor(c && (c.author || (c.commit && c.commit.author)));
|
||||
}
|
||||
setTimeout(function(){setIsSpin(false);},500);
|
||||
}).catch(error=>{setIsSpin(false);})
|
||||
}
|
||||
|
||||
useEffect(()=>{
|
||||
if(projectDetail && lastCommit)
|
||||
{
|
||||
let ele = document.getElementById("ptxt");
|
||||
if(ele){
|
||||
let h = ele.offsetHeight;
|
||||
if( h > 18 ) setHideBtn(true)
|
||||
}
|
||||
}
|
||||
},[projectDetail,lastCommit])
|
||||
// 获取子目录列表
|
||||
function getFileInfo(path, ref){
|
||||
setIsSpin(true);
|
||||
const url = `/${owner}/${projectsId}/sub_entries.json`;
|
||||
axios.get(url, {
|
||||
params:{
|
||||
filepath:path,
|
||||
ref:ref || branchName,
|
||||
type
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
let en = result.data.entries;
|
||||
if(en.type){
|
||||
setDirInfo(undefined);
|
||||
setFileInfo(en);
|
||||
setType(en.type);
|
||||
}else{
|
||||
setFileInfo(undefined);
|
||||
setDirInfo(en);
|
||||
setType("dir");
|
||||
}
|
||||
let c = result.data.last_commit
|
||||
setLastCommit(c && c.commit);
|
||||
setLastCommitAuthor(c && (c.author || (c.commit && c.commit.author)));
|
||||
}
|
||||
setTimeout(function(){setIsSpin(false);},500)
|
||||
}).catch(error=>{setIsSpin(false);})
|
||||
}
|
||||
|
||||
// 切换分支或者标签
|
||||
function changeBranch(value){
|
||||
let url = `/projects/${owner}/${projectsId}${value && `/tree/${value}`}${treeValue ? `/${treeValue}`:""}`;
|
||||
props.history.push(url);
|
||||
}
|
||||
|
||||
// 文件相关的下拉项
|
||||
const fileMenu =(
|
||||
<Menu>
|
||||
<Menu.Item><Link to={`/projects/${owner}/${projectsId}/${branchName || (projectDetail && projectDetail.default_branch)}/uploadfile${treeValue === undefined ? "" : `/${treeValue}`}`}>上传文件</Link></Menu.Item>
|
||||
<Menu.Item><Link to={`/projects/${owner}/${projectsId}/${branchName || (projectDetail && projectDetail.default_branch)}/newfile${treeValue === undefined ? "" : `/${treeValue}`}`}>新建文件</Link></Menu.Item>
|
||||
</Menu>
|
||||
)
|
||||
|
||||
function getPathUrl(array,index){
|
||||
if(array && array.length>0 && index){
|
||||
let str = "";
|
||||
for(let i=0;i<index;i++){
|
||||
str += `/${array[i]}`;
|
||||
}
|
||||
return str.substr(1);
|
||||
}
|
||||
}
|
||||
// 页面地址返回到主目录
|
||||
function returnMain(){
|
||||
setTreeValue(undefined);
|
||||
let branch = branchName || (projectDetail && projectDetail.default_branch);
|
||||
props.history.push(`/projects/${owner}/${projectsId}/tree/${branch}`);
|
||||
};
|
||||
// 子目录路径返回链接
|
||||
function returnUlr(url){
|
||||
props.history.push(`/projects/${owner}/${projectsId}/tree${branchName?`/${branchName}`:""}/${url}`);
|
||||
}
|
||||
// 点击跳转到子目录
|
||||
function goToSubRoot(path,type,filename){
|
||||
setType(type);
|
||||
props.history.push(`/projects/${owner}/${projectsId}${`/tree/${branchName || (projectDetail && projectDetail.default_branch)}`}${path?`/${path}`:""}`);
|
||||
}
|
||||
|
||||
function onEdit(readOnly){
|
||||
setReadOnly(readOnly);
|
||||
}
|
||||
function ChangeFile(path, readOnly){
|
||||
//点击直接跳转页面 加载一次路由
|
||||
props.history.push(`/projects/${owner}/${projectsId}/tree/${branchName || (projectDetail && projectDetail.default_branch)}/${path}`);
|
||||
setType("file");
|
||||
setReadOnly(readOnly);
|
||||
};
|
||||
|
||||
function changeHide(hide){
|
||||
setHide(!hide);
|
||||
}
|
||||
|
||||
const downloadMenu = (
|
||||
<Menu>
|
||||
<Menu.Item><a href={zip_url}>ZIP</a></Menu.Item>
|
||||
<Menu.Item><a href={tar_url}>TAR.GZ</a></Menu.Item>
|
||||
</Menu>
|
||||
)
|
||||
return(
|
||||
<WhiteBack>
|
||||
<Spin spinning={isSpin}>
|
||||
{
|
||||
dirInfo &&
|
||||
<React.Fragment>
|
||||
<DrawerPanel
|
||||
history={props.history}
|
||||
owner={owner}
|
||||
projectsId={projectsId}
|
||||
name={projectDetail && projectDetail.name}
|
||||
branch={branchName || (projectDetail && projectDetail.default_branch)}
|
||||
visible={visible}
|
||||
onClose={()=>setVisible(false)}
|
||||
/>
|
||||
<div className="drawerBtn" onClick={()=>setVisible(true)}><i className="iconfont icon-youjiantou"></i></div>
|
||||
</React.Fragment>
|
||||
}
|
||||
<div style={{minHeight:"500px"}}>
|
||||
{
|
||||
projectDetail &&
|
||||
<Box className="Panels">
|
||||
<LongWidth>
|
||||
<div className="panelmenu">
|
||||
<FlexAJ>
|
||||
<AlignCenter>
|
||||
<div className="mr20">
|
||||
{
|
||||
props && props.platform ?
|
||||
<SelectBranch
|
||||
repo_id={projectDetail && projectDetail.repo_id}
|
||||
projectsId={projectsId}
|
||||
branch={branchName || (projectDetail && projectDetail.default_branch)}
|
||||
changeBranch={changeBranch}
|
||||
owner={owner}
|
||||
history={props.history}
|
||||
branchList={projectDetail && projectDetail.branches && projectDetail.branches.list}
|
||||
></SelectBranch>
|
||||
:
|
||||
<span>分支:<span className="color-grey-6">{branchName || (projectDetail && projectDetail.default_branch)}</span></span>
|
||||
}
|
||||
</div>
|
||||
<AlignCenter className="mr20">
|
||||
<Link to={`/projects/${owner}/${projectsId}/branchs`} className="color-grey-9">
|
||||
<i className="iconfont icon-fenzhi2 font-18 color-grey-9 mr3"></i>
|
||||
<span className="color-grey-6 mr3">{projectDetail && projectDetail.branches && projectDetail.branches.total_count}个</span>分支
|
||||
</Link>
|
||||
</AlignCenter>
|
||||
<AlignCenter className="mr20">
|
||||
<Link to={`/projects/${owner}/${projectsId}/tag`} className="color-grey-9">
|
||||
<i className="iconfont icon-biaoqian3 font-16 color-grey-9 mr3"></i>
|
||||
<span className="color-grey-6 mr3">{projectDetail && projectDetail.tags && projectDetail.tags.total_count}个</span>标签
|
||||
</Link>
|
||||
</AlignCenter>
|
||||
</AlignCenter>
|
||||
<AlignCenter>
|
||||
<div className="mr20 addOptionBtn">
|
||||
<Link to={`/projects/${owner}/${projectsId}/pulls/new`}>+ 合并请求</Link>
|
||||
<Link to={`/projects/${owner}/${projectsId}/issues/new`}>+ 任务</Link>
|
||||
</div>
|
||||
{ type === "dir" && <Dropdown.Button overlay={fileMenu} className="mr20">文件</Dropdown.Button>}
|
||||
<Dropdown.Button overlay={downloadMenu} type={'primary'}>下载</Dropdown.Button>
|
||||
</AlignCenter>
|
||||
</FlexAJ>
|
||||
{
|
||||
dirInfo || fileInfo ?
|
||||
<div className="listtable">
|
||||
{
|
||||
lastCommit &&
|
||||
<div className="listtablehead">
|
||||
<User url={getImageUrl(`images/${lastCommitAuthor && lastCommitAuthor.image_url}`)} name={lastCommitAuthor && lastCommitAuthor.name} />
|
||||
<div className={hideBtn && hide ? "ellipsistxt hide" :"ellipsistxt"}><p id="ptxt">{lastCommit && lastCommit.message}</p></div>
|
||||
{ hideBtn && <span className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></span> }
|
||||
|
||||
<span className="ml12 color-grey-9 mt3">{lastCommit && lastCommit.time_from_now}</span>
|
||||
{ commitCount ? <span className="ml12 color-grey-9"><i className="iconfont icon-tijiao mr3 font-17 color-grey-9"></i>{commitCount}次提交</span>:"" }
|
||||
</div>
|
||||
}
|
||||
<ul className="listtablebody">
|
||||
{
|
||||
treeValuePath && treeValuePath.length > 0 &&
|
||||
<Path
|
||||
identifier={projectDetail && projectDetail.identifier}
|
||||
treeValuePath={treeValuePath}
|
||||
returnUlr={returnUlr}
|
||||
returnMain={returnMain}
|
||||
getPathUrl={getPathUrl}
|
||||
/>
|
||||
}
|
||||
{
|
||||
dirInfo && dirInfo.length > 0 &&
|
||||
dirInfo.map((item,key)=>{
|
||||
return(
|
||||
<Catalogue
|
||||
owner={owner}
|
||||
item={item}
|
||||
projectsId={projectsId}
|
||||
goToSubRoot={goToSubRoot}
|
||||
/>
|
||||
)
|
||||
})
|
||||
}
|
||||
{
|
||||
fileInfo &&
|
||||
<CoderRootFileDetail
|
||||
{...props}
|
||||
detail={fileInfo}
|
||||
readOnly={readOnly}
|
||||
onEdit={onEdit}
|
||||
currentBranch={branchName || (projectDetail && projectDetail.default_branch)}
|
||||
></CoderRootFileDetail>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
: <Nodata _html="暂未发现文件"/>
|
||||
}
|
||||
{/* readme文件显示(显示文件详情时不显示readme文件) */}
|
||||
{ dirInfo && <ReadMe ChangeFile={ChangeFile} readme={projectDetail && projectDetail.readme} operate={props && (props.isManager || props.isDeveloper)} history={props.history} /> }
|
||||
</div>
|
||||
</LongWidth>
|
||||
{
|
||||
!fileInfo &&
|
||||
<ShortWidth>
|
||||
<Gap style={{paddingLeft:"30px"}}>
|
||||
<div className="panelmenu">
|
||||
<p className="font-18 color-grey-6 mb20" style={{lineHeight:"28px"}}>简介</p>
|
||||
<p className="font-14 color-grey-9 mb15" style={{lineHeight:"22px"}}>{projectDetail && projectDetail.content}</p>
|
||||
{
|
||||
projectDetail && projectDetail.website &&
|
||||
<p className="color-grey-6 df">
|
||||
<i className="iconfont icon-lianjie2 font-15 mr10 color-grey-9"></i>
|
||||
<span style={{wordBreak:"break-all",lineHeight:"20px",marginTop:"5px"}}>{projectDetail.website}</span>
|
||||
</p>
|
||||
}
|
||||
<p>
|
||||
<i className="iconfont icon-wenjian4 font-15 mr10 color-grey-9"></i>
|
||||
<a href="#readme" className="color-grey-6">README.md</a>
|
||||
</p>
|
||||
<p className="color-grey-6">
|
||||
<i className="iconfont icon-dataBase font-15 mr10 color-grey-9"></i>
|
||||
<span>{projectDetail && projectDetail.size}</span>
|
||||
</p>
|
||||
{
|
||||
projectDetail && projectDetail.license_name &&
|
||||
<p className="color-grey-6">
|
||||
<i className="iconfont icon-tianping font-16 mr10 color-grey-9"></i>
|
||||
<span>{projectDetail.license_name}</span>
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
{/* 发布 */}
|
||||
{
|
||||
projectDetail && projectDetail.release_versions &&
|
||||
<React.Fragment>
|
||||
<Divider />
|
||||
<Releases owner={owner} projectsId={projectsId} releaseVersions={projectDetail.release_versions} history={props.history}/>
|
||||
</React.Fragment>
|
||||
}
|
||||
{/* 贡献者 */}
|
||||
{
|
||||
projectDetail && projectDetail.contributors &&
|
||||
<React.Fragment>
|
||||
<Divider />
|
||||
<Contributors contributors={projectDetail && projectDetail.contributors}/>
|
||||
</React.Fragment>
|
||||
}
|
||||
{/* 语言 */}
|
||||
{ projectDetail && projectDetail.languages &&
|
||||
<React.Fragment>
|
||||
<Divider />
|
||||
<LanguagePower languages={projectDetail.languages}/>
|
||||
</React.Fragment>
|
||||
}
|
||||
</Gap>
|
||||
</ShortWidth>
|
||||
}
|
||||
</Box>
|
||||
}
|
||||
</div>
|
||||
</Spin>
|
||||
</WhiteBack>
|
||||
)
|
||||
}
|
||||
export default CoderDepot;
|
|
@ -0,0 +1,22 @@
|
|||
import React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { truncateCommitId } from '../common/util';
|
||||
|
||||
function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId }){
|
||||
return(
|
||||
<li>
|
||||
<span>
|
||||
<a onClick={()=>goToSubRoot(item.path,item.type,item.name)}>
|
||||
<i className={item.type === 'dir' ? "iconfont icon-wenjianjia1 color-green-file font-15 mr5":"iconfont icon-wenjia color-green-file font-15 mr5"}></i>{item.name}
|
||||
</a>
|
||||
</span>
|
||||
<span title="init project">
|
||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.commit && item.commit.sha}`)}`} title={item.commit && item.commit.message}>
|
||||
{item.commit && item.commit.message}
|
||||
</Link>
|
||||
</span>
|
||||
<span>{item.commit && item.commit.time_from_now}</span>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
export default CoderDepotCatalogue;
|
|
@ -0,0 +1,30 @@
|
|||
import React from 'react';
|
||||
|
||||
|
||||
function CoderDepotPath({treeValuePath , returnUlr , returnMain , getPathUrl , identifier}){
|
||||
return(
|
||||
<li className="listtablepath">
|
||||
<p>
|
||||
<a
|
||||
onClick={returnMain}
|
||||
className="color-blue"
|
||||
>
|
||||
{identifier}
|
||||
</a>
|
||||
{treeValuePath.map((item, key) => {
|
||||
return (
|
||||
<React.Fragment>
|
||||
{
|
||||
key === treeValuePath.length-1 ?
|
||||
<span className="color-grey-6 subFileName" key={key}>{item}</span>
|
||||
:
|
||||
<a onClick={()=>returnUlr(`${getPathUrl(treeValuePath,key+1)}`)} className="color-blue subFileName">{item}</a>
|
||||
}
|
||||
</React.Fragment>
|
||||
);
|
||||
})}
|
||||
</p>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
export default CoderDepotPath;
|
|
@ -0,0 +1,26 @@
|
|||
import React from 'react';
|
||||
import RenderHtml from '../../components/render-html';
|
||||
|
||||
function CoderDepotReadme({ operate , history , readme , ChangeFile }){
|
||||
return(
|
||||
<div className="commonBox" id="readme">
|
||||
<div className="commonBox-title">
|
||||
<span className="mr10">
|
||||
<i className="iconfont icon-wenjian1 font-16 color-grey-9 fl mt3"></i>
|
||||
</span>
|
||||
<span className="commonBox-title-read">README.md</span>
|
||||
{
|
||||
operate ?
|
||||
<a className="ml20 pull-right" onClick={() =>ChangeFile(readme && readme.path, false)}>
|
||||
<i className="iconfont icon-bianji6 font-16 color-blue"></i>
|
||||
</a>
|
||||
:""
|
||||
}
|
||||
</div>
|
||||
<div className="commonBox-info">
|
||||
<RenderHtml className="break_word_comments imageLayerParent" value={readme && readme.content} url={history.location}/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default CoderDepotReadme;
|
|
@ -32,7 +32,7 @@ export default ((props)=>{
|
|||
return(
|
||||
<li key={key}>
|
||||
<div>
|
||||
<Link to={`/projects/${owner}/${projectsId}/branch/${item.name}`} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link>
|
||||
<Link to={`/projects/${owner}/${projectsId}/tree/${item.name}`} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link>
|
||||
<p className="f-wrap-alignCenter mt15">
|
||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.last_commit.sha}`)}`} className="mr5 commitKey" style={{marginLeft:0}}>{item.last_commit && truncateCommitId(item.last_commit.sha)}</Link>
|
||||
<span className="color-grey-3 hide-1 messages leftPoint">{item.last_commit && item.last_commit.message}</span>
|
||||
|
|
|
@ -107,7 +107,7 @@ class CoderRootCommit extends Component{
|
|||
let branch = branchName || defaultBranch;
|
||||
return(
|
||||
<React.Fragment>
|
||||
<div className={commit_class}>
|
||||
<div className={"main"}>
|
||||
<div className="f-wrap-between">
|
||||
<SelectBranch
|
||||
repo_id={projectDetail && projectDetail.repo_id}
|
||||
|
|
|
@ -302,7 +302,7 @@ class CoderRootDirectory extends Component {
|
|||
treeValue:url
|
||||
})
|
||||
const { projectsId , owner , branchName } = this.props.match.params;
|
||||
this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/branch/${branchName}`:""}/tree/${url}`);
|
||||
this.props.history.push(`/projects/${owner}/${projectsId}/tree${branchName?`/${branchName}`:""}/${url}`);
|
||||
}
|
||||
|
||||
onEdit=(readOnly)=>{
|
||||
|
|
|
@ -172,7 +172,7 @@ class CoderRootFileDetail extends Component {
|
|||
let flag = current_user && current_user.login && (isManager || isDeveloper);
|
||||
const Option = Select.Option;
|
||||
return (
|
||||
<div className="mb20">
|
||||
<React.Fragment>
|
||||
<div className="grid-item branchTitle">
|
||||
<div className="grid-item">
|
||||
<span className="ml20 color-grey-6 font-16">
|
||||
|
@ -275,7 +275,7 @@ class CoderRootFileDetail extends Component {
|
|||
></Meditor>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,6 +71,7 @@ class CoderRootIndex extends Component{
|
|||
this.getTopCount(branchName || defaultBranch);
|
||||
}
|
||||
|
||||
// 获取<Top />组件里要显示的数据
|
||||
getTopCount=(branch)=>{
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
const url = `/${owner}/${projectsId}/top_counts.json`;
|
||||
|
@ -105,13 +106,6 @@ class CoderRootIndex extends Component{
|
|||
(props) => (<FileNew {...this.props} {...props} {...this.state} getTopCount={this.getTopCount} />)
|
||||
}
|
||||
></Route>
|
||||
|
||||
{/* diff */}
|
||||
<Route path="/projects/:owner/:projectsId/commits/branch/:branchName"
|
||||
render={
|
||||
(props) => (<CoderRootCommit {...this.props} {...props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/commits/:sha"
|
||||
render={
|
||||
(props) => (<Diff {...this.props} {...props} {...this.state}/>)
|
||||
|
@ -122,7 +116,6 @@ class CoderRootIndex extends Component{
|
|||
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
||||
}
|
||||
></Route>
|
||||
|
||||
<Route path="/projects/:owner/:projectsId/releases/:versionId/update"
|
||||
render={
|
||||
(props) => (<CoderRootVersionUpdate {...this.props} {...this.state} {...props} />)
|
||||
|
@ -133,33 +126,21 @@ class CoderRootIndex extends Component{
|
|||
() => (<CoderRootVersionNew {...this.props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
|
||||
<Route path="/projects/:owner/:projectsId/releases"
|
||||
render={
|
||||
() => (<CoderRootVersion {...this.props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
|
||||
<Route path="/projects/:owner/:projectsId/tag"
|
||||
render={
|
||||
() => (<CoderRootTag {...this.props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/tree/:branchName"
|
||||
render={
|
||||
(props) => (<CoderRootDirectory {...this.props} {...this.state} getTopCount={this.getTopCount} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/branchs"
|
||||
render={
|
||||
() => (<CoderRootBranch {...this.props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId"
|
||||
render={
|
||||
() => (<CoderRootDirectory {...this.props} {...this.state} getTopCount={this.getTopCount} />)
|
||||
}
|
||||
></Route>
|
||||
</Switch>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -97,6 +97,14 @@ const ForkUsers = Loadable({
|
|||
loading: Loading,
|
||||
})
|
||||
|
||||
const CoderRootCommit = Loadable({
|
||||
loader: () => import('./CoderRootCommit'),
|
||||
loading: Loading,
|
||||
})
|
||||
const CoderDepot = Loadable({
|
||||
loader: () => import('./CoderDepot'),
|
||||
loading: Loading,
|
||||
})
|
||||
|
||||
const TrendsIndex = Loadable({
|
||||
loader: () => import('../Activity/Activity'),
|
||||
|
@ -151,7 +159,6 @@ class Detail extends Component {
|
|||
watched: false,
|
||||
praised: false,
|
||||
http_url: undefined,
|
||||
author: undefined,
|
||||
branchs: undefined,
|
||||
branchList: undefined,
|
||||
project: null,
|
||||
|
@ -246,7 +253,7 @@ class Detail extends Component {
|
|||
|
||||
getDetail = () => {
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
const url = `/${owner}/${projectsId}.json`;
|
||||
const url = `/${owner}/${projectsId}/detail.json`;
|
||||
axios.get(url).then((result) => {
|
||||
if (result && result.data) {
|
||||
this.setState({
|
||||
|
@ -256,7 +263,6 @@ class Detail extends Component {
|
|||
isReporter: result.data.permission && result.data.permission === "Reporter",
|
||||
isDeveloper: result.data.permission && result.data.permission === "Developer",
|
||||
http_url: result.data.clone_url,
|
||||
author: result.data.author,
|
||||
praised: result.data.praised,
|
||||
watched: result.data.watched,
|
||||
watchers_count: result.data.watchers_count,
|
||||
|
@ -677,11 +683,6 @@ class Detail extends Component {
|
|||
(props) => (<MergeIndexDetail {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/coders/filesurl"
|
||||
render={
|
||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/watchers"
|
||||
render={
|
||||
(props) => (<WatchUsers {...this.props} {...props} {...this.state} {...common} />)
|
||||
|
@ -697,19 +698,27 @@ class Detail extends Component {
|
|||
(props) => (<ForkUsers {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
|
||||
|
||||
{/* 代码库----详情页面 */}
|
||||
<Route path="/projects/:owner/:projectsId/commits/branch/:branchName"
|
||||
render={
|
||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||
(props) => (<CoderRootCommit {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/tree/:branchName"
|
||||
render={
|
||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||
(props) => (<CoderDepot {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/:subIndex"
|
||||
render={
|
||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId"
|
||||
render={
|
||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||
(props) => (<CoderDepot {...this.props} {...props} {...this.state} {...common}/>)
|
||||
}
|
||||
></Route>
|
||||
</Switch>
|
||||
|
|
|
@ -59,7 +59,7 @@ export default ({ match , history }) => {
|
|||
{commit && commit.message &&
|
||||
<pre className="task-hide" style={{marginBottom:"0px",height:"28px",whiteSpace:"pre-wrap"}}>{commit.message}</pre>
|
||||
}
|
||||
<Button type="primary" onClick={()=>{history.push(`/projects/${owner}/${projectsId}/branch/${truncateCommitId(sha)}`)}} className="ml30">浏览代码</Button>
|
||||
<Button type="primary" onClick={()=>{history.push(`/projects/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`)}} className="ml30">浏览代码</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="f-wrap-between" style={{ alignItems: "center" }}>
|
||||
|
|
|
@ -71,4 +71,201 @@
|
|||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// coderDepot
|
||||
.Panels{
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
.panelmenu{
|
||||
padding-top:30px;
|
||||
}
|
||||
.addOptionBtn{
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
display: flex;
|
||||
border:1px solid #d9d9d9;
|
||||
border-radius: 4px;
|
||||
a{
|
||||
padding:0px 13px;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
cursor: pointer;
|
||||
}
|
||||
& > a:first-child{
|
||||
border-right: 1px solid #d9d9d9;
|
||||
}
|
||||
}
|
||||
.infoCount{
|
||||
display: inline-block;
|
||||
padding:0px 5px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
background-color: #eee;
|
||||
color:#999;
|
||||
border-radius: 12px;
|
||||
margin-left: 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.attrPerson{
|
||||
padding-top: 15px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
a{
|
||||
margin: 10px 10px 0px 0px;
|
||||
img{
|
||||
border-radius: 50%;
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
&:nth-child(6){
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.progress{
|
||||
display: flex;
|
||||
border-radius: 10px;
|
||||
height: 7px;
|
||||
margin-top: 12px;
|
||||
span{
|
||||
border-left: 1px solid #fff;
|
||||
&:first-child{
|
||||
border-left: none;
|
||||
border-radius: 10px 0px 0px 10px;
|
||||
}
|
||||
&:last-child{
|
||||
border-radius: 0px 10px 10px 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.progresstip{
|
||||
margin-top: 15px;
|
||||
flex-wrap: wrap;
|
||||
i.zero{
|
||||
position: absolute;
|
||||
display: block;
|
||||
border-radius: 50%;
|
||||
height: 8px;
|
||||
width: 8px;
|
||||
left: 0px;
|
||||
top:10px
|
||||
}
|
||||
&>span{
|
||||
padding-left: 15px;
|
||||
position: relative;
|
||||
min-width: 33.5%;
|
||||
span{
|
||||
color: #666;
|
||||
&:last-child{
|
||||
color: #999;
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.listtable{
|
||||
margin-top: 20px;
|
||||
border:1px solid #d9d9d9;
|
||||
border-radius: 4px;
|
||||
.listtablehead{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
border-bottom: 1px solid #d9d9d9;
|
||||
padding:7px 20px;
|
||||
border-radius: 4px 4px 0px 0px;
|
||||
background-color: #FAFBFC;
|
||||
.ellipsistxt{
|
||||
margin-left: 13px;
|
||||
line-height:18px;
|
||||
margin-top:6px;
|
||||
flex:1;
|
||||
width: 0;
|
||||
color: #666;
|
||||
&>p{
|
||||
word-break:break-all;
|
||||
}
|
||||
&.hide{
|
||||
height: 18px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
padding-right:8px;
|
||||
}
|
||||
&.hide::after{
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
content:"...";
|
||||
|
||||
}
|
||||
}
|
||||
.ellipsis{
|
||||
margin-left: 8px;
|
||||
cursor: pointer;
|
||||
border-radius: 2px;
|
||||
background-color: #c1c1c1;
|
||||
padding:0px 4px;
|
||||
height: 14px;
|
||||
line-height: 14px;
|
||||
margin-top: 9px;
|
||||
i{
|
||||
font-size: 15px!important;
|
||||
color: #fff;
|
||||
height: 14px;
|
||||
line-height: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.listtablebody{
|
||||
li.listtablepath{
|
||||
a{color: #40a9ff;}
|
||||
}
|
||||
li{
|
||||
height: 42px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #d9d9d9;
|
||||
padding:0px 20px 0px 24px;
|
||||
& > span:first-child{
|
||||
width: 30%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
& > span:nth-child(2){
|
||||
width: 60%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
& > span:nth-child(3){
|
||||
width: 10%;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
&> li:last-child{
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.drawerBtn{
|
||||
position: fixed;
|
||||
left: -13px;
|
||||
border:1px solid #d9d9d9;
|
||||
width: 34px;
|
||||
border-radius: 0px 12px 12px 0px;
|
||||
text-align: right;
|
||||
height: 70px;
|
||||
line-height: 70px;
|
||||
top:50%;
|
||||
margin-top: -35px;
|
||||
cursor: pointer;
|
||||
&:hover{
|
||||
box-shadow: 1px 0px 7px rgba(0,0,0,0.1);
|
||||
}
|
||||
i{
|
||||
color: #d9d9d9;
|
||||
}
|
||||
}
|
|
@ -424,15 +424,11 @@
|
|||
max-width: 100%;
|
||||
}
|
||||
/* 分支 */
|
||||
.branchTable{
|
||||
border:1px solid #f7f7f7;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.branchTitle{
|
||||
padding:12px 10px;
|
||||
padding:8px 10px;
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
background:rgba(241,248,255,1);
|
||||
border-bottom: 1px solid #d9d9d9;
|
||||
}
|
||||
.branchUl{
|
||||
padding:0px 30px;
|
||||
|
@ -548,17 +544,19 @@
|
|||
}
|
||||
.commonBox{
|
||||
border:1px solid #ddd;
|
||||
margin-top: 25px;
|
||||
margin-top: 30px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.commonBox .commonBox-title{
|
||||
padding:0px 15px;
|
||||
padding:0px 20px;
|
||||
box-sizing: border-box;
|
||||
font-size: 16px;
|
||||
background: #F1F8FF;
|
||||
background: #FAFBFC;/* F1F8FF */
|
||||
font-weight: bold;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
height: 45px;
|
||||
line-height: 45px;
|
||||
border-bottom: 1px solid #d9d9d9;
|
||||
border-radius: 4px 4px 0px 0px;
|
||||
}
|
||||
.synchronism{
|
||||
display: block;
|
||||
|
@ -575,7 +573,7 @@
|
|||
.commonBox .commonBox-info{
|
||||
padding:20px 15px;
|
||||
}
|
||||
.commonBox-title-read{vertical-align: middle;}
|
||||
.commonBox-title-read{vertical-align: middle;color: #666;}
|
||||
|
||||
@media screen and (max-width: 370px){
|
||||
.p-r-tags,.p-r-btn{
|
||||
|
|
|
@ -98,7 +98,7 @@ class MergeItem extends Component {
|
|||
<span className="ml15">
|
||||
<Tag className="pr-branch-tag">
|
||||
<Link
|
||||
to={`/projects/${item.is_original ? item.fork_project_user : owner}/${ item.is_original ? item.fork_project_identifier : projectsId }/branch/${item.pull_request_head}`}
|
||||
to={`/projects/${item.is_original ? item.fork_project_user : owner}/${ item.is_original ? item.fork_project_identifier : projectsId }/tree/${item.pull_request_head}`}
|
||||
className="maxW200px hide-1 ver-middle"
|
||||
>
|
||||
{item.is_original
|
||||
|
@ -116,7 +116,7 @@ class MergeItem extends Component {
|
|||
</span>
|
||||
<Tag className="pr-branch-tag">
|
||||
<Link
|
||||
to={`/projects/${owner}/${projectsId}/branch/${item.pull_request_base}`}
|
||||
to={`/projects/${owner}/${projectsId}/tree/${item.pull_request_base}`}
|
||||
className="maxW200px hide-1 ver-middle"
|
||||
>
|
||||
{/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */}
|
||||
|
|
|
@ -305,7 +305,7 @@ class MessageCount extends Component {
|
|||
<div className="mt15">
|
||||
<Tag className="pr-branch-tag">
|
||||
<Link
|
||||
to={`/projects/${owner}/${data.pull_request.is_original?data.project_identifier:projectsId}/branch/${data.pull_request.head}`}
|
||||
to={`/projects/${owner}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${data.pull_request.head}`}
|
||||
className="ver-middle"
|
||||
>
|
||||
{data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}:{data.pull_request.head}
|
||||
|
@ -320,7 +320,7 @@ class MessageCount extends Component {
|
|||
</span>
|
||||
<Tag className="pr-branch-tag">
|
||||
<Link
|
||||
to={`/projects/${owner}/${projectsId}/branch/${data.pull_request.base}`}
|
||||
to={`/projects/${owner}/${projectsId}/tree/${data.pull_request.base}`}
|
||||
className="ver-middle"
|
||||
>
|
||||
{/* {data.pull_request.is_fork ? data.pull_request.base : `${data.pull_request.pull_request_user}:${data.pull_request.base}`} */}
|
||||
|
|
|
@ -54,7 +54,7 @@ class UserSubmitComponent extends Component {
|
|||
const { getTopCount } = this.props;
|
||||
getTopCount && getTopCount(values.branchname);
|
||||
}
|
||||
let url = `/projects/${owner}/${projectsId}${values.branchname ? `/branch/${values.branchname}`: (branch ? `/branch/${branch}` : "")}`;
|
||||
let url = `/projects/${owner}/${projectsId}${values.branchname ? `/tree/${values.branchname}`: (branch ? `/tree/${branch}` : "")}`;
|
||||
this.props.history.push(url);
|
||||
}
|
||||
})
|
||||
|
@ -89,7 +89,7 @@ class UserSubmitComponent extends Component {
|
|||
.then((result) => {
|
||||
this.setState({ isSpin: false });
|
||||
if (result.data && result.data.status === 1) {
|
||||
let url = `/projects/${owner}/${projectsId}${(values.branchname ? `/branch/${values.branchname}` : ((currentBranch || branch) ? `/branch/${currentBranch || branch}`:""))}`;
|
||||
let url = `/projects/${owner}/${projectsId}${(values.branchname ? `/tree/${values.branchname}` : ((currentBranch || branch) ? `/tree/${currentBranch || branch}`:""))}`;
|
||||
this.props.history.push(url);
|
||||
this.props.showNotification("文件修改成功!");
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ class UserSubmitComponent extends Component {
|
|||
const { editor_type } = this.props;
|
||||
return (
|
||||
<div>
|
||||
<span className="df mt30" style={{ alignItems: "center" }}>
|
||||
<span className="df" style={{ alignItems: "center" }}>
|
||||
<Link to={`/users/${current_user && current_user.login}`} className="show-user-link" >
|
||||
<img
|
||||
src={getImageUrl(`images/${current_user && current_user.image_url}`)}
|
||||
|
|
|
@ -61,10 +61,6 @@
|
|||
.screwPanel .ant-radio-wrapper{
|
||||
display: block;
|
||||
}
|
||||
.branchTable{
|
||||
border:1px solid #eaeaea;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.branchTable .margin-view-overlays{
|
||||
border-right: 1px solid #eaeaea;
|
||||
background-color: #fbfbfb;
|
||||
|
|
|
@ -56,18 +56,19 @@ class m_editor extends Component {
|
|||
editorWillMount={this.editorWillMount}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{!readOnly && (
|
||||
<UserSubmitComponent
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
filepath={`${this.props.filepath}`}
|
||||
content={editorValue}
|
||||
editor_type={editorType}
|
||||
currentBranch={currentBranch}
|
||||
></UserSubmitComponent>
|
||||
)}
|
||||
</div>
|
||||
{!readOnly && (
|
||||
<div style={{padding:"20px",marginTop:"20px",borderTop:"1px solid #d9d9d9"}}>
|
||||
<UserSubmitComponent
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
filepath={`${this.props.filepath}`}
|
||||
content={editorValue}
|
||||
editor_type={editorType}
|
||||
currentBranch={currentBranch}
|
||||
></UserSubmitComponent>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue