提交优化-发行版改版

This commit is contained in:
谢思 2021-09-27 10:08:52 +08:00
parent 5d83c85b2d
commit 1402029bfe
11 changed files with 115 additions and 96 deletions

View File

@ -1760,6 +1760,14 @@ a.decoration {
margin-bottom: 10px;
}
.mb12 {
margin-bottom: 12px;
}
.mb13 {
margin-bottom: 13px;
}
.mb14 {
margin-bottom: 14px;
}

View File

@ -3,11 +3,9 @@ import styled from 'styled-components';
import { Link } from 'react-router-dom';
export default ({ url , name , column , id , login })=>{
console.log(url);
console.log(name);
console.log(id);
const Img = styled.span`
display:flex;
font-weight: bold;
${column && "flex-direction: column;text-align:center;"}
align-items: center;
& img{
@ -18,7 +16,6 @@ export default ({ url , name , column , id , login })=>{
${!column && `
& span{
margin-left:8px;
font-weight: bold;
}`
}
`;

View File

@ -20,6 +20,12 @@ function returnbar(str){
}
return str;
}
function timeFormat(seconds) {
const time = new Date(seconds*1000);
return time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+(time.getHours()+1)+":"+time.getMinutes();
}
//代码库--提交页面
class CoderRootCommit extends Component{
constructor(props){
@ -37,8 +43,12 @@ class CoderRootCommit extends Component{
componentDidMount=()=>{
this.Init();
this.getBranchs();
// goBack
// addEventListener
}
// componentde
// 获取分支列表
getBranchs=()=>{
const { projectsId , owner } = this.props.match.params;
@ -91,7 +101,8 @@ class CoderRootCommit extends Component{
image_url:item.author && item.author.image_url,
sha:item.sha,
time_from_now:item.time_from_now,
message:item.message
message:item.message,
timestamp:item.timestamp
})
})
this.setState({
@ -117,6 +128,7 @@ class CoderRootCommit extends Component{
})
this.getCommitList(branchName , page , limit);
}
render(){
const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state;
const { projectDetail, commit_class , defaultBranch } = this.props;
@ -145,35 +157,25 @@ class CoderRootCommit extends Component{
<div className="commitList-item f-wrap-between">
<div>
<AlignTop>
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}`} className="commitDesc font-14 color-grey-3 font-bd">{item.message}</Link>
<div className="commitDesc"><Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}?commitpage=${page}`} className="font-14 color-grey-3 font-bd">{item.message}</Link></div>
</AlignTop>
<p className="f-wrap-alignCenter mt15">
<User
id = {item.id}
url={(item.image_url && getImageUrl(`/${item.image_url}`))|| "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
id={item.id}
url={(item.image_url && getImageUrl(`/${item.image_url}`)) || "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
name={item.name}
login={item.login}
/>
{item.time_from_now && <li className="ml4">提交于{item.time_from_now}</li>}
{/* {
item.id ?
<Link to={`/${item.login}`} className="show-user-link">
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr8 radius"/>:""}
<label className="font-14 color-grey-3" style={{verticalAlign:'middle'}}><label className="font-bd" style={{cursor:"pointer"}}>{item.name ?`${item.name} `:""}</label> {item.time_from_now}</label>
</Link>:
<span className="show-user-link">
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr8 radius"/>:""}
<label className="font-14 color-grey-3" style={{verticalAlign:'middle'}}><label className="font-bd">{item.name ?`${item.name} `:""}</label> {item.time_from_now}</label>
</span>
} */}
{item.timestamp && <label className="font-14 color-grey-3 ml3">提交于 {timeFormat(item.timestamp)}</label>}
</p>
</div>
<div>
<div className="treecopy">
<div className="shadow">
<span className="treecopy-cont">
<div>
<span className="treecopy-cont shadow">
<img src={Tree} alt="sha" width={"16px"}/>
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}`}>{truncateCommitId(`${item.sha}`)}</Link>
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`}/>
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}?commitpage=${page}`}>{truncateCommitId(`${item.sha}`)}</Link>
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`} disabled/>
</span>
<CopyTool beforeText="复制commit id" afterText="复制成功" inputId={`value${k}`}/>
</div>

View File

