:
diff --git a/src/forge/Main/CoderRootIndex.js b/src/forge/Main/CoderRootIndex.js
index 0fb30c4e..7ff25dae 100644
--- a/src/forge/Main/CoderRootIndex.js
+++ b/src/forge/Main/CoderRootIndex.js
@@ -1,9 +1,9 @@
import React , { Component } from 'react';
import { Route , Switch } from 'react-router-dom';
-import Top from './DetailTop';
+// import Top from './DetailTop';
import Loadable from 'react-loadable';
import Loading from '../../Loading';
-import axios from 'axios';
+import './Index.scss';
const FileNew = Loadable({
loader: () => import('../Newfile/Index'),
@@ -18,25 +18,25 @@ const CoderRootCommit = Loadable({
loading: Loading,
})
const CoderRootBranch = Loadable({
- loader: () => import('./CoderRootBranch'),
+ loader: () => import('./tree/Index'),
loading: Loading,
})
const CoderRootTag = Loadable({
- loader: () => import('./CoderRootTag'),
+ loader: () => import('./tag/Index'),
loading: Loading,
})
const CoderRootVersion = Loadable({
- loader: () => import('../Version/version'),
- loading: Loading,
-})
-const CoderRootVersionNew = Loadable({
- loader: () => import('../Version/New'),
- loading: Loading,
-})
-const CoderRootVersionUpdate = Loadable({
- loader: () => import('../Version/New'),
+ loader: () => import('./version/Index'),
loading: Loading,
})
+// const CoderRootVersionNew = Loadable({
+// loader: () => import('./version/New'),
+// loading: Loading,
+// })
+// const CoderRootVersionUpdate = Loadable({
+// loader: () => import('./version/New'),
+// loading: Loading,
+// })
const Diff = Loadable({
loader: () => import('./Diff'),
loading: Loading,
@@ -50,41 +50,41 @@ class CoderRootIndex extends Component{
}
}
- componentDidMount=()=>{
- this.Init();
- }
- componentDidUpdate=(prevProps)=>{
- const { location } = this.props;
- const prevlocation = prevProps && prevProps.location;
- if (location !== prevlocation) {
- this.Init();
- }
- }
+ // componentDidMount=()=>{
+ // this.Init();
+ // }
+ // componentDidUpdate=(prevProps)=>{
+ // const { location } = this.props;
+ // const prevlocation = prevProps && prevProps.location;
+ // if (location !== prevlocation) {
+ // this.Init();
+ // }
+ // }
- Init=()=>{
- const { branchName } = this.props.match.params;
- const { defaultBranch } = this.props;
- this.getTopCount(branchName || defaultBranch);
- }
+ // Init=()=>{
+ // const { branchName } = this.props.match.params;
+ // const { defaultBranch } = this.props;
+ // this.getTopCount(branchName || defaultBranch);
+ // }
// 获取
组件里要显示的数据
- getTopCount=(branch)=>{
- const { projectsId , owner } = this.props.match.params;
- const url = `/${owner}/${projectsId}/top_counts.json`;
- axios.get(url,{params:{
- ref:branch
- }}).then(result=>{
- if(result){
- this.setState({
- coderCount:result.data
- })
- }
- }).catch(error=>{console.log(error);})
- }
+ // getTopCount=(branch)=>{
+ // const { projectsId , owner } = this.props.match.params;
+ // const url = `/${owner}/${projectsId}/top_counts.json`;
+ // axios.get(url,{params:{
+ // ref:branch
+ // }}).then(result=>{
+ // if(result){
+ // this.setState({
+ // coderCount:result.data
+ // })
+ // }
+ // }).catch(error=>{console.log(error);})
+ // }
render(){
return(
-
-
+
+ {/*
*/}
{/* 新建文件 */}
()
+ (props) => ()
}
>
()
+ () => ()
}
>
()
+ () => ()
}
>
- ()
}
@@ -126,7 +126,7 @@ class CoderRootIndex extends Component{
render={
() => ()
}
- >
+ > */}
()
diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js
index a1a74149..4e1c241b 100644
--- a/src/forge/Main/Detail.js
+++ b/src/forge/Main/Detail.js
@@ -681,18 +681,19 @@ class Detail extends Component {
(props) => ()
}
>
- {/* 修改详情 */}
- ()
}
>
- {/* 复制详情 */}
+ {/* 复制详情 copyetail*/}
()
+ (props) => ()
}
>
+
{/* 任务详情 */}
.f-wrap-between {
- padding: 10px 20px;
+ 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 }) => {
+function turnbar(str){
+ if(str && str.length>0 && str.indexOf("/")>-1){
+ return str.replaceAll('/','%2F');
+ }
+ return str;
+}
+//提交详情页
+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 } = match.params;
useEffect(() => {
if (projectsId && owner && sha) {
@@ -43,6 +73,7 @@ export default ({ match , history }) => {
setParents(result.data.parents);
setCommitter(result.data.committer || (result.data.commit && result.data.commit.committer));
setIsSpin(false);
+
}
})
.catch(error => {
@@ -56,29 +87,42 @@ export default ({ match , history }) => {
- {commit && commit.message &&
-
{commit.message}
- }
-
+
+ {commit && commit.message &&
+
+ }
+ {data.branch}
+
+
- {committer && committer.time_from_now && - {committer.time_from_now}
}
+ {commit && commit.timestamp && - 提交于{timeFormat(commit.timestamp)}
}
{
parents && parents.length > 0 && parents.map((item,key)=>{
return(
-
+
+
+

+
{truncateCommitId(item.sha)}
+
)
})
}
-
+
+
+

+
{truncateCommitId(sha)}
+
@@ -87,6 +131,7 @@ export default ({ match , history }) => {
data={data}
owner={owner}
projectsId={projectsId}
+ parentsSha={parents && parents.length > 0 && parents[0].sha}
/>
diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss
index 1158c38e..4ec6a7cb 100644
--- a/src/forge/Main/Index.scss
+++ b/src/forge/Main/Index.scss
@@ -189,13 +189,13 @@
flex-wrap: wrap;
padding-bottom: 2px;
a{
- margin: 0px 17px 0px 0px;
+ margin: 0px 17px 10px 0px;
img{
border-radius: 50%;
width: 40px;
height: 40px;
}
- &:nth-child(6){
+ &:nth-child(5n){
margin-right: 0px;
}
}
@@ -224,7 +224,7 @@
height: 8px;
width: 8px;
left: 0px;
- top:10px
+ top:8px;
}
&>span{
padding-left: 15px;
@@ -252,8 +252,14 @@
border: 1px solid rgba(42, 97, 255, 0.23);
background-color: #FAFCFF;
.ellipsistxt{
- margin-top: 6px;
- cursor: pointer;
+ &:hover .markdown-body{
+ color: #466AFF;
+ & a{
+ color: #466AFF;
+ }
+ }
+ margin-top: 2px;
+ // cursor: pointer;
#ptxt{
margin-bottom: 0px;
word-break: break-all;
@@ -263,6 +269,27 @@
white-space:-pre-wrap; /* Opera 4-6 */
white-space:-o-pre-wrap; /* Opera 7 */
word-wrap:break-word;
+ .markdown-body{
+ line-height: 10px;
+ font-size: 14px;
+ & p {
+ margin: 1px 0px 0px !important;
+ font-size: 14px !important;
+ }
+ & ol,ul{
+ padding-bottom: 3px;
+ & li{
+ min-height: 18px;
+ }
+ }
+ & table{
+ line-height: 1;
+ background: #FAFCFF;
+ }
+ &:first-child {
+ margin-top: -1px !important;
+ }
+ }
}
margin-left: 13px;
line-height:18px;
@@ -270,7 +297,7 @@
width: 0;
color: #666;
&.hidetxt{
- height: 18px;
+ height: 24px;
overflow: hidden;
position: relative;
padding-right:8px;
@@ -402,6 +429,16 @@
cursor: pointer;
background: #FAFBFC;
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;
font-size: 15px;
font-weight: normal;
@@ -447,4 +484,28 @@
.ant-anchor-ink::before{
background-color: #fff;
}
+}
+.coderSubPage{
+ width: 1200px;
+ margin:0px auto;
+}
+.griditemAnchor{
+ margin-left: 0px;
+ padding: 0px;
+ border-bottom: 1px solid #ddd;
+ .ant-anchor{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 10px 20px;
+ }
+ .griditemCate{
+ color: #333;
+ font-size: 16px;
+ display: flex;
+ align-items: center;
+ .catelogue{
+ margin-left: 0px;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/forge/Main/img/tree-black.png b/src/forge/Main/img/tree-black.png
new file mode 100644
index 00000000..02aa71c3
Binary files /dev/null and b/src/forge/Main/img/tree-black.png differ
diff --git a/src/forge/Main/img/tree.png b/src/forge/Main/img/tree.png
new file mode 100644
index 00000000..56247256
Binary files /dev/null and b/src/forge/Main/img/tree.png differ
diff --git a/src/forge/Main/list.scss b/src/forge/Main/list.scss
index 72c3437e..83b4d5ee 100644
--- a/src/forge/Main/list.scss
+++ b/src/forge/Main/list.scss
@@ -426,14 +426,15 @@
border-right: none;
}
.gitAddressClone > input{
- border:none;
outline: none;
- padding:0px 8px;
- height: 40px;
- line-height: 40px;
- border-radius: 0px;
- border: 1px solid #eee;
- flex:1;
+ padding: 0px 8px;
+ height: 38px;
+ line-height: 38px;
+ border: none!important;
+ border-right: 1px solid #eee!important;
+ border-radius: 4px 0px 0px 4px;
+ flex: 1;
+ max-width: 249px;
}
.wrap-commit-table .ant-table-small > .ant-table-content > .ant-table-body{
margin:0px;
@@ -574,6 +575,9 @@
border:1px solid #ddd;
margin-top: 18px;
border-radius: 4px;
+ .ant-anchor-wrapper{
+ overflow: unset!important;
+ }
}
.commonBox .commonBox-title{
padding:0px 20px;
@@ -718,12 +722,82 @@ a.color-grey-ccc:hover{
padding:0px 30px;
min-height: 400px;
}
-.commitList > div{
- border-bottom: 1px solid #EEEEEE;
- padding:16px 0px;
-}
-.commitList > div:last-child{
- border-bottom: none;
+
+.main{
+ margin: 30px auto;
+ .ant-timeline{
+ margin-top: 28px;
+ .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;
+ & .markdown-body table{
+ background: #FAFCFF;
+ }
+ &: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);
+ }
+ & .markdown-body table{
+ background: #EEF6FF;
+ }
+ }
+ .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;
+ }
+ }
}
diff --git a/src/forge/Main/sub/ReadmeCatelogue.jsx b/src/forge/Main/sub/ReadmeCatelogue.jsx
index d1e018bb..6dab7d79 100644
--- a/src/forge/Main/sub/ReadmeCatelogue.jsx
+++ b/src/forge/Main/sub/ReadmeCatelogue.jsx
@@ -1,7 +1,7 @@
-import React , { useState , useEffect } from 'react';
+import React , { useState } from 'react';
import { Anchor , Input } from 'antd';
import './sub.scss';
-import { Base64 } from 'js-base64';
+import { useEffect } from 'react';
const { Link } = Anchor;
@@ -18,7 +18,7 @@ function ReadmeCatelogue({ menuList , hash }) {
function changeValue(e) {
setValue(e.target.value);
if(e.target.value){
- let m = menuList.filter(i=>i.text.indexOf(e.target.value)>-1);
+ let m = menuList.filter(i=>i.text.toLowerCase().indexOf(e.target.value.toLowerCase())>-1);
setMenu(m);
}else{
setMenu(menuList);
diff --git a/src/forge/Main/sub/SubMenu.jsx b/src/forge/Main/sub/SubMenu.jsx
new file mode 100644
index 00000000..78f37b4d
--- /dev/null
+++ b/src/forge/Main/sub/SubMenu.jsx
@@ -0,0 +1,13 @@
+import React from 'react';
+import { Link } from 'react-router-dom';
+import'./sub.scss'
+
+function SubMenu({tab,owner,projectsId}) {
+ return(
+
+ )
+}
+export default SubMenu;
\ No newline at end of file
diff --git a/src/forge/Main/sub/sub.scss b/src/forge/Main/sub/sub.scss
index 4e6a3d8a..7716f0c5 100644
--- a/src/forge/Main/sub/sub.scss
+++ b/src/forge/Main/sub/sub.scss
@@ -64,4 +64,28 @@
background-color: #fff;
}
}
+}
+.subMenu{
+ display: flex;
+ padding-top: 30px;
+ a{
+ width: 83px;
+ font-weight: 500;
+ line-height: 30px;
+ height: 32px;
+ color: #333333!important;
+ text-align: center;
+ border: 1px solid #D0D0D0;
+ border-radius: 0px 4px 4px 0px;
+ background: rgba(250, 251, 252, 0);
+ &:first-child{
+ border-right: none;
+ border-radius: 4px 0px 0px 4px;
+ }
+ &.active{
+ background-color: #466AFF;
+ color: #fff!important;
+ border-color: #466AFF;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/forge/Main/tag/Index.jsx b/src/forge/Main/tag/Index.jsx
new file mode 100644
index 00000000..0fd40b1f
--- /dev/null
+++ b/src/forge/Main/tag/Index.jsx
@@ -0,0 +1,138 @@
+import React,{ useEffect , useState } from 'react';
+import SubMenu from '../sub/SubMenu';
+import { Table , Tooltip , Spin } from 'antd';
+import axios from 'axios';
+import { Link } from 'react-router-dom';
+import { truncateCommitId } from '../../common/util';
+import { getImageUrl } from 'educoder';
+import Nonedata from '../../Nodata';
+import './Index.scss';
+import Tree from '../img/tree.png'
+import moment from 'moment';
+
+function Tags(props) {
+
+ const [ source , setSource ] = useState(undefined);
+ const [ isSpin , setIsSpin ] = useState(true);
+
+ const { projectsId , owner } = props.match.params;
+
+ useEffect(() => {
+ if (projectsId) {
+ const url = `/${owner}/${projectsId}/tags.json`;
+ axios.get(url).then((result) => {
+ if (result) {
+ setSource(result.data);
+ setIsSpin(false);
+ }
+ }).catch(error => {})
+ }
+ }, [owner, projectsId]);
+
+ const columns=[
+ {
+ title:"标签名",
+ dataIndex:"name",
+ key:1,
+ ellipsis:true,
+ width:"200px",
+ render:(txt,item)=>{
+ return(
+
+ {item.name}
+
+ )
+ }
+ },
+ {
+ title:"创建时间",
+ dataIndex:"time_ago",
+ key:2,
+ ellipsis:true,
+ render:(txt,item)=>{
+ return (
+
+ {
+ item.tagger &&
+
+ {
+ item.tagger.id ?
+
+
+
+ :
+
+
+
+ }
+
+ }
+ 创建于{txt}
+
+ )
+ }
+ },
+ {
+ title:"提交ID",
+ dataIndex:"id",
+ key:3,
+ ellipsis:true,
+ render:(txt,item)=>{
+ return (
+
+
+ {truncateCommitId(item.id)}
+
+ )
+ }
+ },
+ {
+ title:"描述信息",
+ dataIndex:"message",
+ key:4,
+ ellipsis:true,
+ render:(txt,item)=>{
+ return item.message || "--"
+ }
+ },
+ {
+ title:"下载",
+ dataIndex:"stage_type",
+ key:5,
+ ellipsis:true,
+ align:"center",
+ width:"204px",
+ render:(txt,item)=>{
+ return (
+
+
+ TAR
+
+
+ ZIP
+
+
+ )
+ }
+ }
+ ]
+ return(
+
+
+
+
+ {
+ source && source.length > 0 &&
+
+ }
+ {
+ source && source.length === 0 &&
+ }
+
+
+
+ )
+}
+export default Tags;
\ No newline at end of file
diff --git a/src/forge/Main/tag/Index.scss b/src/forge/Main/tag/Index.scss
new file mode 100644
index 00000000..6adba91e
--- /dev/null
+++ b/src/forge/Main/tag/Index.scss
@@ -0,0 +1,58 @@
+.tagTable{
+ margin-top: 30px;
+ thead{
+ tr th{
+ background-color: #fff;
+ padding:5px 0px;
+ width: 172px;
+ .ant-table-column-title{
+ font-size: 16px;
+ font-weight: 500;
+ color: #333333;
+ }
+ }
+ }
+ tbody{
+ .btn-83{
+ margin:0px 8px;
+ }
+ tr{
+ &:hover td{
+ background-color: #fff!important;
+ }
+ td{
+ padding:0px;
+ height: 69px;
+ line-height: 69px;
+ color:#333333;
+ div{
+ font-weight: 500;
+ }
+ }
+ &:last-child{
+ td{
+ border-bottom: none!important;
+ }
+ }
+ }
+ }
+}
+.tagSpin{
+ min-height: 300px;
+}
+.tagBranch{
+ padding-right: 15px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ .tagClass{
+ color:#333333;
+ }
+}
+.tagModel{
+ font-weight: 400;
+ .tagModelImg img{
+ width: 25px;
+ height: 25px;
+ border-radius: 50%;
+ }
+}
\ No newline at end of file
diff --git a/src/forge/Main/tree/Index.jsx b/src/forge/Main/tree/Index.jsx
new file mode 100644
index 00000000..84220a0b
--- /dev/null
+++ b/src/forge/Main/tree/Index.jsx
@@ -0,0 +1,114 @@
+import React , { useEffect , useState } from 'react';
+import CopyTool from '../../Component/CopyTool';
+import { truncateCommitId } from '../../common/util';
+import { Link } from 'react-router-dom';
+import { getImageUrl } from 'educoder';
+import { Dropdown , Menu , Spin } from 'antd';
+import './Index.scss';
+
+import Tree from '../img/tree.png';
+import Axios from 'axios';
+
+function turnbar(str){
+ if(str && str.length>0 && str.indexOf("/")>-1){
+ return str.replaceAll('/','%2F');
+ }
+ return str;
+}
+function Index(props) {
+ const [ list , setList ] = useState([]);
+ const [ isSpin , setIsSpin ] = useState(true);
+
+ const { projectsId , owner } = props.match.params;
+ const { isManager , isDeveloper , projectDetail } = props;
+
+ useEffect(()=>{
+ getList();
+ },[])
+
+
+ const menu =(zip_url,tar_url)=> (
+
+ )
+
+ function getList() {
+ const url = `/${owner}/${projectsId}/branches_slice.json`;
+ Axios.get(url).then(result=>{
+ if(result){
+ setList(result.data);
+ }
+ setIsSpin(false);
+ }).catch(error=>{setIsSpin(false);})
+ }
+
+ return(
+
+
+ {
+ list && list.length>0 && list.map((item,key)=>{
+ return(
+
+ {item.branch_type === "default" ? "默认分支" : item.branch_type==="protected"?"保护分支":"其它分支"}
+ {
+ item.list && item.list.length>0 &&
+
+ {
+ item.list.map((i,k)=>{
+ let last_commit = i.last_commit;
+ return(
+ -
+
+
{i.name}
+
+ {
+ last_commit && last_commit.committer && last_commit.committer.id?
+
+

+
{last_commit && last_commit.committer && last_commit.committer.name}
+
+ :
+
+
+ {last_commit && last_commit.committer && last_commit.committer.name}
+
+ }
+
更新于{last_commit && last_commit.time_from_now}
+
+
+
+
+ {
+ (isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) &&
+
+ 合并请求
+ }
+
+ 下载
+
+
+
+ )
+ })
+ }
+
+ }
+
+ )
+ })
+ }
+
+
+ )
+}
+export default Index;
\ No newline at end of file
diff --git a/src/forge/Main/tree/Index.scss b/src/forge/Main/tree/Index.scss
new file mode 100644
index 00000000..b077d9de
--- /dev/null
+++ b/src/forge/Main/tree/Index.scss
@@ -0,0 +1,96 @@
+.branchSort{
+ font-weight: 500;
+ color: #333333;
+ font-size: 15px;
+ height: 20px;
+ line-height: 20px;
+ padding-left: 10px;
+ margin-top: 20px;
+ margin-bottom: 6px!important;
+}
+.treeUl{
+ background: #FAFCFF;
+ border-radius: 4px;
+ border: 1px solid rgba(42, 97, 255, 0.23);
+ li{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 12px 20px;
+ border-bottom: 1px solid rgba(42, 97, 255, 0.23);
+ &:last-child{
+ border-bottom: none;
+ }
+ .treeinfo{
+ max-width: 399px;
+ flex:1;
+ flex-direction: column;
+ a:hover{
+ span{
+ color: #466AFF!important;
+ }
+ }
+ img{
+ height: 20px;
+ width: 20px;
+ margin-right: 5px;
+ }
+ }
+ .treeabout{
+ flex:1;
+ 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;
+}
\ No newline at end of file
diff --git a/src/forge/Main/version/Empty.jsx b/src/forge/Main/version/Empty.jsx
new file mode 100644
index 00000000..3200d3e8
--- /dev/null
+++ b/src/forge/Main/version/Empty.jsx
@@ -0,0 +1,22 @@
+import { Button } from 'antd';
+import React from 'react';
+import './version.scss';
+
+function Empty({operation,addFunc}) {
+ return(
+
+
+
这里暂未发布过任何版本
+
发行版功能基于仓库中的历史标记
建议使用类似 V1.0 的版本标记作为发布点
+
+ {
+ operation ?
+
+ :
+ 该项目暂时没有发布版本
+ }
+
+
+ )
+}
+export default Empty;
\ No newline at end of file
diff --git a/src/forge/Main/version/Index.jsx b/src/forge/Main/version/Index.jsx
new file mode 100644
index 00000000..37cc8c12
--- /dev/null
+++ b/src/forge/Main/version/Index.jsx
@@ -0,0 +1,41 @@
+import React from 'react';
+import { Switch , Route } from 'react-router';
+import Loadable from 'react-loadable';
+import Loading from '../../../Loading';
+import SubMenu from '../sub/SubMenu';
+import "./version.scss";
+
+const CoderRootVersion = Loadable({
+ loader: () => import('./version'),
+ loading: Loading,
+})
+const CoderRootVersionNew = Loadable({
+ loader: () => import('./New'),
+ loading: Loading,
+})
+function Index(props) {
+ const { projectsId , owner } = props.match.params;
+ return(
+
+
+
+ ()
+ }
+ >
+ ()
+ }
+ >
+ ()
+ }
+ >
+
+
+ )
+}
+export default Index;
\ No newline at end of file
diff --git a/src/forge/Main/version/New.jsx b/src/forge/Main/version/New.jsx
new file mode 100644
index 00000000..8adde9b0
--- /dev/null
+++ b/src/forge/Main/version/New.jsx
@@ -0,0 +1,266 @@
+import React, { useState, useEffect, forwardRef } from "react";
+import styled from "styled-components";
+import { AutoComplete , Input, Checkbox, Button, Form } from "antd";
+import SelectBranch from '../../Branch/Select';
+
+import Editor from "../../../modules/tpm/challengesnew/tpm-md-editor";
+import Upload from "../../Upload/Index";
+import Attachments from "../../Upload/attachment";
+import axios from "axios";
+import "./version.scss";
+import { trim } from "lodash";
+
+const { Option } = AutoComplete;
+
+const Span = styled.span`
+ margin: 0px 15px;
+ color: #bbb;
+ line-height: 35px;
+ font-size:16px;
+ font-weight:400;
+ color:#666;
+`;
+export default Form.create()(
+ forwardRef(
+ (
+ { form, projectDetail , match, showNotification, history },
+ ref
+ ) => {
+ const { getFieldDecorator, validateFields, setFieldsValue } = form;
+ const [tagList, setTagList] = useState(undefined);
+ const [desc, setDesc] = useState(null);
+ const [branch, setBranch ] = useState(null);
+ const [fileList, setFileList] = useState(undefined);
+ const [attachment, setAttachment] = useState(undefined);
+ const [options , setOptions] = useState(undefined);
+ const stable = history && history.location && history.location.state.stable;
+ const { projectsId, versionId , owner } = match.params;
+
+ useEffect(()=>{
+ if(projectDetail && projectDetail.default_branch){
+ setBranch(projectDetail.default_branch);
+ }
+ },[projectDetail])
+
+
+ useEffect(() => {
+ if (versionId) {
+ const url = `/${owner}/${projectsId}/releases/${versionId}/edit.json`;
+ axios.get(url).then(result => {
+ if (result) {
+ setFieldsValue(result.data);
+ setDesc(result.data.body);
+ setAttachment(result.data.attachments);
+ }
+ });
+ }
+ }, [versionId]);
+
+ useEffect(() => {
+ if (projectsId) {
+ const url = `/${owner}/${projectsId}/tags.json`;
+ axios
+ .get(url,{params:{
+ limit:1000
+ }})
+ .then(result => {
+ if (result) {
+ setTagList(result.data);
+ setOptions(renderTagList(result.data));
+ }
+ })
+ .catch(error => {
+ console.log(error);
+ });
+ }
+ }, [projectsId]);
+
+ function renderTagList(list) {
+ if (list) {
+ let array = list.map((item, key) => {
+ return (
+
+ );
+ });
+ return array || undefined;
+ }
+ }
+ function submit() {
+ validateFields((err, value) => {
+ if(err)return;
+ if (versionId) {
+ let url = `/${owner}/${projectsId}/releases/${versionId}.json`;
+ axios
+ .put(url, {
+ ...value,
+ body: desc,
+ attachment_ids: fileList,
+ target_commitish:branch
+ })
+ .then(result => {
+ if (result) {
+ showNotification("版本修改成功!");
+ history.push(`/${owner}/${projectsId}/releases`);
+ }
+ });
+ } else {
+ let url = `/${owner}/${projectsId}/releases.json`;
+ axios.post(url, {
+ ...value,
+ body: desc,
+ attachment_ids: fileList
+ })
+ .then(result => {
+ if (result) {
+ showNotification("版本发布成功!");
+ history.push(`/${owner}/${projectsId}/releases`);
+ }
+ });
+ }
+ });
+ }
+ // 输入标签名
+ function changeAuto(value){
+ let l = tagList.filter(item=>item.name.indexOf(value) > -1);
+ setOptions(renderTagList(l));
+ }
+
+ function changeBranch(params) {
+ setBranch(params);
+ }
+
+ return (
+
+
+ {getFieldDecorator("name",
+ { rules:[
+ { required: true, message: "请输入发行版的标题" },
+ { validator: (rule,val,callback) =>{
+ if(val.length>50){
+ callback('标题长度在1~50个字符之间');
+ }else{
+ callback();
+ }
+ }}],
+ validateFirst: true
+ })(
+
+ )}
+
+
+
+
+
+ }
+ size={100}
+ showNotification={showNotification}
+ />
+ {versionId && attachment && attachment.length > 0 ? (
+
+ ) : (
+ ""
+ )}
+
+
+ {getFieldDecorator("prerelease",
+ { rules:[],
+ validateFirst: true
+ })(
+ 这是一个预览版本
+ )}
+
+
+
+
+
+
+
+
+
标签命名建议
+
+ 通常的做法是在版本名称前加上字母 v 前缀, v1.0 或者 v2.3.4。
+
+
+ 如果标签不适合在生产环境下使用,请在版本名称后添加预发行版本。例如:v0.2-alpha
+ 或者 v5.9-beta.3。
+
+
+
+
语义化版本
+
+ 如果你是第一次发布版本,我们强烈建议你阅读语义化版本。
+
+
+
+
附件大小说明
+
+ 单个附件不能超过 100M(GVP 项目200M),每个仓库总附件不可超过
+ 1G(推荐项目不可超过 5G;GVP 项目不可超过
+ 20G)。附件总容量统计包括仓库附件和发行版附件。
+
+
+
+
+ );
+ }
+ )
+);
diff --git a/src/forge/Main/version/version.js b/src/forge/Main/version/version.js
new file mode 100644
index 00000000..2896899f
--- /dev/null
+++ b/src/forge/Main/version/version.js
@@ -0,0 +1,150 @@
+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';
+import User from "../../Component/User";
+
+function version(props) {
+ const [ data , setData ] = useState(undefined);
+ const [ releases , setReleases ] = useState(undefined);
+ const [ isSpin , setIsSpin ] = useState(true);
+ const { projectsId ,owner } = props.match.params;
+ const { location } = props;
+ const type = props.projectDetail && props.projectDetail.type;
+ const turnFromNew = location && location.query && location.query.turnFromNew;
+ useEffect(()=>{
+ getIssueList();
+ },[])
+ // 获取列表数据
+ function getIssueList(){
+ const url = `/${owner}/${projectsId}/releases.json`;
+ 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);
+ }
+ }).catch((error) => {
+ console.log(error);
+ })
+ }
+ // 显示版本描述
+ function showBody(key,flag){
+ var lists = releases.concat();
+ lists[key].bodyshow = !flag ? true : false;
+ lists.splice();
+ setReleases(lists);
+ }
+ //删除
+ function deleteRelease(releaseId) {
+ if(releaseId){
+ axios.delete(`/${owner}/${projectsId}/releases/${releaseId}.json`).then((result)=>{
+ if(result){
+ getIssueList();
+ }
+ })
+ }
+ }
+ function release(item,key){
+ return (
+
+
+ {item.draft}
+
+
+ {item.tag_name}
+
+
+
+ {truncateCommitId(item.sha)}
+
+
+
+
+ {item.name}
+
+ {data && data.user_admin_permission && type !== 2 && }
+ {data && data.user_admin_permission && type !== 2 && {deleteRelease(item.version_id)}}>}
+
+
+
+ showBody(key,item.bodyshow)}>
+
+ 发布于{item.created_at}
+
+ {
+ item.bodyshow &&
+
+
+
+ }
+
+
+ {/* 发行版附件下载 */}
+ {item.attachments && item.attachments.map((item)=>{
+ return(下载 {item.title})
+ })}
+ {/* 发行版下载包 */}
+ 下载 {item.tag_name}.TAR.gz
+ 下载 {item.tag_name}.ZIP
+
+
+
+ )
+ }
+ function renderList(releases){
+ if (releases && releases.length > 0) {
+ return (
+
+ {
+ data && data.user_admin_permission && type !== 2 &&
+
+
+
+ }
+
+ {!turnFromNew ? releases.map((item, key) => release(item,key)) : release(releases[0],0)}
+
+
+ )
+ } else if (releases && releases.length === 0) {
+ return (
+
+ )
+ } else{
+ return (
)
+ }
+ }
+
+ function addFunc(){
+ props.history.push({pathname:`/${owner}/${projectsId}/releases/new`,state:{stable:true}});
+ }
+
+ return (
+
+
+
+ {renderList(releases)}
+
+
+
+ )
+}
+export default version;
\ No newline at end of file
diff --git a/src/forge/Main/version/version.scss b/src/forge/Main/version/version.scss
new file mode 100644
index 00000000..7cd5ddb4
--- /dev/null
+++ b/src/forge/Main/version/version.scss
@@ -0,0 +1,357 @@
+.topWrapper {
+ padding: 20px 0;
+ box-sizing: border-box;
+ display: flex;
+ justify-content: space-between;
+ border-bottom: 1px solid #EEEEEE;
+ align-items: center;
+}
+.topWrapper_btn_new {
+ background: #fff;
+ color: #5091FF!important;
+ padding:0px 12px;
+ text-align: center;
+ height: 32px;
+ line-height: 32px;
+ border-radius: 4px;
+ border:1px solid #5091FF;
+}
+.versionInfo{
+ display: flex;
+ width: 100%;
+}
+.versionInfo_left{
+ display: flex;
+ width: 182px;
+ flex-direction: column;
+ align-items: flex-end;
+ padding-right: 15px;
+ &>.color-grey-3{
+ max-width: 10rem;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+}
+.versionInfo_right{
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ border-left: 1px solid #eee;
+ position: relative;
+ padding: 0px 30px 60px 24px;
+ &::before{
+ position: absolute;
+ left: -4px;
+ top:0px;
+ content: '';
+ width: 8px;
+ height: 8px;
+ background-color: #466AFF;
+ border-radius: 50%;
+ }
+ .sendAuthorImg{
+ width: 20px;
+ height: 20px;
+ border-radius: 50%;
+ margin-right: 5px;
+ }
+ .body-show{
+ padding: 5px 10px 10px 10px;
+ }
+ & .version-user>a>span{
+ display: inline-block;
+ & img{
+ width: 20px;
+ height: 20px;
+ }
+ }
+}
+.versionTag{
+ display: inline;
+ padding:0px 9px;
+ color: #fff;
+ position: relative;
+ margin-top: -8px;
+ height: 22px;
+ line-height: 20px;
+ border-radius: 4px;
+ &::before{
+ position: absolute;
+ content: "";
+ width: 0;
+ height: 0px;
+ border-left: 4px solid #cccccc;
+ border-top: 4px solid transparent;
+ border-bottom: 4px solid transparent;
+ border-right: 4px solid transparent;
+ z-index: 9;
+ top: 6px;
+ right: -9px;
+ }
+ &:after{
+ width: 0px;
+ height: 0px;
+ top:6px;
+ right: -7px;
+ position: absolute;
+ border-left:4px solid #fff;
+ border-top:4px solid transparent;
+ border-bottom:4px solid transparent;
+ border-right:4px solid transparent;
+ content:'';
+ z-index:10;
+ }
+}
+.versionFile{
+ margin-top: 5px;
+ padding-top: 20px;
+ border-top: 1px solid #eee;
+ // width: 100%;
+ a{
+ display: block;
+ color: #333;
+ font-weight: 400;
+ height: 20px;
+ margin-bottom: 10px;
+ }
+}
+.versionTag.yellow{
+ border: 1px solid #FBBC06;
+ color: #FBBC06;
+ &::before{
+ border-left-color: #FBBC06;
+ }
+}
+.versionTag.green{
+ border: 1px solid #2DB44D;
+ color: #2DB44D;
+ &::before{
+ border-left-color: #2DB44D;
+ }
+}
+.versionTag.orange{
+ border: 1px solid #FF6E23;
+ color: #FF6E23;
+ &::before{
+ border-left-color: #FF6E23;
+ }
+}
+.addReleaseBtn{
+ text-align: right;
+ margin-bottom: 30px;
+}
+.versionName{
+ font-size: 16px;
+ color: #333;
+ margin-bottom: 15px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ width: 100%;
+ height: 18px;
+ line-height: 18px;
+ margin-top: -5px;
+}
+
+
+.versionmilepostleft{
+ padding: 15px;
+ margin-right: 50px;
+ width: 80%;
+ }
+.topWrapper_btn_close {
+ background: #504b4b;
+ color: #FFFFFF!important;
+ padding:0px 12px;
+ text-align: center;
+ height: 32px;
+ line-height: 32px;
+ border-radius: 4px;
+ }
+
+ .topWrapper_btn_delete {
+ background: #da1010;
+ color: #FFFFFF!important;
+ padding:0px 12px;
+ text-align: center;
+ height: 32px;
+ line-height: 32px;
+ border-radius: 4px;
+ }
+
+ .versionrighe{
+ flex: 2;
+ }
+ .versionleft{
+ flex: 1;
+ text-align: right;
+ display: flex;
+ justify-content: right;
+ }
+
+ /* .version_line{
+ display: flex;
+ height: 30px;
+ margin: auto;
+ border-left:1px solid #eee;
+ } */
+ .version_line_one{
+ display: flex;
+ height: 45px;
+ margin: auto;
+ border-left:1px solid #eee;
+ }
+
+ .version_line_tpw{
+ display: flex;
+ height: 80px;
+ margin: auto;
+ border-left:1px solid #eee;
+ }
+
+ .versiondiv{
+ display: flex;
+ }
+ .verwinth{
+ width: 80%;
+ }
+
+ /*开启中 关闭中*/
+.opendversionetail{
+ display: inline-block;
+ background: #21ba45;
+ color: #ffffff!important;
+ padding:0px 5px;
+ text-align: center;
+ height: 25px;
+ /*width: 110px;*/
+ border-radius: 4px;
+ line-height: 25px;
+}
+.closedversionetail{
+ display: inline-block;
+ background: #e60b0b;
+ color: #ffffff!important;
+ padding:0px 5px;
+ text-align: center;
+ height: 25px;
+ /*width: 110px;*/
+ border-radius: 4px;
+ line-height: 25px;
+}
+.versionrectangle {
+ width: 8px;
+ height: 8px;
+ border-radius: 100%;
+ margin-top: 15px;
+ margin-left: -4px;
+ margin-bottom: 10px;
+ background: rgb(83, 81, 81);
+ }
+.ver-middle{
+ vertical-align: middle;
+}
+/* new */
+.versionForm{
+ 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;
+ box-sizing: border-box;
+}
+.infosTip{
+ border-bottom: 1px solid #EEEEEE;
+ color: #333;
+ padding-bottom: 26px;
+ margin-bottom: 26px;
+ font-weight: 400;
+ text-align: justify;
+ &:last-child{
+ border-bottom: none;
+ }
+}
+.dragBox{
+ background: rgba(153, 153, 153, 0.04);
+ border-radius: 4px;
+ border: 1px dashed #d9d9d9;
+ padding:20px;
+ .versionStyle{
+ border: none!important;
+ padding-bottom:20px;
+ .dragIcon{
+ font-size: 40px!important;
+ color: #666!important;
+ line-height: 40px;
+ height: 40px;
+ margin-bottom: 14px;
+ display: block;
+ }
+ }
+ .ant-upload-list-item:hover .ant-upload-list-item-info {
+ background-color: rgba(239, 244, 255, 1);
+ }
+ .ant-upload-list-item-info{
+ padding:0px 20px 0px 8px;
+ &>span{
+ display: flex;
+ align-items: center;
+ }
+ }
+}
+
+.set-ant-row .ant-row{
+ display: flex;
+ height: 20px;
+ align-items: center;
+}
+.itemInline{
+ display: flex;
+ align-items: flex-start;
+ position: relative;
+ &>p{
+ position: absolute;
+ bottom: -5px;
+ }
+}
+.itemInline .ant-row{
+ margin-bottom: 0px;
+}
+.prerelease{
+ padding-top: 20px;
+ .ant-form-item-control{
+ height: 20px;
+ line-height: 20px;
+ }
+}
+.releaseIndex{
+ margin: 30px auto;
+ width: 1200px;
+}
+.emptyPanel{
+ width: 100%;
+ background: #FAFCFF;
+ border-radius: 4px;
+ border: 1px solid rgba(42, 97, 255, 0.23);
+ min-height: 418px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ .operation{
+ width: 400px;
+ border-top: 1px solid #eee;
+ padding-top: 34px;
+ text-align: center;
+ margin-top: 30px;
+ }
+}
+.ant-form-item-control{
+ line-height: initial;
+}
\ No newline at end of file
diff --git a/src/forge/Merge/Files.jsx b/src/forge/Merge/Files.jsx
index 82a8638c..b4cf5b48 100644
--- a/src/forge/Merge/Files.jsx
+++ b/src/forge/Merge/Files.jsx
@@ -1,17 +1,24 @@
import React ,{useEffect,useState } from 'react';
import { truncateCommitId } from '../common/util';
import { AlignCenter , FlexAJ } from '../Component/layout';
-import { Button } from 'antd';
+import { Tooltip,Progress } from 'antd';
import './merge.css';
+import './Index.scss';
-function Files({data,history,owner,projectsId}){
+function Files({ data,history,owner,projectsId , parentsSha }){
const [ files , setFiles ] = useState(data && data.files);
-
+ const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径");
+ const [ isOpen, setIsOpen] = useState(false);
+
useEffect(()=>{
if(data){
setFiles(data.files);
}
- },[data])
+ },[data]);
+
+ useEffect(()=>{
+ document.addEventListener('click',()=>{setIsOpen(false)})
+ })
function showDown(flag,index,isBin){
if(!isBin){
@@ -22,35 +29,86 @@ 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 = (
+
+ )
+
return(
-
-
-
-
- 共有 {data && data.files_count} 个文件被更改,包括
+ {e.nativeEvent.stopImmediatePropagation()}}>
+
+ {setIsOpen(!isOpen)}}>
+
+
+ 共有 {data && data.files_count} 个文件 被更改,包括
{ data && data.total_addition ? {data && data.total_addition} 次插入:"" }
{ data && data.total_addition && data.total_deletion ? " 和 ":""}
{ data && data.total_deletion ? {data && data.total_deletion} 次删除:""}
-
+
+
+ {isOpen && folderOpen}
{
files && files.length>0 &&
-
+
{
files.map((item,key)=>{
return(
-
showDown(item.flag,key,item.isBin)}>
+
+
- {!item.isBin ? :""}
-
- {item.name}
+ {!item.isBin ? showDown(item.flag,key,item.isBin)}>:""}
+ showDown(item.flag,key,item.isBin)}>{item.name}
+ setCopyfileTipTitle("复制文件路径")}
+ >
+ copyFileName(item.name)}>
+
-
-
- +{item.addition}
- -{item.deletion}
-
+
+
0 ? ":":""} ${item.addition > 0 ? item.addition + "处添加" : ""}${item.addition > 0 && item.deletion > 0 ? "和" : ""}${item.deletion > 0 ? item.deletion + "处删除" : ""}`}>
+
+ {item.addition+item.deletion}处
+
+ {
+ !item.isSubmodule &&
+
{history.push(`/${owner}/${projectsId}${item.isDeleted ? `/commits/${truncateCommitId(parentsSha)}`:`/tree/${truncateCommitId(item.sha)}/${item.name}`}`)}}>查看文件
+ }
+
{
item.sections && item.sections.length >= 1 && !item.flag &&
diff --git a/src/forge/Merge/Index.scss b/src/forge/Merge/Index.scss
index 936b868f..16cc9563 100644
--- a/src/forge/Merge/Index.scss
+++ b/src/forge/Merge/Index.scss
@@ -18,4 +18,86 @@
.pr_tags_closed{
border:1px solid #FA6400;
color: #FA6400;
+}
+.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: 14rem;
+ .ml10{
+ display: inline-block;
+ width: 4.5rem;
+ cursor: default;
+ }
+ span{
+ width: 7%;
+ }
+ }
+ .anchorPoint{
+ position: relative;
+ top: -5rem;
+ display: block;
+ height: 0;
+ }
+}
+.filesInfo{
+ background: #FAFCFF;
+ border-color:rgba(42, 97, 255, 0.23);
+ .ant-progress-line {
+ width: 5rem;
+ }
+ .ant-progress-inner{
+ background-color: #D14A4A;
+ }
+}
+.folders,.ant-anchor{
+ margin-left: 0;
+ padding-left: 0;
+}
+.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: 275px;
+ 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;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/forge/Merge/MergeItem.js b/src/forge/Merge/MergeItem.js
index 884c50fe..d5e7eb83 100644
--- a/src/forge/Merge/MergeItem.js
+++ b/src/forge/Merge/MergeItem.js
@@ -11,6 +11,8 @@ function turnbar(str){
}
return str;
}
+const port = window.location.port;
+const hostname = window.location.hostname;
class MergeItem extends Component {
constructor(props) {
super(props);
@@ -166,24 +168,17 @@ class MergeItem extends Component {
)}
{item.version || "--"}
-
-
- {item.journals_count ? (
+
+ {item.journals_count ?
-
- {item.journals_count}
-
- ) : (
- ""
- )}
- {user_admin_or_developer && item.pull_request_status === 0 ? (
+
{item.journals_count}
+ :""
+ }
+ {user_admin_or_developer && item.pull_request_status === 0 &&
+
查重
);
diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js
index b064e3c2..8f78c093 100644
--- a/src/forge/Merge/MessageCount.js
+++ b/src/forge/Merge/MessageCount.js
@@ -364,7 +364,7 @@ class MessageCount extends Component {
to={`/${data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${turnbar(data.pull_request && data.pull_request.head)}`}
className="ver-middle"
>
- {data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: {turnbar(data.pull_request && data.pull_request.head)}
+ {data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: {data.pull_request && data.pull_request.head}
diff --git a/src/forge/Merge/merge.css b/src/forge/Merge/merge.css
index 6b50eeb1..d5ce68d1 100644
--- a/src/forge/Merge/merge.css
+++ b/src/forge/Merge/merge.css
@@ -152,13 +152,23 @@ form .ant-cascader-picker, form .ant-select {
margin-top: 15px;
border-radius: 2px;
}
+.see-file-btn{
+ color: #466AFF;
+ cursor: pointer;
+}
.filesInfo{
padding:10px 15px;
background-color: #fafafa;
}
+.filesInfo .cursor-pointer{
+ cursor: pointer;
+}
.filesContent{
border-top: 1px solid #ddd;
}
+.icon-fuzhiicon:hover{
+ color: #466AFF;
+}
.linesContent{
display: flex;
min-height: 30px;
@@ -198,4 +208,8 @@ form .ant-cascader-picker, form .ant-select {
}
.linesContent.add{
background: rgba(48, 232, 132, 0.15);
-}
\ No newline at end of file
+}
+
+.mergeRequest .folders{
+ width: 72rem;
+ }
\ No newline at end of file
diff --git a/src/forge/Merge/merge.js b/src/forge/Merge/merge.js
index 399c9bd9..d9e06aac 100644
--- a/src/forge/Merge/merge.js
+++ b/src/forge/Merge/merge.js
@@ -382,6 +382,7 @@ class merge extends Component {
+
diff --git a/src/forge/Merge/merge_footer.js b/src/forge/Merge/merge_footer.js
index 6502827c..5e3a7556 100644
--- a/src/forge/Merge/merge_footer.js
+++ b/src/forge/Merge/merge_footer.js
@@ -119,7 +119,7 @@ class MergeFooter extends Component {
return (
!footer_type && !comparesData || (comparesData && ((comparesData.commits && comparesData.commits.length===0)||(comparesData && !comparesData.diff)) )?"":
-
-
+
+
+
diff --git a/src/forge/Newfile/UserSubmitComponent.js b/src/forge/Newfile/UserSubmitComponent.js
index 65fa7ec2..aa4bba6e 100644
--- a/src/forge/Newfile/UserSubmitComponent.js
+++ b/src/forge/Newfile/UserSubmitComponent.js
@@ -83,8 +83,8 @@ class UserSubmitComponent extends Component {
if (result.data && result.data.name) {
this.props.showNotification("文件新建成功!");
if(submitType === "1"){
- const { getTopCount } = this.props;
- getTopCount && getTopCount(values.branchname);
+ const { getDetail } = this.props;
+ getDetail && getDetail();
}
let url = `/${owner}/${projectsId}${values.branchname ? `/tree/${turnbar(values.branchname)}`: (branch ? `/tree/${turnbar(branch)}` : "")}`;
this.props.history.push(url);
@@ -147,6 +147,7 @@ class UserSubmitComponent extends Component {
const { current_user, filepath, projectDetail , currentBranch } = this.props;
const { editor_type } = this.props;
let b = currentBranch || branch;
+
return (
diff --git a/src/forge/Newfile/index.css b/src/forge/Newfile/index.css
index 242fd451..746febe5 100644
--- a/src/forge/Newfile/index.css
+++ b/src/forge/Newfile/index.css
@@ -8,7 +8,13 @@
border: 1px solid #d9d9d9!important;
border-right: none!important;
}
-
+.editorBorder .editorBorderBox{
+ border:1px solid #eee;
+ border-radius: 2px;
+}
+.editorBorder .editorBorderSubmitBox{
+ padding:20px 0px!important;
+}
.userScrew{
margin:20px 0px;
border:1px solid #f4f4f4;
@@ -39,7 +45,7 @@
z-index: 1;
}
.ant-input-group .ant-input:focus{
- border-right: 1px solid #d9d9d9!important;
+ border-right: 1px solid rgba(70, 106, 255, 1)!important;
}
.ant-btn-primary.grey{
border:1px solid #BBBBBB;
diff --git a/src/forge/Newfile/m_editor.js b/src/forge/Newfile/m_editor.js
index 05a7b2ac..242f7e0d 100644
--- a/src/forge/Newfile/m_editor.js
+++ b/src/forge/Newfile/m_editor.js
@@ -10,6 +10,7 @@ class m_editor extends Component {
super(props);
this.state = {
editorValue: this.props.content,
+ prevHeight:0
};
}
componentDidUpdate=(prevProps)=>{
@@ -41,42 +42,81 @@ class m_editor extends Component {
folding: true,
foldingStrategy: "indentation", // 代码可分小段折叠
automaticLayout: true, // 自适应布局
- // overviewRulerBorder: false, // 不要滚动条的边框
- // scrollBeyondLastLine: false, // 取消代码后面一大段空白
+ overviewRulerBorder: false, // 不要滚动条的边框
+ scrollBeyondLastLine: false, // 取消代码后面一大段空白
minimap: {
// 不要小地图
enabled: false,
},
};
+
+ const handleEditorMount = (editor, monaco) => {
+ editor.onDidChangeModelDecorations(() => {
+ requestAnimationFrame(updateEditorHeight); // folding
+ });
+
+ const updateEditorHeight = () => {
+ const editorElement = editor.getDomNode();
+
+ if (!editorElement) {
+ return;
+ }
+
+ const padding = 40;
+
+ const lineHeight = editor.getOption(
+ monaco.editor.EditorOption.lineHeight
+ );
+
+ const lineCount = editor.getModel().getLineCount() || 1;
+ let height =
+ editor.getTopForLineNumber(lineCount + 1) +
+ lineHeight +
+ padding ;
+
+ if(height<400){height = 400;}
+
+ if (this.state.prevHeight !== height) {
+ this.setState({
+ prevHeight:height
+ })
+ // setPrevHeight(height);
+ editorElement.style.height = `${height}px`;
+ editor.layout();
+ }
+ };
+
+ updateEditorHeight(); // typing
+ };
+
+
return (
-
-
-
-
- {!readOnly && (
-
-
-
- )}
-
+
+
+
+ {!readOnly && (
+
+
+
+ )}
);
}
diff --git a/src/forge/Order/CopyDetail.js b/src/forge/Order/CopyDetail.js
index 1f61e736..906de4be 100644
--- a/src/forge/Order/CopyDetail.js
+++ b/src/forge/Order/CopyDetail.js
@@ -1,11 +1,13 @@
-import React, { Component } from "react";
+import React from "react";
import OrderItem from './order_form'
-class CopyDetail extends Component {
- render() {
- return (
-
- )
- }
+
+
+function CopyDetail(props){
+ const operate = props.match.params.operate;
+ console.log(operate);
+ return(
+
+ )
}
-export default CopyDetail;
+export default CopyDetail;
\ No newline at end of file
diff --git a/src/forge/Order/Detail.js b/src/forge/Order/Detail.js
index b377b6a1..19ef67c5 100644
--- a/src/forge/Order/Detail.js
+++ b/src/forge/Order/Detail.js
@@ -123,22 +123,25 @@ class Detail extends Component {
//复制
copydetail = () => {
const { projectsId, orderId, owner } = this.props.match.params;
- const url = `/${owner}/${projectsId}/issues/${orderId}/copy.json`;
- axios
- .post(url, {
- project_id: projectsId,
- id: orderId,
- })
- .then((result) => {
- if (result) {
- this.props.history.push(
- `/${owner}/${projectsId}/issues/${result.data.issue_id}/copyetail`
- );
- }
- })
- .catch((error) => {
- console.log(error);
- });
+ // const url = `/${owner}/${projectsId}/issues/${orderId}/copy.json`;
+ // axios
+ // .post(url, {
+ // project_id: projectsId,
+ // id: orderId,
+ // })
+ // .then((result) => {
+ // if (result) {
+ // this.props.history.push(
+ // `/${owner}/${projectsId}/issues/${result.data.issue_id}/copyetail`
+ // );
+ // }
+ // })
+ // .catch((error) => {
+ // console.log(error);
+ // });
+ this.props.history.push(
+ `/${owner}/${projectsId}/issues/${orderId}/copyetail`
+ );
};
// 翻页
diff --git a/src/forge/Order/UpdateDetail.js b/src/forge/Order/UpdateDetail.js
index 9cbb3cd6..0bf4f0f1 100644
--- a/src/forge/Order/UpdateDetail.js
+++ b/src/forge/Order/UpdateDetail.js
@@ -1,11 +1,11 @@
-import React, { Component } from "react";
+import React from "react";
import OrderForm from './order_form'
-class UpdateDetail extends Component {
- render() {
- return (
-
- )
- }
+
+function CopyDetail(props){
+ const operateName = props.match.params.operateName;
+ return(
+
+ )
}
-export default UpdateDetail;
+export default CopyDetail;
diff --git a/src/forge/Order/order_form.js b/src/forge/Order/order_form.js
index 936dc3d1..0858ac52 100644
--- a/src/forge/Order/order_form.js
+++ b/src/forge/Order/order_form.js
@@ -153,7 +153,7 @@ class order_form extends Component {
values.issue_tag_ids = [values.issue_tag_ids];
}
const { description, start_date, due_date, issue_type } = this.state;
- if (form_type === "new") {
+ if (form_type !== "edit") {
const url = `/${owner}/${projectsId}/issues.json`;
axios.post(url, {
...values,
@@ -178,7 +178,6 @@ class order_form extends Component {
this.setState({
isSpin: false,
});
- console.log(error);
});
} else {
const url = `/${owner}/${projectsId}/issues/${orderId}.json`;
diff --git a/src/forge/Settings/Setting.js b/src/forge/Settings/Setting.js
index b1af2f99..460ec162 100644
--- a/src/forge/Settings/Setting.js
+++ b/src/forge/Settings/Setting.js
@@ -153,15 +153,20 @@ class Setting extends Component {
name: values.project_name,
description: values.project_description,
private: private_check,
+ identifier:values.project_identifier,
...values,
}).then((result) => {
if (result) {
- this.props.showNotification(`仓库信息修改成功!`);
- const { getDetail } = this.props;
- getDetail && getDetail();
this.setState({
loading:false
})
+ this.props.showNotification(`仓库信息修改成功!`);
+ if(values.project_identifier !== projectsId){
+ this.props.history.push(`/${owner}/${values.project_identifier}/settings`);
+ }else{
+ const { getDetail } = this.props;
+ getDetail && getDetail();
+ }
}
}).catch((error) => {
console.log(error);
@@ -283,6 +288,20 @@ class Setting extends Component {
)}
+
项目标识 (项目url标识部分,更改项目标识将导致原仓库地址失效)}
+ >
+ {getFieldDecorator("project_identifier", {
+ rules: [
+ {
+ required: true,
+ message: "请输入项目标识",
+ },
+ ],
+ })(
+
+ )}
+
{getFieldDecorator("project_description", {
rules: [],
diff --git a/src/forge/Team/List.jsx b/src/forge/Team/List.jsx
index ea23ab07..48a19c22 100644
--- a/src/forge/Team/List.jsx
+++ b/src/forge/Team/List.jsx
@@ -19,7 +19,6 @@ function List(props){
const [ search , setSearch ] = useState(undefined);
const [ page , setPage ] = useState(1);
const [ sortBy , setSortBy ] = useState("updated_on");
- const [ sortDirection , setSortDirection ] = useState("asc");
const OIdentifier = props.match.params.OIdentifier;
const organizeDetail = props.organizeDetail;
@@ -37,7 +36,7 @@ function List(props){
params:{
search,page,limit,
sort_by:sortBy,
- sort_direction:sortDirection
+ sort_direction:"desc"
}
}).then(result=>{
if(result && result.data){
diff --git a/src/forge/Team/New.jsx b/src/forge/Team/New.jsx
index 414a8d15..46e13c3e 100644
--- a/src/forge/Team/New.jsx
+++ b/src/forge/Team/New.jsx
@@ -87,7 +87,7 @@ export default Form.create()(
}
],
)}
diff --git a/src/forge/Team/Setting/TeamSettingCommon.jsx b/src/forge/Team/Setting/TeamSettingCommon.jsx
index 499a00c2..e4f5cf7a 100644
--- a/src/forge/Team/Setting/TeamSettingCommon.jsx
+++ b/src/forge/Team/Setting/TeamSettingCommon.jsx
@@ -122,7 +122,7 @@ export default Form.create()(
validator:checkname
}
],
- ,true
+ ,true
)}
{helper(
"组织名称:",
diff --git a/src/forge/Team/Sub/SubDetail.jsx b/src/forge/Team/Sub/SubDetail.jsx
index b4f1d036..278fef07 100644
--- a/src/forge/Team/Sub/SubDetail.jsx
+++ b/src/forge/Team/Sub/SubDetail.jsx
@@ -48,9 +48,9 @@ export default ((props)=>{
- {OIdentifier}
+ {detail && detail.organization && detail.organization.nickname}
- {detail ? detail.name : "新建团队"}
+ {detail ? detail.nickname : "新建团队"}
{
detail &&
diff --git a/src/forge/Upload/Index.js b/src/forge/Upload/Index.js
index 5b09ca07..713803aa 100644
--- a/src/forge/Upload/Index.js
+++ b/src/forge/Upload/Index.js
@@ -1,7 +1,6 @@
import React, { Component } from "react";
import { Upload, Icon , Button } from 'antd';
import { getUploadActionUrl, appendFileSizeToUploadFileAll } from 'educoder';
-import { AlignCenter } from '../Component/layout';
import axios from 'axios';
const { Dragger } = Upload;
@@ -64,7 +63,6 @@ class Index extends Component {
changeIsComplete && changeIsComplete(true);
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList;
-
this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) });
this.fileIdList(fileList);
}
@@ -111,7 +109,7 @@ class Index extends Component {
:
{icon || }
- 拖动文件或点击此处上传
+ 拖动文件或点击此处上传
)
}
diff --git a/src/forge/Upload/untitled b/src/forge/Upload/untitled
deleted file mode 100644
index 2796e4d7..00000000
--- a/src/forge/Upload/untitled
+++ /dev/null
@@ -1,21 +0,0 @@
-
-1.请求URL: https://code.ihub.org.cn/api/v1/mirrors/create.json
-
-2.请求方式: POST
-
-3.参数:
-
-{
- "image_url": "xxx.git", #必填,且后缀必为.git,
- "language": "Ruby", #必填,如数据库不存在,则会创建新的记录
-}
-
-
-4. 返回值: {
- "status": 1,
- "message": "同步成功,项目ID===1806"
-}
-
-5. 返回值说明: 仅有当有返回值,且返回值的status 的值为1, 才是创建成功,其余均为创建失败
-
-
diff --git a/src/forge/Version/New.jsx b/src/forge/Version/New.jsx
deleted file mode 100644
index 0678a345..00000000
--- a/src/forge/Version/New.jsx
+++ /dev/null
@@ -1,278 +0,0 @@
-import React, { useState, useEffect, useCallback, forwardRef } from "react";
-import styled from "styled-components";
-import { AutoComplete, Select, Input, Checkbox, Button, Form } from "antd";
-
-import Editor from "../../modules/tpm/challengesnew/tpm-md-editor";
-import Upload from "../Upload/Index";
-import Attachments from "../Upload/attachment";
-import axios from "axios";
-import "./version.css";
-import UploadImg from "../Images/upload.png";
-import { getBranch } from '../GetData/getData';
-
-const { Option } = AutoComplete;
-
-export default Form.create()(
- forwardRef(
- (
- { form, projectDetail , match, showNotification, history },
- ref
- ) => {
- const { getFieldDecorator, validateFields, setFieldsValue } = form;
- const [tagList, setTagList] = useState(undefined);
- const [branchList, setBranchList] = useState(undefined);
- const [desc, setDesc] = useState(null);
- const [fileList, setFileList] = useState(undefined);
- const [attachment, setAttachment] = useState(undefined);
- const [options , setOptions] = useState(undefined);
-
-
- const repo_id = projectDetail && projectDetail.repo_id;
- const { projectsId, versionId , owner } = match.params;
- useEffect(()=>{
- getBranchs(projectsId,owner);
- },[projectsId])
-
- async function getBranchs(id,owner){
- let result = await getBranch(id,owner);
- setBranchList(result);
- }
-
- const Span = styled.span`
- margin: 0px 15px;
- color: #bbb;
- line-height: 35px;
- `;
-
-
- useEffect(() => {
- if (versionId) {
- const url = `/${owner}/${projectsId}/releases/${versionId}/edit.json`;
- axios.get(url).then(result => {
- if (result) {
- setFieldsValue(result.data);
- setDesc(result.data.body);
- setAttachment(result.data.attachments);
- }
- });
- }
- }, [versionId]);
-
- useEffect(() => {
- if (projectsId) {
- const url = `/${owner}/${projectsId}/tags.json`;
- axios
- .get(url,{params:{
- limit:1000
- }})
- .then(result => {
- if (result) {
- setTagList(result.data);
- setOptions(renderTagList(result.data));
- }
- })
- .catch(error => {
- console.log(error);
- });
- }
- }, [projectsId]);
-
- function renderTagList(list) {
- if (list) {
- let array = list.map((item, key) => {
- return (
-
- );
- });
- return array || undefined;
- }
- }
- function submit() {
- validateFields((err, value) => {
- if(err)return;
- if (versionId) {
- let url = `/${owner}/${projectsId}/releases/${versionId}.json`;
- axios
- .put(url, {
- ...value,
- body: desc,
- attachment_ids: fileList
- })
- .then(result => {
- if (result) {
- showNotification("版本修改成功!");
- history.push(`/${owner}/${projectsId}/releases`);
- }
- });
- } else {
- let url = `/${owner}/${projectsId}/releases.json`;
- axios.post(url, {
- ...value,
- body: desc,
- attachment_ids: fileList
- })
- .then(result => {
- if (result) {
- showNotification("版本发布成功!");
- history.push(`/${owner}/${projectsId}/releases`);
- }
- });
- }
- });
- }
-
- const helper = useCallback(
- (label, name, rules, widget, isRequired = true) => (
-
- {label}
-
- {getFieldDecorator(name, { rules, validateFirst: true })(widget)}
-
-
- ),
- []
- );
- // 输入标签名
- function changeAuto(value){
- let l = tagList.filter(item=>item.name.indexOf(value) > -1);
- setOptions(renderTagList(l));
- }
- return (
-
-
-
-
-
标签命名建议
-
- 通常的做法是在版本名称前加上字母 v 前缀, v1.0 或者 v2.3.4。
-
-
- 如果标签不适合在生产环境下使用,请在版本名称后添加预发行版本。例如:v0.2-alpha
- 或者 v5.9-beta.3。
-
-
-
-
语义化版本
-
- 如果你是第一次发布版本,我们强烈建议你阅读语义化版本。
-
-
-
-
附件大小说明
-
- 单个附件不能超过 100M(GVP 项目200M),每个仓库总附件不可超过
- 1G(推荐项目不可超过 5G;GVP 项目不可超过
- 20G)。附件总容量统计包括仓库附件和发行版附件。
-
-
-
-
- );
- }
- )
-);
diff --git a/src/forge/Version/version.css b/src/forge/Version/version.css
deleted file mode 100644
index ddfbe7d6..00000000
--- a/src/forge/Version/version.css
+++ /dev/null
@@ -1,205 +0,0 @@
-.topWrapper {
- padding: 20px 0;
- box-sizing: border-box;
- display: flex;
- justify-content: space-between;
- border-bottom: 1px solid #EEEEEE;
- align-items: center;
-}
-.topWrapper_btn_new {
- background: #fff;
- color: #5091FF!important;
- padding:0px 12px;
- text-align: center;
- height: 32px;
- line-height: 32px;
- border-radius: 4px;
- border:1px solid #5091FF;
-}
-.versionInfo{
- display: flex;
- width: 100%;
-}
-.versionInfo_left{
- display: flex;
- width: 30%;
- padding-top: 20px;
- flex-direction: column;
- align-items: flex-end;
- padding-right: 15px;
-}
-.versionInfo_right{
- flex: 1;
- padding: 20px 0px 20px 15px;
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- border-left: 1px solid #eee;
-}
-.versionTag{
- display: inline;
- border-radius: 2px;
- padding:2px 12px;
- font-size: 12px;
- color: #fff;
-}
-.versionTag.yellow{
- background-color: #FBBC06;
-}
-.versionTag.green{
- background-color: #20BA45;
-}
-.versionTag.orange{
- background-color: #F2711D;
-}
-.versionName{
- font-size: 16px;
- color: #333;
- margin-bottom: 10px;
- display: flex;
- align-items: flex-end;
- position: relative;
-}
-.versionName::before{
- position: absolute;
- left: -19px;
- top:8px;
- content: '';
- width: 8px;
- height: 8px;
- background-color: #5091FF;
- border-radius: 50%;
-}
-
-
-.versionmilepostleft{
- padding: 15px;
- margin-right: 50px;
- width: 80%;
- }
-.topWrapper_btn_close {
- background: #504b4b;
- color: #FFFFFF!important;
- padding:0px 12px;
- text-align: center;
- height: 32px;
- line-height: 32px;
- border-radius: 4px;
- }
-
- .topWrapper_btn_delete {
- background: #da1010;
- color: #FFFFFF!important;
- padding:0px 12px;
- text-align: center;
- height: 32px;
- line-height: 32px;
- border-radius: 4px;
- }
-
- .versionrighe{
- flex: 2;
- }
- .versionleft{
- flex: 1;
- text-align: right;
- display: flex;
- justify-content: right;
- }
-
- /* .version_line{
- display: flex;
- height: 30px;
- margin: auto;
- border-left:1px solid #eee;
- } */
- .version_line_one{
- display: flex;
- height: 45px;
- margin: auto;
- border-left:1px solid #eee;
- }
-
- .version_line_tpw{
- display: flex;
- height: 80px;
- margin: auto;
- border-left:1px solid #eee;
- }
-
- .versiondiv{
- display: flex;
- }
- .verwinth{
- width: 80%;
- }
-
- /*开启中 关闭中*/
-.opendversionetail{
- display: inline-block;
- background: #21ba45;
- color: #ffffff!important;
- padding:0px 5px;
- text-align: center;
- height: 25px;
- /*width: 110px;*/
- border-radius: 4px;
- line-height: 25px;
-}
-.closedversionetail{
- display: inline-block;
- background: #e60b0b;
- color: #ffffff!important;
- padding:0px 5px;
- text-align: center;
- height: 25px;
- /*width: 110px;*/
- border-radius: 4px;
- line-height: 25px;
-}
-.versionrectangle {
- width: 8px;
- height: 8px;
- border-radius: 100%;
- margin-top: 15px;
- margin-left: -4px;
- margin-bottom: 10px;
- background: rgb(83, 81, 81);
- }
-.ver-middle{
- vertical-align: middle;
-}
-/* new */
-.versionForm{
- flex:1;
- padding-right: 30px;
- box-sizing: border-box;
-}
-.versionTips{
- width:30%;
- padding-left: 15px;
- box-sizing: border-box;
-}
-.infosTip{
- padding:20px;
- background-color: #F1F8FF;
- margin-bottom: 22px;
- color: #333;
-}
-.versionStyle{
- height: 200px!important;
- border: 1px dashed rgba(80,145,255,1)!important;
-}
-.set-ant-row .ant-row{
- display: flex;
- height: 20px;
- align-items: center;
-}
-.itemInline{
- display: flex;
- align-item: center;
- margin-bottom: 5px;
-}
-.itemInline .ant-row{
- margin-bottom: 0px;
-}
\ No newline at end of file
diff --git a/src/forge/Version/version.js b/src/forge/Version/version.js
deleted file mode 100644
index 5049b31d..00000000
--- a/src/forge/Version/version.js
+++ /dev/null
@@ -1,128 +0,0 @@
-import React, { Component } from "react";
-import { Link } from 'react-router-dom';
-import { Spin } from 'antd';
-import NoneData from '../Nodata';
-import './version.css';
-import axios from 'axios';
-import RenderHtml from '../../components/render-html';
-
-/**
- * issue_chosen:下拉的筛选列表,
- * data:列表接口返回的所有数据,
- * issues:列表数组,
- * isSpin:加载中,
- */
-class version extends Component {
- constructor(props) {
- super(props);
- this.state = {
- issue_chosen: undefined,
- data: undefined,
- releases:undefined,
- issues: undefined,
- isSpin: true,
- search: undefined,
- search_count: undefined,
- }
- }
-
- componentDidMount = () => {
- this.getIssueList();
- }
- // 获取列表数据
- getIssueList = () => {
- const { projectsId, owner } = this.props.match.params;
- const url = `/${owner}/${projectsId}/releases.json`;
- axios.get(url).then((result) => {
- if (result) {
- this.setState({
- data: result.data,
- releases:result.data.releases,
- issues: result.data.issues,
- isSpin: false
- })
- }
- }).catch((error) => {
- console.log(error);
- })
- }
-
- // 显示版本描述
- showBody=(key,flag)=>{
- let { releases } = this.state;
- releases[key].bodyshow = !flag;
- this.setState({
- releases
- })
- }
-
- renderList = (releases) => {
- const { projectsId , owner } = this.props.match.params;
- const { isManager , isDeveloper } = this.props;
- const type = this.props.projectDetail && this.props.projectDetail.type;
-
- if (releases && releases.length > 0) {
- return (
- releases.map((item, key) => {
- return (
-
-
- {item.draft}
- {item.created_at}
-
-
- {item.tag_name}
-
-
-
-
- {item.name}
- {
- (isManager || isDeveloper) && type !==2 &&
- (编辑)
- }
-
-
- this.showBody(key,item.bodyshow)}>
- {item.user_name}:发布了这个版本,并在发布后提交给{item.target_commitish}
-
- {
- item.bodyshow &&
- }
-
-
- TAR
- ZIP
-
-
-
- )
- })
- )
- } else if (releases && releases.length === 0) {
- return (
)
- }
- }
-
- render() {
- const { projectsId ,owner } = this.props.match.params;
- const { data , releases , isSpin } = this.state;
- const type = this.props.projectDetail && this.props.projectDetail.type;
- return (
-
-
- 版本发布
- {
- data && data.user_permission && type !== 2 ?
- + 发布新版
- : ''
- }
-
-
-
{this.renderList(releases)}
-
-
- )
- }
-}
-export default version;
\ No newline at end of file
diff --git a/src/forge/common/util.js b/src/forge/common/util.js
index 4f8f0bf3..1b35ea23 100644
--- a/src/forge/common/util.js
+++ b/src/forge/common/util.js
@@ -6,3 +6,11 @@ export function truncateCommitId(str) {
return str
}
}
+
+// 秒数转2021-9-29 01:01
+export function timeFormat(SecondsStr){
+ const time = new Date(SecondsStr*1000);
+ const hour = time.getHours()<10?"0".concat(time.getHours()):time.getHours();
+ const minutes = time.getMinutes()<10?"0".concat(time.getMinutes()):time.getMinutes();
+ return time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+hour+":"+minutes;
+}
\ No newline at end of file
diff --git a/src/forge/css/index.scss b/src/forge/css/index.scss
index d9a5b071..a19619d7 100644
--- a/src/forge/css/index.scss
+++ b/src/forge/css/index.scss
@@ -88,14 +88,26 @@ ul,ol,dl{
display: flex;
flex-wrap: wrap;
align-items: center;
+ &>span, & a:link, a:visited{
+ color: #333;
+ }
+ &>span{
+ cursor: default;
+ }
}
.commitDesc{
flex:1;
- margin-left:20px;
- font-size:16px;
- color:#333;
- line-height:26px;
+ line-height:20px;
word-break: break-all;
+ width: 49rem;
+ overflow: hidden;
+ white-space: normal;
+ &:hover{
+ text-decoration: underline;
+ & .markdown-body{
+ color: #466AFF;
+ }
+ }
}
.normalBox{
@@ -143,7 +155,7 @@ form.ant-form{
}
form{
.ant-row.ant-form-item{
- margin-bottom: 15px;
+ margin-bottom: 20px;
}
}
@media screen and (max-width: 1000px){
@@ -285,4 +297,50 @@ form{
border-bottom: none;
}
}
+}
+.btn-83{
+ width: 83px;
+ height: 32px;
+ line-height: 30px;
+ text-align: center;
+ background: #FAFBFC;
+ border: 1px solid #D0D0D0;
+ display: inline-block;
+ border-radius: 5px;
+ font-weight: 500;
+ color: #333333!important;
+ margin-right: 15px;
+ &:hover{
+ background: #F3F4F6;
+ color: #333333!important;
+ }
+ &:active{
+ background: #D0D0D0;
+ color: #333333!important;
+ }
+}
+.shadow:hover{
+ background: #eeeff1;
+ border-bottom-left-radius: 4px;
+ border-top-left-radius: 4px;
+}
+a.hover:hover{
+ text-decoration: underline;
+}
+button.ant-btn-primary.btnblue{
+ background-color:rgba(70, 106, 255, 1);
+ border-color:rgba(70, 106, 255, 1);
+ &:hover{
+ 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;
+ }
}
\ No newline at end of file
diff --git a/src/index.css b/src/index.css
index e58df61f..4c75d804 100644
--- a/src/index.css
+++ b/src/index.css
@@ -30,11 +30,11 @@
.ant-upload-list-item-info .anticon-loading,
.ant-upload-list-item-info .anticon-paper-clip {
- color: #29bd8b !important;
+ color: rgba(102, 102, 102, 1) !important;
}
.anticon anticon-paper-clip {
- color: #29bd8b !important;
+ color: rgba(102, 102, 102, 1) !important;
}
.MuiModal-root-15 {
diff --git a/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js b/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js
index 4f1e6d81..d6df12c4 100644
--- a/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js
+++ b/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js
@@ -53,8 +53,6 @@ class CompetitionContentspdfpeopledata extends Component {
let url = `/users/accounts/${id}.json`;
axios.get(url).then((result) => {
if (result.data) {
- console.log("GetuseridApi");
- console.log(result.data);
this.setState({
userdata:result.data
})
diff --git a/src/modules/courses/css/Courses.css b/src/modules/courses/css/Courses.css
index 73d320ed..cf5f1783 100644
--- a/src/modules/courses/css/Courses.css
+++ b/src/modules/courses/css/Courses.css
@@ -938,7 +938,7 @@ body #root {
}
.ant-input:focus {
- border: 1px solid #d9d9d9 !important;
+ border: 1px solid rgba(70, 106, 255, 1) !important;
}
/* 公用的文字按钮:蓝、白、灰 */
@@ -1423,7 +1423,7 @@ samp {
}
.newcourses .ant-select-selection--single:hover {
- border: 1px solid #d9d9d9 !important;
+ border: 1px solid rgba(70, 106, 255, 1) !important;
}
.pd20 {
@@ -1528,9 +1528,6 @@ samp {
display: none;
}
-.exerciselist .ant-input {
- border: 1px solid #d9d9d9 !important;
-}
.exercisetime .ant-form-explain {
margin-left: 107px;
@@ -1689,18 +1686,12 @@ samp {
height: 40px;
}
-.ant-input-affix-wrapper:hover .ant-input:not(.ant-input-disabled) {
- border: 1px solid #d9d9d9 !important;
-}
.ant-input-affix-wrapper .ant-input-prefix,
.ant-input-affix-wrapper .ant-input-suffix {
background: #fafafa !important;
}
-.ant-input:hover {
- border: 1px solid #d9d9d9 !important;
-}
.ant-input:focus {
box-shadow: none !important;
diff --git a/src/modules/courses/publicNav/nav.css b/src/modules/courses/publicNav/nav.css
index b6d8c7aa..1d6edf78 100644
--- a/src/modules/courses/publicNav/nav.css
+++ b/src/modules/courses/publicNav/nav.css
@@ -11,9 +11,6 @@
.ant-input-affix-wrapper:hover .ant-input:not(.ant-input-disabled){
border:1px solid #d9d9d9!important;
}
-.ant-input:hover{
- border:1px solid #d9d9d9!important;
-}
.ant-input:focus{
box-shadow:none!important;
background-color: #fff!important;
diff --git a/src/modules/tpm/TPMIndex.css b/src/modules/tpm/TPMIndex.css
index 859ddcf9..bdd6d36a 100644
--- a/src/modules/tpm/TPMIndex.css
+++ b/src/modules/tpm/TPMIndex.css
@@ -163,7 +163,6 @@ body>.-task-title {
outline: 0;
-webkit-box-shadow: 0 0 0 2px transparent;
box-shadow: 0 0 0 2px transparent;
- border: 1px solid #d9d9d9;
}
.HeaderSearch .ant-input-search .ant-input::-webkit-input-placeholder {