Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into pre_develop_dev
This commit is contained in:
commit
208c1de930
|
@ -27,6 +27,7 @@ class CoderRootFileDetail extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount = () => {
|
componentDidMount = () => {
|
||||||
|
window.scrollTo(0, 0);
|
||||||
const { detail , mdFlag } = this.props;
|
const { detail , mdFlag } = this.props;
|
||||||
this.setState({
|
this.setState({
|
||||||
value: detail.content,
|
value: detail.content,
|
||||||
|
@ -214,7 +215,7 @@ class CoderRootFileDetail extends Component {
|
||||||
const Option = Select.Option;
|
const Option = Select.Option;
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Anchor className="griditemAnchor" offsetTop={70} targetOffset={160}>
|
<Anchor className="griditemAnchor" offsetTop={70}>
|
||||||
<div className="griditemCate">
|
<div className="griditemCate">
|
||||||
{
|
{
|
||||||
md && readOnly &&
|
md && readOnly &&
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { Route , Switch } from 'react-router-dom';
|
||||||
// import Top from './DetailTop';
|
// import Top from './DetailTop';
|
||||||
import Loadable from 'react-loadable';
|
import Loadable from 'react-loadable';
|
||||||
import Loading from '../../Loading';
|
import Loading from '../../Loading';
|
||||||
import axios from 'axios';
|
|
||||||
import './Index.scss';
|
import './Index.scss';
|
||||||
|
|
||||||
const FileNew = Loadable({
|
const FileNew = Loadable({
|
||||||
|
@ -51,37 +50,37 @@ class CoderRootIndex extends Component{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount=()=>{
|
// componentDidMount=()=>{
|
||||||
this.Init();
|
// this.Init();
|
||||||
}
|
// }
|
||||||
componentDidUpdate=(prevProps)=>{
|
// componentDidUpdate=(prevProps)=>{
|
||||||
const { location } = this.props;
|
// const { location } = this.props;
|
||||||
const prevlocation = prevProps && prevProps.location;
|
// const prevlocation = prevProps && prevProps.location;
|
||||||
if (location !== prevlocation) {
|
// if (location !== prevlocation) {
|
||||||
this.Init();
|
// this.Init();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
Init=()=>{
|
// Init=()=>{
|
||||||
const { branchName } = this.props.match.params;
|
// const { branchName } = this.props.match.params;
|
||||||
const { defaultBranch } = this.props;
|
// const { defaultBranch } = this.props;
|
||||||
this.getTopCount(branchName || defaultBranch);
|
// this.getTopCount(branchName || defaultBranch);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 获取<Top />组件里要显示的数据
|
// 获取<Top />组件里要显示的数据
|
||||||
getTopCount=(branch)=>{
|
// getTopCount=(branch)=>{
|
||||||
const { projectsId , owner } = this.props.match.params;
|
// const { projectsId , owner } = this.props.match.params;
|
||||||
const url = `/${owner}/${projectsId}/top_counts.json`;
|
// const url = `/${owner}/${projectsId}/top_counts.json`;
|
||||||
axios.get(url,{params:{
|
// axios.get(url,{params:{
|
||||||
ref:branch
|
// ref:branch
|
||||||
}}).then(result=>{
|
// }}).then(result=>{
|
||||||
if(result){
|
// if(result){
|
||||||
this.setState({
|
// this.setState({
|
||||||
coderCount:result.data
|
// coderCount:result.data
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
}).catch(error=>{console.log(error);})
|
// }).catch(error=>{console.log(error);})
|
||||||
}
|
// }
|
||||||
render(){
|
render(){
|
||||||
return(
|
return(
|
||||||
<div className="coderSubPage">
|
<div className="coderSubPage">
|
||||||
|
@ -100,12 +99,12 @@ class CoderRootIndex extends Component{
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/:owner/:projectsId/:branch/newfile"
|
<Route path="/:owner/:projectsId/:branch/newfile"
|
||||||
render={
|
render={
|
||||||
(props) => (<FileNew {...this.props} {...props} {...this.state} getTopCount={this.getTopCount} />)
|
(props) => (<FileNew {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/:owner/:projectsId/commits/branch/:branchName"
|
<Route path="/:owner/:projectsId/commits/branch/:branchName"
|
||||||
render={
|
render={
|
||||||
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/:owner/:projectsId/commits/:sha"
|
<Route path="/:owner/:projectsId/commits/:sha"
|
||||||
|
@ -115,7 +114,7 @@ class CoderRootIndex extends Component{
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/:owner/:projectsId/commits"
|
<Route path="/:owner/:projectsId/commits"
|
||||||
render={
|
render={
|
||||||
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* <Route path="/:owner/:projectsId/releases/:versionId/update"
|
{/* <Route path="/:owner/:projectsId/releases/:versionId/update"
|
||||||
|
|
|
@ -224,7 +224,7 @@
|
||||||
height: 8px;
|
height: 8px;
|
||||||
width: 8px;
|
width: 8px;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
top:10px
|
top:8px;
|
||||||
}
|
}
|
||||||
&>span{
|
&>span{
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
import React,{ useEffect , useState } from 'react';
|
import React,{ useEffect , useState } from 'react';
|
||||||
import SubMenu from '../sub/SubMenu';
|
import SubMenu from '../sub/SubMenu';
|
||||||
import { Table , Tooltip } from 'antd';
|
import { Table , Tooltip , Spin } from 'antd';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { truncateCommitId } from '../../common/util';
|
import { truncateCommitId } from '../../common/util';
|
||||||
import './Index.scss';
|
import './Index.scss';
|
||||||
import Tree from '../img/tree.png'
|
import Tree from '../img/tree.png'
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import Loading from '../../../Loading';
|
|
||||||
|
|
||||||
function Tags(props) {
|
function Tags(props) {
|
||||||
|
|
||||||
const [ source , setSource ] = useState([]);
|
const [ source , setSource ] = useState([]);
|
||||||
|
const [ isSpin , setIsSpin ] = useState(true);
|
||||||
|
|
||||||
const { projectsId , owner } = props.match.params;
|
const { projectsId , owner } = props.match.params;
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ function Tags(props) {
|
||||||
axios.get(url).then((result) => {
|
axios.get(url).then((result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
setSource(result.data);
|
setSource(result.data);
|
||||||
|
setIsSpin(false);
|
||||||
}
|
}
|
||||||
}).catch(error => {})
|
}).catch(error => {})
|
||||||
}
|
}
|
||||||
|
@ -83,7 +84,6 @@ function Tags(props) {
|
||||||
render:(txt,item)=>{
|
render:(txt,item)=>{
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<a href={`${item.tarball_url}`} download className="btn-83">
|
<a href={`${item.tarball_url}`} download className="btn-83">
|
||||||
<i className="iconfont icon-xiazai-icon font-16 mr5"></i>TAR
|
<i className="iconfont icon-xiazai-icon font-16 mr5"></i>TAR
|
||||||
</a>
|
</a>
|
||||||
|
@ -98,7 +98,17 @@ function Tags(props) {
|
||||||
return(
|
return(
|
||||||
<div>
|
<div>
|
||||||
<SubMenu tab={"tags"} projectsId={projectsId} owner={owner}/>
|
<SubMenu tab={"tags"} projectsId={projectsId} owner={owner}/>
|
||||||
<Table className="tagTable" dataSource={source} columns={columns} pagination={false}></Table>
|
{
|
||||||
|
source && source.length > 0 ?
|
||||||
|
|
||||||
|
<Table
|
||||||
|
className="tagTable"
|
||||||
|
dataSource={source} columns={columns} pagination={false}></Table>
|
||||||
|
:
|
||||||
|
<div className="tagSpin">
|
||||||
|
<Spin spinning={isSpin}/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,4 +32,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.tagSpin{
|
||||||
|
min-height: 300px;
|
||||||
|
text-align: center;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
|
@ -83,8 +83,7 @@ class UserSubmitComponent extends Component {
|
||||||
if (result.data && result.data.name) {
|
if (result.data && result.data.name) {
|
||||||
this.props.showNotification("文件新建成功!");
|
this.props.showNotification("文件新建成功!");
|
||||||
if(submitType === "1"){
|
if(submitType === "1"){
|
||||||
const { getTopCount , getDetail } = this.props;
|
const { getDetail } = this.props;
|
||||||
getTopCount && getTopCount(values.branchname);
|
|
||||||
getDetail && getDetail();
|
getDetail && getDetail();
|
||||||
}
|
}
|
||||||
let url = `/${owner}/${projectsId}${values.branchname ? `/tree/${turnbar(values.branchname)}`: (branch ? `/tree/${turnbar(branch)}` : "")}`;
|
let url = `/${owner}/${projectsId}${values.branchname ? `/tree/${turnbar(values.branchname)}`: (branch ? `/tree/${turnbar(branch)}` : "")}`;
|
||||||
|
|
Loading…
Reference in New Issue