)
}
diff --git a/src/forge/Team/ListItem.jsx b/src/forge/Team/ListItem.jsx
index 767a23c2..ab9d64f2 100644
--- a/src/forge/Team/ListItem.jsx
+++ b/src/forge/Team/ListItem.jsx
@@ -7,17 +7,13 @@ function ListItem({item,key,OIdentifier}) {
- {item.identifier}
+ {item.name}
{ item.forked_from_project_id && }
{
- item.type && item.type !== 0 ?
- item.type === 2 ?
+ item.type && item.type === 2 ?
- :
-
-
- :""
+ :""
}
diff --git a/src/forge/Team/New.jsx b/src/forge/Team/New.jsx
index f314cfa8..46e13c3e 100644
--- a/src/forge/Team/New.jsx
+++ b/src/forge/Team/New.jsx
@@ -1,15 +1,17 @@
import React,{ forwardRef , useCallback , useEffect, useState } from 'react';
import './Index.scss';
-import { Form , Input , Radio , Checkbox , Button, InputNumber } from "antd";
+import { Form , Input , Radio , Checkbox , Button } from "antd";
import UploadImage from './Component/UploadImage';
import axios from 'axios';
-
+const port = window.location.port;
+const hostname = window.location.hostname;
export default Form.create()(
forwardRef(({ form , showNotification , history })=>{
const [ image , setImage ] = useState(undefined);
const [ imageFlag , setImageFlag] = useState(false);
- const { getFieldDecorator, validateFields , setFieldsValue } = form;
+ const [ descNum ,setDescNum ] = useState(0);
+ const { getFieldDecorator, validateFields , setFieldsValue } = form;
const radioStyle = {
display: 'block',
height: '30px',
@@ -47,7 +49,7 @@ export default Form.create()(
}).then(result=>{
if(result && result.data){
showNotification("组织创建成功!");
- history.push(`/organize/${result.data.name}`);
+ history.push(`/${result.data.name}`);
}
}).catch(error=>{})
}
@@ -60,33 +62,62 @@ export default Form.create()(
})
},[])
+ function checkname(rule, value, callback){
+ if(!value){
+ callback();
+ }
+ if(value && !value.match(/^[a-zA-Z][a-zA-Z0-9_-]{3,19}$/)){
+ callback("只能使用以字母开头,包含字母、数字、下划线、横杠等,长度4到20个字符");
+ }
+ callback();
+ }
+
return(
-
+
-
+
)
diff --git a/src/forge/Team/RightBox.jsx b/src/forge/Team/RightBox.jsx
index 06731712..5c85ae47 100644
--- a/src/forge/Team/RightBox.jsx
+++ b/src/forge/Team/RightBox.jsx
@@ -1,5 +1,4 @@
import React , { useEffect , useState } from 'react';
-import { Button } from 'antd';
import styled from 'styled-components';
import Box from './Box';
import axios from 'axios';
@@ -7,6 +6,8 @@ import { getImageUrl } from 'educoder';
import { Link } from 'react-router-dom';
import Nodata from '../Nodata';
+import CheckProfile from '../Component/ProfileModal/Profile';
+
const Span = styled.span`{
color:#888;
font-size:12px;
@@ -36,7 +37,7 @@ const Img = styled.img`{
height:45px;
margin-right:12px;
}`
-function RightBox({ OIdentifier , history , admin }) {
+function RightBox({ OIdentifier , history , admin , showCompeleteDialog ,completeProfile }) {
const [ memberData, setMemberData ] = useState(undefined);
const [ groupData, setGroupData ] = useState(undefined);
@@ -67,14 +68,14 @@ function RightBox({ OIdentifier , history , admin }) {
{
memberData && memberData.organization_users && memberData.organization_users.length>0 ?
-
+
{
memberData.organization_users.map((item,key)=>{
return(
-

+
-
{item.user && item.user.name}
+
{item.user && item.user.name}
加入时间:{item.created_at}
@@ -87,8 +88,16 @@ function RightBox({ OIdentifier , history , admin }) {
history.push(`/organize/${OIdentifier}/group/new`)}>新建团队}
- url={`/organize/${OIdentifier}/group`}
+ bottom={
+ admin &&
+ history.push(`/${OIdentifier}/teams/new`)}
+ className={"ant-btn ant-btn-primary"}
+ >新建团队
+ }
+ url={`/${OIdentifier}/teams`}
>
{
groupData && groupData.teams && groupData.teams.length>0?
@@ -97,7 +106,12 @@ function RightBox({ OIdentifier , history , admin }) {
return(
-
{item.name}
+ {
+ (item.is_admin || item.is_member) ?
+
{item.nickname}
+ :
+
{item.name}
+ }
{item.num_users}名成员
{item.num_projects}个仓库
diff --git a/src/forge/Team/Setting/TeamSettingCommon.jsx b/src/forge/Team/Setting/TeamSettingCommon.jsx
index b161e5a1..6e98183f 100644
--- a/src/forge/Team/Setting/TeamSettingCommon.jsx
+++ b/src/forge/Team/Setting/TeamSettingCommon.jsx
@@ -1,5 +1,5 @@
import React, { forwardRef , useCallback , useEffect, useState } from 'react';
-import { Form , Input , Radio ,Checkbox , Divider , Button } from 'antd';
+import { Form , Input , Radio ,Checkbox , Divider , Button , InputNumber } from 'antd';
import { WhiteBack , FlexAJ } from '../../Component/layout';
import Title from '../../Component/Title';
import styled from 'styled-components';
@@ -25,22 +25,25 @@ 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(()=>{
if(organizeDetail){
setFieldsValue({
- ...organizeDetail
+ ...organizeDetail,
+ max_repo_creation:organizeDetail.max_repo_creation===-1 ? "":organizeDetail.max_repo_creation
})
setImage(organizeDetail.avatar_url);
+ setDescNum(organizeDetail.description ? organizeDetail.description.length : 0);
}
},[organizeDetail])
const helper = useCallback(
- (label, name, rules, widget , isRequired , flag ) => (
+ (label, name, rules, widget , isRequired , flag , help ) => (
{label}
-
+
{getFieldDecorator(name, { rules, validateFirst: true , valuePropName:flag ? "checked":"value" })(widget)}
@@ -60,7 +63,7 @@ export default Form.create()(
showNotification("组织信息更新成功!");
if(values.name !== organizeDetail.name){
console.log("false111");
- history.push(`/organize/${values.name}/setting`);
+ history.push(`/${values.name}/setting`);
}
updateFunc && updateFunc(values.name,values.description);
}
@@ -90,11 +93,20 @@ export default Form.create()(
}).then(result=>{
if(result && result.data){
// 删除后跳转到个人中心的组织页面
- history.push(`/users/${current_user && current_user.login}/organizes`);
+ history.push(`/${current_user && current_user.login}/organizes`);
}
})
setVisible(false);
}
+ function checkname(rule, value, callback){
+ if(!value){
+ callback();
+ }
+ if(value && !value.match(/^[a-zA-Z][a-zA-Z0-9_-]{3,19}$/)){
+ callback("只能使用以字母开头,包含字母、数字、下划线、横杠等,长度4到20个字符");
+ }
+ callback();
+ }
return(
@@ -102,17 +114,35 @@ export default Form.create()(
diff --git a/src/forge/Team/Setting/TeamSettingGroup.jsx b/src/forge/Team/Setting/TeamSettingGroup.jsx
index 006d579c..8ebdb4af 100644
--- a/src/forge/Team/Setting/TeamSettingGroup.jsx
+++ b/src/forge/Team/Setting/TeamSettingGroup.jsx
@@ -3,11 +3,11 @@ import { WhiteBack , Banner } from '../../Component/layout';
import GroupItems from '../TeamGroupItems';
const limit = 8;
-function TeamSettingGroup({organizeDetail,history}){
+function TeamSettingGroup({organizeDetail,history,current_user}){
return(
组织团队管理
-
+
)
}
diff --git a/src/forge/Team/Setting/TeamSettingIndex.jsx b/src/forge/Team/Setting/TeamSettingIndex.jsx
index 4717f2fe..462a92d1 100644
--- a/src/forge/Team/Setting/TeamSettingIndex.jsx
+++ b/src/forge/Team/Setting/TeamSettingIndex.jsx
@@ -30,21 +30,21 @@ export default (( props )=>{
function returnActive (pathname){
let a = 0;
- if(pathname === `/organize/${OIdentifier}/setting/member`){
+ if(pathname === `/${OIdentifier}/setting/member`){
a = 1;
- }else if(pathname === `/organize/${OIdentifier}/setting/group`){
+ }else if(pathname === `/${OIdentifier}/setting/group`){
a = 2;
- }else if(pathname === `/organize/${OIdentifier}/setting/hooks`){
+ }else if(pathname === `/${OIdentifier}/setting/hooks`){
a = 3;
}
return a;
}
const active = returnActive(pathname);
const array = {list:[
- {name:'基本设置',icon:"icon-base",href:`/organize/${OIdentifier}/setting`},
- {name:'组织成员管理',icon:"icon-zuzhichengyuan",href:`/organize/${OIdentifier}/setting/member`},
- {name:'组织团队管理',icon:"icon-zuzhixiangmu",href:`/organize/${OIdentifier}/setting/group`},
- // {name:'管理web钩子',icon:"icon-zhongqingdianxinicon10",href:`/organize/${OIdentifier}/setting/hooks`}
+ {name:'基本设置',icon:"icon-base",href:`/${OIdentifier}/setting`},
+ {name:'组织成员管理',icon:"icon-zuzhichengyuan",href:`/${OIdentifier}/setting/member`},
+ {name:'组织团队管理',icon:"icon-zuzhixiangmu",href:`/${OIdentifier}/setting/group`},
+ // {name:'管理web钩子',icon:"icon-zhongqingdianxinicon10",href:`/${OIdentifier}/setting/hooks`}
],
active
}
@@ -54,33 +54,35 @@ export default (( props )=>{
组织设置} nav={array}>
-
-
+
+
+
(
)}
>
(
)}
>
(
)}
>
(
)}
>
+
diff --git a/src/forge/Team/Setting/TeamSettingMember.jsx b/src/forge/Team/Setting/TeamSettingMember.jsx
index 4871def6..9124390f 100644
--- a/src/forge/Team/Setting/TeamSettingMember.jsx
+++ b/src/forge/Team/Setting/TeamSettingMember.jsx
@@ -7,36 +7,27 @@ import styled from 'styled-components';
import { getImageUrl } from 'educoder';
import axios from 'axios';
import { Link } from 'react-router-dom';
+import AddMemberBox from '../Component/AddMemberBox';
const Img = styled.img`{
width:30px;
height:30px;
border-radius:50%;
}`
-
-const demoData = [
- {
- img:"images/avatars/User/g",
- name:"蔡世",
- email:"1149225589@qq.com",
- team:"caicaizi",
- role:"管理者",
- operation:"移除成员",
- }
-]
-export default (({organizeDetail})=>{
- const [ choiceId , serChoiceId ] = useState(undefined);
+const limit = 15;
+export default (({organizeDetail,history,match})=>{
+ const OIdentifier = match.params.OIdentifier;
const [ page , setPage ] = useState(1);
- const [ limit , setLimit ] = useState(15);
const [ total , setTotal ] = useState(0);
const [ search , setSearch ] = useState(undefined);
- const [ data , setData ] = useState(demoData);
+ const [ data , setData ] = useState(undefined);
useEffect(()=>{
if(organizeDetail && organizeDetail.id){
getData(search);
}
- },[organizeDetail,search])
+ },[organizeDetail,search,page])
+
function getData(search){
const url = `/organizations/${organizeDetail.id}/organization_users.json`;
@@ -64,7 +55,7 @@ export default (({organizeDetail})=>{
width:"5%",
render:(value)=>{
return(
- value &&
})
+ value &&
})
)
}
},
@@ -73,7 +64,7 @@ export default (({organizeDetail})=>{
dataIndex: 'user',
width:"15%",
render:(value,item)=>{
- return
{value && value.name}
+ return
{value && value.name}
}
},
{
@@ -127,6 +118,12 @@ export default (({organizeDetail})=>{
+ 添加用户
*/}
+
diff --git a/src/forge/Team/Sub/Detail.jsx b/src/forge/Team/Sub/Detail.jsx
index 3979c4c4..f591c864 100644
--- a/src/forge/Team/Sub/Detail.jsx
+++ b/src/forge/Team/Sub/Detail.jsx
@@ -38,12 +38,12 @@ function Detail(props){
// 设置页面:顶部不需要设置按钮了
useEffect(()=>{
if(pathname){
- if(pathname.indexOf(`/organize/${OIdentifier}/setting`)>-1){
+ if(pathname.indexOf(`/${OIdentifier}/setting`)>-1){
setFlag(false);
}else{
setFlag(true);
}
- if(pathname.indexOf(`/organize/${OIdentifier}/group`)>-1 || pathname.indexOf(`/organize/${OIdentifier}/member`)>-1){
+ if(pathname.indexOf(`/${OIdentifier}/teams`)>-1 || pathname.indexOf(`/${OIdentifier}/members`)>-1){
setButtonflagFlag(true);
}else{
setButtonflagFlag(false);
@@ -77,57 +77,68 @@ function Detail(props){
{
detail &&
- {flag && !buttonflag && detail.is_admin ?
- 设置
-
- :""}
+ {flag && !buttonflag && detail.is_admin ?
+ 设置
+ :""}
{buttonflag &&
- 组织成员{detail.num_users && {detail.num_users}}
- 组织团队{detail.num_teams &&{detail.num_teams}}
+ 组织成员{detail.num_users && {detail.num_users}}
+ 组织团队{detail.num_teams &&{detail.num_teams}}
}
}
+ bottomInfos={
+ !buttonflag &&
+ {
+ detail.location &&
+
{detail.location}
+ }
+ {
+ detail.website &&
+
{detail.website}
+ }
+
+ }
/>
}
{/* 组织团队-详情 */}
{
return
}}
>
{/* 组织成员 */}
{
return
}}
>
{/* 组织团队 */}
{
return
}}
>
{
return
}}
>
{
return
}}
diff --git a/src/forge/Team/Sub/SubDetail.jsx b/src/forge/Team/Sub/SubDetail.jsx
index 7fad7cb7..278fef07 100644
--- a/src/forge/Team/Sub/SubDetail.jsx
+++ b/src/forge/Team/Sub/SubDetail.jsx
@@ -22,7 +22,7 @@ export default ((props)=>{
// 设置页面:顶部不需要设置按钮了
useEffect(()=>{
if(pathname){
- if(pathname.indexOf(`/organize/${OIdentifier}/group/${groupId}/setting`)>-1){
+ if(pathname.indexOf(`/${OIdentifier}/teams/${groupId}/setting`)>-1){
setFlag(false);
}else{
setFlag(true);
@@ -48,19 +48,19 @@ export default ((props)=>{
- {OIdentifier}
+ {detail && detail.organization && detail.organization.nickname}
- {detail ? detail.name : "新建团队"}
+ {detail ? detail.nickname : "新建团队"}
{
detail &&
- 组织成员{detail.num_users && {detail.num_users}}
- 组织团队{detail.num_teams &&{detail.num_teams}}
+ 组织成员{detail.num_users && {detail.num_users}}
+ 组织团队{detail.num_teams &&{detail.num_teams}}
}
desc={!flag && detail.description}
@@ -69,7 +69,7 @@ export default ((props)=>{
{/* 组织团队-设置 */}
{
return
}}
diff --git a/src/forge/Team/TeamGroup.jsx b/src/forge/Team/TeamGroup.jsx
index cb52a7d1..1920caed 100644
--- a/src/forge/Team/TeamGroup.jsx
+++ b/src/forge/Team/TeamGroup.jsx
@@ -3,11 +3,11 @@ import { Banner } from '../Component/layout';
import GroupItems from './TeamGroupItems';
const limit = 14;
-function TeamGroup({organizeDetail,history}){
+function TeamGroup({organizeDetail,history,current_user}){
return(
-
+
组织团队
-
+
)
}
diff --git a/src/forge/Team/TeamGroupItems.jsx b/src/forge/Team/TeamGroupItems.jsx
index fe73c505..5a955818 100644
--- a/src/forge/Team/TeamGroupItems.jsx
+++ b/src/forge/Team/TeamGroupItems.jsx
@@ -17,7 +17,7 @@ const ImgContent = styled.img`{
border-radius:50%;
margin:5px 10px;
}`
-function TeamGroupItems({organizeDetail,limit, count , history}){
+function TeamGroupItems({organizeDetail,limit, count , history ,current_user}){
const [ page , setPage ] = useState(1);
const [ isSpin , setIsSpin ] = useState(true);
const [ total , setTotal ] = useState(0);
@@ -48,12 +48,13 @@ function TeamGroupItems({organizeDetail,limit, count , history}){
axios.delete(url).then(result =>{
if(result && result.data){
getData();
+ history.push(`/${current_user && current_user.login}`);
}
}).catch(error=>{})
}
// 团队设置
function toGroupSetting(id){
- history.push(`/organize/${organizeDetail && organizeDetail.name}/group/${id}/setting`);
+ history.push(`/${organizeDetail && organizeDetail.name}/teams/${id}/setting`);
}
// 解散团队
function disMissGroup(id){
@@ -75,7 +76,12 @@ function TeamGroupItems({organizeDetail,limit, count , history}){
return(
- {item.name}
+ {
+ (item.is_admin || item.is_member) ?
+ {item.nickname}
+ :
+ {item.nickname}
+ }
{ item.is_admin && item.authorize!=="owner" && disMissGroup(item.id)}>解散团队}
{ item.is_member && }
@@ -86,10 +92,10 @@ function TeamGroupItems({organizeDetail,limit, count , history}){
{
item.users && item.users.map((i,k)=>{
return(
- k < count ?
+ k < count ?
:
k === count ?
-
+
:""
)
})
@@ -105,7 +111,7 @@ function TeamGroupItems({organizeDetail,limit, count , history}){
}
}
- { list && list.length > 0 &&
}
+ { list && list.length === 0 &&
}
{
total > limit &&
diff --git a/src/forge/Team/TeamMember.jsx b/src/forge/Team/TeamMember.jsx
index 63aa515a..d21d514f 100644
--- a/src/forge/Team/TeamMember.jsx
+++ b/src/forge/Team/TeamMember.jsx
@@ -4,9 +4,11 @@ import Cards from '../Component/MemberCards';
import axios from 'axios';
import Nodata from '../Nodata';
import { Pagination , Spin } from 'antd';
+import AddMemberBox from './Component/AddMemberBox';
const limit = 15;
-function TeamMember({organizeDetail,current_user}){
+function TeamMember({organizeDetail,current_user,history,match}){
+ const OIdentifier = match.params.OIdentifier;
const [ page , setPage ] = useState(1);
const [ total , setTotal ] = useState(0);
const [ isSpin , setIsSpin ] = useState(true);
@@ -33,8 +35,18 @@ function TeamMember({organizeDetail,current_user}){
}
return(
-
- 组织成员
+
+ 组织成员
+ {
+ organizeDetail && organizeDetail.is_admin &&
+
+ }
+
{
diff --git a/src/forge/Upload/Index.js b/src/forge/Upload/Index.js
index d2113f6f..cd56e6e7 100644
--- a/src/forge/Upload/Index.js
+++ b/src/forge/Upload/Index.js
@@ -1,5 +1,5 @@
import React, { Component } from "react";
-import { Upload , Icon } from 'antd';
+import { Upload, Icon , Button } from 'antd';
import { getUploadActionUrl, appendFileSizeToUploadFileAll } from 'educoder';
import axios from 'axios';
@@ -28,22 +28,12 @@ class Index extends Component {
onAttachmentRemove = (file) => {
if (!file.percent || file.percent === 100) {
- // this.props.confirm({
- // content: '是否确认删除?',
- // onOk: () => {
- // this.deleteAttachment(file)
- // },
- // onCancel() {
- // console.log('Cancel');
- // },
- // });
this.deleteAttachment(file)
return false;
}
}
deleteAttachment = (file) => {
-
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url).then((response) => {
if (response.data) {
@@ -73,7 +63,6 @@ class Index extends Component {
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList;
-
this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) });
this.fileIdList(fileList);
@@ -96,7 +85,7 @@ class Index extends Component {
fileIdList = (fileList) => {
let array = [];
fileList && fileList.length > 0 && fileList.map((item) => {
- return array.push(item.response && item.response.id);
+ return array.push(item.response && (item.response.id || (item.response.data && item.response.data.id)));
})
array && this.props.load && this.props.load(array);
}
@@ -112,23 +101,29 @@ class Index extends Component {
render() {
//判断是否已经提交,如已提交评论则上一条评论数据清除
- const { isComplete, icon } = this.props;
+ const { isComplete, icon , btn , className , size , actionUrl } = this.props;
const { fileList } = this.state;
let list = isComplete === true ? fileList : undefined;
const upload = {
name: 'file',
fileList: list,
- action: `${getUploadActionUrl()}`,
+ action: actionUrl || `${getUploadActionUrl()}`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
beforeUpload: this.beforeUpload
};
return (
-
+ btn ?
+
+
+ (你可以上传小于{size}MB的文件)
+
+ :
+
{icon || }
- 拖动文件或点击此处上传
+ 拖动文件或点击此处上传
)
}
diff --git a/src/forge/UsersList/common_users.js b/src/forge/UsersList/common_users.js
index 78655108..e8404b38 100644
--- a/src/forge/UsersList/common_users.js
+++ b/src/forge/UsersList/common_users.js
@@ -85,15 +85,21 @@ class CommonUsers extends Component {
return (
-
-
-
{type_title}
+
+
+
{type_title}
{count === 0 ? (
) : (
-
+
)}
diff --git a/src/forge/UsersList/focus_button.js b/src/forge/UsersList/focus_button.js
index 192d4008..a2e93bde 100644
--- a/src/forge/UsersList/focus_button.js
+++ b/src/forge/UsersList/focus_button.js
@@ -3,8 +3,9 @@ import axios from "axios";
import { Button } from "antd";
import "./list.css";
-function FocusButton({is_watch , fontClass, starText, is_block , id , successFunc}){
+function FocusButton({is_watch , fontClass, starText, is_block , id , successFunc,notReset}){
const [ isSpin , setIsSpin ] = useState(false);
+ const [ watchFlag , setWatchFlag ] = useState(is_watch);
// 关注和取消关注
function focusFunc(flag){
setIsSpin(true);
@@ -18,6 +19,9 @@ function FocusButton({is_watch , fontClass, starText, is_block , id , successFun
}).then((result) => {
if (result && result.data.status === 0) {
successFunc && successFunc();
+ if(notReset){
+ setWatchFlag(!watchFlag);
+ }
}
setIsSpin(false);
})
@@ -25,8 +29,8 @@ function FocusButton({is_watch , fontClass, starText, is_block , id , successFun
};
return (
-