Merge pull request '代码库二级页面改版-测试-提交,发行版' (#36) from durian/forgeplus-react:feature_repo_second_page_xiesi into feature_repo_second_page
This commit is contained in:
commit
28bc235b0b
|
@ -125,7 +125,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node --max_old_space_size=15360 scripts/start.js",
|
"start": "node --max_old_space_size=15360 scripts/start.js",
|
||||||
"build": "cross-env 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",
|
"test-build": "cross-env 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",
|
"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",
|
"gen_stats": "NODE_ENV=production webpack --profile --config=./config/webpack.config.prod.js --json > stats.json",
|
||||||
"ana": "webpack-bundle-analyzer ./stats.json",
|
"ana": "webpack-bundle-analyzer ./stats.json",
|
||||||
|
|
|
@ -29,12 +29,12 @@ function timeFormat(seconds) {
|
||||||
//代码库--提交页面
|
//代码库--提交页面
|
||||||
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:10,
|
limit:10,
|
||||||
page:1,
|
page: 1,
|
||||||
isSpining:false,
|
isSpining:false,
|
||||||
branchList:undefined
|
branchList:undefined
|
||||||
}
|
}
|
||||||
|
@ -43,12 +43,8 @@ class CoderRootCommit extends Component{
|
||||||
componentDidMount=()=>{
|
componentDidMount=()=>{
|
||||||
this.Init();
|
this.Init();
|
||||||
this.getBranchs();
|
this.getBranchs();
|
||||||
// goBack
|
|
||||||
// addEventListener
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// componentde
|
|
||||||
|
|
||||||
// 获取分支列表
|
// 获取分支列表
|
||||||
getBranchs=()=>{
|
getBranchs=()=>{
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
|
@ -157,7 +153,7 @@ class CoderRootCommit extends Component{
|
||||||
<div className="commitList-item f-wrap-between">
|
<div className="commitList-item f-wrap-between">
|
||||||
<div>
|
<div>
|
||||||
<AlignTop>
|
<AlignTop>
|
||||||
<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>
|
<div className="commitDesc"><Link to={{pathname:`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}`,query:{page:page}}} className="font-14 color-grey-3 font-bd">{item.message}</Link></div>
|
||||||
</AlignTop>
|
</AlignTop>
|
||||||
<p className="f-wrap-alignCenter mt15">
|
<p className="f-wrap-alignCenter mt15">
|
||||||
<User
|
<User
|
||||||
|
@ -174,7 +170,7 @@ class CoderRootCommit extends Component{
|
||||||
<div>
|
<div>
|
||||||
<span className="treecopy-cont shadow">
|
<span className="treecopy-cont shadow">
|
||||||
<img src={Tree} alt="sha" width={"16px"}/>
|
<img src={Tree} alt="sha" width={"16px"}/>
|
||||||
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}?page=${page}`}>{truncateCommitId(`${item.sha}`)}</Link>
|
<Link to={{pathname:`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}`,query:{page:page}}}>{truncateCommitId(`${item.sha}`)}</Link>
|
||||||
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`} disabled/>
|
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`} disabled/>
|
||||||
</span>
|
</span>
|
||||||
<CopyTool beforeText="复制commit id" afterText="复制成功" inputId={`value${k}`}/>
|
<CopyTool beforeText="复制commit id" afterText="复制成功" inputId={`value${k}`}/>
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 631 B |
|
@ -100,9 +100,12 @@ function version(props) {
|
||||||
<a href={item.zipball_url}><i className="iconfont icon-wenjian7 font-14 mr10 color-grey-3"></i>{item.tag_name}.ZIP</a>
|
<a href={item.zipball_url}><i className="iconfont icon-wenjian7 font-14 mr10 color-grey-3"></i>{item.tag_name}.ZIP</a>
|
||||||
</p>
|
</p>
|
||||||
{/* 发行版附件下载 */}
|
{/* 发行版附件下载 */}
|
||||||
|
{/* {item.attachments.length !=0 && <p className="versionFile">
|
||||||
|
<span>附件:</span> */}
|
||||||
{item.attachments && item.attachments.map((item)=>{
|
{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>)
|
return(<Link to={`${item.url}`}><i className="iconfont icon-wenjian7 font-14 mr10 color-grey-3"></i>{item.title}</Link>)
|
||||||
})}
|
})}
|
||||||
|
{/* </p>} */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
import React ,{useEffect,useState } from 'react';
|
import React ,{useEffect,useRef,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, Tooltip,Progress, Popover, Anchor } from 'antd';
|
import { Button, Tooltip,Progress, Popover, Anchor } from 'antd';
|
||||||
import './merge.css';
|
import './merge.css';
|
||||||
import './Index.scss';
|
import './Index.scss';
|
||||||
|
|
||||||
const {Link} =Anchor;
|
function Files(props){
|
||||||
|
const { data,history,owner,projectsId } = props;
|
||||||
function Files({data,history,owner,projectsId}){
|
|
||||||
const [ files , setFiles ] = useState(data && data.files);
|
const [ files , setFiles ] = useState(data && data.files);
|
||||||
const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径");
|
const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径");
|
||||||
const [ isOpen, setIsOpen] = useState(false);
|
const [ isOpen, setIsOpen] = useState(false);
|
||||||
|
const commitPage = history && history.location && history.location.query && history.location.query.page;
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(data){
|
if(data){
|
||||||
setFiles(data.files);
|
setFiles(data.files);
|
||||||
}
|
}
|
||||||
},[data])
|
},[data]);
|
||||||
|
|
||||||
function showDown(flag,index,isBin){
|
function showDown(flag,index,isBin){
|
||||||
if(!isBin){
|
if(!isBin){
|
||||||
|
|
Loading…
Reference in New Issue