guoyuqi 2022-08-17 17:26:27 +08:00 committed by 刘瑞斌
parent ef131d91de
commit 29c8d6031e
9 changed files with 38 additions and 7 deletions

View File

@ -233,4 +233,9 @@ public class ApiTestCaseController {
public void saveFollows(@PathVariable String testId, @RequestBody List<String> follows) {
apiTestCaseService.saveFollows(testId, follows);
}
@GetMapping("/be/cited/scenario/{testId}")
public Integer getCitedScenarioCount(@PathVariable String testId) {
return apiTestCaseService.getCitedScenarioCount(testId);
}
}

View File

@ -125,6 +125,8 @@ public class ApiTestCaseService {
private ApiCaseBatchSyncService apiCaseSyncService;
@Resource
private ApiTestCaseSyncService apiTestCaseSyncService;
@Resource
private ApiScenarioReferenceIdMapper apiScenarioReferenceIdMapper;
private static final String BODY_FILE_DIR = FileUtils.BODY_FILE_DIR;
@ -1310,4 +1312,15 @@ public class ApiTestCaseService {
}
request.setStatusList(syncRuleCaseStatus);
}
public Integer getCitedScenarioCount(String testId) {
ApiScenarioReferenceIdExample apiScenarioReferenceIdExample = new ApiScenarioReferenceIdExample();
apiScenarioReferenceIdExample.createCriteria().andDataTypeEqualTo(ReportTriggerMode.CASE.name()).andReferenceTypeEqualTo(MsTestElementConstants.REF.name()).andReferenceIdEqualTo(testId);
List<ApiScenarioReferenceId> apiScenarioReferenceIds = apiScenarioReferenceIdMapper.selectByExample(apiScenarioReferenceIdExample);
if (CollectionUtils.isEmpty(apiScenarioReferenceIds)) {
return 0;
} else {
return apiScenarioReferenceIds.size();
}
}
}

View File

@ -362,6 +362,7 @@
t1.update_user_id,
t1.create_time,
t1.update_time,
t1.to_be_updated,
t1.num,
a.module_id,
a.path,

View File

@ -29,5 +29,5 @@ public class ProjectConfig {
private String triggerUpdate;
private Boolean openUpdateTime = false;
private String openUpdateRuleTime;
private Boolean openUpdateRule = false;
private Boolean openUpdateRule = null;
}

View File

@ -323,7 +323,8 @@ export default {
caseSyncRuleRelation: {
scenarioCreator: true,
showUpdateRule: false,
}
},
citedScenarioCount: 0,
}
},
props: {
@ -395,6 +396,7 @@ export default {
if (hasLicense()) {
this.beforeUpdateRequest = deepClone(this.apiCase.request);
this.getSyncRule();
this.getCitedScenarioCount();
this.$EventBus.$on('showXpackCaseSet', noShowSyncRuleRelation => {
this.handleXpackCaseSetChange(noShowSyncRuleRelation);
});
@ -707,6 +709,9 @@ export default {
},
validCaseRestChange() {
let syncCaseVisible = false;
if (this.citedScenarioCount === 0) {
return false;
}
if (this.apiCase.request.headers && this.beforeUpdateRequest.headers) {
let submitRequestHeaders = JSON.stringify(this.apiCase.request.headers);
let beforeRequestHeaders = JSON.stringify(this.beforeUpdateRequest.headers);
@ -869,6 +874,13 @@ export default {
},
handleXpackCaseSetChange(noShowSyncRuleRelation) {
this.noShowSyncRuleRelation = noShowSyncRuleRelation
},
getCitedScenarioCount() {
this.$get('/api/testcase/be/cited/scenario/' + this.apiCase.id, response => {
if (response.data) {
this.citedScenarioCount = response.data;
}
});
}
}
}

View File

@ -427,7 +427,7 @@ export default {
this.showSyncTimeSetting = true;
}
}
this.openUpdateRule = this.config.openUpdateRule
this.openUpdateRule = this.config.openUpdateRule !== false;
this.disabledRuleBtn = !this.openUpdateRule
}
});

View File

@ -3414,7 +3414,7 @@ export default {
no_show_setting_tip: "After checking, the pop-up window will no longer pop up, and the synchronization and change notification will be performed according to the setting content by default: If you need to change the setting, you can open the setting item in the drop-down option next to the save button。",
go_to_api_message: 'Interface API update message notification',
go_to_case_message: 'CASE update message notification',
update_case_tip: 'When the CASE changes, the creator of the automation scene referring to the CASE recycles the message reminder in the station'
update_case_tip: 'When the CASE changes, the creator of the automation scene referring to the CASE will receive an in-site message reminder'
}
}
};

View File

@ -3425,7 +3425,7 @@ export default {
no_show_setting_tip: "勾选后,不再弹出弹窗,会默认按照设置的内容执行同步和变更通知:如果需要更改设置,可以在保存按钮旁的下拉选项中,打开设置项。",
go_to_api_message: '接口API更新消息通知',
go_to_case_message: 'CASE更新消息通知',
update_case_tip: '当CASE发生变化时引用CASE的自动化场景创建人收到站内消息提醒'
update_case_tip: '当CASE发生变化时引用CASE的自动化场景创建人收到站内消息提醒'
}
}
};

View File

@ -3401,7 +3401,7 @@ export default {
no_show_setting_tip: "勾選後,不再彈出彈窗,會默認按照設置的內容執行同步和變更通知:如果需要更改設置,可以在保存按鈕旁的下拉選項中,打開設置項。",
go_to_api_message: '接口API更新消息通知',
go_to_case_message: 'CASE更新消息通知',
update_case_tip: '當CASE發生變化時引用CASE的自動化場景創建人收到站內消息提醒'
update_case_tip: '當CASE發生變化時引用CASE的自動化場景創建人收到站內消息提醒'
}
}
};