@ -4,11 +4,10 @@ import { Button ,Spin } from "antd";
import { truncateCommitId } from '../common/util';
import { getImageUrl } from 'educoder';
import Files from '../Merge/Files';
import Tree from "./img/tree.png";
import User from "../Component/User";
import axios from "axios";
import { Link } from "react-router-dom";
const Infos = styled.div`
border: 1px solid #FAFCFF;
@ -17,7 +16,7 @@ const Infos = styled.div`
background-color: #f1f8ff;
border: 1px solid rgba(42, 97, 255, 0.23);
border-radius: 3px 3px 0px 0px;
padding: 10px 8px 10px 16px;
padding: 10px 20px 10px 16px;
& .f-wrap-between{
align-items: center;
}
@ -32,11 +31,14 @@ const Infos = styled.div`
}
}
& > .f-wrap-between {
padding: 14px 8px 14px 16px;
padding: 14px 20px 14px 16px;
border-radius: 3px 3px 0px 0px;
border: 1px solid #D0D0D0;
.df{
align-items: center;
& .underline:hover{
text-decoration: underline;
}
}
}
`;
@ -47,7 +49,7 @@ export default ({ match , history }) => {
const [parents, setParents] = useState(undefined);
const [committer, setCommitter] = useState(undefined);
const [isSpin, setIsSpin] = useState(true);
console.log(match);
const { sha , projectsId, owner, branchName } = match.params;
useEffect(() => {
if (projectsId && owner && sha) {
@ -68,6 +70,11 @@ export default ({ match , history }) => {
});
}
}, [projectsId , owner, sha]);
function timeFormat(seconds) {
const time = new Date(seconds*1000);
return time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+(time.getHours()+1)+":"+time.getMinutes();
}
return (
<div className="main" style={{padding:"0px",border:"none"}}>
@ -79,7 +86,7 @@ export default ({ match , history }) => {
{commit && commit.message &&
<pre className="task-hide">{commit.message}</pre>
}
<i className="iconfont icon-fenzhi2 font-18"></i>{branchName}
<Link to={`/${owner}/${projectsId}/tree/${branchName}`}><i className="iconfont icon-fenzhi2 font-18"></i>{branchName}</Link>
</div>
<Button type="primary" onClick={()=>{history.push(`/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`)}} className="btnblue" style={{height:"36px"}}>浏览文件</Button>
</div>
@ -90,19 +97,9 @@ export default ({ match , history }) => {
id = {committer && committer.id}
url={(committer && getImageUrl(`/${committer.image_url}`))|| "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
name={committer && committer.name}
login={committer && committer.login}
/>
{commit && commit.time_from_now && <li className="ml4">提交于{commit.time_from_now}</li>}
{/* {
item.id ?
<Link to={`/${item.login}`} className="show-user-link">
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr8 radius"/>:""}
<label className="font-14 color-grey-3" style={{verticalAlign:'middle'}}><label className="font-bd" style={{cursor:"pointer"}}>{item.name ?`${item.name} `:""}</label>提交于 {item.time_from_now}</label>
</Link>:
<span className="show-user-link">
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr8 radius"/>:""}
<label className="font-14 color-grey-3" style={{verticalAlign:'middle'}}><label className="font-bd">{item.name ?`${item.name} `:""}</label>提交于 {item.time_from_now}</label>
</span>
} */}
{commit && commit.timestamp && <li className="ml4">提交于{timeFormat(commit.timestamp)}</li>}
</ul>
<li className="df">
{
@ -111,7 +108,7 @@ export default ({ match , history }) => {
<div className="ml40 f-wrap-alignCenter">
<label className="mr8">父节点</label>
<img src={Tree} alt="sha" width={"16px"} className="mr4"/>
<span>{truncateCommitId(item.sha)}</span>
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branchName}`} className="underline">{truncateCommitId(item.sha)}</Link>
</div>
)
})

View File

@ -5,15 +5,15 @@ import './version.scss';
function Empty({operation,addFunc}) {
return(
<div className="emptyPanel color-grey-3">
<i className="iconfont icon-banbenicon font-50 color-grey-6" style={{height:"50px",lineHeight:"50px",marginBottom:"13px"}}></i>
<span className="weight500 font-26 mb15">这里暂未发布过任何版本</span>
<i className="iconfont icon-banbenicon font-50 color-grey-3" style={{height:"50px",lineHeight:"50px",marginBottom:"13px"}}></i>
<span className="weight font-26 mb15">这里暂未发布过任何版本</span>
<span className="weight400" style={{textAlign:"center",lineHeight:"20px"}}>发行版功能基于仓库中的历史标记<br/>建议使用类似 V1.0 的版本标记作为发布点</span>
<div className="operation">
{
operation ?
<Button type={"primary"} onClick={addFunc} className="btnblue" style={{width:"118px",height:"36px"}}>发布新版本</Button>
:
<span className="color-grey-3 weight500 font-16">该项目暂时没有发布版本</span>
<span className="color-grey-3 weight font-16">该项目暂时没有发布版本</span>
}
</div>
</div>

View File

@ -130,7 +130,7 @@ export default Form.create()(
setBranch(params);
}
return (
<div className="df pt20">
<div className="df pt15">
<Form className="versionForm">
<div className="itemInline">
<Form.Item>
@ -211,19 +211,19 @@ export default Form.create()(
)}
</Form.Item>
<p className="pt20" style={{borderTop:"1px solid #eee"}}>
<Button onClick={submit} type="primary" className="mr30">
<Button onClick={submit} type="primary" className="mr30 btnblue">
{versionId ? "保存" : "创建"}发行版
</Button>
<Button
onClick={() =>history.push(`/${owner}/${projectsId}/releases`)}
style={{backgroundColor: "rgba(187,187,187,1)",color: "#fff"}}
// style={{backgroundColor: "rgba(187,187,187,1)",color: "#fff"}}
>取消</Button>
</p>
</Form>
<div className="versionTips">
<div className="infosTip">
<p className="font-16 mb15 weight500">标签命名建议</p>
<p className="mb15">
<p className="font-16 mb14 weight">标签命名建议</p>
<p className="mb20">
通常的做法是在版本名称前加上字母 v 前缀 v1.0 或者 v2.3.4
</p>
<p>
@ -232,13 +232,13 @@ export default Form.create()(
</p>
</div>
<div className="infosTip">
<p className="font-16 mb15 weight500">语义化版本</p>
<p className="font-16 mb14 weight">语义化版本</p>
<p>
如果你是第一次发布版本我们强烈建议你阅读<a className="color-blue">语义化版本</a>
</p>
</div>
<div className="infosTip">
<p className="font-16 mb15 weight500">附件大小说明</p>
<p className="font-16 mb14 weight">附件大小说明</p>
<p>
单个附件不能超过 100MGVP 项目200M每个仓库总附件不可超过
1G推荐项目不可超过 5GGVP 项目不可超过

View File

@ -42,7 +42,7 @@
content: '';
width: 8px;
height: 8px;
background-color: #5091FF;
background-color: #466AFF;
border-radius: 50%;
}
.sendAuthorImg{
@ -242,6 +242,9 @@
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.5);;
}
}
.versionTips{
width:268px;
@ -298,7 +301,7 @@
position: relative;
&>p{
position: absolute;
bottom: 0px;
bottom: -5px;
}
}
.itemInline .ant-row{

View File

@ -11,7 +11,6 @@ function Files({data,history,owner,projectsId}){
const [ files , setFiles ] = useState(data && data.files);
const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径");
const [ isOpen, setIsOpen] = useState(false);
console.log(isOpen);
useEffect(()=>{
if(data){
@ -40,12 +39,12 @@ function Files({data,history,owner,projectsId}){
}
const folderOpen = (
<Anchor showInkInFixed={false}>
<div className={`folderList ${isOpen && "invisable"}`}>
{files && files.length>1 && files.map((item, key) => {
<div className="folders">
<div className="folderList">
{files && files.map((item, key) => {
return (
<Link href={`#value${key}`} title=
{<FlexAJ className="filesInfo" key={key} onClick={() => {item.flag && showDown(item.flag, key, item.isBin);setIsOpen(true);console.log("bbb")}}>
<a href={`#value${key}`}>
<FlexAJ className="filesInfo" key={key} onClick={() => {item.flag && showDown(item.flag, key, item.isBin);setIsOpen(false);}}>
<AlignCenter>
<i className="iconfont icon-wenjianicon mr4"></i>
<span className="cursor-pointer" data-clipboard-text={item.name}>{item.name}</span>
@ -57,26 +56,27 @@ function Files({data,history,owner,projectsId}){
{item.deletion >0 && <span className="color-red ml10">-{item.deletion}</span>}
</Tooltip>
</div>
</FlexAJ>}
/>
</FlexAJ>
</a>
)
})}
</div>
</Anchor>
</div>
)
return(
<div>
<AlignCenter className="color-grey-9 pb10">
<i className="iconfont icon-triangle mr5 font-16"></i>
<Popover content={folderOpen} placement="bottomLeft" trigger="click" onClick={()=>{isOpen && setIsOpen(false);console.log("aaa")}}>
<span className="color-grey-6" style={{cursor:"pointer"}}>
<AlignCenter className="color-grey-9" style={{position:'relative'}}>
<div onClick={()=>{setIsOpen(!isOpen)}}>
<i className={`iconfont mr5 ${isOpen? "font-18 icon-sanjiaoxing-down":"font-16 icon-triangle"}`}></i>
<span className="color-grey-6 update-file-count">
共有<span className="color-grey-3"> {data && data.files_count} 个文件 </span>被更改包括
{ data && data.total_addition ? <span className="color-green"> {data && data.total_addition} 次插入</span>:"" }
{ data && data.total_addition && data.total_deletion ? " 和 ":""}
{ data && data.total_deletion ? <span className="color-red"> {data && data.total_deletion} 次删除</span>:""}
</span>
</Popover>
</div>
{isOpen && folderOpen}
</AlignCenter>
{
files && files.length>0 &&
@ -84,7 +84,8 @@ function Files({data,history,owner,projectsId}){
{
files.map((item,key)=>{
return(
<div className="files" key={key} id= {`value${key}`}>
<div className="files" key={key}>
<a id= {`value${key}`} className="anchorPoint"></a>
<FlexAJ className="filesInfo">
<AlignCenter>
{!item.isBin ? <i className={!item.flag?"iconfont icon-sanjiaoxing-down color-grey-9 mt4":"iconfont icon-triangle font-15 color-grey-9 mt4"} onClick={()=>showDown(item.flag,key,item.isBin)}></i>:""}

View File

@ -19,28 +19,33 @@
border:1px solid #FA6400;
color: #FA6400;
}
.color-grey-3{
font-weight: bold;
}
.invisable{
display: none;
.update-file-count{
cursor: pointer;
& .color-grey-3{
font-weight: bold;
}
}
.fileList{
.sc-bxivhb{
width: 55rem;
}
.see-file{
width: 15rem;
width: 14rem;
.ml10{
display: inline-block;
width: 5rem;
width: 4.5rem;
cursor: default;
}
span{
width: 7%;
}
}
.anchorPoint{
position: relative;
top: -5rem;
display: block;
height: 0;
}
}
.filesInfo{
background: #FAFCFF;
@ -52,28 +57,28 @@
background-color: #D14A4A;
}
}
.ant-popover-arrow,.ant-anchor-ink-ball {
display: none;
}
.ant-popover-inner {
margin-left: -21px;
background: #FFF;
}
.ant-anchor-link,.ant-popover-inner-content{
padding: 0 0;
}
.ant-anchor-wrapper,.ant-anchor{
.folders,.ant-anchor{
margin-left: 0;
padding-left: 0;
}
.ant-anchor-link-active > .ant-anchor-link-title {
color: #466AFF;
}
.ant-popover-inner-content{
.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: 280px;
max-height: 275px;
overflow:auto;
.files{
border: 0px;

View File

@ -109,7 +109,7 @@ class Index extends Component {
:
<Dragger {...upload} className={className}>
{icon || <Icon type="inbox" />}
<p className="ant-upload-text font-14">拖动文件或点击此处上传</p>
<p className="ant-upload-text font-16 color-grey-3">拖动文件或点击此处上传</p>
</Dragger>
)
}

View File

@ -88,12 +88,18 @@ ul,ol,dl{
display: flex;
flex-wrap: wrap;
align-items: center;
&>span, & a:link, a:visited{
color: #333;
}
&>span{
cursor: default;
}
}
.commitDesc{
flex:1;
line-height:20px;
word-break: break-all;
width: 48rem;
width: 49rem;
overflow: hidden;
white-space: normal;
&:hover{