diff --git a/package-lock.json b/package-lock.json index 96077ad3..9ea84263 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 601b94e8..4937686d 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 7a287d96..3ed27867 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/version/New.jsx b/src/forge/Main/version/New.jsx index 3f432e94..ca9057ca 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 fced2f7f..bbc145b9 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 ( )