Merge pull request '代码库二级页面改版-发行版' (#82) from tongChong/forgeplus-react:feature_repo_second_page into feature_repo_second_page

This commit is contained in:
baladiwei 2021-09-28 10:08:26 +08:00
commit a64887d420
22 changed files with 340 additions and 147 deletions

82
package-lock.json generated
View File

@ -3875,6 +3875,52 @@
"warning": "^4.0.3"
}
},
"cross-env": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
"integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
"requires": {
"cross-spawn": "^7.0.1"
},
"dependencies": {
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"requires": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
}
},
"path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="
},
"shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"requires": {
"shebang-regex": "^3.0.0"
}
},
"shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"requires": {
"isexe": "^2.0.0"
}
}
}
},
"cross-fetch": {
"version": "3.1.4",
"resolved": "https://registry.nlark.com/cross-fetch/download/cross-fetch-3.1.4.tgz",
@ -7261,12 +7307,14 @@
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -7281,17 +7329,20 @@
"code-point-at": {
"version": "1.1.0",
"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": {
"version": "0.0.1",
"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": {
"version": "1.1.0",
"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": {
"version": "1.0.2",
@ -7408,7 +7459,8 @@
"inherits": {
"version": "2.0.4",
"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": {
"version": "1.3.5",
@ -7420,6 +7472,7 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -7434,6 +7487,7 @@
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -7441,12 +7495,14 @@
"minimist": {
"version": "1.2.5",
"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": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz",
"integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==",
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@ -7465,6 +7521,7 @@
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz",
"integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==",
"optional": true,
"requires": {
"minimist": "^1.2.5"
}
@ -7526,7 +7583,8 @@
"npm-normalize-package-bin": {
"version": "1.0.1",
"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": {
"version": "1.4.8",
@ -7554,7 +7612,8 @@
"number-is-nan": {
"version": "1.0.1",
"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": {
"version": "4.1.1",
@ -7566,6 +7625,7 @@
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"optional": true,
"requires": {
"wrappy": "1"
}
@ -7679,6 +7739,7 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -16566,6 +16627,11 @@
}
}
},
"save-dev": {
"version": "0.0.1-security",
"resolved": "https://registry.npmjs.org/save-dev/-/save-dev-0.0.1-security.tgz",
"integrity": "sha512-k6knZTDNK8PKKbIqnvxiOveJinuw2LcQjqDoaorZWP9M5AR2EPsnpDeSbeoZZ0pHr5ze1uoaKdK8NBGQrJ34Uw=="
},
"sax": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",

View File

@ -26,6 +26,7 @@
"code-prettify": "^0.1.0",
"codemirror": "^5.53.0",
"connected-react-router": "4.4.1",
"cross-env": "^7.0.3",
"css-loader": "^3.5.2",
"dompurify": "^2.0.15",
"dotenv": "4.0.0",
@ -103,6 +104,7 @@
"redux-thunk": "2.3.0",
"rsuite": "^4.3.4",
"sass-loader": "7.3.1",
"save-dev": "0.0.1-security",
"scroll-into-view": "^1.14.2",
"showdown": "^1.9.1",
"showdown-katex": "^0.8.0",
@ -122,7 +124,7 @@
},
"scripts": {
"start": "node --max_old_space_size=15360 scripts/start.js",
"build": "NODE_ENV=production node --max_old_space_size=15360 scripts/build.js",
"build": "cross-env NODE_ENV=production node --max_old_space_size=15360 scripts/build.js",
"test-build": "NODE_ENV=testBuild node --max_old_space_size=15360 scripts/build.js",
"pre-build": "NODE_ENV=preBuild node --max_old_space_size=15360 scripts/build.js",
"gen_stats": "NODE_ENV=production webpack --profile --config=./config/webpack.config.prod.js --json > stats.json",

View File

@ -1760,6 +1760,14 @@ a.decoration {
margin-bottom: 10px;
}
.mb12 {
margin-bottom: 12px;
}
.mb13 {
margin-bottom: 13px;
}
.mb14 {
margin-bottom: 14px;
}

View File

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 2340181 */
src: url('iconfont.woff2?t=1632447048516') format('woff2'),
url('iconfont.woff?t=1632447048516') format('woff'),
url('iconfont.ttf?t=1632447048516') format('truetype');
src: url('iconfont.woff2?t=1632792244115') format('woff2'),
url('iconfont.woff?t=1632792244115') format('woff'),
url('iconfont.ttf?t=1632792244115') format('truetype');
}
.iconfont {
@ -13,6 +13,22 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-wenjian7:before {
content: "\e8e0";
}
.icon-xiangyoujiantou:before {
content: "\e8de";
}
.icon-xiangzuojiantou:before {
content: "\e8df";
}
.icon-a-liulanicon2x:before {
content: "\e8dd";
}
.icon-wenjianicon:before {
content: "\e8dc";
}

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,34 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "24656750",
"name": "文件",
"font_class": "wenjian7",
"unicode": "e8e0",
"unicode_decimal": 59616
},
{
"icon_id": "630094",
"name": "向右箭头",
"font_class": "xiangyoujiantou",
"unicode": "e8de",
"unicode_decimal": 59614
},
{
"icon_id": "630095",
"name": "向左箭头",
"font_class": "xiangzuojiantou",
"unicode": "e8df",
"unicode_decimal": 59615
},
{
"icon_id": "24600282",
"name": "浏览icon@2x",
"font_class": "a-liulanicon2x",
"unicode": "e8dd",
"unicode_decimal": 59613
},
{
"icon_id": "24567893",
"name": "文件icon",

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -17,7 +17,8 @@ function Releases({owner,projectsId,releaseVersions , baseOperate , projectType}
key === 0 &&<AlignTop className="mt10">
<div>
<p className="font-16 color-grey-6">
<Link to={`/${owner}/${projectsId}/releases`}>{item.name}</Link>
{/* 如果是点击最新则发行版列表页只展示最新的一个 */}
<Link to={{pathname:`/${owner}/${projectsId}/releases`,query:{turnFromNew:true}}}>{item.name}</Link>
<span className="font-12 laterest ml5">最新</span>
</p>
<p className="color-grey-3 font-12">{item.created_at}</p>

View File

@ -5,6 +5,7 @@ import { Link } from 'react-router-dom';
export default ({ url , name , column , id , login })=>{
const Img = styled.span`
display:flex;
font-weight: bold;
${column && "flex-direction: column;text-align:center;"}
align-items: center;
& img{
@ -15,7 +16,6 @@ export default ({ url , name , column , id , login })=>{
${!column && `
& span{
margin-left:8px;
font-weight: bold;
}`
}
`;

View File

@ -6,6 +6,7 @@ import { AlignTop } from '../Component/layout';
import SelectBranch from '../Branch/Select';
import Nodata from '../Nodata';
import User from '../Component/User'
import Tree from './img/tree.png';
import axios from 'axios';
import {Link} from "react-router-dom";
@ -19,6 +20,12 @@ function returnbar(str){
}
return str;
}
function timeFormat(seconds) {
const time = new Date(seconds*1000);
return time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+(time.getHours()+1)+":"+time.getMinutes();
}
//代码库--提交页面
class CoderRootCommit extends Component{
constructor(props){
@ -36,8 +43,12 @@ class CoderRootCommit extends Component{
componentDidMount=()=>{
this.Init();
this.getBranchs();
// goBack
// addEventListener
}
// componentde
// 获取分支列表
getBranchs=()=>{
const { projectsId , owner } = this.props.match.params;
@ -90,7 +101,8 @@ class CoderRootCommit extends Component{
image_url:item.author && item.author.image_url,
sha:item.sha,
time_from_now:item.time_from_now,
message:item.message
message:item.message,
timestamp:item.timestamp
})
})
this.setState({
@ -116,6 +128,7 @@ class CoderRootCommit extends Component{
})
this.getCommitList(branchName , page , limit);
}
render(){
const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state;
const { projectDetail, commit_class , defaultBranch } = this.props;
@ -144,29 +157,25 @@ class CoderRootCommit extends Component{
<div className="commitList-item f-wrap-between">
<div>
<AlignTop>
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}`} className="commitDesc font-14 color-grey-3 font-bd">{item.message}</Link>
<div className="commitDesc"><Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}?page=${page}`} className="font-14 color-grey-3 font-bd">{item.message}</Link></div>
</AlignTop>
<p className="f-wrap-alignCenter mt15">
{
item.id ?
<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"/>:""}
<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>:
<span className="show-user-link">
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr8 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>
</span>
}
<User
id={item.id}
url={(item.image_url && getImageUrl(`/${item.image_url}`)) || "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
name={item.name}
login={item.login}
/>
{item.timestamp && <label className="font-14 color-grey-3 ml3">提交于 {timeFormat(item.timestamp)}</label>}
</p>
</div>
<div>
<div className="treecopy">
<div className="shadow">
<span className="treecopy-cont">
<div>
<span className="treecopy-cont shadow">
<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}`)}`}/>
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}?page=${page}`}>{truncateCommitId(`${item.sha}`)}</Link>
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`} disabled/>
</span>
<CopyTool beforeText="复制commit id" afterText="复制成功" inputId={`value${k}`}/>
</div>

View File

@ -4,11 +4,10 @@ import { Button ,Spin } from "antd";
import { truncateCommitId } from '../common/util';
import { getImageUrl } from 'educoder';
import Files from '../Merge/Files';
import Tree from "./img/tree.png";
import User from "../Component/User";
import axios from "axios";
import { Link } from "react-router-dom";
const Infos = styled.div`
border: 1px solid #FAFCFF;
@ -17,7 +16,7 @@ const Infos = styled.div`
background-color: #f1f8ff;
border: 1px solid rgba(42, 97, 255, 0.23);
border-radius: 3px 3px 0px 0px;
padding: 10px 8px 10px 16px;
padding: 10px 20px 10px 16px;
& .f-wrap-between{
align-items: center;
}
@ -32,22 +31,25 @@ const Infos = styled.div`
}
}
& > .f-wrap-between {
padding: 14px 8px 14px 16px;
padding: 14px 20px 14px 16px;
border-radius: 3px 3px 0px 0px;
border: 1px solid #D0D0D0;
.df{
align-items: center;
& .underline:hover{
text-decoration: underline;
}
}
}
`;
//
export default ({ match , history }) => {
export default (props) => {
const {match , history } = props;
const [data, setData] = useState({undefined});
const [commit, setCommit] = useState(undefined);
const [parents, setParents] = useState(undefined);
const [committer, setCommitter] = useState(undefined);
const [isSpin, setIsSpin] = useState(true);
const { sha , projectsId, owner, branchName } = match.params;
useEffect(() => {
if (projectsId && owner && sha) {
@ -68,6 +70,11 @@ export default ({ match , history }) => {
});
}
}, [projectsId , owner, sha]);
function timeFormat(seconds) {
const time = new Date(seconds*1000);
return time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+(time.getHours()+1)+":"+time.getMinutes();
}
return (
<div className="main" style={{padding:"0px",border:"none"}}>
@ -76,10 +83,10 @@ export default ({ match , history }) => {
<div className="commitinfos">
<div className="f-wrap-between">
<div>
{commit && commit.message &&
<pre className="task-hide">{commit.message}</pre>
}
<i className="iconfont icon-fenzhi2 font-18"></i>{branchName}
{commit && commit.message &&
<pre className="task-hide">{commit.message}</pre>
}
<Link to={`/${owner}/${projectsId}/tree/${branchName}`}><i className="iconfont icon-fenzhi2 font-18"></i>{branchName}</Link>
</div>
<Button type="primary" onClick={()=>{history.push(`/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`)}} className="btnblue" style={{height:"36px"}}>浏览文件</Button>
</div>
@ -87,10 +94,12 @@ export default ({ match , history }) => {
<div className="f-wrap-between" style={{ alignItems: "center" }}>
<ul className="df">
<User
id = {committer && committer.id}
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}
login={committer && committer.login}
/>
{commit && commit.time_from_now && <li className="ml4">提交于{commit.time_from_now}</li>}
{commit && commit.timestamp && <li className="ml4">提交于{timeFormat(commit.timestamp)}</li>}
</ul>
<li className="df">
{
@ -99,7 +108,7 @@ export default ({ match , history }) => {
<div className="ml40 f-wrap-alignCenter">
<label className="mr8">父节点</label>
<img src={Tree} alt="sha" width={"16px"} className="mr4"/>
<span>{truncateCommitId(item.sha)}</span>
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branchName}`} className="underline">{truncateCommitId(item.sha)}</Link>
</div>
)
})

View File

@ -5,15 +5,15 @@ import './version.scss';
function Empty({operation,addFunc}) {
return(
<div className="emptyPanel color-grey-3">
<i className="iconfont icon-banbenicon font-50 color-grey-6" style={{height:"50px",lineHeight:"50px",marginBottom:"13px"}}></i>
<span className="weight500 font-26 mb15">这里暂未发布过任何版本</span>
<i className="iconfont icon-banbenicon font-50 color-grey-3" style={{height:"50px",lineHeight:"50px",marginBottom:"13px"}}></i>
<span className="weight font-26 mb15">这里暂未发布过任何版本</span>
<span className="weight400" style={{textAlign:"center",lineHeight:"20px"}}>发行版功能基于仓库中的历史标记<br/>建议使用类似 V1.0 的版本标记作为发布点</span>
<div className="operation">
{
operation ?
<Button type={"primary"} onClick={addFunc} className="btnblue" style={{width:"118px",height:"36px"}}>发布新版本</Button>
:
<span className="color-grey-3 weight500 font-16">该项目暂时没有发布版本</span>
<span className="color-grey-3 weight font-16">该项目暂时没有发布版本</span>
}
</div>
</div>

View File

@ -130,7 +130,7 @@ export default Form.create()(
setBranch(params);
}
return (
<div className="df pt20">
<div className="df pt15">
<Form className="versionForm">
<div className="itemInline">
<Form.Item>
@ -211,18 +211,18 @@ export default Form.create()(
)}
</Form.Item>
<p className="pt20" style={{borderTop:"1px solid #eee"}}>
<Button onClick={submit} type="primary" className="mr30">
<Button onClick={submit} type="primary" className="mr30 btnblue">
{versionId ? "保存" : "创建"}发行版
</Button>
<Button
onClick={() =>history.push(`/${owner}/${projectsId}/releases`)}
style={{backgroundColor: "rgba(187,187,187,1)",color: "#fff"}}
onClick={() =>history.push(`/${owner}/${projectsId}/releases`)} className="btngrey"
// style={{backgroundColor: "rgba(187,187,187,1)",color: "#fff"}}
>取消</Button>
</p>
</Form>
<div className="versionTips">
<div className="infosTip">
<p className="font-16 mb15 weight500">标签命名建议</p>
<p className="font-16 mb14 weight">标签命名建议</p>
<p className="mb15">
通常的做法是在版本名称前加上字母 v 前缀 v1.0 或者 v2.3.4
</p>
@ -232,13 +232,13 @@ export default Form.create()(
</p>
</div>
<div className="infosTip">
<p className="font-16 mb15 weight500">语义化版本</p>
<p className="font-16 mb14 weight">语义化版本</p>
<p>
如果你是第一次发布版本我们强烈建议你阅读<a className="color-blue">语义化版本</a>
</p>
</div>
<div className="infosTip">
<p className="font-16 mb15 weight500">附件大小说明</p>
<p className="font-16 mb14 weight">附件大小说明</p>
<p>
单个附件不能超过 100MGVP 项目200M每个仓库总附件不可超过
1G推荐项目不可超过 5GGVP 项目不可超过

View File

@ -2,19 +2,24 @@ import React, { useEffect , useState } from "react";
import { Link } from 'react-router-dom';
import { Spin , Button } from 'antd';
import { getImageUrl } from 'educoder';
import {truncateCommitId} from '../../common/util';
import Empty from './Empty';
import './version.scss';
import axios from 'axios';
import Tree from '../img/tree-black.png';
import RenderHtml from '../../../components/render-html';
function version(props) {
console.log(props);
const [ data , setData ] = useState(undefined);
const [ releases , setReleases ] = useState(undefined);
const [ isSpin , setIsSpin ] = useState(true);
const { projectsId ,owner } = props.match.params;
const { isManager , isDeveloper } = props;
const { isManager, isDeveloper, location , user } = props;
const type = props.projectDetail && props.projectDetail.type;
const turnFromNew = location && location.query && location.query.turnFromNew;
const current_user_login = user && user.login;
owner && console.log(owner);
useEffect(()=>{
getIssueList();
},[])
@ -24,6 +29,9 @@ function version(props) {
axios.get(url).then((result) => {
if (result) {
setData(result.data);
const { releases = [] } = result.data;
//默认第一个展开body参数)
releases.length && (releases[0].bodyshow = true);
setReleases(result.data.releases);
setIsSpin(false);
}
@ -31,7 +39,6 @@ function version(props) {
console.log(error);
})
}
// 显示版本描述
function showBody(key,flag){
var lists = releases.concat();
@ -39,7 +46,67 @@ function version(props) {
lists.splice();
setReleases(lists);
}
//删除
function deleteRelease(releaseId) {
console.log(releaseId);
if(releaseId){
axios.delete(`/${owner}/${projectsId}/releases/${releaseId}.json`).then((result)=>{
if(result){
getIssueList();
}
})
}
}
function release(item,key){
return (
<div className="versionInfo" key={key}>
<span className="versionInfo_left">
<span className={`${item.draft === "稳定" ?"versionTag green":"versionTag orange"}`}>{item.draft}</span>
<span className="color-grey-3 mt15 font-12">
<i className="iconfont icon-biaoqianicon mr3 font-14"></i>
{item.tag_name}{item.draft === "预发行" ?"(standalone)":""}
</span>
<span className="color-grey-3 font-12">
<img src={Tree} width="16px" color="#333333" className="mr3"/>
{truncateCommitId(item.sha)}
</span>
</span>
<div className="versionInfo_right">
<div className="versionName">
<Link to={`/${owner}/${projectsId}/tree/${item.tag_name}`} className="task-hide color-blue hover font-18">发布{item.name}{item.draft === "预发行" ?"(standalone)版本":""}</Link>
<span>
{
(isManager || isDeveloper) && type !==2 &&
<Link to={`/${owner}/${projectsId}/releases/${item.version_id}/update`} className="ml15"><i className="iconfont icon-a-bianji1 font-16 color-grey-6"></i></Link>
}
{current_user_login == owner && <i className ="iconfont icon-shanchuicon1 font-16 ml15" onClick={()=>{deleteRelease(item.version_id)}}></i>}
</span>
</div>
<span className="color-grey-3 mb15">
<i className={`${item.bodyshow ? "iconfont icon-sanjiaoxing-down color-grey-8 mr3 font-14":"iconfont icon-triangle color-grey-8 mr3 font-14"}`} onClick={()=>showBody(key,item.bodyshow)}></i>
<img src={getImageUrl(item.image_url)} alt="" className="sendAuthorImg"/>
<span className="weight500">{item.user_name}</span>
<span className="ml5">发布于{item.created_at}</span>
</span>
{
item.bodyshow &&
<div className="body-show">
<RenderHtml className="break_word_comments imageLayerParent" value={item.body} url={props.history.location}/>
</div>
}
<RenderHtml />
<p className="versionFile">
<a href={item.tarball_url}><i className="iconfont icon-wenjian7 font-14 mr10 color-grey-3"></i>{item.tag_name}.TAR.gz</a>
<a href={item.zipball_url}><i className="iconfont icon-wenjian7 font-14 mr10 color-grey-3"></i>{item.tag_name}.ZIP</a>
</p>
{/* 发行版附件下载 */}
{item.attachments && item.attachments.map((item)=>{
return(<a href={`/${owner}/${projectsId}${item.url}`}><i className="iconfont icon-wenjian7 font-14 mr10 color-grey-3"></i>{item.title}</a>)
})}
</div>
</div>
)
}
function renderList(releases){
if (releases && releases.length > 0) {
return (
@ -51,47 +118,7 @@ function version(props) {
</div>
}
<div>
{
releases.map((item, key) => {
return (
<div className="versionInfo" key={key}>
<span className="versionInfo_left">
<span className={`${item.draft === "稳定" ?"versionTag green":"versionTag orange"}`}>{item.draft}</span>
<span className="color-grey-3 mt15">
<i className="iconfont icon-biaoqianicon mr3 font-14"></i>
{item.tag_name}{item.draft === "预发行" ?"(standalone)":""}
</span>
</span>
<div className="versionInfo_right">
<div className="versionName">
<Link to={`/${owner}/${projectsId}/tree/${item.tag_name}`} className="task-hide color-blue hover font-18">发布{item.name}{item.draft === "预发行" ?"(standalone)版本":""}</Link>
{
(isManager || isDeveloper) && type !==2 &&
<Link to={`/${owner}/${projectsId}/releases/${item.version_id}/update`} className="ml15"><i className="iconfont icon-a-bianji1 font-16 color-grey-6"></i></Link>
}
</div>
<span className="color-grey-3 mb15">
<i className={`${item.bodyshow ? "iconfont icon-sanjiaoxing-down color-grey-8 mr3 font-14":"iconfont icon-triangle color-grey-8 mr3 font-14"}`} onClick={()=>showBody(key,item.bodyshow)}></i>
<img src={getImageUrl(item.image_url)} alt="" className="sendAuthorImg"/>
<span className="weight500">{item.user_name}</span>
<span className="ml5">发布于{item.created_at}</span>
</span>
{
item.bodyshow &&
<div className="padding10">
<RenderHtml className="break_word_comments imageLayerParent" value={item.body} url={props.history.location}/>
</div>
}
<RenderHtml />
<p className="versionFile">
<a href={item.tarball_url}><i className="iconfont icon-tar font-14 mr10 color-grey-3"></i>{item.tag_name}.TAR.gz</a>
<a href={item.zipball_url}><i className="iconfont icon-icon font-14 mr10 color-grey-3"></i>{item.tag_name}.ZIP</a>
</p>
</div>
</div>
)
})
}
{!turnFromNew ? releases.map((item, key) => release(item,key)) : release(releases[0],0)}
</div>
</React.Fragment>
)

View File

@ -42,7 +42,7 @@
content: '';
width: 8px;
height: 8px;
background-color: #5091FF;
background-color: #466AFF;
border-radius: 50%;
}
.sendAuthorImg{
@ -51,6 +51,9 @@
border-radius: 50%;
margin-right: 5px;
}
.body-show{
padding: 5px 10px 10px 10px;
}
}
.versionTag{
display: inline;
@ -242,6 +245,9 @@
flex:1;
padding-right: 40px;
box-sizing: border-box;
.ant-select-auto-complete.ant-select .ant-input:hover,.ant-input:hover {
border-color: rgba(153, 153, 153, 0.8);
}
}
.versionTips{
width:268px;
@ -298,7 +304,7 @@
position: relative;
&>p{
position: absolute;
bottom: 0px;
bottom: -5px;
}
}
.itemInline .ant-row{

View File

@ -10,6 +10,7 @@ const {Link} =Anchor;
function Files({data,history,owner,projectsId}){
const [ files , setFiles ] = useState(data && data.files);
const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径");
const [ isOpen, setIsOpen] = useState(false);
useEffect(()=>{
if(data){
@ -38,15 +39,14 @@ function Files({data,history,owner,projectsId}){
}
const folderOpen = (
<Anchor showInkInFixed={false}>
<div className="folderList">
{files && files.length>1 && files.map((item, key) => {
<div className="folders">
<div className="folderList">
{files && files.map((item, key) => {
return (
<Link href={`#value${key}`} title=
{<FlexAJ className="filesInfo" key={key} onClick={() => {item.flag && showDown(item.flag, key, item.isBin);}}>
<a href={`#value${key}`}>
<FlexAJ className="filesInfo" key={key} onClick={() => {item.flag && showDown(item.flag, key, item.isBin);setIsOpen(false);}}>
<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">
@ -56,26 +56,27 @@ function Files({data,history,owner,projectsId}){
{item.deletion >0 && <span className="color-red ml10">-{item.deletion}</span>}
</Tooltip>
</div>
</FlexAJ>}
/>
</FlexAJ>
</a>
)
})}
</div>
</Anchor>
</div>
)
return(
<div>
<AlignCenter className="color-grey-9 pb10">
<i className="iconfont icon-triangle mr5 font-16"></i>
<Popover content={folderOpen} placement="bottomLeft" className="popover-file">
<span className="color-grey-6" style={{cursor:"pointer"}}>
<AlignCenter className="color-grey-9" style={{position:'relative'}}>
<div onClick={()=>{setIsOpen(!isOpen)}}>
<i className={`iconfont mr5 ${isOpen? "font-18 icon-sanjiaoxing-down":"font-16 icon-triangle"}`}></i>
<span className="color-grey-6 update-file-count">
共有<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 && data.total_deletion ? " 和 ":""}
{ data && data.total_deletion ? <span className="color-red"> {data && data.total_deletion} 次删除</span>:""}
</span>
</Popover>
</div>
{isOpen && folderOpen}
</AlignCenter>
{
files && files.length>0 &&
@ -83,10 +84,11 @@ function Files({data,history,owner,projectsId}){
{
files.map((item,key)=>{
return(
<div className="files" key={key} id= {`value${key}`}>
<div className="files" key={key}>
<a id= {`value${key}`} className="anchorPoint"></a>
<FlexAJ className="filesInfo">
<AlignCenter>
{!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>:""}
{!item.isBin ? <i className={!item.flag?"iconfont icon-sanjiaoxing-down color-grey-9 mt4":"iconfont icon-triangle font-15 color-grey-9"} onClick={()=>showDown(item.flag,key,item.isBin)}></i>:""}
<span className="cursor-pointer" data-clipboard-text={item.name} onClick={()=>showDown(item.flag,key,item.isBin)}>{item.name}</span>
<Tooltip
title={copyfileTipTitle}

View File

@ -19,28 +19,36 @@
border:1px solid #FA6400;
color: #FA6400;
}
.color-grey-3{
font-weight: bold;
}
.invisable{
display: none;
.update-file-count{
cursor: pointer;
& .color-grey-3{
font-weight: bold;
}
}
.fileList{
.sc-bxivhb{
width: 55rem;
overflow: hidden;
white-space: normal;
word-break: break-all;
}
.see-file{
width: 15rem;
width: 14rem;
.ml10{
display: inline-block;
width: 5rem;
width: 4.5rem;
cursor: default;
}
span{
width: 7%;
}
}
.anchorPoint{
position: relative;
top: -5rem;
display: block;
height: 0;
}
}
.filesInfo{
background: #FAFCFF;
@ -52,28 +60,28 @@
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{
.folders,.ant-anchor{
margin-left: 0;
padding-left: 0;
}
.ant-anchor-link-active > .ant-anchor-link-title {
color: #466AFF;
}
.ant-popover-inner-content{
.folders{
position: absolute;
z-index: 2;
left: 0px;
top: 37px;
color: #333333;
width: 75rem;
box-shadow: 0px 4px 8px 2px rgba(212, 212, 212, 0.5);
border-radius: 4px;
border: 1px solid rgba(153, 153, 153, 0.32);
.ant-anchor-link-active > .ant-anchor-link-title {
color: #466AFF;
}
.ant-anchor-link {
padding: 0px;
}
.folderList{
max-height: 280px;
max-height: 275px;
overflow:auto;
.files{
border: 0px;

View File

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

View File

@ -109,7 +109,7 @@ class Index extends Component {
:
<Dragger {...upload} className={className}>
{icon || <Icon type="inbox" />}
<p className="ant-upload-text font-14">拖动文件或点击此处上传</p>
<p className="ant-upload-text font-16 color-grey-3">拖动文件或点击此处上传</p>
</Dragger>
)
}

View File

@ -88,12 +88,18 @@ ul,ol,dl{
display: flex;
flex-wrap: wrap;
align-items: center;
&>span, & a:link, a:visited{
color: #333;
}
&>span{
cursor: default;
}
}
.commitDesc{
flex:1;
line-height:20px;
word-break: break-all;
width: 48rem;
width: 49rem;
overflow: hidden;
white-space: normal;
&:hover{
@ -327,4 +333,13 @@ button.ant-btn-primary.btnblue{
background-color:rgba(70, 106, 255, 0.85);
border-color:rgba(70, 106, 255, 0.85);
}
}
button.btngrey{
background-color:#FFFFFF;
border-color:#D0D0D0;
color: #666666;
&:hover,&:focus{
border-color:rgba(153, 153, 153, 0.5);
color: #666666;
}
}