fix(测试跟踪): 添加到用例库校验是否开启用例库

--bug=1023684 --user=陈建星 【测试跟踪】项目未开启公共用例库开关-用例详情页-点击添加到公共用例库-也能添加成功 https://www.tapd.cn/55049933/s/1341404
This commit is contained in:
chenjianxing 2023-02-22 20:26:55 +08:00 committed by jianxing
parent 844f6bcd38
commit b63365c801
1 changed files with 26 additions and 5 deletions

View File

@ -346,7 +346,12 @@ import {
hasTestCaseOtherInfo,
testCaseEditFollows,
testCaseGetByVersionId,
testCaseDeleteToGc, getTestCaseNodesByCaseFilter, getTestCaseByVersionId, getEditSimpleTestCase, getSimpleTestCase,
testCaseDeleteToGc,
getTestCaseNodesByCaseFilter,
getTestCaseByVersionId,
getEditSimpleTestCase,
getSimpleTestCase,
testCaseBatchEdit,
} from "@/api/testCase";
import {
@ -889,12 +894,28 @@ export default {
}
},
addPublic() {
this.casePublic = true;
this.saveCase(true);
getProjectApplicationConfig('CASE_PUBLIC')
.then(res => {
let data = res.data;
if (data && data.typeValue === 'true') {
this.casePublic = true;
this.saveCase(true);
} else {
this.$warning(this.$t('test_track.case.public_warning'), false);
}
});
},
removePublic() {
this.casePublic = false;
this.saveCase(true);
getProjectApplicationConfig('CASE_PUBLIC')
.then(res => {
let data = res.data;
if (data && data.typeValue === 'true') {
this.casePublic = false;
this.saveCase(true);
} else {
this.$warning(this.$t('test_track.case.public_warning'), false);
}
});
},
handleCommand(e) {
this.saveType = e;