Merge pull request '代码库二级页面改版-提交' (#29) from durian/forgeplus-react:feature_repo_second_page_xiesi into feature_repo_second_page

This commit is contained in:
durian 2021-09-24 14:35:39 +08:00
commit 2777ebcda2
24 changed files with 465 additions and 162 deletions

50
package-lock.json generated
View File

@ -3425,9 +3425,9 @@
"integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==" "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw=="
}, },
"clipboard": { "clipboard": {
"version": "2.0.6", "version": "2.0.8",
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.6.tgz", "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.8.tgz",
"integrity": "sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==", "integrity": "sha512-Y6WO0unAIQp5bLmk1zdThRhgJt/x3ks6f30s3oE3H1mgIEU33XyQjEf8gsf6DxC7NPX8Y1SsNWjUjL/ywLnnbQ==",
"requires": { "requires": {
"good-listener": "^1.2.2", "good-listener": "^1.2.2",
"select": "^1.1.2", "select": "^1.1.2",
@ -7240,8 +7240,7 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -7262,14 +7261,12 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -7284,20 +7281,17 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -7414,8 +7408,7 @@
"inherits": { "inherits": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -7427,7 +7420,6 @@
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -7442,7 +7434,6 @@
"version": "3.0.4", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -7450,14 +7441,12 @@
"minimist": { "minimist": {
"version": "1.2.5", "version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.9.0", "version": "2.9.0",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz",
"integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==",
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -7476,7 +7465,6 @@
"version": "0.5.3", "version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz",
"integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==",
"optional": true,
"requires": { "requires": {
"minimist": "^1.2.5" "minimist": "^1.2.5"
} }
@ -7538,8 +7526,7 @@
"npm-normalize-package-bin": { "npm-normalize-package-bin": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz",
"integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA=="
"optional": true
}, },
"npm-packlist": { "npm-packlist": {
"version": "1.4.8", "version": "1.4.8",
@ -7567,8 +7554,7 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -7580,7 +7566,6 @@
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -7658,8 +7643,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -7695,7 +7679,6 @@
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -7715,7 +7698,6 @@
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -7759,14 +7741,12 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="
"optional": true
} }
} }
}, },

View File

@ -22,7 +22,7 @@
"case-sensitive-paths-webpack-plugin": "2.1.1", "case-sensitive-paths-webpack-plugin": "2.1.1",
"chalk": "1.1.3", "chalk": "1.1.3",
"classnames": "^2.2.5", "classnames": "^2.2.5",
"clipboard": "^2.0.6", "clipboard": "^2.0.8",
"code-prettify": "^0.1.0", "code-prettify": "^0.1.0",
"codemirror": "^5.53.0", "codemirror": "^5.53.0",
"connected-react-router": "4.4.1", "connected-react-router": "4.4.1",

View File

@ -2474,7 +2474,7 @@ a:hover{
.color-grey-B3 { .color-grey-B3 {
color: #B3B3B3 !important; color: #B3B3B3 !important;
} }
`
.color-grey-B4 { .color-grey-B4 {
color: #B4B4B4 !important; color: #B4B4B4 !important;
} }

View File

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 2340181 */ font-family: "iconfont"; /* Project id 2340181 */
src: url('iconfont.woff2?t=1631692103587') format('woff2'), src: url('iconfont.woff2?t=1632447048516') format('woff2'),
url('iconfont.woff?t=1631692103587') format('woff'), url('iconfont.woff?t=1632447048516') format('woff'),
url('iconfont.ttf?t=1631692103587') format('truetype'); url('iconfont.ttf?t=1632447048516') format('truetype');
} }
.iconfont { .iconfont {
@ -13,6 +13,18 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-wenjianicon:before {
content: "\e8dc";
}
.icon-a-yuanquan2x:before {
content: "\e8db";
}
.icon-xiangmubiaoqian:before {
content: "\e8da";
}
.icon-icon:before { .icon-icon:before {
content: "\e8ce"; content: "\e8ce";
} }

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,27 @@
"css_prefix_text": "icon-", "css_prefix_text": "icon-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "24567893",
"name": "文件icon",
"font_class": "wenjianicon",
"unicode": "e8dc",
"unicode_decimal": 59612
},
{
"icon_id": "24527422",
"name": "圆圈@2x",
"font_class": "a-yuanquan2x",
"unicode": "e8db",
"unicode_decimal": 59611
},
{
"icon_id": "24378423",
"name": "项目标签",
"font_class": "xiangmubiaoqian",
"unicode": "e8da",
"unicode_decimal": 59610
},
{ {
"icon_id": "24368060", "icon_id": "24368060",
"name": "icon", "name": "icon",

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -15,6 +15,7 @@ export default ({ url , name , column , id , login })=>{
${!column && ` ${!column && `
& span{ & span{
margin-left:8px; margin-left:8px;
font-weight: bold;
}` }`
} }
`; `;

View File

@ -190,6 +190,7 @@ function CoderDepot(props){
setLastCommit(c && c.commit); setLastCommit(c && c.commit);
setLastCommitAuthor(c && c.committer); setLastCommitAuthor(c && c.committer);
setMainFlag(false); setMainFlag(false);
setReadOnly(true);
setReadOnly(!editReadme); setReadOnly(!editReadme);
setHide(true); setHide(true);
} }

View File

@ -1,13 +1,17 @@
import React , { Component } from 'react'; import React , { Component } from 'react';
import { Spin , Pagination } from 'antd'; import { Spin , Pagination, Timeline } from 'antd';
import { getImageUrl } from 'educoder'; import { getImageUrl } from 'educoder';
import { truncateCommitId } from '../common/util'; import { truncateCommitId } from '../common/util';
import { AlignTop } from '../Component/layout'; import { AlignTop } from '../Component/layout';
import SelectBranch from '../Branch/Select'; import SelectBranch from '../Branch/Select';
import Nodata from '../Nodata'; import Nodata from '../Nodata';
import Tree from './img/tree.png';
import axios from 'axios'; import axios from 'axios';
import {Link} from "react-router-dom"; import {Link} from "react-router-dom";
import CopyTool from '../Component/CopyTool';
import './tree/Index.scss'
function returnbar(str){ function returnbar(str){
if(str && str.length>0 && str.indexOf("%2F")>-1){ if(str && str.length>0 && str.indexOf("%2F")>-1){
@ -15,13 +19,14 @@ function returnbar(str){
} }
return str; return str;
} }
//代码库--提交页面
class CoderRootCommit extends Component{ class CoderRootCommit extends Component{
constructor(props){ constructor(props){
super(props) super(props)
this.state={ this.state={
commitDatas:undefined, commitDatas:undefined,
dataCount:undefined, dataCount:undefined,
limit:20, limit:10,
page:1, page:1,
isSpining:false, isSpining:false,
branchList:undefined branchList:undefined
@ -63,7 +68,6 @@ class CoderRootCommit extends Component{
this.setState({ this.setState({
isSpining:true isSpining:true
}) })
console.log(returnbar(branch));
const { projectsId , owner } = this.props.match.params; const { projectsId , owner } = this.props.match.params;
const url = `/${owner}/${projectsId}/commits.json`; const url = `/${owner}/${projectsId}/commits.json`;
axios.get(url,{ axios.get(url,{
@ -107,6 +111,9 @@ class CoderRootCommit extends Component{
ChangePage=(page)=>{ ChangePage=(page)=>{
const { branchName } = this.props.match.params; const { branchName } = this.props.match.params;
const { limit } = this.state; const { limit } = this.state;
this.setState({
page: page
})
this.getCommitList(branchName , page , limit); this.getCommitList(branchName , page , limit);
} }
render(){ render(){
@ -129,42 +136,50 @@ class CoderRootCommit extends Component{
></SelectBranch> ></SelectBranch>
</div> </div>
<Spin spinning={isSpining}> <Spin spinning={isSpining}>
<div className="commonBox"> <Timeline className="commitList">
<div className="commonBox-title"> {
<div className="f-wrap-between" style={{alignItems:"center"}}> commitDatas && commitDatas.length > 0 && commitDatas.map((item,k)=>{
<span className="font-16">{dataCount}次提交代码({branch})</span> return(
</div> <Timeline.Item key={k} dot={page ===1 && k===0 ?<span className="new-conmmit">最新</span>:<i className="iconfont icon-a-yuanquan2x"></i>}>
</div> <div className="commitList-item f-wrap-between">
<div className="commitList"> <div>
{ <AlignTop>
commitDatas && commitDatas.length > 0 && commitDatas.map((item,k)=>{ <Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}`} className="commitDesc font-14 color-grey-3 font-bd">{item.message}</Link>
return( </AlignTop>
<div key={k}> <p className="f-wrap-alignCenter mt15">
<AlignTop> {
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitKey" style={{marginLeft:0,marginTop:"3px"}}>{truncateCommitId(`${item.sha}`)}</Link> item.id ?
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitDesc">{item.message}</Link> <Link to={`/${item.login}`} className="show-user-link">
</AlignTop> {item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr8 radius"/>:""}
<p className="f-wrap-alignCenter mt15"> <label className="font-14 color-grey-3" style={{verticalAlign:'middle'}}><label className="font-bd">{item.name ?`${item.name} `:""}</label> {item.time_from_now}</label>
{ </Link>:
item.id ? <span className="show-user-link">
<Link to={`/${item.login}`} className="show-user-link"> {item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr8 radius"/>:""}
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""} <label className="font-14 color-grey-3" style={{verticalAlign:'middle'}}><label className="font-bd">{item.name ?`${item.name} `:""}</label> {item.time_from_now}</label>
<label className="font-14 color-grey-6" style={{verticalAlign:'middle'}}>{item.name ?`${item.name}:`:""}提交于 {item.time_from_now}</label> </span>
</Link>: }
<span className="show-user-link"> </p>
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""} </div>
<label className="font-14 color-grey-6" style={{verticalAlign:'middle'}}>{item.name ?`${item.name}:`:""}提交于 {item.time_from_now}</label> <div>
</span> <div className="treecopy">
} <div className="shadow">
<span className="treecopy-cont">
</p> <img src={Tree} alt="sha" width={"16px"}/>
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}`}>{truncateCommitId(`${item.sha}`)}</Link>
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`}/>
</span>
<CopyTool beforeText="复制commit id" afterText="复制成功" inputId={`value${k}`}/>
</div>
<button className="btn-83" onClick={()=>{window.location.href=`/${owner}/${projectsId}/tree/${truncateCommitId(item.sha)}`}}>浏览文件</button>
</div>
</div>
</div> </div>
) </Timeline.Item>
}) )
} })
{commitDatas && commitDatas.length === 0 && <Nodata _html="暂无数据"/>} }
</div> {commitDatas && commitDatas.length === 0 && <Nodata _html="暂无数据"/>}
</div> </Timeline>
{ {
dataCount > limit ? dataCount > limit ?
<div className="edu-txt-center pt30 mb30"> <div className="edu-txt-center pt30 mb30">

View File

@ -108,7 +108,7 @@ class CoderRootIndex extends Component{
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />) () => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
} }
></Route> ></Route>
<Route path="/:owner/:projectsId/commits/:sha" <Route path="/:owner/:projectsId/commits/:sha/:branchName"
render={ render={
(props) => (<Diff {...this.props} {...props} {...this.state}/>) (props) => (<Diff {...this.props} {...props} {...this.state}/>)
} }

