diff --git a/src/AppConfig.js b/src/AppConfig.js
index 21e7e807..12abacae 100644
--- a/src/AppConfig.js
+++ b/src/AppConfig.js
@@ -30,7 +30,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 || ''
+ window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
}
function clearAllCookie() {
cookie.remove('_educoder_session', { path: '/' });
diff --git a/src/forge/Settings/BranchRule.jsx b/src/forge/Settings/BranchRule.jsx
new file mode 100644
index 00000000..e002eec1
--- /dev/null
+++ b/src/forge/Settings/BranchRule.jsx
@@ -0,0 +1,60 @@
+import React , { forwardRef , useCallback } from 'react';
+import { Form , Input , Select , Button } from 'antd';
+import Title from '../Component/Title';
+import { WhiteBack , Cancel } from '../Component/layout';
+import styled from 'styled-components';
+
+const {Option} = Select;
+const Div = styled.div`{
+ padding:20px 30px;
+}`
+export default Form.create()(
+ forwardRef(( { form })=>{
+ const { getFieldDecorator } = form;
+ const helper = useCallback(
+ (label, name, rules, widget , className , isRequired ) => (
+
+ {label}
+
+ {getFieldDecorator(name, { rules, validateFirst: true })(widget)}
+
+
+ ),
+ []
+ );
+ return(
+
+ 新建保护分支规则
+
+ {helper(
+ "设置分支/通配符",
+ "sign",
+ [],
+
,'setStyleRule'
+ )}
+
例如:设置为“master”,则对名称为“master”的分支生效;设置为“*-stable“ 或 ”release*“,则对名称符合此通配符的所有保护分支生效。
+ {helper(
+ "可推送代码成员",
+ "psuhmember",
+ [],
+
,'setSelectWidth'
+ )}
+ {helper(
+ "可合并Pull Request成员",
+ "pullmember",
+ [],
+
,'setSelectWidth'
+ )}
+
+
+ 取消
+
+
+
+ )
+ })
+)
\ No newline at end of file
diff --git a/src/forge/Settings/Index.js b/src/forge/Settings/Index.js
index 5c254ba6..41472f01 100644
--- a/src/forge/Settings/Index.js
+++ b/src/forge/Settings/Index.js
@@ -6,8 +6,12 @@ import "./setting.scss";
import Loadable from "react-loadable";
import Loading from "../../Loading";
-import { Box , Long , Short , Gap , WhiteBack} from '../Component/layout';
+import { Box, Long, Short, Gap } from '../Component/layout';
+const BranchNew = Loadable({
+ loader: () => import("./BranchRule"),
+ loading: Loading,
+});
const Branch = Loadable({
loader: () => import("./Branch"),
loading: Loading,
@@ -45,8 +49,8 @@ class Index extends Component {
-
- 基本设置
+
+ 基本设置
@@ -57,7 +61,7 @@ class Index extends Component {
>
-
+
协作者管理
@@ -79,7 +83,7 @@ class Index extends Component {
>
-
+
项目标签
@@ -101,7 +105,7 @@ class Index extends Component {
-
+
{/* 协作者 */}
)}
>
+ (
+
+ )}
+ >
(
diff --git a/src/forge/Settings/setting.scss b/src/forge/Settings/setting.scss
index f3e7a7c3..f9fedddf 100644
--- a/src/forge/Settings/setting.scss
+++ b/src/forge/Settings/setting.scss
@@ -174,18 +174,27 @@
border-bottom: none;
}
}
-
-.hooksNew{
- .required{
- position: relative;
- &::before{
- content: "*";
- color: red;
- position: absolute;
- left: -10px;
- top: -2px;
- }
+.required{
+ position: relative;
+ &::before{
+ content: "*";
+ color: red;
+ position: absolute;
+ left: -10px;
+ top: -2px;
}
+}
+.hooksNew{
+ .ant-select.ant-select-enabled{
+ width: 100%;
+ }
+}
+.setStyleRule{
+ .ant-row.ant-form-item{
+ margin-bottom: 10px;
+ }
+}
+.setSelectWidth{
.ant-select.ant-select-enabled{
width: 100%;
}