forked from Gitlink/forgeplus-react
新建分支保护规则
This commit is contained in:
parent
1384946620
commit
277341e889
|
@ -30,7 +30,7 @@ if (isDev) {
|
||||||
}
|
}
|
||||||
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
|
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
|
||||||
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
|
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() {
|
function clearAllCookie() {
|
||||||
cookie.remove('_educoder_session', { path: '/' });
|
cookie.remove('_educoder_session', { path: '/' });
|
||||||
|
|
|
@ -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 ) => (
|
||||||
|
<div className={className}>
|
||||||
|
<span className={isRequired?"required":""}>{label}</span>
|
||||||
|
<Form.Item>
|
||||||
|
{getFieldDecorator(name, { rules, validateFirst: true })(widget)}
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
return(
|
||||||
|
<WhiteBack>
|
||||||
|
<Title>新建保护分支规则</Title>
|
||||||
|
<Div>
|
||||||
|
{helper(
|
||||||
|
"设置分支/通配符",
|
||||||
|
"sign",
|
||||||
|
[],
|
||||||
|
<Input placeholder="请输入分支名称或通配符规则" />,'setStyleRule'
|
||||||
|
)}
|
||||||
|
<p className="color-grey-8 mb20">例如:设置为“master”,则对名称为“master”的分支生效;设置为“*-stable“ 或 ”release*“,则对名称符合此通配符的所有保护分支生效。</p>
|
||||||
|
{helper(
|
||||||
|
"可推送代码成员",
|
||||||
|
"psuhmember",
|
||||||
|
[],
|
||||||
|
<Select placeholder="请选择仓库成员" >
|
||||||
|
<Option value="0">请选择仓库成员</Option>
|
||||||
|
</Select>,'setSelectWidth'
|
||||||
|
)}
|
||||||
|
{helper(
|
||||||
|
"可合并Pull Request成员",
|
||||||
|
"pullmember",
|
||||||
|
[],
|
||||||
|
<Select placeholder="请选择仓库成员" >
|
||||||
|
<Option value="0">请选择仓库成员</Option>
|
||||||
|
</Select>,'setSelectWidth'
|
||||||
|
)}
|
||||||
|
<div className="df pb30">
|
||||||
|
<Button type="primary">保存</Button>
|
||||||
|
<Cancel className="ml30">取消</Cancel>
|
||||||
|
</div>
|
||||||
|
</Div>
|
||||||
|
</WhiteBack>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
)
|
|
@ -6,8 +6,12 @@ import "./setting.scss";
|
||||||
|
|
||||||
import Loadable from "react-loadable";
|
import Loadable from "react-loadable";
|
||||||
import Loading from "../../Loading";
|
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({
|
const Branch = Loadable({
|
||||||
loader: () => import("./Branch"),
|
loader: () => import("./Branch"),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
|
@ -45,8 +49,8 @@ class Index extends Component {
|
||||||
<li className={flag ? "active" : ""}>
|
<li className={flag ? "active" : ""}>
|
||||||
<p>
|
<p>
|
||||||
<Link to={`/projects/${projectsId}/setting`} className="w-100">
|
<Link to={`/projects/${projectsId}/setting`} className="w-100">
|
||||||
|
|
||||||
<i className="iconfont icon-huabanfuben font-18 mr10"></i>基本设置
|
<i className="iconfont icon-huabanfuben font-18 mr10"></i>基本设置
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
|
@ -57,7 +61,7 @@ class Index extends Component {
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
<Link to={`/projects/${projectsId}/setting/collaborator`} className="w-100">
|
<Link to={`/projects/${projectsId}/setting/collaborator`} className="w-100">
|
||||||
<i className="iconfont icon-chengyuan font-18 mr10"></i>
|
<i className="iconfont icon-chengyuan font-18 mr10"></i>
|
||||||
协作者管理
|
协作者管理
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
|
@ -79,7 +83,7 @@ class Index extends Component {
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
<Link to={`/projects/${projectsId}/setting/tags`} className="w-100">
|
<Link to={`/projects/${projectsId}/setting/tags`} className="w-100">
|
||||||
<i className="iconfont icon-biaoqian3 font-18 mr10"></i>
|
<i className="iconfont icon-biaoqian3 font-18 mr10"></i>
|
||||||
项目标签
|
项目标签
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
|
@ -101,7 +105,7 @@ class Index extends Component {
|
||||||
</Short>
|
</Short>
|
||||||
<Long>
|
<Long>
|
||||||
<Gap>
|
<Gap>
|
||||||
<Switch {...this.props}>
|
<Switch {...this.props}>
|
||||||
{/* 协作者 */}
|
{/* 协作者 */}
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:projectsId/setting/collaborator"
|
path="/projects/:projectsId/setting/collaborator"
|
||||||
|
@ -116,6 +120,12 @@ class Index extends Component {
|
||||||
<Tags {...this.props} {...props} {...this.state} />
|
<Tags {...this.props} {...props} {...this.state} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
|
<Route
|
||||||
|
path="/projects/:projectsId/setting/branch/new"
|
||||||
|
render={(props) => (
|
||||||
|
<BranchNew {...this.props} {...props} {...this.state} />
|
||||||
|
)}
|
||||||
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:projectsId/setting/branch"
|
path="/projects/:projectsId/setting/branch"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
|
|
|
@ -174,18 +174,27 @@
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.required{
|
||||||
.hooksNew{
|
position: relative;
|
||||||
.required{
|
&::before{
|
||||||
position: relative;
|
content: "*";
|
||||||
&::before{
|
color: red;
|
||||||
content: "*";
|
position: absolute;
|
||||||
color: red;
|
left: -10px;
|
||||||
position: absolute;
|
top: -2px;
|
||||||
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{
|
.ant-select.ant-select-enabled{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue