-
-
-
陈Professer
-
加入时间:2020-04-28
+
+
+
+
+
+ {
+ list && list.length>0 ? list.map((item,key)=>{
+ return(
+ -
+ )
+ })
+ :
+
+ }
+
+
-
-
新建团队}
- >
-
-
-
陈Professer
-
- 2名成员
- 1个仓库
-
+ {
+ totalCount > limit &&
+
-
-
-
+ }
+
+
)
-})
\ No newline at end of file
+}
+export default List;
\ No newline at end of file
diff --git a/src/forge/Team/ListItem.jsx b/src/forge/Team/ListItem.jsx
new file mode 100644
index 00000000..8dd8fd36
--- /dev/null
+++ b/src/forge/Team/ListItem.jsx
@@ -0,0 +1,25 @@
+import React from 'react';
+import ListCount from '../Component/ListCount';
+import { Link } from 'react-router-dom';
+function ListItem({item,key,OIdentifier}) {
+ return(
+
+
+
+ {item.identifier}
+
+
+
+
+
+
+
+ {item.description}
+
+
+ 更新于{item.time_ago}
+
+
+ )
+}
+export default ListItem;
\ No newline at end of file
diff --git a/src/forge/Team/New.jsx b/src/forge/Team/New.jsx
index bf854ab2..098db460 100644
--- a/src/forge/Team/New.jsx
+++ b/src/forge/Team/New.jsx
@@ -1,14 +1,13 @@
-import React,{ forwardRef , useCallback, useEffect, useState } from 'react';
+import React,{ forwardRef , useCallback , useState } from 'react';
import './Index.scss';
import { Form , Input , Radio , Checkbox , Button, InputNumber } from "antd";
import UploadImage from './Component/UploadImage';
import axios from 'axios';
export default Form.create()(
- forwardRef(({form , showNotification ,history})=>{
+ forwardRef(({ form , showNotification , history })=>{
const [ image , setImage ] = useState(undefined);
-
- const { getFieldDecorator, validateFields , setFieldsValue } = form;
+ const { getFieldDecorator, validateFields } = form;
const radioStyle = {
display: 'block',
@@ -42,6 +41,7 @@ export default Form.create()(
}).then(result=>{
if(result && result.data){
showNotification("组织创建成功!");
+ history.push(`/organize/${result.data.name}`);
}
}).catch(error=>{})
}
diff --git a/src/forge/Team/RightBox.jsx b/src/forge/Team/RightBox.jsx
new file mode 100644
index 00000000..f535fa95
--- /dev/null
+++ b/src/forge/Team/RightBox.jsx
@@ -0,0 +1,113 @@
+import React , { useEffect , useState } from 'react';
+import { Button } from 'antd';
+import styled from 'styled-components';
+import Box from './Box';
+import axios from 'axios';
+import { getImageUrl } from 'educoder';
+
+const Span = styled.span`{
+ color:#888;
+ font-size:12px;
+ margin-right:10px;
+}`
+const Align = styled.div`{
+ display:flex;
+ aligin:center;
+}`
+const ListName = styled.div`{
+ font-size:14px;
+ color:#333;
+ margin-bottom:8px;
+ height:18px;
+ line-height:18px;
+}`;
+const ColorListName = styled.div`{
+ color:#5091FF;
+ font-size:14px;
+ margin-bottom:8px;
+ height:18px;
+ line-height:18px;
+}`
+const Img = styled.img`{
+ border-radius:50%;
+ width:45px;
+ height:45px;
+ margin-right:12px;
+}`
+function RightBox({ OIdentifier }) {
+ const [ memberData, setMemberData ] = useState(undefined);
+ const [ groupData, setGroupData ] = useState(undefined);
+
+ useEffect(()=>{
+ if(OIdentifier){
+ getMember(OIdentifier);
+ getGroup(OIdentifier);
+ }
+ },[OIdentifier])
+
+ function getMember(iden){
+ const url = `/organizations/${iden}/organization_users.json`;
+ axios.get(url).then(result=>{
+ if(result && result.data){
+ setMemberData(result.data);
+ }
+ }).catch(error=>{})
+ }
+ function getGroup(iden){
+ const url = `/organizations/${iden}/teams.json`;
+ axios.get(url).then(result=>{
+ if(result && result.data){
+ setGroupData(result.data);
+ }
+ }).catch(error=>{})
+ }
+ return(
+
+ {
+ memberData && memberData.organization_users && memberData.organization_users.length>0 ?
+
+ {
+ memberData.organization_users.map((item,key)=>{
+ return(
+
+
+
+
{item.user && item.user.name}
+
加入时间:{item.created_at}
+
+
+ )
+ })
+ }
+
+ :""
+ }
+ {
+ groupData && groupData.teams && groupData.teams.length>0?
+
新建团队}
+ >
+ {
+ groupData.teams.map((item,key)=>{
+ return(
+
+
+
{item.name}
+
+ {item.num_users}名成员
+ {item.num_projects}个仓库
+
+
+
+ )
+ })
+ }
+
+ :""
+ }
+
+ )
+}
+export default RightBox;
\ No newline at end of file
diff --git a/src/forge/Team/Setting/TeamSettingCommon.jsx b/src/forge/Team/Setting/TeamSettingCommon.jsx
index 1fa3eb64..2e302a37 100644
--- a/src/forge/Team/Setting/TeamSettingCommon.jsx
+++ b/src/forge/Team/Setting/TeamSettingCommon.jsx
@@ -1,9 +1,11 @@
-import React, { forwardRef , useCallback } from 'react';
-import { Form , Input , Cascader , Radio ,Checkbox , Divider , Button } from 'antd';
+import React, { forwardRef , useCallback , useEffect, useState } from 'react';
+import { Form , Input , Radio ,Checkbox , Divider , Button } from 'antd';
import { WhiteBack , FlexAJ } from '../../Component/layout';
import Title from '../../Component/Title';
import styled from 'styled-components';
-import { locData } from "../../Utils/locData";
+import UploadImage from '../Component/UploadImage';
+import axios from 'axios';
+import { getImageUrl } from 'educoder';
const TextArea = Input.TextArea;
const Div = styled.div`{
@@ -15,19 +17,58 @@ const radioStyle = {
lineHeight: '30px',
};
export default Form.create()(
- forwardRef(({ form })=>{
- const { getFieldDecorator } = form;
+ forwardRef(({ form , organizeDetail , showNotification , history })=>{
+ const [ image , setImage ] = useState(undefined);
+ const [ imageFlag , setImageFlag ] = useState(false);
+ const [ password , setPassword ] = useState(undefined);
+ const { getFieldDecorator , validateFields, setFieldsValue} = form;
+
+ useEffect(()=>{
+ if(organizeDetail){
+ setFieldsValue({
+ ...organizeDetail
+ })
+ setImage(organizeDetail.avatar_url);
+ }
+ },[organizeDetail])
+
const helper = useCallback(
- (label, name, rules, widget , isRequired ) => (
+ (label, name, rules, widget , isRequired , flag ) => (
{label}
- {getFieldDecorator(name, { rules, validateFirst: true })(widget)}
+ {getFieldDecorator(name, { rules, validateFirst: true , valuePropName:flag ? "checked":"value" })(widget)}
),
[]
);
+
+ // 更新
+ function updateDetail(){
+ validateFields((error,values)=>{
+ if(!error){
+ const url = `/organizations/${organizeDetail.id}.json`;
+ axios.patch(url,{
+ ...values,image:imageFlag ? image : undefined
+ }).then(result=>{
+ if(result && result.data){
+ showNotification("组织信息更新成功!");
+ history.push(`/organize/${values.name}/setting`);
+ }
+ }).catch(error=>{})
+ }
+ })
+ }
+ function getImage(image){
+ setImageFlag(true);
+ setImage(image);
+ }
+
+ // 删除组织
+ function deleteOrganize(){
+
+ }
return(
@@ -42,46 +83,48 @@ export default Form.create()(
)}
{helper(
"组织描述:",
- "desc",
+ "description",
[],
)}
{helper(
"官方网站:",
- "web",
+ "website",
[],
)}
{helper(
'所在地区:',
- "area",
+ "location",
[],
-
+
)}
{helper(
'可见性:',
- "opacity",
+ "visibility",
[],
- 公开
- 受限(仅对登录用户可见)
- 私有(仅对组织成员可见)
+ 公开
+ 受限(仅对登录用户可见)
+ 公开(仅对组织成员可见)
)}
{helper(
'权限:',
- "operation",
+ "repo_admin_change_team_access",
[],
- 仓库管理员可以添加或移除团队的访问权限
+ 仓库管理员可以添加或移除团队的访问权限,false,true
)}
{helper(
'最大仓库数:',
- "number",
+ "max_repo_creation",
[],
)}
-
+ 选择头像:
+
+
@@ -93,9 +136,9 @@ export default Form.create()(
密码:
-
+ setPassword(e.target.value)}/>
- 删除组织
+ 删除组织