change some bugs
This commit is contained in:
parent
39698e42da
commit
582ae7765d
|
|
@ -99,9 +99,9 @@ export function initAxiosInterceptors(props) {
|
|||
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation
|
||||
// TODO 读取到package.json中的配置?
|
||||
var
|
||||
// proxy = "http://localhost:3000"
|
||||
proxy = "http://localhost:3000"
|
||||
// proxy = "https://pre-newweb.educoder.net"
|
||||
proxy = "https://testforgeplus.trustie.net"
|
||||
// proxy = "https://testforgeplus.trustie.net"
|
||||
|
||||
// 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求;
|
||||
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ class Detail extends Component {
|
|||
<div className="detailHeader-wrapper">
|
||||
<div className="normal">
|
||||
<div className="f-wrap-between mb15" style={{ position: "relative" }}>
|
||||
<p className="font-18 color-white df flex-1 lineH2 mt15" style={{ alignItems: "center" }}>
|
||||
<p className="font-22 color-white df flex-1 lineH2 mt15" style={{ alignItems: "center" }}>
|
||||
{project && project.author &&
|
||||
<Link to={`/users/${project.author.login}`} className="show-user-link color-white">
|
||||
{project.author.name}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ class NewMerge extends Component {
|
|||
};
|
||||
|
||||
selectBrach = (type, value) => {
|
||||
const {merge_head,projects_names} = this.state;
|
||||
this.state[type] = value;
|
||||
this.ischeckmerge();
|
||||
};
|
||||
|
|
@ -137,7 +136,7 @@ class NewMerge extends Component {
|
|||
head: merge,
|
||||
base: pull,
|
||||
is_original: merge_head,
|
||||
fork_project_id: merge_head ? project_id : ""
|
||||
fork_project_id: merge_head ? project_id : undefined
|
||||
})
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
|
|
@ -190,7 +189,7 @@ class NewMerge extends Component {
|
|||
key={key + 1}
|
||||
value={item.name}
|
||||
>
|
||||
{type ? `${item.user_name}:${item.name}` : item.name}
|
||||
{item.name}
|
||||
</Option>
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -58,10 +58,10 @@ class MergeForm extends Component {
|
|||
if (data && merge_type === "edit") {
|
||||
this.setState({
|
||||
desc: data.body,
|
||||
issue_tag_ids: data.issue_tag_ids[0],
|
||||
issue_tag_ids: data.issue_tag_ids ? data.issue_tag_ids[0] : undefined,
|
||||
fixed_version_id: data.fixed_version_id ? String(data.fixed_version_id) : undefined,
|
||||
assigned_to_id: String(data.assigned_to_id),
|
||||
priority_id: String(data.priority_id),
|
||||
assigned_to_id: data.assigned_to_id ? String(data.assigned_to_id) : undefined,
|
||||
priority_id: data.priority_id ? String(data.priority_id) :undefined,
|
||||
title: data.title,
|
||||
});
|
||||
}
|
||||
|
|
@ -125,15 +125,13 @@ class MergeForm extends Component {
|
|||
this.props.form.validateFieldsAndScroll((err, values) => {
|
||||
if (!err) {
|
||||
const { projectsId, mergeId } = this.props.match.params;
|
||||
const { merge, pull, merge_type } = this.props;
|
||||
const { merge, pull, merge_type, data } = this.props;
|
||||
if (values.issue_tag_ids && values.issue_tag_ids.length > 0) {
|
||||
values.issue_tag_ids = [parseInt(values.issue_tag_ids)];
|
||||
} else {
|
||||
values.issue_tag_ids = [];
|
||||
}
|
||||
const { desc } = this.state;
|
||||
const { data } = this.props;
|
||||
console.log("merge_type", merge_type)
|
||||
const { desc } = this.state;
|
||||
if (merge_type === "new") {
|
||||
let url = `/projects/${projectsId}/pull_requests.json`;
|
||||
axios
|
||||
|
|
@ -142,9 +140,9 @@ class MergeForm extends Component {
|
|||
body: desc,
|
||||
head: pull,
|
||||
base: merge,
|
||||
is_original: data.is_original,
|
||||
fork_project_id: data.fork_project_id,
|
||||
merge_user_login: data.merge_user_login
|
||||
is_original: data && data.is_original,
|
||||
fork_project_id: data && data.fork_project_id,
|
||||
merge_user_login: data && data.merge_user_login
|
||||
})
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
|
|
@ -152,6 +150,8 @@ class MergeForm extends Component {
|
|||
isSpin: false,
|
||||
});
|
||||
this.props.history.push(`/projects/${projectsId}/merge`);
|
||||
const { getDetail } = this.props;
|
||||
getDetail && getDetail();
|
||||
} else {
|
||||
this.setState({
|
||||
isSpin: false,
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@ class UserSubmitComponent extends Component {
|
|||
: `/projects/${projectsId}/coders`;
|
||||
this.props.history.push(url);
|
||||
this.props.showNotification("文件新建成功!");
|
||||
if(submitType === "1"){
|
||||
const { getDetail } = this.props;
|
||||
getDetail && getDetail();
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue