代码库二级页面改版issue

This commit is contained in:
谢思 2021-09-30 15:45:14 +08:00
parent 5726969431
commit c42d249fd9
5 changed files with 36 additions and 18 deletions

13
package-lock.json generated
View File

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

View File

@ -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
<div className="branch-tagBox">
{/* {nav === 0 ?"分支":"标签"} */}
<span className="color-grey-9 mr3 ml8"><i className="iconfont icon-fenzhi2 font-18"></i></span>
<span className="ant-dropdown-link task-hide" style={{fontWeight:"500",minWidth:"45px"}}>
<span className="ant-dropdown-link task-hide" style={{fontWeight:"500",minWidth:"45px",maxWidth:"270px"}}>
{showValue}
</span>
<i className="showtag iconfont icon-sanjiaoxing-down font-15 color-grey-9 mr5 ml5 mt1" />

View File

@ -15,9 +15,9 @@ function Releases({owner,projectsId,releaseVersions , baseOperate , projectType}
return(
key === 0 &&<AlignTop className="mt10">
<div>
<p className="font-16 color-grey-6">
<p className="font-16 color-grey-6" style={{display:'flex',alignItems:'center'}}>
{/* 如果是点击最新则发行版列表页只展示最新的一个 */}
<Link to={{pathname:`/${owner}/${projectsId}/releases`,query:{turnFromNew:true}}}>{item.name}</Link>
<Link to={{pathname:`/${owner}/${projectsId}/releases`,query:{turnFromNew:true}}} style={{maxWidth:'200px',overflow: 'hidden',whiteSpace: 'nowrap',textOverflow:'ellipsis'}}>{item.name}</Link>
<span className="font-12 laterest ml5">最新</span>
</p>
<p className="color-grey-3 font-12">{item.created_at}</p>

View File

@ -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()(
<Form.Item>
{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
})(
<AutoComplete
@ -166,8 +173,14 @@ export default Form.create()(
<Form.Item className="pt20">
{getFieldDecorator("name",
{ rules:[
{ required: true, message: "请输入发行版的标题" }
],
{ required: true, message: "请输入发行版的标题" },
{ validator: (rule,val,callback) =>{
if(val.length>50){
callback('标题长度在1~50个字符之间');
}else{
callback();
}
}}],
validateFirst: true
})(
<Input placeholder="发行版的标题" />

View File

@ -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) {
</span>
<div className="versionInfo_right">
<div className="versionName">
<Link to={`/${owner}/${projectsId}/tree/${item.tag_name}`} className="task-hide color-blue hover font-18">发布{item.name}</Link>
<Link to={`/${owner}/${projectsId}/tree/${item.tag_name}`} className="task-hide color-blue hover font-18">{item.name}</Link>
<span>
{data && data.user_admin_permission && <Link to={{pathname:`/${owner}/${projectsId}/releases/${item.version_id}/update`,state:{"stable":item.draft==="稳定"}}} className="ml15"><i className="iconfont icon-a-bianji1 font-16 color-grey-6"></i></Link>}
{data && data.user_admin_permission && <i className ="iconfont icon-shanchuicon1 font-16 ml15" onClick={()=>{deleteRelease(item.version_id)}}></i>}
{data && data.user_permission && type !== 2 && <Link to={{pathname:`/${owner}/${projectsId}/releases/${item.version_id}/update`,state:{"stable":item.draft==="稳定"}}} className="ml15"><i className="iconfont icon-a-bianji1 font-16 color-grey-6"></i></Link>}
{data && data.user_permission && type !== 2 && <i className ="iconfont icon-shanchuicon1 font-16 ml15" onClick={()=>{deleteRelease(item.version_id)}}></i>}
</span>
</div>
<span className="color-grey-3 mb15 version-user">
@ -97,7 +98,7 @@ function version(props) {
<p className="versionFile">
{/* 发行版附件下载 */}
{item.attachments && item.attachments.map((item)=>{
return(<Link to={`${item.url}`}><i className="iconfont icon-wenjian7 font-14 mr10 color-grey-3"></i> {item.title}</Link>)
return(<a href={item.url}><i className="iconfont icon-wenjian7 font-14 mr10 color-grey-3"></i> {item.title}</a>)
})}
{/* 发行版下载包 */}
<a href={item.tarball_url}><i className="iconfont icon-wenjian7 font-14 mr10 color-grey-3"></i> {item.tag_name}.TAR.gz</a>
@ -112,7 +113,7 @@ function version(props) {
return (
<React.Fragment>
{
data && data.user_admin_permission &&
data && data.user_permission && type !== 2 &&
<div className="addReleaseBtn">
<Button type={"primary"} onClick={addFunc} className="btnblue" style={{height:"36px"}}>发布新版本</Button>
</div>
@ -125,7 +126,7 @@ function version(props) {
} else if (releases && releases.length === 0) {
return (
<Empty
operation={data && data.user_admin_permission}
operation={data && data.user_permission && type !== 2}
addFunc={addFunc}
/>
)