forked from Gitlink/forgeplus-react
fork
This commit is contained in:
parent
6e7b6f3928
commit
1027156adb
|
@ -151,7 +151,9 @@ class Detail extends Component {
|
|||
}
|
||||
|
||||
componentDidUpdate = (prevState) => {
|
||||
if (prevState && this.props && (prevState.match.params.projectsId !== this.props.match.params.projectsId)) {
|
||||
let prevParam = prevState.match.params;
|
||||
let propsParam = this.props.match.params;
|
||||
if (prevState && this.props && (prevParam.projectsId !== propsParam.projectsId || prevParam.owner !== propsParam.owner)) {
|
||||
this.getProject();
|
||||
}
|
||||
}
|
||||
|
@ -204,7 +206,6 @@ class Detail extends Component {
|
|||
disconnected: () => { },
|
||||
received: data => {
|
||||
console.log(`###### ---received data--- ######`);
|
||||
console.log(data);
|
||||
if (data) {
|
||||
this.getDetail();
|
||||
cable.subscriptions.consumer.disconnect();
|
||||
|
@ -247,33 +248,30 @@ class Detail extends Component {
|
|||
target_type: "project",
|
||||
id: project_id
|
||||
}
|
||||
}).then(result => {
|
||||
if (result && result.data.status === 0) {
|
||||
this.setWatchersCount(result.data.watchers_count, result.data.watched);
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
if (result && result.data.status === 0) {
|
||||
this.setWatchersCount(result.data.watchers_count, result.data.watched);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
// 点赞和取消点赞
|
||||
pariseFunc = (flag) => {
|
||||
const { project_id } = this.state;
|
||||
|
||||
axios({
|
||||
method: flag ? 'delete' : 'post',
|
||||
url: `/projects/${project_id}/praise_tread/${flag ? 'unlike' : 'like'}.json`
|
||||
}).then(result => {
|
||||
if (result && result.data.status === 0) {
|
||||
this.setPraisesCount(result.data.praises_count, result.data.praised)
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
if (result && result.data.status === 0) {
|
||||
this.setPraisesCount(result.data.praises_count, result.data.praised)
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
setWatchersCount = (count, is_watched) => {
|
||||
|
@ -292,11 +290,12 @@ class Detail extends Component {
|
|||
|
||||
// fork项目
|
||||
forkFunc = () => {
|
||||
const { current_user } = this.props
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
const url = `/${owner}/${projectsId}/forks.json`;
|
||||
axios.post(url).then(result => {
|
||||
if (result && result.data.status === 0) {
|
||||
this.props.history.push(`/projects/${owner}/${result.data.identifier}/coders`);
|
||||
this.props.history.push(`/projects/${current_user && current_user.login}/${result.data.identifier}/coders`);
|
||||
this.props.showNotification(result.data.message);
|
||||
}
|
||||
}).catch(error => {
|
||||
|
@ -304,7 +303,6 @@ class Detail extends Component {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
// 同步镜像
|
||||
synchronismMirror = () => {
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
|
|
|
@ -17,11 +17,11 @@ class order_form extends Component {
|
|||
branch_name: "",
|
||||
issue_tag_ids: "",
|
||||
fixed_version_id: "",
|
||||
tracker_id: "1",
|
||||
tracker_id: "4",
|
||||
issue_type: "1",
|
||||
status_id: "1",
|
||||
assigned_to_id: "",
|
||||
priority_id: "1",
|
||||
priority_id: "2",
|
||||
done_ratio: "0%",
|
||||
issue_chosen: undefined,
|
||||
branches: undefined,
|
||||
|
|
Loading…
Reference in New Issue