View File

@ -5,24 +5,42 @@ import { truncateCommitId } from '../common/util';
import { getImageUrl } from 'educoder'; import { getImageUrl } from 'educoder';
import Files from '../Merge/Files'; import Files from '../Merge/Files';
import Tree from "./img/tree.png";
import User from "../Component/User"; import User from "../Component/User";
import Keys from "../Component/Keys";
import axios from "axios"; import axios from "axios";
const Infos = styled.div` const Infos = styled.div`
border: 1px solid #dddddd; border: 1px solid #FAFCFF;
margin-bottom:15px; margin-bottom:15px;
& .commitinfos { & .commitinfos {
background-color: #f1f8ff; background-color: #f1f8ff;
border-bottom: 1px solid #ddd; border: 1px solid rgba(42, 97, 255, 0.23);
padding: 20px; border-radius: 3px 3px 0px 0px;
padding: 10px 8px 10px 16px;
& .f-wrap-between{
align-items: center;
}
& .task-hide{
width: 65rem;
overflow:hidden;
white-space:normal;
word-break:break-all;
font-weight: bold;
color: #333333;
font-size: 16px;
}
} }
& > .f-wrap-between { & > .f-wrap-between {
padding: 10px 20px; padding: 14px 8px 14px 16px;
border-radius: 3px 3px 0px 0px;
border: 1px solid #D0D0D0;
.df{
align-items: center;
}
} }
`; `;
//
export default ({ match , history }) => { export default ({ match , history }) => {
const [data, setData] = useState({undefined}); const [data, setData] = useState({undefined});
const [commit, setCommit] = useState(undefined); const [commit, setCommit] = useState(undefined);
@ -30,7 +48,7 @@ export default ({ match , history }) => {
const [committer, setCommitter] = useState(undefined); const [committer, setCommitter] = useState(undefined);
const [isSpin, setIsSpin] = useState(true); const [isSpin, setIsSpin] = useState(true);
const { sha , projectsId, owner } = match.params; const { sha , projectsId, owner, branchName } = match.params;
useEffect(() => { useEffect(() => {
if (projectsId && owner && sha) { if (projectsId && owner && sha) {
const url = `/${owner}/${projectsId}/commits/${sha}.json`; const url = `/${owner}/${projectsId}/commits/${sha}.json`;
@ -50,16 +68,20 @@ export default ({ match , history }) => {
}); });
} }
}, [projectsId , owner, sha]); }, [projectsId , owner, sha]);
return ( return (
<div className="main" style={{padding:"0px",border:"none"}}> <div className="main" style={{padding:"0px",border:"none"}}>
<Spin spinning={isSpin}> <Spin spinning={isSpin}>
<Infos> <Infos>
<div className="commitinfos"> <div className="commitinfos">
<div className="f-wrap-between"> <div className="f-wrap-between">
<div>
{commit && commit.message && {commit && commit.message &&
<pre className="task-hide" style={{marginBottom:"0px",height:"28px",whiteSpace:"pre-wrap"}}>{commit.message}</pre> <pre className="task-hide">{commit.message}</pre>
} }
<Button type="primary" onClick={()=>{history.push(`/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`)}} className="ml30">浏览代码</Button> <i className="iconfont icon-fenzhi2 font-18"></i>{branchName}
</div>
<Button type="primary" onClick={()=>{history.push(`/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`)}} className="btnblue" style={{height:"36px"}}>浏览文件</Button>
</div> </div>
</div> </div>
<div className="f-wrap-between" style={{ alignItems: "center" }}> <div className="f-wrap-between" style={{ alignItems: "center" }}>
@ -68,17 +90,25 @@ export default ({ match , history }) => {
url={(committer && getImageUrl(`/${committer.image_url}`))|| "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"} url={(committer && getImageUrl(`/${committer.image_url}`))|| "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
name={committer && committer.name} name={committer && committer.name}
/> />
{committer && committer.time_from_now && <li className="ml20 mt2">{committer.time_from_now}</li>} {commit && commit.time_from_now && <li className="ml4">提交于{commit.time_from_now}</li>}
</ul> </ul>
<li className="df"> <li className="df">
{ {
parents && parents.length > 0 && parents.map((item,key)=>{ parents && parents.length > 0 && parents.map((item,key)=>{
return( return(
<Keys title="父节点" value={truncateCommitId(item.sha)} key={key} className="mr20"></Keys> <div className="ml40 f-wrap-alignCenter">
<label className="mr8">父节点</label>
<img src={Tree} alt="sha" width={"16px"} className="mr4"/>
<span>{truncateCommitId(item.sha)}</span>
</div>
) )
}) })
} }
<Keys title="当前节点" value={truncateCommitId(sha)}></Keys> <div className="ml40 f-wrap-alignCenter">
<label className="mr8">当前节点</label>
<img src={Tree} alt="sha" width={"16px"} className="mr4"/>
<span>{truncateCommitId(sha)}</span>
</div>
</li> </li>
</div> </div>
</Infos> </Infos>

View File

@ -402,6 +402,16 @@
cursor: pointer; cursor: pointer;
background: #FAFBFC; background: #FAFBFC;
border-radius: 4px; border-radius: 4px;
.ant-dropdown-menu-item{
border-radius: 8px;
text-align: left!important;
a{
width: 350px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
border: 1px solid #D0D0D0; border: 1px solid #D0D0D0;
font-size: 15px; font-size: 15px;
font-weight: normal; font-weight: normal;

View File

@ -718,12 +718,76 @@ a.color-grey-ccc:hover{
padding:0px 30px; padding:0px 30px;
min-height: 400px; min-height: 400px;
} }
.commitList > div{
border-bottom: 1px solid #EEEEEE; .main{
padding:16px 0px; margin: 30px auto;
} .ant-timeline{
.commitList > div:last-child{ margin-top: 28px;
border-bottom: none; .commitList-item{
position: relative;
padding: 20px 20px;
background: #FAFCFF;
border: 1px solid rgba(42, 97, 255, 0.23);
border-radius: 4px;
margin-left: 16px;
align-items: center;
&:after,&:before{
content: "";
position: absolute;
left: -10px;
top: 10px;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-right: 10px solid rgba(42, 97, 255, 0.23);
}
&:after{
left: -8px;
border-right: 10px solid #FAFCFF;
&:hover{
border-right: 10px solid #EEF6FF;
}
}
&:hover{
background: #EEF6FF;
border: 1px solid rgba(42, 97, 255, 0.58);
&:after{
border-right: 10px solid #EEF6FF;
}
&:before{
border-right: 10px solid rgba(42, 97, 255, 0.58);
}
}
.treecopy-cont{
padding: 4px 15px;
}
.btn-83{
margin-left: 20px;
}
}
.ant-timeline-item{
padding: 8px 0 20px;
}
.ant-timeline-item-tail{
height: calc(100% - 20px);
border-left: 2px solid #EEEEEE;
top: 12px;
&:after{
content: ' ';
height: 0;
position: absolute;
width: 0;
border: 7px solid transparent;
border-top-color: #EEEEEE;
top: 100%;
left: 50%;
margin-left: -8px;
}
}
.ant-timeline-item-head-custom{
top:20px;
padding: 0 1px;
}
}
} }

View File

@ -86,7 +86,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
</li> </li>
:"" :""
} }
{ {/* {
item.menu_name === "resources" && item.menu_name === "resources" &&
<li className={pathname==="source" ? "active" : ""}> <li className={pathname==="source" ? "active" : ""}>
<Link to={{ pathname: `/${owner}/${projectsId}/source`, state }}> <Link to={{ pathname: `/${owner}/${projectsId}/source`, state }}>
@ -95,7 +95,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
{projectDetail && projectDetail.source_count ? <span className="num">{projectDetail.source_count}</span> :""} {projectDetail && projectDetail.source_count ? <span className="num">{projectDetail.source_count}</span> :""}
</Link> </Link>
</li> </li>
} } */}
{ {
item.menu_name === "versions" && item.menu_name === "versions" &&
<li className={pathname==="milestones" ? "active" : ""}> <li className={pathname==="milestones" ? "active" : ""}>

View File

@ -34,48 +34,61 @@
margin-right: 5px; margin-right: 5px;
} }
} }
.treecopy{
flex:1;
display: flex;
justify-content: center;
&>div{
height: 32px;
background: #FAFBFC;
border-radius: 4px;
border: 1px solid #D0D0D0;
position: relative;
z-index: 1;
display: flex;
align-items: center;
&>span{
padding:0px 15px;
border-right: 1px solid rgba(153, 153, 153, 0.4);
height: 100%;
img{
margin-right: 4px;
}
a{
color: #466AFF;
&:hover{
text-decoration: underline;
}
}
}
&>i{
margin:0px 12px;
color: #333!important;
}
input{
position: absolute;
z-index: 0;
opacity: 0;
top: 32px;
}
}
}
.treeabout{ .treeabout{
flex:1; flex:1;
text-align: right; text-align: right;
} }
} }
}
.treecopy{
flex:1;
display: flex;
justify-content: center;
&>div{
height: 32px;
background: #FAFBFC;
border-radius: 4px;
border: 1px solid #D0D0D0;
position: relative;
z-index: 1;
display: flex;
align-items: center;
&>span{
padding:0px 15px;
border-right: 1px solid rgba(153, 153, 153, 0.4);
height: 100%;
img{
margin-right: 4px;
}
a{
color: #466AFF;
&:hover{
text-decoration: underline;
}
}
}
&>i{
margin:0px 12px;
color: #333!important;
}
input{
position: absolute;
z-index: 0;
opacity: 0;
top: 32px;
}
}
}
.new-conmmit{
width: 30px;
height: 18px;
line-height: 18px;
display: block;
background: #FF6832;
color: white;
font-size: 12px;
border-radius: 4px;
}
.icon-a-yuanquan2x{
color: #466AFF;
} }

