Merge branch 'master' of github.com:metersphere/metersphere

This commit is contained in:
Captain.B 2021-03-18 17:15:26 +08:00
commit 749e43341b
17 changed files with 91 additions and 32 deletions

View File

@ -332,8 +332,10 @@ public class ApiAutomationService {
public ApiScenarioDTO getApiScenario(String id) {
ApiScenarioDTO apiScenarioDTO = new ApiScenarioDTO();
ApiScenarioWithBLOBs scenarioWithBLOBs = apiScenarioMapper.selectByPrimaryKey(id);
BeanUtils.copyBean(apiScenarioDTO, scenarioWithBLOBs);
setApiScenarioProjectIds(apiScenarioDTO);
if (scenarioWithBLOBs != null) {
BeanUtils.copyBean(apiScenarioDTO, scenarioWithBLOBs);
setApiScenarioProjectIds(apiScenarioDTO);
}
return apiScenarioDTO;
}

View File

@ -20,7 +20,7 @@ public class LoginRequest {
try {
RsaKey rsaKey = CommonBeanFactory.getBean(RsaKey.class);
return RsaUtil.privateDecrypt(username, rsaKey.getPrivateKey());
} catch (NoSuchAlgorithmException e) {
} catch (Exception e) {
return username;
}
}
@ -29,7 +29,7 @@ public class LoginRequest {
try {
RsaKey rsaKey = CommonBeanFactory.getBean(RsaKey.class);
return RsaUtil.privateDecrypt(password, rsaKey.getPrivateKey());
} catch (NoSuchAlgorithmException e) {
} catch (Exception e) {
return password;
}
}

View File

@ -14,7 +14,6 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.ldap.core.DirContextOperations;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController

View File

@ -377,7 +377,7 @@ public class TestCaseReviewService {
sqlSession.flushStatements();
//同步添加关联的接口和测试用例
if(request.getChecked()){
/* if(request.getChecked()){
if (!testCaseIds.isEmpty()) {
testCaseIds.forEach(caseId -> {
TestCaseWithBLOBs testDtail=testCaseMapper.selectByPrimaryKey(caseId);
@ -434,7 +434,7 @@ public class TestCaseReviewService {
});
}
}
}*/
TestCaseReview testCaseReview = testCaseReviewMapper.selectByPrimaryKey(request.getReviewId());
if (StringUtils.equals(testCaseReview.getStatus(), TestCaseReviewStatus.Prepare.name())
|| StringUtils.equals(testCaseReview.getStatus(), TestCaseReviewStatus.Completed.name())) {

@ -1 +1 @@
Subproject commit adefde265ff12d4ea909353c3f46008f8a8e17e7
Subproject commit efd6af73b7c5cc53cd4515772000bc1436c49837

View File

@ -12,7 +12,7 @@
<span>
<slot name="headerLeft">
<i class="icon el-icon-arrow-right" :class="{'is-active': data.active}"
@click="active(data)" v-if="data.type!='scenario' && data.type!='JmeterElement' && !isMax " @click.stop/>
@click="active(data)" v-if="data.type!='scenario' && !isMax " @click.stop/>
<span @click.stop v-if="isShowInput && isShowNameInput">
<el-input :draggable="draggable" size="mini" v-model="data.name" class="name-input"
@blur="isShowInput = false" :placeholder="$t('commons.input_name')" ref="nameEdit" :disabled="data.disabled"/>
@ -113,9 +113,6 @@
this.$refs.nameEdit.focus();
});
}
if (this.data && this.data.type === "JmeterElement") {
this.data.active = false;
}
if (this.data && ELEMENTS.get("AllSamplerProxy").indexOf(this.data.type) != -1) {
if (!this.data.method) {
this.data.method = this.data.protocol;

View File

@ -2,6 +2,7 @@
<api-base-component
@copy="copyRow"
@remove="remove"
@active="active"
:data="request"
:draggable="draggable"
:color="defColor"
@ -9,7 +10,9 @@
:show-btn="showBtn"
:background-color="defBackgroundColor"
:title="request.elementType">
<div style="height: 300px;width: 100%">
<ms-code-edit mode="xml" :data.sync="request.jmeterElement" theme="eclipse" ref="codeEdit"/>
</div>
</api-base-component>
</template>
@ -56,6 +59,9 @@
copyRow() {
this.$emit('copyRow', this.jsr223Processor, this.node);
},
active() {
this.request.active = !this.request.active;
},
}
}
</script>

View File

@ -459,11 +459,11 @@
} else {
this.operatingElements = [];
}
if (data && data.type != "JmeterElement") {
if (data) {
data.active = true;
if (data.hashTree) {
data.hashTree.forEach(item => {
if (item && item.type != "JmeterElement") {
if (item) {
item.active = true;
}
})
@ -915,7 +915,7 @@
setProjectEnvMap(projectEnvMap) {
this.projectEnvMap = projectEnvMap;
},
refReload(data,node) {
refReload(data, node) {
this.selectedTreeNode = data;
this.selectedNode = node;
this.initProjectIds();

View File

@ -2,7 +2,7 @@
<div>
<el-row :gutter="10" type="flex" justify="space-between" align="middle">
<el-col>
<el-input :disabled="isReadOnly" v-model="xPath2.expression" maxlength="200" size="small" show-word-limit
<el-input :disabled="isReadOnly" v-model="xPath2.expression" maxlength="500" size="small" show-word-limit
:placeholder="$t('api_test.request.extract.xpath_expression')"/>
</el-col>
<el-col class="assertion-btn">

View File

@ -222,7 +222,9 @@
}
this.result = this.$post("/api/testcase/list", this.condition, response => {
this.apiCaseList = response.data;
if(response.data){
this.apiCaseList = response.data;
}
this.apiCaseList.forEach(apiCase => {
if (apiCase.tags && apiCase.tags.length > 0) {
apiCase.tags = JSON.parse(apiCase.tags);
@ -236,7 +238,7 @@
}
})
if (!this.useEnvironment && this.apiCaseList[0].request && this.apiCaseList[0].request.useEnvironment) {
if (!this.useEnvironment && this.apiCaseList[0] && this.apiCaseList[0].request && this.apiCaseList[0].request.useEnvironment) {
this.useEnvironment = this.apiCaseList[0].request.useEnvironment;
this.environment = this.useEnvironment;
}

View File

@ -1,6 +1,7 @@
<template>
<el-dialog :close-on-click-modal="false" :title="$t('api_test.api_import.title')" width="30%"
:visible.sync="visible" class="api-import" v-loading="result.loading" @close="close">
:visible.sync="visible" class="api-import" v-loading="result.loading" @close="close"
:destroy-on-close="true">
<div class="header-bar">
<div>{{ $t('api_test.api_import.data_format') }}</div>
@ -23,12 +24,12 @@
<el-form :model="formData" :rules="rules" label-width="100px" v-loading="result.loading" ref="form">
<el-row>
<el-col :span="11">
<el-form-item :label="$t('commons.import_module')">
<el-form-item :label="$t('commons.import_module')" prop="moduleId">
<el-select size="small" v-model="formData.moduleId" class="project-select" clearable>
<el-option v-for="item in moduleOptions" :key="item.id" :label="item.path" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item v-if="!isScenarioModel&&!isHar" :label="$t('commons.import_mode')">
<el-form-item v-if="!isScenarioModel&&!isHar" :label="$t('commons.import_mode')" prop="modeId">
<el-select size="small" v-model="formData.modeId" class="project-select" clearable>
<el-option v-for="item in modeOptions" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
@ -167,7 +168,14 @@ export default {
modeId: this.$t('commons.not_cover'),
moduleId: '',
},
rules: {},
rules: {
modeId: [
{required: true, message: this.$t('commons.please_select_import_mode'), trigger: 'change'},
],
moduleId: [
{required: true, message: this.$t('commons.please_select_import_module'), trigger: 'change'},
],
},
currentModule: {},
fileList: []
}

View File

@ -524,7 +524,8 @@ export default {
this.$emit('editApi', row);
},
runApi(row) {
let request = JSON.parse(row.request);
let request = row ? JSON.parse(row.request) : {};
if (row.tags instanceof Array) {
row.tags = JSON.stringify(row.tags);
}

View File

@ -1,6 +1,6 @@
<template>
<el-dialog title="表头显示字段" :visible.sync="dialogTableVisible" :append-to-body="true">
<tree-transfer :title="['待选字段', '已选字段']"
<el-dialog :title="$t('table.header_display_field')" :visible.sync="dialogTableVisible" :append-to-body="true">
<tree-transfer :title="[$t('table.fields_to_be_selected'), $t('table.selected_fields')]"
:from_data='optionalFields'
:draggable="true"
:to_data='fieldSelected'

View File

@ -330,6 +330,9 @@
<el-form-item :label="$t('member.new_password')" prop="newpassword">
<el-input type="password" v-model="ruleForm.newpassword" autocomplete="off" show-password></el-input>
</el-form-item>
<el-form-item :label="$t('member.repeat_password')" prop="confirmpassword">
<el-input type="password" v-model="ruleForm.confirmpassword" autocomplete="off" show-password></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="ruleForm.id" autocomplete="off" :disabled="true" style="display:none"/>
</el-form-item>
@ -385,6 +388,15 @@ export default {
ShowMoreBtn
},
data() {
const validateConfirmPwd = (rule, value, callback) => {
if(value === ''){
callback(new Error(this.$t('user.input_password')));
}else if((value !== this.ruleForm.newpassword)){
callback(new Error(this.$t('member.inconsistent_passwords')));
}else{
callback();
}
};
return {
referenced: false,
queryPath: '/user/special/list',
@ -479,7 +491,17 @@ export default {
message: this.$t('member.password_format_is_incorrect'),
trigger: 'blur'
}
],
confirmpassword: [
{
required: true,
pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^]{8,30}$/,
message: this.$t('member.password_format_is_incorrect'),
trigger: 'blur'
},
{trigger: ['blur', 'change'], validator: validateConfirmPwd}
]
}
}
},

View File

@ -1,7 +1,9 @@
export default {
commons: {
pass_rate:'Pass rate',
execution_times:'Execution times',
please_select_import_mode: 'Please select import mode',
please_select_import_module: 'Please select import module',
pass_rate: 'Pass rate',
execution_times: 'Execution times',
cover: 'Cover',
not_cover: 'Not Cover',
import: 'Import',
@ -1608,5 +1610,10 @@ export default {
delete_prompt: 'This operation will delete the authentication source, do you want to continue? ',
title: 'Auth Source',
auth_name_valid: 'Name does not support special characters',
},
table: {
header_display_field: 'Header display field',
fields_to_be_selected: 'Fields to be selected',
selected_fields: 'Selected fields'
}
};

View File

@ -1,7 +1,9 @@
export default {
commons: {
pass_rate:'通过率',
execution_times:'执行次数',
please_select_import_mode: '请选择导入模式',
please_select_import_module: '请选择导入模块',
pass_rate: '通过率',
execution_times: '执行次数',
cover: '覆盖',
not_cover: '不覆盖',
import: '导入',
@ -1611,5 +1613,10 @@ export default {
delete_prompt: '此操作会删除认证源,是否继续?',
title: '认证设置',
auth_name_valid: '名称不支持特殊字符',
},
table: {
header_display_field: '表头显示字段',
fields_to_be_selected: '待选字段',
selected_fields: '已选字段'
}
};

View File

@ -1,7 +1,9 @@
export default {
commons: {
pass_rate:'通過率',
execution_times:'執行次數',
please_select_import_mode: '請選擇導入模式',
please_select_import_module: '請選擇導入模塊',
pass_rate: '通過率',
execution_times: '執行次數',
cover: '覆蓋',
not_cover: '不覆蓋',
import: '導入',
@ -1609,5 +1611,11 @@ export default {
delete_prompt: '此操作會刪除認證源,是否繼續? ',
title: '認證設置',
auth_name_valid: '名稱不支持特殊字符',
},
table: {
header_display_field: '表頭顯示欄位',
fields_to_be_selected: '待選欄位',
selected_fields: '已選欄位'
}
};