change style for tag

This commit is contained in:
sylor_huang@126.com 2020-06-30 10:27:05 +08:00
commit 39698e42da
18 changed files with 256 additions and 95 deletions

View File

@ -29,4 +29,12 @@
color:#fff !important;
}
.display-flex{display: flex !important;}
.merge-flex1{flex:1}
.merge-flex1{flex:1}
.ant-tag.pr-branch-tag{
border-radius: 12px;
height: 24px;
background: rgba(241,248,255,1);
border: none;
font-size: 13px;
padding: 0 10px;
}

View File

@ -14,7 +14,7 @@ li.ant-menu-item{
align-items: center;
padding:20px 34px;
background-color: #fff;
margin:18px 0px;
margin-bottom:18px;
.img{
margin-right: 20px;
width: 190px;

View File

@ -48,8 +48,8 @@ export const WhiteBack = styled.div`{
border-radius:5px;
}`
export const Blueline = styled.a`{
height:32px;
line-height:30px;
height:30px;
line-height:28px;
border-radius:2px;
border:1px solid rgba(80,145,255,1);
color:rgba(80,145,255,1);
@ -57,8 +57,8 @@ export const Blueline = styled.a`{
display:inline-block;
}`
export const Redline = styled.a`{
height:32px;
line-height:32px;
height:30px;
line-height:28px;
border-radius:2px;
border:1px solid #F73030;
color:#F73030;
@ -68,8 +68,8 @@ export const Redline = styled.a`{
text-align:center;
}`
export const Greenline = styled.a`{
height:32px;
line-height:32px;
height:30px;
line-height:28px;
border-radius:2px;
border:1px solid #28BD6C;
color:#28BD6C;
@ -78,6 +78,28 @@ export const Greenline = styled.a`{
min-width:80px;
text-align:center;
}`
export const Greenback = styled.a`{
height:30px;
line-height:30px;
border-radius:2px;
background-color:#28BD6C;
color:#fff;
padding:0px 12px;
display:inline-block;
min-width:80px;
text-align:center;
}`
export const Redback = styled.a`{
height:30px;
line-height:30px;
border-radius:2px;
background-color:#F73030;
color:#fff;
padding:0px 12px;
display:inline-block;
min-width:80px;
text-align:center;
}`
export const NumUl = styled.ul`{
padding-left: 20px;
& > li{

View File

@ -10,6 +10,7 @@ import RootTable from './RootTable';
import CoderRootFileDetail from './CoderRootFileDetail';
import { truncateCommitId } from '../common/util';
import RenderHtml from '../../components/render-html';
import Top from './DetailTop';
import axios from "axios";
/**
@ -42,7 +43,11 @@ class CoderRootDirectory extends Component {
readOnly: true,
zip_url:undefined,
tar_url:undefined,
chooseType:undefined
chooseType:undefined,
tags_count:undefined,
commits_count:undefined,
branches_count:undefined
}
}
changeAddress = (address) => {
@ -122,6 +127,9 @@ class CoderRootDirectory extends Component {
(last_commit.commit && last_commit.commit.author)),
zip_url: result.data.zip_url,
tar_url: result.data.tar_url,
tags_count: result.data.tags_count,
branches_count: result.data.branches_count,
commits_count: result.data.commits_count
});
if (entries && entries.length > 0) {
this.renderData(entries);
@ -440,14 +448,15 @@ class CoderRootDirectory extends Component {
let array = filePath && filePath.split("/");
return (
<Spin spinning={isSpin}>
<Top {...this.props} {...this.state}/>
<div className="main">
<div className="f-wrap-between mb20">
<div className="f-wrap-alignCenter">
<SelectBranch
repo_id={projectDetail && projectDetail.repo_id}
projectsId={projectsId}
<SelectBranch
repo_id={projectDetail && projectDetail.repo_id}
projectsId={projectsId}
branch={branch}
changeBranch={this.changeBranch}
changeBranch={this.changeBranch}
></SelectBranch>
{filePath && (

View File

@ -3,7 +3,6 @@ import { Route , Switch } from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '../../Loading';
import Top from './DetailTop';
const CoderRootDirectory = Loadable({
@ -40,11 +39,9 @@ const Diff = Loadable({
})
class CoderRootIndex extends Component{
render(){
return(
<div>
<Top {...this.props} {...this.state}/>
<Switch {...this.props}>
<Route path="/projects/:projectsId/coders/commit"
render={
@ -68,7 +65,7 @@ class CoderRootIndex extends Component{
(props) => (<CoderRootVersionUpdate {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/projects/:projectsId/coders/version"
render={
(props) => (<CoderRootVersion {...this.props} {...props} {...this.state} />)
@ -99,4 +96,4 @@ class CoderRootIndex extends Component{
)
}
}
export default CoderRootIndex;
export default CoderRootIndex;

View File

@ -145,19 +145,31 @@ class Detail extends Component {
author: undefined,
branchs: undefined,
branchList: undefined,
project: null
}
}
componentDidMount = () => {
this.getProject();
this.getDetail();
}
componentDidUpdate = (prevState) => {
if ((prevState.match.params.projectsId !== this.props.match.params.projectsId)) {
this.getProject();
this.getDetail();
}
}
getProject = () => {
const { projectsId } = this.props.match.params;
const url = `/projects/${projectsId}/simple.json`;
axios.get(url).then((result) => {
this.setState({
project: result.data
})
})
}
getDetail = () => {
const { projectsId } = this.props.match.params;
@ -186,7 +198,7 @@ class Detail extends Component {
// 关注和取消关注
focusFunc = (flag) => {
const { project_id } = this.state;
axios({
method: flag? 'delete' : 'post',
url: `/watchers/${flag? 'unfollow' : 'follow'}.json`,
@ -262,25 +274,7 @@ class Detail extends Component {
console.log(error);
})
}
// 获取分支列表
getBranch = (id) => {
const url = `/projects/${id}/branches.json`;
axios.get(url).then((result) => {
if (result && result.data.length > 0) {
const branchs = [];
result.data.map((item, key) => {
branchs.push({
index: key,
name: item.name
})
})
this.setState({
branchList: result.data,
branchs,
})
}
}).catch((error) => { })
}
// 同步镜像
synchronismMirror=()=>{
@ -292,6 +286,7 @@ class Detail extends Component {
axios.post(url).then(result=>{
if(result && result.data && result.data.status === 0){
this.props.showNotification("镜像同步成功!");
this.getProject();
this.getDetail();
}else{
this.props.showNotification("镜像同步失败!");
@ -299,14 +294,14 @@ class Detail extends Component {
isSpin:false
})
}
}).catch(error=>{
console.log(error);
})
}
render() {
const { projectDetail, watchers_count, praises_count, forked_count, isSpin, isManager, watched, praised } = this.state;
const { projectDetail, watchers_count, praises_count, forked_count, isSpin, isManager, watched, praised, project } = this.state;
const url = this.props.history.location.pathname;
const urlArr = url.split("/");
const urlFlag = (urlArr.length === 3);
@ -337,19 +332,18 @@ class Detail extends Component {
}
return (
<div>
<Spin spinning={isSpin}>
<div className="detailHeader-wrapper">
<div className="normal">
<div className="f-wrap-between mb15" style={{ position: "relative" }}>
<p className="font-22 color-white df flex-1 lineH2 mt15" style={{ alignItems: "center" }}>
{projectDetail && projectDetail.author &&
<Link to={`/users/${projectDetail.author.login}`} className="show-user-link color-white">
{projectDetail.author.name}
<p className="font-18 color-white df flex-1 lineH2 mt15" style={{ alignItems: "center" }}>
{project && project.author &&
<Link to={`/users/${project.author.login}`} className="show-user-link color-white">
{project.author.name}
</Link>
}
<span className="ml5 mr5">/</span>
<span className="hide-1 flex-1 df">
<Link to={`/projects/${projectsId}/coders`} className="color-white font-22">{projectDetail && projectDetail.name}</Link>
<Link to={`/projects/${projectsId}/coders`} className="color-white font-22">{project && project.name}</Link>
{
projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ?
<Tooltip placement={'right'} title={text}>
@ -404,7 +398,6 @@ class Detail extends Component {
<li className={(url.indexOf("coders") > -1 || urlFlag) ? "active" : ""}>
<Link to={{ pathname: `/projects/${projectsId}/coders`, state }}>
<img alt="" src={img_1} width="18" />代码库
{ projectDetail && projectDetail.commits_count ? <span>{projectDetail.commits_count}</span>:""}
</Link>
</li>
<li className={(url.indexOf("orders") > -1 && !(url.indexOf("Milepost") > 0 || url.indexOf("meilpost") > 0 || url.indexOf("tags") > 0)) ? "active" : ""}>
@ -546,7 +539,7 @@ class Detail extends Component {
<Route path="/projects/:projectsId/merge/new"
render={
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork= {true}/>)
}
></Route>
@ -604,7 +597,6 @@ class Detail extends Component {
}
></Route>
</Switch>
</Spin>
</div>
)
}

View File

@ -3,22 +3,22 @@ import { Link } from 'react-router-dom';
class DetailTop extends Component {
render() {
const { projectDetail } = this.props;
const { projectDetail, tags_count, commits_count, branches_count } = this.props;
const { projectsId } = this.props.match.params;
const { pathname } = this.props.location;
return (
<p className="branch-wrapper">
<Link to={`/projects/${projectsId}/coders/commit`} className={pathname.indexOf("/coders/commit") > 0 ? "active" : ""}>
<i className="iconfont icon-tijiaojilu font-20 mr3 font-bd"></i>
<span>{projectDetail && projectDetail.commits_count}</span>
<span>{commits_count}</span>
</Link>
<Link to={`/projects/${projectsId}/coders/branch`} className={pathname.indexOf("/coders/branch") > 0 ? "active" : ""}>
<i className="iconfont icon-fenzhi1 font-18 mr3"></i>
<span>{projectDetail && projectDetail.branches_count}</span>
<span>{branches_count}</span>
</Link>
<Link to={`/projects/${projectsId}/coders/tag`} className={pathname.indexOf("/coders/tag") > 0 ? "active" : ""}>
<i className="iconfont icon-biaoqian3 font-18 mr3"></i>
<span>{projectDetail && projectDetail.issue_tags_count}</span>
<span>{tags_count}</span>
</Link>
<Link to={`/projects/${projectsId}/coders/version`} className={pathname.indexOf("/coders/version") > 0 ? "active" : ""}>
<i className="iconfont icon-fahangban font-18 mr3"></i>

View File

@ -96,7 +96,7 @@ class MergeItem extends Component {
</span>
<span className="color-grey-8">{item.pr_time}</span>
<span className="ml15">
<Tag>
<Tag className="pr-branch-tag">
<Link
to={`projects/${
item.is_original ? item.fork_project_id : projectsId
@ -116,7 +116,7 @@ class MergeItem extends Component {
}
></i>
</span>
<Tag>
<Tag className="pr-branch-tag">
<Link
to={`projects/${projectsId}/coders?branch=${item.pull_request_base}`}
className="maxW200px hide-1 ver-middle"

View File

@ -256,7 +256,7 @@ class MessageCount extends Component {
</div>
{
<div className="mt15">
<Tag>
<Tag className="pr-branch-tag">
<Link
to={`projects/${data.pull_request.is_original?data.pull_request.fork_project_id:projectsId}/coders?branch=${data.pull_request.head}`}
className="ver-middle"
@ -271,7 +271,7 @@ class MessageCount extends Component {
}
></i>
</span>
<Tag>
<Tag className="pr-branch-tag">
<Link
to={`projects/${projectsId}/coders?branch=${data.pull_request.base}`}
className="ver-middle"

View File

@ -216,6 +216,21 @@ class Index extends Component {
})
}
ChangeAddr=(e)=>{
let value = e.target.value;
if(value.indexOf("/") > -1){
let arr = value.split("/");
let first = arr[arr.length-1];
if(first.indexOf(".git") > -1){
let second = first.split('.')[0];
if(!second)return;
this.props.form.setFieldsValue({
repository_name:second
})
}
}
}
render() {
const { getFieldDecorator } = this.props.form;
// 项目类型deposit-托管项目mirror-镜像项目
@ -262,7 +277,7 @@ class Index extends Component {
required: true, message: '请填写镜像版本库地址'
}],
})(
<Input placeholder="输入需要同步到本项目的镜像版本库地址" />
<Input placeholder="输入需要同步到本项目的镜像版本库地址" onChange={this.ChangeAddr} />
)}
</Form.Item>
<p className="formTip color-orange">示例https://github.com/facebook/reack.git</p>

View File

@ -5,7 +5,7 @@
.setInputAddon .ant-input-group-addon{
height: 30px;
line-height: 30px;
border-left: 1px solid #d9d9d9!important;
border: 1px solid #d9d9d9!important;
border-right: none!important;
}

View File

@ -55,7 +55,6 @@ class order extends Component {
allValue: [],
all: false,
select_params: {
status_type: "1", //开启中和关闭中,全部,默认为全部
assigned_to_id: undefined, // 负责人
author_id: undefined, // 发布人
issue_tag_id: undefined, // 标签
@ -77,7 +76,7 @@ class order extends Component {
componentDidMount = () => {
this.getSelectList();
this.getIssueList();
this.getIssueList('1');
};
getSelectList = () => {
@ -101,7 +100,7 @@ class order extends Component {
};
// 获取列表数据
getIssueList = (begin, end) => {
getIssueList = (status_type , begin, end) => {
this.setState({
isSpin: true
})
@ -113,7 +112,8 @@ class order extends Component {
params: {
...select_params,
start_date: begin,
due_date: end
due_date: end,
status_type
}
})
.then((result) => {
@ -165,7 +165,8 @@ class order extends Component {
this.state.select_params.order_name = key_name[0];
this.state.select_params.order_type = e.item.props.value;
this.state.select_params.page = 1;
this.getIssueList();
const { status_type } = this.state;
this.getIssueList(status_type);
};
getOption = (e, id, name,toGet) => {
@ -192,7 +193,8 @@ class order extends Component {
assigned_to_id
});
if(!toGet){
this.getIssueList();
const { status_type } = this.state;
this.getIssueList(status_type);
}
};
@ -225,8 +227,10 @@ class order extends Component {
checkedValue: [],
all: false
});
const { status_type } = this.state;
this.state.select_params.page = page;
this.getIssueList();
this.getIssueList(status_type);
};
// 搜索
@ -235,9 +239,11 @@ class order extends Component {
search: value,
isSpin: true,
});
const { status_type } = this.state;
this.state.select_params.search = value;
this.state.select_params.page = 1;
this.getIssueList();
this.getIssueList(status_type);
};
openorder = (type) => {
@ -254,12 +260,11 @@ class order extends Component {
paix: "排序",
});
this.state.select_params = {
status_type: type,
search: undefined,
page: 1,
limit: 15,
};
this.getIssueList();
this.getIssueList(type);
};
// 筛选:全部、指派给我、由我创建
@ -269,7 +274,7 @@ class order extends Component {
isSpin: true,
});
if (type) {
if (current_user === undefined) {
if (!current_user) {
this.setState({
isSpin: false,
});
@ -304,8 +309,9 @@ class order extends Component {
this.state.select_params.assigned_to_id = undefined;
this.state.select_params.author_id = undefined;
}
const { status_type } = this.state;
this.getIssueList();
this.getIssueList(status_type);
};
deletedetail = (id) => {
@ -319,7 +325,9 @@ class order extends Component {
})
.then((result) => {
if (result) {
this.getIssueList();
const { status_type } = this.state;
this.getIssueList(status_type);
}
})
.catch((error) => {
@ -339,16 +347,18 @@ class order extends Component {
// 修改开始时间
changeBeginTime = (data, value) => {
const { status_type } = this.state;
this.setState({
begin: value
})
this.getIssueList(value, this.state.end);
this.getIssueList(status_type,value, this.state.end);
}
changeEndTime = (data, value) => {
const { status_type } = this.state;
this.setState({
end: value
})
this.getIssueList(this.state.begin, value);
this.getIssueList(status_type,this.state.begin, value);
}
// 选择列表里面的checkbox
@ -395,6 +405,11 @@ class order extends Component {
updateIssues=()=>{
const {checkedValue , select_params} = this.state;
const { projectsId } = this.props.match.params;
if(!select_params.update_author_id && !select_params.update_fixed_version_id &&!select_params.update_status_id ){
this.resetSelectParams();
return;
}
this.setState({
isSpin:true
})
@ -415,6 +430,12 @@ class order extends Component {
}
successFunc=()=>{
this.resetSelectParams();
const { status_type } = this.state;
this.getIssueList(status_type);
}
resetSelectParams=()=>{
let select_params = this.state.select_params;
select_params.update_author_id = undefined;
select_params.update_fixed_version_id = undefined;
@ -427,7 +448,6 @@ class order extends Component {
update_status_ids:"修改状态",
select_params
})
this.getIssueList();
}
// 批量删除

View File

@ -468,7 +468,7 @@ class Collaborator extends Component {
<Spin spinning={isSpin}>
<div className="collaboratorList baseForm">
{listData ? (
{listData && listData.length>0 ? (
<Table
pagination={false}
columns={columns}

View File

@ -25,6 +25,9 @@
.baseForm{
padding:15px 30px!important;
}
.collaboratorList{
min-height: 400px;
}
.iteminline{
display: flex;
align-items: center;
@ -172,6 +175,10 @@
}
.ant-table-tbody > tr > td{
border-bottom: none;
padding:15px 8px 15px 0px;
}
.ant-table-tbody > tr > td:last-child{
padding-right: 0px;
}
}

View File

@ -1,32 +1,35 @@
import React , { useState } from 'react';
import { Box , Long , Short , Gap , Banner , WhiteBack } from '../../Component/layout';
import { Box , Long , Short , Gap , WhiteBack } from '../../Component/layout';
import Title from '../../Component/Title';
import Setnav from '../../Component/Setnav';
import styled from 'styled-components';
const Div = styled.div`{
padding:18px 30px;
}`
import { Route, Switch } from "react-router-dom";
import Loadable from "react-loadable";
import Loading from "../../../Loading";
const Common = Loadable({
loader: () => import("./SettingCommon"),
loading: Loading,
});
export default (props)=>{
const pathname = props.location.pathname;
const organizeId = props.match.params.organizeId;
const memberId = props.match.params.memberId;
function returnActive (pathname){
let a = 0;
if(pathname === `/organize/${organizeId}/setting/member`){
if(pathname === `/organize/${organizeId}/member/${memberId}/setting/member`){
a = 1;
}else if(pathname === `/organize/${organizeId}/setting/group`){
}else if(pathname === `/organize/${organizeId}/member/${memberId}/setting/project`){
a = 2;
}else if(pathname === `/organize/${organizeId}/setting/hooks`){
a = 3;
}
return a;
}
const active = returnActive(pathname);
const array = {list:[
{name:'基本设置',icon:"icon-base",href:`/organize/${organizeId}/setting`},
{name:'团队成员管理',icon:"icon-zuzhichengyuan",href:`/organize/${organizeId}/setting/member`},
{name:'团队项目管理',icon:"icon-zuzhixiangmu",href:`/organize/${organizeId}/setting/group`},
{name:'基本设置',icon:"icon-base",href:`/organize/${organizeId}/member/${memberId}/setting`},
{name:'团队成员管理',icon:"icon-zuzhichengyuan",href:`/organize/${organizeId}/member/${memberId}/setting/member`},
{name:'团队项目管理',icon:"icon-zuzhixiangmu",href:`/organize/${organizeId}/member/${memberId}/setting/project`},
],
active
}
@ -38,10 +41,14 @@ export default (props)=>{
<Long>
<Gap>
<WhiteBack>
<Banner>团队项目管理</Banner>
<Div>
</Div>
<Switch>
<Route
path="/organize/:organizeId/member/:memberId/setting"
render={() => (
<Common {...props} />
)}
></Route>
</Switch>
</WhiteBack>
</Gap>
</Long>

View File

@ -0,0 +1,67 @@
import React , { useState } from 'react';
import { AutoComplete , Pagination } from 'antd';
import { Banner , Blueline , FlexAJ , Greenback , Redback } from '../../Component/layout';
import styled from 'styled-components';
const Option = AutoComplete.Option;
const Div = styled.div`{
padding:18px 30px;
}`;
const LIMIT = 15;
const demoData=[{name:"Python相关",id:1},{name:"Python相关",id:2}];
export default ()=>{
const [ searchKey , setSearchKey ] = useState(undefined);
const [ page , setPage ] = useState(1);
const [ total , setTotal ] = useState(0);
function changeInputUser(){}
function selectInputUser(){}
//
function ChangePage(page){
setPage(page);
}
const source = demoData && demoData.map((item,key)=>{
return(
<Option key={key} value={`${item.id}`}>{item.name}</Option>
)
})
return(
<div>
<Banner>团队项目管理</Banner>
<Div>
<FlexAJ className="actionNav">
<div>
<AutoComplete
dataSource={source}
value={searchKey}
style={{ width: 270 }}
onChange={changeInputUser}
onSelect={selectInputUser}
placeholder="搜索项目…"
/>
<Blueline className="ml30">+&nbsp;添加项目</Blueline>
</div>
<span>
<Greenback>添加所有</Greenback>
<Redback className="ml20">移除所有</Redback>
</span>
</FlexAJ>
<div className="GSlist">
<div>
<span>
caishi/前端v0.1
</span>
<a style={{color:"#F73030"}}>移除</a>
</div>
</div>
{
total > LIMIT ?
<div className="edu-txt-center mt30 mb20">
<Pagination simple defaultCurrent={page} total={total} pageSize={LIMIT} onChange={ChangePage}></Pagination>
</div>:""
}
</Div>
</div>
)
}

View File

@ -38,6 +38,7 @@
.teamDetail{
width: 1200px;
margin:0px auto;
padding-top:18px;
}
.list{
display: flex;
@ -322,3 +323,19 @@
}
}
// 组织团队设置
.actionNav{
padding:20px 30px;
background-color: #FAFAFA;
}
.GSlist{
padding-top:15px;
min-height: 400px;
&>div{
padding:20px 0px;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #eee;
}
}

View File

@ -31,19 +31,19 @@ export default ((props)=>{
<Switch {...props}>
<Route
path="/organize/:organizeId/member/:memberId/setting"
render={(props) => {
render={() => {
return <GroupSetting {...props} />
}}
></Route>
<Route
path="/organize/:organizeId/setting"
render={(props) => {
render={() => {
return <Setting {...props} />
}}
></Route>
<Route
path="/organize/:organizeId"
render={(props) => {
render={() => {
return <DetailIndex {...props} />
}}
></Route>