Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into pre_develop_dev

This commit is contained in:
caishi 2021-10-11 18:12:00 +08:00
commit 7a50c73040
4 changed files with 25 additions and 6 deletions

View File

@ -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 &&

View File

@ -6,6 +6,7 @@ import { getImageUrl } from 'educoder';
import Files from '../Merge/Files'; import Files from '../Merge/Files';
import Tree from "./img/tree.png"; import Tree from "./img/tree.png";
import User from "../Component/User"; import User from "../Component/User";
import RenderHtml from "../../components/render-html";
import axios from "axios"; import axios from "axios";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
@ -85,7 +86,7 @@ export default (props) => {
<div className="f-wrap-between"> <div className="f-wrap-between">
<div> <div>
{commit && commit.message && {commit && commit.message &&
<div dangerouslySetInnerHTML={{__html:commit.message.replaceAll('\n\n','<br/>').replaceAll('\n\r','<br/>').replaceAll('\n','<br/>')}} className="task-hide"></div> <RenderHtml className="task-hide" value={commit.message} url={history.location} />
} }
<Link to={`/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`}><i className="iconfont icon-fenzhi2 font-18"></i>{data.branch}</Link> <Link to={`/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`}><i className="iconfont icon-fenzhi2 font-18"></i>{data.branch}</Link>
</div> </div>

View File

@ -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>
) )
} }

View File

@ -32,4 +32,11 @@
} }
} }
} }
}
.tagSpin{
min-height: 300px;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
} }