forked from Gitlink/forgeplus-react
merge develop
This commit is contained in:
parent
c33561c212
commit
ff06efe109
|
@ -6704,3 +6704,9 @@ ul.count_ul li:not(:last-child):after {
|
|||
input.ant-input-lg::placeholder{
|
||||
font-size: 14px !important;
|
||||
}
|
||||
.toprightNum{
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top:4px;
|
||||
color: #999;
|
||||
}
|
|
@ -0,0 +1,174 @@
|
|||
import React ,{ forwardRef, useEffect, useState } from 'react';
|
||||
import { Modal , Form , Input , Radio , Select } from 'antd';
|
||||
import SearchUser from '../Component/SearchUser';
|
||||
import './Index.scss';
|
||||
import Axios from 'axios';
|
||||
|
||||
const { Option } = Select;
|
||||
function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){
|
||||
const { getFieldDecorator, validateFields , setFieldsValue } = form;
|
||||
const [ cate , setCate ] = useState(0);
|
||||
const [ value , setValue ] = useState(undefined);
|
||||
|
||||
const [ organizations , setOrganizations ] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
setFieldsValue({goal:cate})
|
||||
},[])
|
||||
|
||||
useEffect(()=>{
|
||||
if(owner && repo && visible===true){
|
||||
getTeam();
|
||||
}
|
||||
if(!visible){
|
||||
setFieldsValue({
|
||||
owner_name:undefined,
|
||||
identifier:undefined
|
||||
})
|
||||
setValue(undefined)
|
||||
}
|
||||
},[repo,owner,visible])
|
||||
|
||||
function getTeam(){
|
||||
const url = `/${owner}/${repo}/applied_transfer_projects/organizations.json`;
|
||||
Axios.get(url).then(result=>{
|
||||
if(result){
|
||||
setOrganizations(result.data.organizations);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
// 确认转移
|
||||
function onOk(){
|
||||
validateFields((error,values)=>{
|
||||
console.log(...values);
|
||||
if(!error){
|
||||
const url = `/${owner}/${repo}/applied_transfer_projects.json`;
|
||||
Axios.post(url,{
|
||||
...values
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
onSuccess(result.data && result.data.owner);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
function changeType(e){
|
||||
setCate(e.target.value);
|
||||
setFieldsValue({
|
||||
owner_name:undefined
|
||||
})
|
||||
}
|
||||
|
||||
function checkIdentifier(rule, value, callback){
|
||||
if(!value){
|
||||
callback();
|
||||
}
|
||||
if (repo && value !== repo) {
|
||||
callback("请输入当前项目的标识!");
|
||||
}
|
||||
callback();
|
||||
}
|
||||
|
||||
const layout = {
|
||||
labelCol: { span: 5 },
|
||||
wrapperCol: { span: 18 },
|
||||
};
|
||||
|
||||
function getUser(id){
|
||||
setValue(id);
|
||||
setFieldsValue({
|
||||
owner_name:id
|
||||
})
|
||||
}
|
||||
return(
|
||||
<Modal
|
||||
width="620px"
|
||||
visible={visible}
|
||||
title="转移仓库"
|
||||
onCancel={onCancel}
|
||||
onOk={onOk}
|
||||
okText="确认转移"
|
||||
cancelText={"取消"}
|
||||
centered
|
||||
>
|
||||
<div className="diverModal">
|
||||
{
|
||||
cate === 0 ?
|
||||
<ul className="descUl">
|
||||
<li>转移需对方确认接受,转移成功后你将被移出仓库,其他已有成员权限不变</li>
|
||||
<li>转移成功后,仓库的地址将变更至目标用户的命名空间下</li>
|
||||
<li>已有成员如需继续操作仓库,需更新本地仓库的remote,使之指向新的地址</li>
|
||||
</ul>
|
||||
:
|
||||
<ul className="descUl">
|
||||
<li>仓库仅可以转移到您已经加入的组织中,不可以转移到未加入的组织中</li>
|
||||
<li>涉及到仓库改名操作,请提前做好仓库备份并且在转移后对本地仓库的remote进行修改</li>
|
||||
<li>转移仓库到组织后,你和组织创建者/管理员同时拥有对该仓库的管理操作</li>
|
||||
</ul>
|
||||
}
|
||||
<Form {...layout} colon={false} layout={"horizontal"}>
|
||||
<Form.Item label="转移给:" style={{marginBottom:"0px"}}>
|
||||
{getFieldDecorator("goal",{
|
||||
rules:[]
|
||||
})(
|
||||
<Radio.Group onChange={changeType}>
|
||||
<Radio value={0}>个人</Radio>
|
||||
<Radio value={1}>组织</Radio>
|
||||
</Radio.Group>
|
||||
)}
|
||||
</Form.Item>
|
||||
{
|
||||
cate === 0 &&
|
||||
<Form.Item label=" ">
|
||||
{getFieldDecorator("owner_name",{
|
||||
rules:[{required:true,message:"请输入目标用户名"}]
|
||||
})(
|
||||
// <Input placeholder="请输入目标用户" autoComplete={"off"}/>
|
||||
<SearchUser getUser={getUser} width={"100%"} placeholder="请输入目标用户" value={value}/>
|
||||
)}
|
||||
</Form.Item>
|
||||
}
|
||||
{
|
||||
cate === 1 &&
|
||||
<Form.Item label=" ">
|
||||
{getFieldDecorator("owner_name",
|
||||
{rules:[{required:true,message:"请选择目标组织"}]}
|
||||
)(
|
||||
<Select placeholder="请选择目标组织" getPopupContainer={trigger => trigger.parentNode}>
|
||||
{
|
||||
organizations && organizations.length > 0 ?
|
||||
organizations.map((i,k)=>{
|
||||
return(
|
||||
<Option value={i.name}>{i.nickname}</Option>
|
||||
)
|
||||
})
|
||||
:""
|
||||
}
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
}
|
||||
|
||||
<Form.Item label="仓库名称:">
|
||||
{getFieldDecorator("identifier",
|
||||
{
|
||||
rules:[
|
||||
{required:true,message:"请输入仓库名称"},
|
||||
{
|
||||
validator:checkIdentifier
|
||||
}
|
||||
]
|
||||
}
|
||||
)(
|
||||
<Input placeholder="请输入仓库名称" autoComplete={"off"}/>
|
||||
)}
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
export default Form.create()(forwardRef(DivertModal));
|
|
@ -2,16 +2,14 @@ import React, { Component } from 'react';
|
|||
import AccountProfile from "../../modules/user/AccountProfile";
|
||||
import { getImageUrl } from 'educoder'
|
||||
import axios from 'axios';
|
||||
import { Modal, Input, message, notification , Dropdown , Menu ,Divider } from 'antd';
|
||||
import { Modal, Input, message, notification , Dropdown , Menu } from 'antd';
|
||||
|
||||
import LoginDialog from '../../modules/login/LoginDialog';
|
||||
import GotoQQgroup from '../../modal/GotoQQgroup'
|
||||
// import 'antd/lib/modal/style/index.css';
|
||||
// import 'antd/lib/checkbox/style/index.css';
|
||||
// import 'antd/lib/radio/style/index.css';
|
||||
// import 'antd/lib/input/style/index.css';
|
||||
|
||||
import '../../modules/tpm/TPMIndex.css';
|
||||
import logo from '../../modules/tpm/images/logo.png';
|
||||
|
||||
import './header.scss';
|
||||
const $ = window.$
|
||||
// TODO 这部分脚本从公共脚本中直接调用
|
||||
|
|
|
@ -5,7 +5,13 @@
|
|||
background:#fff;
|
||||
border-radius: 3px;
|
||||
.ant-menu-vertical > .ant-menu-item{
|
||||
border:none
|
||||
border:none;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
margin:0px;
|
||||
}
|
||||
.ant-menu-vertical{
|
||||
border:none;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,8 @@ class Index extends Component {
|
|||
project_language_name: undefined,
|
||||
project_category_name: undefined,
|
||||
license_name: undefined,
|
||||
ignore_name: undefined
|
||||
ignore_name: undefined,
|
||||
descNum:0
|
||||
}
|
||||
}
|
||||
componentDidMount = () => {
|
||||
|
@ -254,6 +255,13 @@ class Index extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
changeDesc=(e)=>{
|
||||
let value = e.target.value;
|
||||
this.setState({
|
||||
descNum:value ? value.length :0
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const { getFieldDecorator } = this.props.form;
|
||||
// 项目类型:deposit-托管项目,mirror-镜像项目
|
||||
|
@ -273,7 +281,9 @@ class Index extends Component {
|
|||
license_list,
|
||||
ignore_list,
|
||||
|
||||
mirrorCheck
|
||||
mirrorCheck,
|
||||
|
||||
descNum
|
||||
} = this.state;
|
||||
return (
|
||||
<div className="main back-white" style={{padding:"0px",border:"none"}}>
|
||||
|
@ -364,7 +374,8 @@ class Index extends Component {
|
|||
<Input placeholder="例如:团队协作方法与研究" maxLength={50}/>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<div className="pr">
|
||||
<span className="toprightNum">{descNum}/200</span>
|
||||
<Form.Item
|
||||
label="项目简介"
|
||||
>
|
||||
|
@ -373,9 +384,10 @@ class Index extends Component {
|
|||
required: true, message: '请填写项目简介'
|
||||
}],
|
||||
})(
|
||||
<Input.TextArea showCount placeholder="项目的介绍" autoSize={{ minRows: 2, maxRows: 6 }} maxLength={"200"}/>
|
||||
<Input.TextArea maxLength={200} placeholder="项目的介绍" autoSize={{ minRows: 2, maxRows: 6 }} onChange={this.changeDesc}/>
|
||||
)}
|
||||
</Form.Item>
|
||||
</div>
|
||||
<Form.Item
|
||||
label="仓库名称"
|
||||
>
|
||||
|
@ -384,7 +396,7 @@ class Index extends Component {
|
|||
required: true, message: '请填写仓库名称'
|
||||
}],
|
||||
})(
|
||||
<Input placeholder="仓库名称请使用与项目相关的英文关键字" maxLength={"100"}/>
|
||||
<Input placeholder="仓库名称请使用与项目相关的英文关键字" maxLength={100} />
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
|
|
|
@ -320,7 +320,7 @@ class order_form extends Component {
|
|||
message: "请填写任务标题",
|
||||
},
|
||||
]
|
||||
})(<Input placeholder="标题" size="large" />)}
|
||||
})(<Input placeholder="标题" size="large" maxLength={80}/>)}
|
||||
</Form.Item>
|
||||
<div className="quillContent">
|
||||
<MDEditor
|
||||
|
|
|
@ -24,6 +24,7 @@ export default Form.create()(
|
|||
const [check_box, setCheckBox] = useState(false);
|
||||
const [switch_box, setSwtichBox] = useState([]);
|
||||
const [onwers, setOnwers] = useState(false);
|
||||
const [ descNum , setDescNum ] = useState(0);
|
||||
const [switch_box_code, setSwtichBoxCode] = useState(false);
|
||||
const [switch_box_pull, setSwtichBoxPull] = useState(false);
|
||||
const [switch_box_issue, setSwtichBoxIssue] = useState(false);
|
||||
|
@ -39,6 +40,7 @@ export default Form.create()(
|
|||
setFieldsValue({
|
||||
...GroupDetail
|
||||
})
|
||||
setDescNum(GroupDetail.description ? GroupDetail.description.length : 0);
|
||||
}
|
||||
}, [GroupDetail])
|
||||
|
||||
|
@ -171,14 +173,19 @@ export default Form.create()(
|
|||
[{ required: true, message: "请输入团队名称" }],
|
||||
<Input placeholder="请输入团队名称"/>, true
|
||||
)}
|
||||
<div className="pr">
|
||||
<span className="toprightNum">{descNum}/200</span>
|
||||
{helper(
|
||||
<span className="mb5">团队描述:<span className="color-grey-8">(描述团队的目的或作用)</span></span>,
|
||||
"description",
|
||||
[],
|
||||
<TextArea
|
||||
placeholder="请输入团队描述"
|
||||
maxLength={200}
|
||||
onChange={(e)=>{setDescNum(e.target.value ? e.target.value.length :0)}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{helper(
|
||||
'项目权限:',
|
||||
|
|
|
@ -9,6 +9,8 @@ export default Form.create()(
|
|||
forwardRef(({ form , showNotification , history })=>{
|
||||
const [ image , setImage ] = useState(undefined);
|
||||
const [ imageFlag , setImageFlag] = useState(false);
|
||||
const [ descNum ,setDescNum ] = useState(0);
|
||||
|
||||
const { getFieldDecorator, validateFields , setFieldsValue } = form;
|
||||
const radioStyle = {
|
||||
display: 'block',
|
||||
|
@ -86,7 +88,7 @@ export default Form.create()(
|
|||
],
|
||||
<Input
|
||||
addonBefore={`https://`+ port ? `${hostname}:${port}/organize`:`${hostname}/organize`}
|
||||
placeholder="组织账号"
|
||||
placeholder="组织账号" maxLength={100}
|
||||
/>
|
||||
)}
|
||||
{helper(
|
||||
|
@ -94,24 +96,28 @@ export default Form.create()(
|
|||
"nickname",
|
||||
[{ required: true, message: "请输入组织名称" }],
|
||||
<Input
|
||||
placeholder="请输入组织名称"
|
||||
placeholder="请输入组织名称" maxLength={100}
|
||||
/>
|
||||
)}
|
||||
|
||||
<div className="pr">
|
||||
<span className="toprightNum">{descNum}/200</span>
|
||||
{helper(
|
||||
'组织描述',
|
||||
"description",
|
||||
[{ required: true, message: "请输入组织描述" }],
|
||||
<Input.TextArea
|
||||
autoSize={{ minRows: 3, maxRows: 5 }}
|
||||
placeholder="请输入组织描述"
|
||||
placeholder="请输入组织描述" maxLength={200}
|
||||
onChange={(e)=>{setDescNum(e.target.value ? e.target.value.length :0)}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{helper(
|
||||
'所在地区',
|
||||
"location",
|
||||
[],
|
||||
<Input placeholder="请输入地址"/>,false
|
||||
<Input placeholder="请输入地址" maxLength={50}/>,false
|
||||
)}
|
||||
{helper(
|
||||
'可见性',
|
||||
|
|
|
@ -25,6 +25,7 @@ export default Form.create()(
|
|||
const [ password , setPassword ] = useState(undefined);
|
||||
const [ passwordFlag , setPasswordFlag ] = useState(false);
|
||||
const [ visible , setVisible ] = useState(false);
|
||||
const [ descNum , setDescNum ] = useState(0);
|
||||
const { getFieldDecorator , validateFields , setFieldsValue } = form;
|
||||
|
||||
useEffect(()=>{
|
||||
|
@ -33,6 +34,7 @@ export default Form.create()(
|
|||
...organizeDetail
|
||||
})
|
||||
setImage(organizeDetail.avatar_url);
|
||||
setDescNum(organizeDetail.description ? organizeDetail.description.length : 0);
|
||||
}
|
||||
},[organizeDetail])
|
||||
|
||||
|
@ -119,20 +121,27 @@ export default Form.create()(
|
|||
validator:checkname
|
||||
}
|
||||
],
|
||||
<Input placeholder="请输入组织账号" disabled/>,true
|
||||
<Input placeholder="请输入组织账号" maxLength={100} disabled/>,true
|
||||
)}
|
||||
{helper(
|
||||
"组织名称:",
|
||||
"nickname",
|
||||
[{ required: true, message: "请输入组织名称" }],
|
||||
<Input placeholder="请输入组织名称" />,true
|
||||
<Input placeholder="请输入组织名称" maxLength={100}/>,true
|
||||
)}
|
||||
<div className="pr">
|
||||
<span className="toprightNum">{descNum}/200</span>
|
||||
{helper(
|
||||
"组织描述:",
|
||||
"description",
|
||||
[],
|
||||
<TextArea placeholder="请输入组织名称" />
|
||||
<TextArea
|
||||
placeholder="请输入组织名称"
|
||||
maxLength={200}
|
||||
onChange={(e)=>{setDescNum(e.target.value ? e.target.value.length :0)}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{helper(
|
||||
"官方网站:",
|
||||
"website",
|
||||
|
|
|
@ -29,7 +29,7 @@ $flex:flex;
|
|||
& > div{
|
||||
margin-bottom: 20px;
|
||||
display: $flex;
|
||||
align-items: flex-start;
|
||||
align-items: center;
|
||||
padding:20px 25px;
|
||||
background-color:rgba(250,250,250,1);
|
||||
.imgBox{
|
||||
|
@ -52,6 +52,11 @@ $flex:flex;
|
|||
font-size: 12px;
|
||||
color: #888;
|
||||
margin-top: 3px;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
.teamdesc{
|
||||
word-break: break-all;
|
||||
line-height: 20px;
|
||||
}
|
||||
}
|
||||
.infosType{
|
||||
|
|
|
@ -7,7 +7,7 @@ function TeamItem({item,history}){
|
|||
<div className="imgBox"><img alt="" src={getImageUrl(`/${item.avatar_url}`)}/></div>
|
||||
<div style={{flex:'1'}}>
|
||||
<span className="mb5 font-18 color-grey-3 task-hide">{item.name}</span>
|
||||
<div className="task-hide-2">
|
||||
<div className="task-hide-2 teamdesc">
|
||||
{item.description}
|
||||
</div>
|
||||
<p className="item-news">
|
||||
|
|
Loading…
Reference in New Issue