fix(接口定义): 修复只有case时,不会弹窗提示同步信息
--bug=1018729 --user=王孝刚 【接口测试】接口定义-创建新版本接口只有CASE,没有备注/依赖关系/MOCK时,不会弹框提示是否勾选同步信息 https://www.tapd.cn/55049933/s/1275021
This commit is contained in:
parent
309ffe9773
commit
fe14e5ce10
|
@ -100,4 +100,6 @@ public interface ExtApiTestCaseMapper {
|
|||
List<ApiTestCaseDTO> relevanceApiList(@Param("request") ApiTestCaseRequest request);
|
||||
|
||||
List<BaseCase> selectBaseCaseByProjectId(@Param("projectId") String projectId);
|
||||
|
||||
int getCaseCountById(String id);
|
||||
}
|
||||
|
|
|
@ -1220,4 +1220,14 @@
|
|||
GROUP BY ${apiCaseGroupColumn}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getCaseCountById" resultType="java.lang.Integer">
|
||||
select
|
||||
count(id) AS countNum
|
||||
FROM api_test_case
|
||||
<where>
|
||||
( `status` != 'Trash' OR `status` IS NULL)
|
||||
AND api_definition_id = #{apiId}
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -266,4 +266,9 @@ public class ApiTestCaseController {
|
|||
public List<JmxInfoDTO> getScenarioCaseByIds(@RequestBody ApiCaseExportJmxRequest request) {
|
||||
return apiTestCaseService.exportJmx(request.getCaseIds(), request.getEnvId());
|
||||
}
|
||||
|
||||
@PostMapping("/case-count")
|
||||
public int getCaseCountById(@RequestBody SaveApiTestCaseRequest request) {
|
||||
return apiTestCaseService.getCaseCountById(request.getId());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1233,4 +1233,8 @@ public class ApiTestCaseService {
|
|||
jmxInfoDTO.setName(apiTestCase.getName());
|
||||
return jmxInfoDTO;
|
||||
}
|
||||
|
||||
public int getCaseCountById(String id) {
|
||||
return extApiTestCaseMapper.getCaseCountById(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,3 +81,7 @@ export function createApiCase(file, files, params) {
|
|||
export function editApiCase(url, file, files, params) {
|
||||
return fileUpload(url, file, files, params);
|
||||
}
|
||||
|
||||
export function apiTestCaseCount(param) {
|
||||
return post('/api/testcase/case-count',param);
|
||||
}
|
||||
|
|
|
@ -96,6 +96,7 @@ import {createComponent} from ".././jmeter/components";
|
|||
import {TYPE_TO_C} from "@/business/automation/scenario/Setting";
|
||||
import MsDialogFooter from "metersphere-frontend/src/components/MsDialogFooter";
|
||||
import {useApiStore} from "@/store";
|
||||
import {apiTestCaseCount} from "@/api/api-test-case";
|
||||
|
||||
const store = useApiStore();
|
||||
const {Body} = require("@/business/definition/model/ApiTestModel");
|
||||
|
@ -345,18 +346,23 @@ export default {
|
|||
// 创建新版本
|
||||
this.basisData.versionId = row.id;
|
||||
this.basisData.versionName = row.name;
|
||||
this.$set(this.basisData, 'newVersionRemark', !!this.basisData.remark);
|
||||
this.$set(this.basisData, 'newVersionDeps', this.$refs.apiOtherInfo.relationshipCount > 0);
|
||||
this.$set(this.basisData, 'newVersionCase', this.basisData.caseTotal > 0);
|
||||
|
||||
if (this.$refs.apiOtherInfo.relationshipCount > 0 || this.basisData.remark || this.basisData.newVersionCase) {
|
||||
this.createNewVersionVisible = true;
|
||||
} else {
|
||||
this.saveApi();
|
||||
if (this.$refs.versionHistory) {
|
||||
this.$refs.versionHistory.loading = false;
|
||||
apiTestCaseCount({id: this.basisData.id}).then(response => {
|
||||
if (response.data > 0) {
|
||||
this.basisData.caseTotal = response.data;
|
||||
}
|
||||
}
|
||||
this.$set(this.basisData, 'newVersionRemark', !!this.basisData.remark);
|
||||
this.$set(this.basisData, 'newVersionDeps', this.$refs.apiOtherInfo.relationshipCount > 0);
|
||||
this.$set(this.basisData, 'newVersionCase', this.basisData.caseTotal > 0);
|
||||
|
||||
if (this.$refs.apiOtherInfo.relationshipCount > 0 || this.basisData.remark || this.basisData.newVersionCase) {
|
||||
this.createNewVersionVisible = true;
|
||||
} else {
|
||||
this.saveApi();
|
||||
if (this.$refs.versionHistory) {
|
||||
this.$refs.versionHistory.loading = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
del(row) {
|
||||
this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + row.name + " ?", '', {
|
||||
|
|
|
@ -210,6 +210,7 @@ import {
|
|||
getMockEnvironment,
|
||||
updateDefinitionFollows
|
||||
} from "@/api/definition";
|
||||
import {apiTestCaseCount} from "@/api/api-test-case";
|
||||
import {relationGet, updateRuleRelation} from "@/api/xpack";
|
||||
import MsApiRequestForm from "../request/http/ApiHttpRequestForm";
|
||||
import MsResponseText from "../response/ResponseText";
|
||||
|
@ -787,25 +788,30 @@ export default {
|
|||
// 创建新版本
|
||||
this.httpForm.versionId = row.id;
|
||||
this.httpForm.versionName = row.name;
|
||||
this.$set(this.httpForm, 'newVersionRemark', !!this.httpForm.remark);
|
||||
this.$set(this.httpForm, 'newVersionDeps', this.$refs.apiOtherInfo.relationshipCount > 0);
|
||||
this.$set(this.httpForm, 'newVersionCase', this.httpForm.caseTotal > 0);
|
||||
createMockConfig({projectId: this.projectId, apiId: this.httpForm.id}).then(response => {
|
||||
this.$set(this.httpForm, 'newVersionMock', response.data.mockExpectConfigList.length > 0);
|
||||
apiTestCaseCount({id: this.httpForm.id}).then(response => {
|
||||
if (response.data > 0) {
|
||||
this.httpForm.caseTotal = response.data;
|
||||
}
|
||||
this.$set(this.httpForm, 'newVersionRemark', !!this.httpForm.remark);
|
||||
this.$set(this.httpForm, 'newVersionDeps', this.$refs.apiOtherInfo.relationshipCount > 0);
|
||||
this.$set(this.httpForm, 'newVersionCase', this.httpForm.caseTotal > 0);
|
||||
createMockConfig({projectId: this.projectId, apiId: this.httpForm.id}).then(response => {
|
||||
this.$set(this.httpForm, 'newVersionMock', response.data.mockExpectConfigList.length > 0);
|
||||
|
||||
if (this.$refs.apiOtherInfo.relationshipCount > 0 || this.httpForm.remark ||
|
||||
this.httpForm.newVersionCase || this.httpForm.newVersionMock) {
|
||||
this.createNewVersionVisible = true;
|
||||
} else {
|
||||
this.saveApi();
|
||||
if (this.$refs.apiOtherInfo.relationshipCount > 0 || this.httpForm.remark ||
|
||||
this.httpForm.newVersionCase || this.httpForm.newVersionMock) {
|
||||
this.createNewVersionVisible = true;
|
||||
} else {
|
||||
this.saveApi();
|
||||
if (this.$refs.versionHistory) {
|
||||
this.$refs.versionHistory.loading = false;
|
||||
}
|
||||
}
|
||||
}, error => {
|
||||
if (this.$refs.versionHistory) {
|
||||
this.$refs.versionHistory.loading = false;
|
||||
}
|
||||
}
|
||||
}, error => {
|
||||
if (this.$refs.versionHistory) {
|
||||
this.$refs.versionHistory.loading = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
del(row) {
|
||||
|
|
|
@ -82,7 +82,8 @@
|
|||
import {
|
||||
definitionFollow,
|
||||
delDefinitionByRefId,
|
||||
getDefinitionById, getDefinitionByIdAndRefId,
|
||||
getDefinitionById,
|
||||
getDefinitionByIdAndRefId,
|
||||
getDefinitionVersions,
|
||||
updateDefinitionFollows
|
||||
} from "@/api/definition";
|
||||
|
@ -97,6 +98,7 @@ import {createComponent} from ".././jmeter/components";
|
|||
import {TYPE_TO_C} from "@/business/automation/scenario/Setting";
|
||||
import MsDialogFooter from "metersphere-frontend/src/components/MsDialogFooter";
|
||||
import {useApiStore} from "@/store";
|
||||
import {apiTestCaseCount} from "@/api/api-test-case";
|
||||
|
||||
const store = useApiStore();
|
||||
const {Body} = require("@/business/definition/model/ApiTestModel");
|
||||
|
@ -358,18 +360,23 @@ export default {
|
|||
// 创建新版本
|
||||
this.basisData.versionId = row.id;
|
||||
this.basisData.versionName = row.name;
|
||||
this.$set(this.basisData, 'newVersionRemark', !!this.basisData.remark);
|
||||
this.$set(this.basisData, 'newVersionDeps', this.$refs.apiOtherInfo.relationshipCount > 0);
|
||||
this.$set(this.basisData, 'newVersionCase', this.basisData.caseTotal > 0);
|
||||
|
||||
if (this.$refs.apiOtherInfo.relationshipCount > 0 || this.basisData.remark || this.basisData.newVersionCase) {
|
||||
this.createNewVersionVisible = true;
|
||||
} else {
|
||||
this.saveApi();
|
||||
if (this.$refs.versionHistory) {
|
||||
this.$refs.versionHistory.loading = false;
|
||||
apiTestCaseCount({id: this.basisData.id}).then(response => {
|
||||
if (response.data > 0) {
|
||||
this.basisData.caseTotal = response.data;
|
||||
}
|
||||
}
|
||||
this.$set(this.basisData, 'newVersionRemark', !!this.basisData.remark);
|
||||
this.$set(this.basisData, 'newVersionDeps', this.$refs.apiOtherInfo.relationshipCount > 0);
|
||||
this.$set(this.basisData, 'newVersionCase', this.basisData.caseTotal > 0);
|
||||
|
||||
if (this.$refs.apiOtherInfo.relationshipCount > 0 || this.basisData.remark || this.basisData.newVersionCase) {
|
||||
this.createNewVersionVisible = true;
|
||||
} else {
|
||||
this.saveApi();
|
||||
if (this.$refs.versionHistory) {
|
||||
this.$refs.versionHistory.loading = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
del(row) {
|
||||
this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + row.name + " ?", '', {
|
||||
|
|
|
@ -114,6 +114,7 @@ import {createComponent} from ".././jmeter/components";
|
|||
import {TYPE_TO_C} from "@/business/automation/scenario/Setting";
|
||||
import MsDialogFooter from "metersphere-frontend/src/components/MsDialogFooter";
|
||||
import {useApiStore} from "@/store";
|
||||
import {apiTestCaseCount} from "@/api/api-test-case";
|
||||
|
||||
const store = useApiStore();
|
||||
const {Body} = require("@/business/definition/model/ApiTestModel");
|
||||
|
@ -460,22 +461,27 @@ export default {
|
|||
// 创建新版本
|
||||
this.basisData.versionId = row.id;
|
||||
this.basisData.versionName = row.name;
|
||||
this.$set(this.basisData, 'newVersionRemark', !!this.basisData.remark);
|
||||
this.$set(this.basisData, 'newVersionDeps', this.$refs.apiOtherInfo.relationshipCount > 0);
|
||||
this.$set(this.basisData, 'newVersionCase', this.basisData.caseTotal > 0);
|
||||
|
||||
createMockConfig({projectId: this.projectId, apiId: this.basisData.id}).then(response => {
|
||||
this.$set(this.basisData, 'newVersionMock', response.data.mockExpectConfigList.length > 0);
|
||||
|
||||
if (this.$refs.apiOtherInfo.relationshipCount > 0 || this.basisData.remark ||
|
||||
this.basisData.newVersionCase || this.basisData.newVersionMock) {
|
||||
this.createNewVersionVisible = true;
|
||||
} else {
|
||||
this.saveApi();
|
||||
if (this.$refs.versionHistory) {
|
||||
this.$refs.versionHistory.loading = false;
|
||||
}
|
||||
apiTestCaseCount({id: this.basisData.id}).then(response => {
|
||||
if (response.data > 0) {
|
||||
this.basisData.caseTotal = response.data;
|
||||
}
|
||||
this.$set(this.basisData, 'newVersionRemark', !!this.basisData.remark);
|
||||
this.$set(this.basisData, 'newVersionDeps', this.$refs.apiOtherInfo.relationshipCount > 0);
|
||||
this.$set(this.basisData, 'newVersionCase', this.basisData.caseTotal > 0);
|
||||
|
||||
createMockConfig({projectId: this.projectId, apiId: this.basisData.id}).then(response => {
|
||||
this.$set(this.basisData, 'newVersionMock', response.data.mockExpectConfigList.length > 0);
|
||||
|
||||
if (this.$refs.apiOtherInfo.relationshipCount > 0 || this.basisData.remark ||
|
||||
this.basisData.newVersionCase || this.basisData.newVersionMock) {
|
||||
this.createNewVersionVisible = true;
|
||||
} else {
|
||||
this.saveApi();
|
||||
if (this.$refs.versionHistory) {
|
||||
this.$refs.versionHistory.loading = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
del(row) {
|
||||
|
|
Loading…
Reference in New Issue