View File

@ -1,11 +1,15 @@
import React ,{useEffect,useState } from 'react'; import React ,{useEffect,useState } from 'react';
import { truncateCommitId } from '../common/util'; import { truncateCommitId } from '../common/util';
import { AlignCenter , FlexAJ } from '../Component/layout'; import { AlignCenter , FlexAJ } from '../Component/layout';
import { Button } from 'antd'; import { Button, Tooltip,Progress, Popover, Anchor } from 'antd';
import './merge.css'; import './merge.css';
import './Index.scss';
const {Link} =Anchor;
function Files({data,history,owner,projectsId}){ function Files({data,history,owner,projectsId}){
const [ files , setFiles ] = useState(data && data.files); const [ files , setFiles ] = useState(data && data.files);
const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径");
useEffect(()=>{ useEffect(()=>{
if(data){ if(data){
@ -22,35 +26,82 @@ function Files({data,history,owner,projectsId}){
} }
} }
function copyFileName(fileName){
var copyCont = document.createElement('input');
copyCont.defaultValue = fileName;
document.body.appendChild(copyCont);
copyCont.select(); //
document.execCommand("Copy"); //
copyCont.className = 'copyCont';
copyCont.style.display='none';
setCopyfileTipTitle("复制成功");
}
const folderOpen = (
<Anchor showInkInFixed={false}>
<div className="folderList">
{files && files.length>1 && files.map((item, key) => {
return (
<Link href={`#value${key}`} title=
{<FlexAJ className="filesInfo" key={key} onClick={() => {item.flag && showDown(item.flag, key, item.isBin);}}>
<AlignCenter>
<i className="iconfont icon-wenjianicon mr4"></i>
{/* {!item.isBin ? <i className={!item.flag ? "iconfont icon-sanjiaoxing-down color-grey-9 mt4" : "iconfont icon-triangle font-15 color-grey-9 mt4"} onClick={() => showDown(item.flag, key, item.isBin)}></i> : ""} */}
<span className="cursor-pointer" data-clipboard-text={item.name}>{item.name}</span>
</AlignCenter>
<div className="see-file">
<Tooltip placement="top" title={`${item.addition+item.deletion}处更改:${item.addition>0?item.addition+"处添加":""}${item.addition>0 && item.deletion>0 ?"和":""}${item.deletion>0?item.deletion+"处删除":""}`}>
<Progress showInfo = {false} strokeColor = "#2DB44D" size="small" percent={item.addition/(item.addition+item.deletion)*100} />
{item.addition >0 && <span className="color-green ml10">+{item.addition}</span>}
{item.deletion >0 && <span className="color-red ml10">-{item.deletion}</span>}
</Tooltip>
</div>
</FlexAJ>}
/>
)
})}
</div>
</Anchor>
)
return( return(
<div> <div>
<AlignCenter className="color-grey-9 pb10" style={{borderBottom:"1px solid #eee"}}> <AlignCenter className="color-grey-9 pb10">
<i className="iconfont icon-sanjiaoxing-down mr5"></i> <i className="iconfont icon-triangle mr5 font-16"></i>
<span> <Popover content={folderOpen} placement="bottomLeft" className="popover-file">
共有<span className="color-grey-3"> {data && data.files_count} 个文件被更改</span>包括 <span className="color-grey-6" style={{cursor:"pointer"}}>
共有<span className="color-grey-3"> {data && data.files_count} 个文件 </span>被更改包括
{ data && data.total_addition ? <span className="color-green"> {data && data.total_addition} 次插入</span>:"" } { data && data.total_addition ? <span className="color-green"> {data && data.total_addition} 次插入</span>:"" }
{ data && data.total_addition && data.total_deletion ? " 和 ":""} { data && data.total_addition && data.total_deletion ? " 和 ":""}
{ data && data.total_deletion ? <span className="color-red"> {data && data.total_deletion} 次删除</span>:""} { data && data.total_deletion ? <span className="color-red"> {data && data.total_deletion} 次删除</span>:""}
</span> </span>
</Popover>
</AlignCenter> </AlignCenter>
{ {
files && files.length>0 && files && files.length>0 &&
<div> <div className="fileList">
{ {
files.map((item,key)=>{ files.map((item,key)=>{
return( return(
<div className="files" key={key}> <div className="files" key={key} id= {`value${key}`}>
<FlexAJ className="filesInfo" style={{cursor:item.isBin ? "default":"pointer"}} onClick={()=>showDown(item.flag,key,item.isBin)}> <FlexAJ className="filesInfo">
<AlignCenter> <AlignCenter>
{!item.isBin ? <i className={!item.flag?"iconfont icon-xiajiantou font-16 mr15 color-grey-9":"iconfont icon-youjiantou font-16 mr15 color-grey-9"}></i>:""} {!item.isBin ? <i className={!item.flag?"iconfont icon-sanjiaoxing-down color-grey-9 mt4":"iconfont icon-triangle font-15 color-grey-9 mt4"} onClick={()=>showDown(item.flag,key,item.isBin)}></i>:""}
<i className="iconfont icon-wenjia font-16 mr8 color-grey-9"></i> <span className="cursor-pointer" data-clipboard-text={item.name} onClick={()=>showDown(item.flag,key,item.isBin)}>{item.name}</span>
<span>{item.name}</span> <Tooltip
title={copyfileTipTitle}
onVisibleChange={()=>setCopyfileTipTitle("复制文件路径")}
>
<i className="iconfont icon-fuzhiicon ml6" onClick={()=>copyFileName(item.name)}></i>
</Tooltip>
</AlignCenter> </AlignCenter>
<span> <div className="see-file">
<Button className="mr20" onClick={()=>{history.push(`/${owner}/${projectsId}/tree/${truncateCommitId(item.sha)}/${item.name}`)}}>查看文件</Button> <Tooltip placement="top" title={`${item.addition+item.deletion}处更改:${item.addition>0?item.addition+"处添加":""}${item.addition>0 && item.deletion>0 ?"和":""}${item.deletion>0?item.deletion+"处删除":""}`}>
<span className="color-green">+{item.addition}</span> <Progress showInfo = {false} strokeColor = "#2DB44D" size="small" percent={item.addition/(item.addition+item.deletion)*100} />
<span className="color-red ml20">-{item.deletion}</span> <span className="ml10">{item.addition+item.deletion}</span>
</span> </Tooltip>
<span className="see-file-btn" onClick={()=>{history.push(`/${owner}/${projectsId}/tree/${truncateCommitId(item.sha)}/${item.name}`)}}>查看文件</span>
</div>
</FlexAJ> </FlexAJ>
{ {
item.sections && item.sections.length >= 1 && !item.flag && item.sections && item.sections.length >= 1 && !item.flag &&

View File

@ -18,4 +18,78 @@
.pr_tags_closed{ .pr_tags_closed{
border:1px solid #FA6400; border:1px solid #FA6400;
color: #FA6400; color: #FA6400;
}
.color-grey-3{
font-weight: bold;
}
.invisable{
display: none;
}
.fileList{
.sc-bxivhb{
width: 55rem;
}
.see-file{
width: 15rem;
.ml10{
display: inline-block;
width: 5rem;
cursor: default;
}
span{
width: 7%;
}
}
}
.filesInfo{
background: #FAFCFF;
border-color:rgba(42, 97, 255, 0.23);
.ant-progress-line {
width: 5rem;
}
.ant-progress-inner{
background-color: #D14A4A;
}
}
.ant-popover-arrow,.ant-anchor-ink-ball {
display: none;
}
.ant-popover-inner {
margin-left: -21px;
background: #FFF;
}
.ant-anchor-link,.ant-popover-inner-content{
padding: 0 0;
}
.ant-anchor-wrapper,.ant-anchor{
margin-left: 0;
padding-left: 0;
}
.ant-anchor-link-active > .ant-anchor-link-title {
color: #466AFF;
}
.ant-popover-inner-content{
color: #333333;
width: 75rem;
.folderList{
max-height: 280px;
overflow:auto;
.files{
border: 0px;
}
.filesInfo {
padding: 10px 18px 10px 15px;
height: 55px;
background: #FFF;
border-bottom: 1px solid #EEEEEE;
&:hover{
background: #F3F4F6;
}
.color-green,.color-red{
width: 3%;
text-align: right;
}
}
}
} }

View File

@ -152,13 +152,23 @@ form .ant-cascader-picker, form .ant-select {
margin-top: 15px; margin-top: 15px;
border-radius: 2px; border-radius: 2px;
} }
.see-file-btn{
color: #466AFF;
cursor: pointer;
}
.filesInfo{ .filesInfo{
padding:10px 15px; padding:10px 15px;
background-color: #fafafa; background-color: #fafafa;
} }
.filesInfo .cursor-pointer{
cursor: pointer;
}
.filesContent{ .filesContent{
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
} }
.icon-fuzhiicon:hover{
color: #466AFF;
}
.linesContent{ .linesContent{
display: flex; display: flex;
min-height: 30px; min-height: 30px;

View File

@ -16,7 +16,7 @@ const menu = [
{name:"合并请求",index:"pulls"}, {name:"合并请求",index:"pulls"},
{name:"Wiki",index:"wiki"}, {name:"Wiki",index:"wiki"},
{name:"工作流(beta版)",index:"devops"}, {name:"工作流(beta版)",index:"devops"},
{name:"资源库",index:"resources"}, // {name:"资源库",index:"resources"},
{name:"里程碑",index:"versions"}, {name:"里程碑",index:"versions"},
{name:"动态",index:"activity"}, {name:"动态",index:"activity"},
] ]

View File

@ -122,7 +122,11 @@ export default Form.create()(
validator:checkname validator:checkname
} }
], ],
<<<<<<< HEAD
<Input placeholder="请输入组织账号" disabled/>,true
=======
<Input placeholder="请输入组织账号" maxLength={100} disabled/>,true <Input placeholder="请输入组织账号" maxLength={100} disabled/>,true
>>>>>>> 465ae57b071299c682f2c8d57d3380aa647c7d23
)} )}
{helper( {helper(
"组织名称:", "组织名称:",

View File

@ -91,11 +91,14 @@ ul,ol,dl{
} }
.commitDesc{ .commitDesc{
flex:1; flex:1;
margin-left:20px; line-height:20px;
font-size:16px;
color:#333;
line-height:26px;
word-break: break-all; word-break: break-all;
width: 48rem;
overflow: hidden;
white-space: normal;
&:hover{
text-decoration: underline;
}
} }
.normalBox{ .normalBox{
@ -297,17 +300,31 @@ form{
border-radius: 5px; border-radius: 5px;
font-weight: 500; font-weight: 500;
color: #333333!important; color: #333333!important;
&:hover,&:active{ &:hover{
background: #F3F4F6; background: #F3F4F6;
color: #333333!important; color: #333333!important;
} }
&:active{
background: #D0D0D0;
color: #333333!important;
}
}
.shadow{
&:hover{
background: #F3F4F6;
}
&:active{
background: #D0D0D0;
}
} }
a.hover:hover{ a.hover:hover{
text-decoration: underline; text-decoration: underline;
} }
button.ant-btn-primary.btnblue{ button.ant-btn-primary.btnblue{
background-color:rgba(70, 106, 255, 1); background-color:rgba(70, 106, 255, 1);
border-color:rgba(70, 106, 255, 1);
&:hover{ &:hover{
background-color:rgba(70, 106, 255, 0.85); background-color:rgba(70, 106, 255, 0.85);
border-color:rgba(70, 106, 255, 0.85);
} }
} }