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 e9533a097d
commit 1e384f2e2c
1 changed files with 26 additions and 5 deletions

View File

@ -346,7 +346,12 @@ import {
hasTestCaseOtherInfo, hasTestCaseOtherInfo,
testCaseEditFollows, testCaseEditFollows,
testCaseGetByVersionId, testCaseGetByVersionId,
testCaseDeleteToGc, getTestCaseNodesByCaseFilter, getTestCaseByVersionId, getEditSimpleTestCase, getSimpleTestCase, testCaseDeleteToGc,
getTestCaseNodesByCaseFilter,
getTestCaseByVersionId,
getEditSimpleTestCase,
getSimpleTestCase,
testCaseBatchEdit,
} from "@/api/testCase"; } from "@/api/testCase";
import { import {
@ -886,12 +891,28 @@ export default {
} }
}, },
addPublic() { addPublic() {
this.casePublic = true; getProjectApplicationConfig('CASE_PUBLIC')
this.saveCase(true); .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() { removePublic() {
this.casePublic = false; getProjectApplicationConfig('CASE_PUBLIC')
this.saveCase(true); .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) { handleCommand(e) {
this.saveType = e; this.saveType = e;