diff --git a/package-lock.json b/package-lock.json index 96077ad36..9ea84263c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7286,7 +7286,8 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "optional": true }, "aproba": { "version": "1.2.0", @@ -7703,7 +7704,8 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -7759,6 +7761,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -7802,12 +7805,14 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "optional": true }, "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "optional": true } } }, diff --git a/src/forge/Branch/Select.jsx b/src/forge/Branch/Select.jsx index 601b94e8b..4937686d1 100644 --- a/src/forge/Branch/Select.jsx +++ b/src/forge/Branch/Select.jsx @@ -4,7 +4,6 @@ import './branch.scss'; import { getBranch , getTag } from '../GetData/getData'; import SelectOverlay from './SelectOverlay'; - export default (({ projectsId , branch , owner , changeBranch , branchList , tagflag = true })=>{ const [ showValue , setShowValue ] = useState(branch); @@ -26,7 +25,7 @@ export default (({ projectsId , branch , owner , changeBranch , branchList , tag
{/* {nav === 0 ?"分支":"标签"} */} - + {showValue} diff --git a/src/forge/Component/Releases.jsx b/src/forge/Component/Releases.jsx index 7a287d964..3ed27867b 100644 --- a/src/forge/Component/Releases.jsx +++ b/src/forge/Component/Releases.jsx @@ -15,9 +15,9 @@ function Releases({owner,projectsId,releaseVersions , baseOperate , projectType} return( key === 0 &&
-

+

{/* 如果是点击最新则发行版列表页只展示最新的一个 */} - {item.name} + {item.name} 最新

{item.created_at}

diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 545b92fe1..1ba951203 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -201,6 +201,7 @@ function CoderDepot(props){ setLastCommit(c && c.commit); setLastCommitAuthor(c && c.committer); setMainFlag(false); + setReadme(result.data.readme) setReadOnly(true); setReadOnly(!editReadme); setHide(true); diff --git a/src/forge/Main/tag/Index.jsx b/src/forge/Main/tag/Index.jsx index 7ab02ac42..d5c2593e9 100644 --- a/src/forge/Main/tag/Index.jsx +++ b/src/forge/Main/tag/Index.jsx @@ -6,29 +6,21 @@ import { Link } from 'react-router-dom'; import { truncateCommitId } from '../../common/util'; import './Index.scss'; import Tree from '../img/tree.png' -import Pagination from 'rc-pagination'; +import moment from 'moment'; -const limit = 15; function Tags(props) { - const [ source , setSource ] = useState([]); - const [ total ,setTotal ] = useState(0); - const [ page , setPage ] = useState(1); + const [ source , setSource ] = useState([]); const { projectsId , owner } = props.match.params; useEffect(() => { if (projectsId) { const url = `/${owner}/${projectsId}/tags.json`; - axios.get(url,{ - // params:{ - // limit - // } - }).then((result) => { + axios.get(url).then((result) => { if (result) { setSource(result.data); - setTotal(result.data.total_count); } }).catch(error => {}) } @@ -53,7 +45,7 @@ function Tags(props) { return ( {item.commit && item.commit.name} - 创建于{item.commit && item.commit.time} + 创建于{item.commit && item.commit.time_ago} ) } @@ -65,7 +57,7 @@ function Tags(props) { ellipsis:true, render:(txt,item)=>{ return ( - + 提交ID {truncateCommitId(item.id)} @@ -91,12 +83,13 @@ function Tags(props) { render:(txt,item)=>{ return ( ) } @@ -106,10 +99,6 @@ function Tags(props) {
- { - total > limit && - setPage(p)}/> - }
) } diff --git a/src/forge/Main/tree/Index.jsx b/src/forge/Main/tree/Index.jsx index 3d532de5f..9324cd596 100644 --- a/src/forge/Main/tree/Index.jsx +++ b/src/forge/Main/tree/Index.jsx @@ -63,7 +63,7 @@ function Index(props) {
{i.name}
- + {last_commit && last_commit.committer && last_commit.committer.name} 更新于{last_commit && last_commit.time_from_now}
diff --git a/src/forge/Main/version/New.jsx b/src/forge/Main/version/New.jsx index 3f432e94d..ca9057caa 100644 --- a/src/forge/Main/version/New.jsx +++ b/src/forge/Main/version/New.jsx @@ -8,6 +8,7 @@ import Upload from "../../Upload/Index"; import Attachments from "../../Upload/attachment"; import axios from "axios"; import "./version.scss"; +import { trim } from "lodash"; const { Option } = AutoComplete; @@ -137,8 +138,14 @@ export default Form.create()( {getFieldDecorator("tag_name", { rules:[ - { required: true, message: "请输入获取或选择一个标签" } - ], + { required: true, message: "请输入获取或选择一个标签" }, + { validator: (rule,val,callback) =>{ + if(val.length>30 || val.indexOf(' ')>0 || val.match(/^\s+$/) || trim(val).length!=val.length){ + callback('无效的标签名称,请参考右侧建议命名标签并确认长度在1~30个字符之间'); + }else{ + callback(); + } + }}], validateFirst: true })( {getFieldDecorator("name", { rules:[ - { required: true, message: "请输入发行版的标题" } - ], + { required: true, message: "请输入发行版的标题" }, + { validator: (rule,val,callback) =>{ + if(val.length>50){ + callback('标题长度在1~50个字符之间'); + }else{ + callback(); + } + }}], validateFirst: true })( diff --git a/src/forge/Main/version/version.js b/src/forge/Main/version/version.js index fced2f7fd..bbc145b9c 100644 --- a/src/forge/Main/version/version.js +++ b/src/forge/Main/version/version.js @@ -34,6 +34,7 @@ function version(props) { setReleases(result.data.releases); setIsSpin(false); } + }).catch((error) => { console.log(error); }) @@ -71,10 +72,10 @@ function version(props) {
- 发布{item.name} + {item.name} - {data && data.user_admin_permission && } - {data && data.user_admin_permission && {deleteRelease(item.version_id)}}>} + {data && data.user_permission && type !== 2 && } + {data && data.user_permission && type !== 2 && {deleteRelease(item.version_id)}}>}
@@ -97,7 +98,7 @@ function version(props) {

{/* 发行版附件下载 */} {item.attachments && item.attachments.map((item)=>{ - return(下载 {item.title}) + return(下载 {item.title}) })} {/* 发行版下载包 */} 下载 {item.tag_name}.TAR.gz @@ -112,7 +113,7 @@ function version(props) { return ( { - data && data.user_admin_permission && + data && data.user_permission && type !== 2 &&

@@ -125,7 +126,7 @@ function version(props) { } else if (releases && releases.length === 0) { return ( ) diff --git a/src/forge/css/index.scss b/src/forge/css/index.scss index 9f5e8cb3f..5926c734f 100644 --- a/src/forge/css/index.scss +++ b/src/forge/css/index.scss @@ -306,6 +306,7 @@ form{ border-radius: 5px; font-weight: 500; color: #333333!important; + margin-right: 15px; &:hover{ background: #F3F4F6; color: #333333!important;