diff --git a/src/AppConfig.js b/src/AppConfig.js
index a55649ce0..f771b9eab 100644
--- a/src/AppConfig.js
+++ b/src/AppConfig.js
@@ -25,7 +25,7 @@ if (isDev) {
}
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
- window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student'
+ window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {
diff --git a/src/forge/Component/layout.jsx b/src/forge/Component/layout.jsx
index ca188866c..6413a4408 100644
--- a/src/forge/Component/layout.jsx
+++ b/src/forge/Component/layout.jsx
@@ -130,7 +130,7 @@ export const Redback = styled.a`{
line-height:30px;
border-radius:2px;
background-color:#F73030;
- color:#fff;
+ color:#fff!important;
padding:0px 12px;
display:inline-block;
min-width:80px;
diff --git a/src/forge/Server/reposyncer/component/createJobModal.jsx b/src/forge/Server/reposyncer/component/createJobModal.jsx
index 1c0eb1e27..b8418a877 100644
--- a/src/forge/Server/reposyncer/component/createJobModal.jsx
+++ b/src/forge/Server/reposyncer/component/createJobModal.jsx
@@ -59,6 +59,7 @@ function DeleteBox({owner, projectsId, visible, setVisible, createJobBy, branchO
dropdownMatchSelectWidth={false}
dropdownClassName="overlihide"
placeholder="请选择仓库分支"
+ getPopupContainer={trigger => trigger.parentNode}
>
{branchOptions && branchOptions.map((item, key) => {
return (
diff --git a/src/forge/Settings/Webhooks/Index.jsx b/src/forge/Settings/Webhooks/Index.jsx
index 1ce5dd617..645185813 100644
--- a/src/forge/Settings/Webhooks/Index.jsx
+++ b/src/forge/Settings/Webhooks/Index.jsx
@@ -16,6 +16,7 @@ function Index(props) {
const [ editId , setEditId ] = useState(undefined);
const [ deleteWebHookModTitle, setDeleteWebHookModTitle] = useState(undefined);
const [ deleteWebHookModSubTitle, setDeleteWebHookModSubTitle] = useState(undefined);
+ const [ totalByUserCreate, setTotalByUserCreate] = useState(undefined);
const { owner , projectsId } = props.match.params;
@@ -33,9 +34,12 @@ function Index(props) {
if(result && result.data){
const reg1 = new RegExp("https://(.*?)jianmuhub.com(.*?)");
const reg2 = new RegExp("https://jianmu.gitlink.org.cn(.*?)");
+ let totalByUserCreate = 0;
result.data.webhooks.map(item=>{
item.isJianMu = reg1.test(item.url) || reg2.test(item.url);
+ !(reg1.test(item.url) || reg2.test(item.url)) && totalByUserCreate++;
})
+ setTotalByUserCreate(totalByUserCreate);
setData(result.data.webhooks);
setTotal(result.data.total_count);
}
@@ -67,8 +71,8 @@ function Index(props) {
}
function addFunc() {
- if(total >= 20){
- return props.showNotification("webhooks数量已到上限!请删除暂不使用的webhooks以进行添加操作");
+ if(totalByUserCreate >= 20){
+ return props.showNotification("您创建的Webhook数量已达到上线!请删除部分Webhook以进行添加操作");
}
props.history.push(`/${owner}/${projectsId}/settings/webhooks/new`)
}
diff --git a/src/forge/Team/Group/Setting/GroupProjectSetting.jsx b/src/forge/Team/Group/Setting/GroupProjectSetting.jsx
index 9a4f39582..1da2af0fe 100644
--- a/src/forge/Team/Group/Setting/GroupProjectSetting.jsx
+++ b/src/forge/Team/Group/Setting/GroupProjectSetting.jsx
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import axios from 'axios';
-import { AutoComplete, Pagination, List, Popconfirm, Dropdown, Spin } from 'antd';
-import { WhiteBack, Blueline, FlexAJ, GroupProjectBackgroup, Greenline, Redline } from '../../../Component/layout';
+import { AutoComplete, Pagination, Popconfirm, Spin, Table, message, Tooltip } from 'antd';
+import { WhiteBack, Blueline, FlexAJ, Redback, Blueback } from '../../../Component/layout';
import Title from '../../../Component/Title';
const { Option } = AutoComplete;
const limit = 15;
@@ -17,6 +17,7 @@ function GroupProjectSetting(props) {
const [ optionsSource , setOptionsSource ] = useState(undefined);
const { OIdentifier, groupId } = props.match.params;
+ const { includesAllProject} = props;
useEffect(() => {
get_project()
@@ -55,12 +56,29 @@ function GroupProjectSetting(props) {
setIsSpin(false)
}
+ // 移除所有项目
function removeALLProject() {
-// 移除所有项目
+ setIsSpin(true);
+ axios.delete(`/organizations/${OIdentifier}/teams/${groupId}/team_projects/destroy_all.json`).then((result) => {
+ if (result && !result.data.status) {
+ message.success('移除成功');
+ get_project();
+ }
+ setIsSpin(false);
+ }).catch((error) => {setIsSpin(false)});
}
+ // 添加所有项目
function addALLProject() {
-// 添加所有项目
+ setIsSpin(true);
+ axios.post(`/organizations/${OIdentifier}/teams/${groupId}/team_projects/create_all.json`).then((result) => {
+ console.log('result', result);
+ if (result && !result.data.status) {
+ message.success('添加成功');
+ get_project();
+ }
+ setIsSpin(false);
+ }).catch((error) => {setIsSpin(false)});
}
// 添加单个项目
@@ -117,74 +135,79 @@ function GroupProjectSetting(props) {
setSearch(value);
}
+ const columns = [
+ {
+ title: '项目名称',
+ dataIndex: 'project',
+ width: "85%",
+ render: (value, item) => {
+ return (
+ {value.owner_name}/{value.name}
+ )
+ }
+ },
+ {
+ title: '操作',
+ dataIndex: 'operation',
+ render: (value, item) => {
+ return includesAllProject ? 移除 : removeProject(item.project.identifier)}
+ okText="确认"
+ cancelText="取消"
+ >
+ 移除
+
+ }
+ }
+ ]
+
return (
-
- 团队项目管理
-
-
- {optionsSource}
-
-
addSingleProject()}>+ 添加项目
-
-
+ 团队项目管理
- {/*
-
-
-
-
addALLProject()}
- okText="确认"
- cancelText="取消"
- >
- 添加所有
-
-
-
removeALLProject()}
- okText="确认"
- cancelText="取消"
- >
- 移除所有
-
-
-
-
- */}
+
+
+
+ {optionsSource}
+
+
addSingleProject()}>+ 添加项目
+
+ {!includesAllProject &&
+
addALLProject()}
+ okText="确认"
+ cancelText="取消"
+ >
+ 添加所有
+
+
removeALLProject()}
+ okText="确认"
+ cancelText="取消"
+ >
+ 移除所有
+
+
}
+
-
(
- removeProject(item.project.identifier)}
- okText="确认"
- cancelText="取消"
- >
- 移除
-
- }
- >
- {item.project.owner_name}/{item.project.name}}
- />
-
- )}
- />
+ pagination={false}
+ className="teamMemberTable"
+ >
{
total > limit ?
diff --git a/src/forge/Team/Sub/SubDetail.jsx b/src/forge/Team/Sub/SubDetail.jsx
index 278fef07e..6bf79b962 100644
--- a/src/forge/Team/Sub/SubDetail.jsx
+++ b/src/forge/Team/Sub/SubDetail.jsx
@@ -71,7 +71,7 @@ export default ((props)=>{
{
- return
+ return
}}
>