Skip to content

Commit

Permalink
fix 关注问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomeinvG committed Nov 19, 2021
1 parent 66feb50 commit bc02c38
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1625,15 +1625,18 @@ export default {
}
if(this.currentScenario.id){
this.$post("/api/automation/update/follows/"+this.currentScenario.id, this.currentScenario.follows,() => {
this.$message.success("cancel success")
this.$success(this.$t('commons.cancel_follow_success'));
});
}
}else {
this.showFollow = true;
if(!this.currentScenario.follows){
this.currentScenario.follows = [];
}
this.currentScenario.follows.push(this.currentUser().id)
if(this.currentScenario.id){
this.$post("/api/automation/update/follows/"+this.currentScenario.id, this.currentScenario.follows,() => {
this.$message.success("cancel success")
this.$success(this.$t('commons.follow_success'));
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,18 @@ export default {
}
if( this.apiCase.id){
this.$post("/api/testcase/update/follows/"+this.apiCase.id, this.apiCase.follows,() => {
this.$message.success("cancel success")
this.$success(this.$t('commons.cancel_follow_success'));
});
}
}else {
this.showFollow = true;
if(!this.apiCase.follows){
this.apiCase.follows = [];
}
this.apiCase.follows.push(this.currentUser().id)
if( this.apiCase.id){
this.$post("/api/testcase/update/follows/"+this.apiCase.id, this.apiCase.follows,() => {
this.$message.success("cancel success")
this.$success(this.$t('commons.follow_success'));
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,6 @@
});
},
saveFollow(){
console.log("***********")
console.log(this.basisData.id)
if(this.showFollow){
this.showFollow = false;
for (let i = 0; i < this.httpForm.follows.length; i++) {
Expand All @@ -424,15 +422,18 @@
}
if(this.basisData.id){
this.$post("/api/definition/update/follows/"+this.basisData.id, this.httpForm.follows,() => {
this.$message.success("cancel success")
this.$success(this.$t('commons.cancel_follow_success'));
});
}
}else {
this.showFollow = true;
if(!this.httpForm.follows){
this.httpForm.follows = [];
}
this.httpForm.follows.push(this.currentUser().id)
if(this.basisData.id){
this.$post("/api/definition/update/follows/"+this.basisData.id, this.httpForm.follows,() => {
this.$message.success("save success")
this.$success(this.$t('commons.follow_success'));
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,15 +494,18 @@ export default {
}
if(this.testId){
this.$post("/performance/test/update/follows/"+this.testId, this.test.follows,() => {
this.$message.success("cancel success")
this.$success(this.$t('commons.cancel_follow_success'));
});
}
}else {
this.showFollow = true;
if(!this.test.follows){
this.test.follows = [];
}
this.test.follows.push(this.currentUser().id)
if(this.testId){
this.$post("/performance/test/update/follows/"+this.testId, this.test.follows,() => {
this.$message.success("cancel success")
this.$success(this.$t('commons.follow_success'));
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,16 +841,21 @@ export default {
this.result.loading = true
this.$post('/test/case/edit/follows/' + this.currentTestCaseInfo.id, this.form.follows, () => {
this.result.loading = false
this.$success(this.$t('commons.cancel_follow_success'));
});
}
} else {
this.showFollow = true;
if(!this.form.follows){
this.form.follows = [];
}
this.form.follows.push(this.currentUser().id)
if (this.path === "/test/case/edit") {
this.result.loading = true
this.$post('/test/case/edit/follows/' + this.currentTestCaseInfo.id, this.form.follows, () => {
this.result.loading = false
this.$success(this.$t('commons.follow_success'));
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,19 @@ export default {
}
if(this.url === "issues/update"){
this.$post("issues/up/follows/"+this.issueId, this.form.follows,() => {
this.$success(this.$t('commons.cancel_follow_success'));
});
}
}else {
this.showFollow = true;
if(!this.form.follows){
this.form.follows = [];
}
this.form.follows.push(this.currentUser().id)
if(this.url === "issues/update"){
this.$post("issues/up/follows/"+this.issueId, this.form.follows,() => {
this.$success(this.$t('commons.follow_success'));
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,14 +565,19 @@ export default {
}
}
this.$post('/test/plan/edit/follows/' + row.id, row.follows,() => {
this.$success(this.$t('commons.cancel_follow_success'));
this.initTableData();
});
return
}
if(!row.showFollow){
row.showFollow = true;
if(!row.follows){
row.follows = [];
}
row.follows.push(this.currentUser().id);
this.$post('/test/plan/edit/follows/' + row.id, row.follows,() => {
this.$success(this.$t('commons.follow_success'));
this.initTableData();
});
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,20 @@ export default {
}
param.followIds = row.followIds
this.$post('/test/case/review/edit/follows', param,() => {
this.$success(this.$t('commons.cancel_follow_success'));
this.initTableData();
});
return
}
if(!row.showFollow){
row.showFollow = true;
if(!row.followIds){
row.followIds = [];
}
row.followIds.push(this.currentUser().id);
param.followIds = row.followIds
this.$post('/test/case/review/edit/follows', param,() => {
this.$success(this.$t('commons.follow_success'));
this.initTableData();
});
}
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/i18n/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ export default {
run_success: "Run Success",
run_completed: "Run Completed",
run_fail: "Run Fail",
follow_success:"Follow Success",
cancel_follow_success: "Cancel Follow Success",
generate_test_data: "Generate test data",
relationship: {
name: 'Dependencies',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/i18n/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ export default {
run_success: "执行成功",
run_completed: "执行完成",
run_fail: "执行失败",
follow_success:"关注成功",
cancel_follow_success:"取消关注成功",
relationship: {
name: '依赖关系',
pre_case: '前置用例',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/i18n/zh-TW.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ export default {
run_success: "執行成功",
run_completed: "執行完成",
run_fail: "執行失敗",
follow_success:"關注成功",
cancel_follow_success: "取消關注成功",
relationship: {
name: '依賴關系',
pre_case: '前置用例',
Expand Down

0 comments on commit bc02c38

Please sign in to comment.